:root {
  --bg: #ffffff;
  --bg-soft: #f5fffd;
  --surface: #ffffff;
  --surface-alt: #f7fdfa;
  --border: #d9efeb;
  --border-strong: #b4e5dc;
  --text: #11211f;
  --text-soft: #516764;
  --text-faint: #738986;
  --brand: #00b4a0;
  --brand-deep: #008d7d;
  --brand-soft: #e8fbf7;
  --shadow: 0 18px 46px rgba(0, 180, 160, 0.08);
  --shadow-soft: 0 10px 24px rgba(17, 33, 31, 0.05);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --max-width: 100%;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Aptos", "Segoe UI Variable Text", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(0, 180, 160, 0.12), transparent 24%),
    linear-gradient(180deg, #ffffff 0%, #fbfffe 100%);
  zoom: 90%;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(0, 180, 160, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 180, 160, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 78%);
  pointer-events: none;
}

.page-shell {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 48px 48px;
}

.hero-panel,
.detail-hero,
.detail-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hero-panel {
  display: grid;
  gap: 12px;
  padding: 40px 48px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(245, 255, 253, 0.85));
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.02);
  position: relative;
  overflow: hidden;
}

.hero-panel::after {
  content: "";
  position: absolute;
  top: -30%;
  right: -10%;
  width: 60%;
  height: 140%;
  background: radial-gradient(circle, rgba(0, 180, 160, 0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero-layout {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
}

.hero-left {
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand-logo-svg svg {
  width: 72px;
  height: 72px;
  stroke: var(--brand-deep);
}

.detail-brand {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.detail-logo {
  width: min(100%, 220px);
}

.hero-titles {
  display: grid;
  gap: 6px;
}

.detail-heading {
  max-width: none;
}

.eyebrow,
.results-heading,
.stat-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--brand-deep);
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  margin-top: 6px;
  font-family: "Aptos Display", "Aptos", "Segoe UI Variable Display", "Segoe UI", sans-serif;
  font-size: clamp(2rem, 2.5vw, 2.6rem);
  font-weight: 800;
  line-height: 1.2;
  padding-bottom: 0.1em;
  letter-spacing: -0.04em;
  background: linear-gradient(100deg, var(--text) 0%, var(--brand-deep) 150%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  margin-top: 8px;
  font-size: clamp(1.35rem, 1.8vw, 1.8rem);
}

h3 {
  font-size: 1.08rem;
  line-height: 1.25;
}

.hero-summary,
.detail-intro,
.card-description,
.detail-item,
.stat-note,
.back-link {
  color: var(--text-soft);
}

.hero-summary {
  margin: 10px 0 0;
  max-width: none;
  line-height: 1.56;
  font-size: 0.9rem;
}

.hero-stats {
  display: flex;
  gap: 16px;
}

.hero-stats .stat-card {
  min-width: 150px;
  padding: 20px 24px;
}

.stat-card {
  position: relative;
  padding: 24px;
  background: linear-gradient(145deg, #ffffff 0%, #f4fffc 100%);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  z-index: 1;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 180, 160, 0.08), 0 4px 12px rgba(0, 180, 160, 0.04);
  border-color: rgba(0, 180, 160, 0.2);
}

.stat-value {
  display: block;
  margin: 10px 0 6px;
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-note {
  font-size: 0.82rem;
}

.project-sections {
  margin-top: 28px;
  display: grid;
  gap: 28px;
}

.category-section {
  display: grid;
  gap: 16px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
}

.results-count {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 0.9rem;
  font-weight: 700;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}

.project-card {
  position: relative;
  min-height: 200px;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: linear-gradient(145deg, #ffffff 0%, #f4fffc 100%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  z-index: 1;
}

.project-card:hover,
.project-card:focus-visible {
  transform: translateY(-6px);
  border-color: rgba(0, 180, 160, 0.3);
  box-shadow: 0 20px 40px rgba(0, 180, 160, 0.12), 0 6px 16px rgba(0, 180, 160, 0.06);
}

.project-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--brand-deep));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-card:hover::after,
.project-card:focus-visible::after {
  opacity: 1;
}

.card-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.card-index {
  display: inline-flex;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}

.card-open {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--surface-alt);
  color: var(--text-soft);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.project-card:hover .card-open,
.project-card:focus-visible .card-open {
  background: var(--brand-soft);
  color: var(--brand-deep);
  border-color: rgba(0, 180, 160, 0.2);
}

.category-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 0.76rem;
  font-weight: 700;
}

.card-description,
.detail-intro,
.detail-item {
  line-height: 1.65;
}

.card-description {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-cta {
  margin-top: auto;
  color: var(--brand-deep);
  font-size: 0.88rem;
  font-weight: 700;
}

.back-link {
  display: inline-flex;
  margin-bottom: 18px;
  text-decoration: none;
  font-weight: 700;
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--brand-deep);
}

.detail-hero {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 32px 36px;
  border-radius: var(--radius-xl);
}

.detail-layout {
  margin-top: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(360px, 1fr);
  gap: 24px;
  align-items: stretch;
}

.detail-panel {
  padding: 24px;
  border-radius: var(--radius-lg);
}

.primary-panel,
.side-panel,
.workflow-panel {
  box-shadow: var(--shadow-soft);
}

.detail-intro {
  margin: 12px 0 0;
  font-size: 1rem;
}

.detail-list {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.detail-item {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
}

.stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.stack-tag {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.86rem;
}

.meta-column {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.meta-pill {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-soft);
  font-size: 0.9rem;
}

.link-panel {
  margin-top: 22px;
  display: grid;
  gap: 12px;
}

.action-link,
.detail-link-form button,
.secondary-link,
.secondary-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 14px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.action-link,
.detail-link-form button {
  border: 0;
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(0, 180, 160, 0.18);
}

.secondary-link,
.secondary-button {
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
}

.detail-link-form {
  display: grid;
  gap: 10px;
}

.detail-link-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

.detail-link-form input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(0, 180, 160, 0.12);
}

.form-message {
  font-size: 0.9rem;
  font-weight: 700;
}

.form-message.is-error {
  color: #b03b3b;
}

.form-message.is-success {
  color: var(--brand-deep);
}

.workflow-panel {
  margin-top: 20px;
}

@media (max-width: 920px) {
  .detail-layout {
    grid-template-columns: 1fr;
  }
  
  .hero-layout {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }
  
  .hero-stats {
    flex-wrap: wrap;
    width: 100%;
  }

  .section-header {
    align-items: flex-start;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .detail-brand {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 18px 14px 36px;
  }

  .hero-panel,
  .detail-hero,
  .detail-panel {
    padding: 18px;
    border-radius: 22px;
  }

  .branding-block {
    gap: 14px;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-card {
    min-height: 190px;
  }

  .brand-logo {
    width: min(100%, 132px);
  }
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0, 180, 160, 0.2);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
  cursor: pointer;
}

.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 180, 160, 0.3);
}
