/* ============================================================================
   Kadircan Kara — portfolio
   Technical, editorial. Geist (grotesque) + Geist Mono.
   Dark is the default theme; `:root[data-theme="light"]` overrides the same
   tokens with a warm-paper palette. index.html sets data-theme before paint.
   ========================================================================== */

:root {
  color-scheme: dark;

  --bg:           #000;
  --surface:      rgba(255, 255, 255, 0.022);
  --surface-2:    rgba(255, 255, 255, 0.04);
  --border:       rgba(255, 255, 255, 0.08);
  --border-soft:  rgba(255, 255, 255, 0.06);
  --border-mid:   rgba(255, 255, 255, 0.14);

  --text:         #f4f4f7;
  --text-dim:     #9c9ca8;
  --text-faint:   #6a6a78;
  --text-ghost:   #4a4a56;

  --accent:       #ef3d3d;
  --accent-soft:  rgba(239, 61, 61, 0.14);
  --accent-line:  rgba(239, 61, 61, 0.4);

  /* --- themed chrome ------------------------------------------------------ */
  --selection-fg:      #fff;
  --scroll-thumb:      rgba(255, 255, 255, 0.12);
  --scroll-thumb-hi:   rgba(255, 255, 255, 0.2);

  --nav-bg:            rgba(0, 0, 0, 0.72);
  --nav-shadow:        0 8px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --nav-active-bg:     rgba(255, 255, 255, 0.07);

  /* gradient-filled "muted" words inside big titles */
  --title-muted-from:  #7c7c88;
  --title-muted-to:    #4c4c58;
  --title-muted-flat:  #5a5a66;
  --hero-muted-from:   #76767f;
  --hero-muted-to:     #46464f;
  --hero-title-halo:   0 3px 28px rgba(0, 0, 0, 0.85);

  --photo-filter:      grayscale(1) contrast(1.05) brightness(0.88);
  --orbit-line:        rgba(239, 61, 61, 0.3);
  --badge-text:        #ff8f8f;

  --btn-primary-bg:    #f4f4f7;
  --btn-primary-fg:    #0a0a0f;
  --btn-primary-bg-hi: #fff;

  --card-grad-end:     rgba(255, 255, 255, 0.008);
  --card-grad-end-hi:  rgba(255, 255, 255, 0.012);
  --card-shadow:       0 18px 50px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(239, 61, 61, 0.1);

  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", "Menlo", monospace;

  --maxw: 1180px;
  --pad: 40px;
  --nav-h: 132px;
  --radius: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- light theme: warm paper ---------------------------------------------- */
:root[data-theme="light"] {
  color-scheme: light;

  --bg:           #fff;
  --surface:      rgba(16, 16, 20, 0.025);
  --surface-2:    rgba(16, 16, 20, 0.05);
  --border:       rgba(16, 16, 20, 0.10);
  --border-soft:  rgba(16, 16, 20, 0.07);
  --border-mid:   rgba(16, 16, 20, 0.18);

  --text:         #101014;
  --text-dim:     #55555f;
  --text-faint:   #6e6e7a;
  --text-ghost:   #a3a3ad;

  --accent:       #c41f1f;
  --accent-soft:  rgba(196, 31, 31, 0.09);
  --accent-line:  rgba(196, 31, 31, 0.32);

  --selection-fg:      #101014;
  --scroll-thumb:      rgba(16, 16, 20, 0.18);
  --scroll-thumb-hi:   rgba(16, 16, 20, 0.3);

  --nav-bg:            rgba(255, 255, 255, 0.78);
  --nav-shadow:        0 8px 30px rgba(16, 16, 20, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  --nav-active-bg:     rgba(16, 16, 20, 0.06);

  --title-muted-from:  #9a9aa6;
  --title-muted-to:    #c2c2cc;
  --title-muted-flat:  #a8a8b4;
  --hero-muted-from:   #a2a2ae;
  --hero-muted-to:     #c8c8d2;
  --hero-title-halo:   0 3px 26px rgba(255, 255, 255, 0.9);

  --photo-filter:      grayscale(1) contrast(1.08) brightness(0.97);
  --orbit-line:        rgba(196, 31, 31, 0.26);
  --badge-text:        #9c1717;

  --btn-primary-bg:    #101014;
  --btn-primary-fg:    #fff;
  --btn-primary-bg-hi: #26262e;

  --card-grad-end:     rgba(16, 16, 20, 0.012);
  --card-grad-end-hi:  rgba(16, 16, 20, 0.02);
  --card-shadow:       0 18px 44px rgba(16, 16, 20, 0.10), 0 0 0 1px rgba(196, 31, 31, 0.14);
}

/* --- reset ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
::selection { background: var(--accent-soft); color: var(--selection-fg); }

/* The page background is a single flat colour — no gradient wash, no grain. */

/* scrollbar */
::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 99px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hi); }

/* --- layout ---------------------------------------------------------------- */
.shell { position: relative; z-index: 2; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }

main { min-height: 100vh; }
.page { padding: var(--nav-h) 0 120px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 28px;
}

/* --- big titles ------------------------------------------------------------ */
.title {
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.98;
  color: var(--text);
}
.title .muted {
  background: linear-gradient(180deg, var(--title-muted-from) 0%, var(--title-muted-to) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--title-muted-flat);
}
.section-title { font-size: clamp(2.6rem, 6.6vw, 5.2rem); max-width: 16ch; }

.lead {
  margin-top: 30px;
  max-width: 56ch;
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  line-height: 1.55;
  color: var(--text-dim);
  letter-spacing: -0.01em;
}
.lead .hi { color: var(--text); }

/* ===========================================================================
   NAV
   ========================================================================== */
.nav-wrap {
  position: fixed;
  top: 26px;
  left: 0; right: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  pointer-events: none;
}
.nav {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 7px 8px 7px 7px;
  background: var(--nav-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--nav-shadow);
}
.nav-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  flex: none;
}
.nav-links { display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-link {
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 14.5px;
  letter-spacing: -0.01em;
  color: var(--text-faint);
  white-space: nowrap;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}
.nav-link:hover { color: var(--text); }
.nav-link.active {
  color: var(--text);
  background: var(--nav-active-bg);
  box-shadow: inset 0 0 0 1px var(--border-mid);
}

/* theme toggle — lives inside the nav pill */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  margin-left: 2px;
  flex: none;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-faint);
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}
.theme-toggle:hover { color: var(--text); background: var(--nav-active-bg); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle .icon-sun,
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }
:root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }

/* ===========================================================================
   HOME
   ========================================================================== */
.hero { padding-top: calc(var(--nav-h) + 18px); padding-bottom: 40px; }
.hero .container { position: relative; }
/* text paints above the absolutely-positioned portrait */
.hero .container > :not(.hero-figure) { position: relative; z-index: 2; }

/* --- hero portrait --------------------------------------------------------- */
.hero-figure {
  position: absolute;
  top: 56px;
  right: -60px;
  width: clamp(280px, 32vw, 420px);
  z-index: 1;
  pointer-events: none;
}
.hero-figure-art {
  position: relative;
  /* melt the left edge into the page so headline tails stay readable */
  -webkit-mask-image: linear-gradient(100deg, transparent 6%, #000 46%);
  mask-image: linear-gradient(100deg, transparent 6%, #000 46%);
}
.hero-photo {
  position: relative;
  z-index: 1; /* above orbit ring: the satellite passes behind the head */
  display: block;
  width: 100%;
  height: auto;
  filter: var(--photo-filter);
  /* dissolve the arc crop into the page */
  -webkit-mask-image: linear-gradient(180deg, #000 50%, transparent 94%);
  mask-image: linear-gradient(180deg, #000 50%, transparent 94%);
}
.hero-orbit {
  position: absolute;
  top: 1%; left: -5%;
  width: 110%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px dashed var(--orbit-line);
  animation: orbit 36s linear infinite;
}
.orbit-sat {
  position: absolute;
  top: -4px; left: 50%;
  margin-left: -3.5px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
@keyframes orbit { to { transform: rotate(360deg); } }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--badge-text);
}
.badge .nav-dot { animation: pulse 2.6s var(--ease) infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.hero-title {
  margin-top: 34px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 0.9;
  font-size: clamp(3.2rem, 11.5vw, 9.2rem);
  /* soft halo keeps glyph tails readable where they cross the portrait */
  text-shadow: var(--hero-title-halo);
}
.hero-title .muted {
  background: linear-gradient(180deg, var(--hero-muted-from) 0%, var(--hero-muted-to) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero .lead { margin-top: 40px; font-size: clamp(1.1rem, 1.7vw, 1.5rem); max-width: 50ch; }

.hero-cta { margin-top: 44px; display: flex; flex-wrap: wrap; gap: 14px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 26px;
  border-radius: 999px;
  font-size: 15.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.btn .arr { transition: transform 0.3s var(--ease); }
.btn-primary { background: var(--btn-primary-bg); color: var(--btn-primary-fg); }
.btn-primary:hover { transform: translateY(-2px); background: var(--btn-primary-bg-hi); }
.btn-primary:hover .arr { transform: translateX(4px); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border-mid); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--text-faint); transform: translateY(-2px); }

/* stats */
.divider { height: 1px; background: var(--border); margin-top: 30px; }
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding: 56px 0 0;
}
.stat-value {
  font-size: clamp(2.4rem, 4.6vw, 3.6rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
}
.stat-value .plus { color: var(--accent); }
.stat-label {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* explore */
.explore { margin-top: 130px; }
.explore-eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 22px;
}
.explore-eyebrow::before { content: "— "; color: var(--text-ghost); }
.explore-title { font-size: clamp(1.9rem, 3.6vw, 2.9rem); font-weight: 600; letter-spacing: -0.03em; }
.explore-grid {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

/* generic card */
.card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface) 0%, var(--card-grad-end) 100%);
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), background 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.card.link:hover {
  transform: translateY(-3px);
  border-color: var(--border-mid);
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--card-grad-end-hi) 100%);
  box-shadow: var(--card-shadow);
}

.explore-card { padding: 28px 28px 30px; min-height: 168px; display: flex; flex-direction: column; }
.explore-card-head { display: flex; align-items: center; justify-content: space-between; }
.explore-card h3 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
.explore-card p { margin-top: auto; padding-top: 26px; color: var(--text-dim); font-size: 1rem; }
.card-arrow {
  color: var(--text-faint);
  transition: transform 0.35s var(--ease), color 0.35s var(--ease);
  flex: none;
}
.card.link:hover .card-arrow { transform: translate(4px, -4px); color: var(--text); }

/* ===========================================================================
   WORK + RESEARCH — split rows
   ========================================================================== */
.stack-list { margin-top: 70px; display: flex; flex-direction: column; gap: 22px; }
.row-card {
  display: grid;
  grid-template-columns: minmax(200px, 0.42fr) 1fr;
  gap: 36px;
  padding: 40px;
}
.row-meta { font-family: var(--font-mono); }
.row-period { font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim); }
.row-loc { margin-top: 10px; font-family: var(--font-sans); font-size: 0.98rem; color: var(--text-faint); letter-spacing: 0; }

.row-year {
  font-size: clamp(2rem, 3vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--accent);
  line-height: 1;
}
.row-venue {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-faint);
  line-height: 1.5;
}

.row-title { font-size: clamp(1.7rem, 2.6vw, 2.4rem); font-weight: 600; letter-spacing: -0.025em; line-height: 1.08; }
.row-sub { margin-top: 10px; font-size: 1.18rem; color: var(--text-dim); letter-spacing: -0.01em; }
.row-desc { margin-top: 20px; font-size: 1.08rem; color: var(--text-dim); line-height: 1.55; max-width: 62ch; }

.row-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  transition: color 0.25s var(--ease);
}
.row-link:hover { color: var(--text); }
.row-link:hover .arr-ext { transform: translate(3px, -3px); }

.points { margin-top: 26px; display: flex; flex-direction: column; gap: 18px; }
.point { display: grid; grid-template-columns: 18px 1fr; gap: 4px; align-items: start; }
.point::before {
  content: "";
  width: 0; height: 0; margin-top: 9px;
  border-left: 6px solid var(--accent);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}
.point span { color: var(--text-dim); font-size: 1.06rem; line-height: 1.55; }

/* ===========================================================================
   PROJECTS
   ========================================================================== */
.proj-grid { margin-top: 70px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.proj-card { padding: 38px; display: flex; flex-direction: column; }
.proj-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.proj-title { font-size: clamp(1.5rem, 2vw, 1.9rem); font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; max-width: 14ch; }
.proj-tag {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
  padding-top: 6px;
}
.proj-desc { margin-top: 22px; color: var(--text-dim); font-size: 1.04rem; line-height: 1.55; }
.proj-foot { margin-top: auto; padding-top: 30px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.proj-foot .chips { margin-top: 0; }
.chips { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
}

/* ===========================================================================
   EDUCATION
   ========================================================================== */
.col-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 22px;
}
/* two labelled sections, spaced like the skill groups */
.edu-sections { margin-top: 70px; display: flex; flex-direction: column; gap: 60px; }
.edu-section .stack-group-label { margin-bottom: 26px; }
.edu-list { display: flex; flex-direction: column; gap: 18px; }
.edu-card { padding: 34px; }
.edu-period {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.edu-school { font-size: 1.7rem; font-weight: 600; letter-spacing: -0.02em; }
.edu-degree { margin-top: 8px; color: var(--text-dim); font-size: 1.1rem; }
.edu-desc { margin-top: 18px; color: var(--text-faint); font-size: 1.02rem; line-height: 1.55; }

.stack-card { padding: 30px 32px 34px; }
.stack-group-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 22px;
}
/* stacked like school → degree on the education cards above */
.spoken-lang { display: block; font-size: 1.7rem; font-weight: 600; letter-spacing: -0.02em; }
.spoken-level { display: block; margin-top: 8px; font-size: 1.1rem; color: var(--text-dim); }

/* ===========================================================================
   SKILLS — one tile grid per group, monogram over name
   ========================================================================== */
.skill-groups { margin-top: 70px; display: flex; flex-direction: column; gap: 60px; }
.skill-group .stack-group-label { margin-bottom: 26px; }
.skill-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.skill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  padding: 30px 20px 28px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease), transform 0.3s var(--ease);
}
.skill:hover { border-color: var(--border-mid); background: var(--surface-2); transform: translateY(-2px); }
/* logo and monogram occupy the same 48px slot so mixed rows stay aligned */
.skill-logo {
  width: 34px; height: 34px;
  margin: 7px 0;
  flex: none;
  color: var(--text);
  transition: color 0.3s var(--ease);
}
.skill:hover .skill-logo { color: var(--accent); }
.skill-mark {
  display: grid;
  place-items: center;
  width: 48px; height: 48px;
  flex: none;
  border: 1px solid var(--accent-line);
  border-radius: 14px;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--accent);
}
.skill-name { font-size: 1rem; letter-spacing: -0.01em; color: var(--text); line-height: 1.35; }

/* approaches, not products — same tile, no glyph, so the name centres instead
   of hanging under an empty slot */
.method-card { justify-content: center; min-height: 106px; }

/* ===========================================================================
   CONTACT
   ========================================================================== */
.contact-grid { margin-top: 80px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.contact-card { padding: 34px 38px 38px; display: flex; flex-direction: column; min-height: 150px; }
.contact-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.contact-row { margin-top: auto; padding-top: 36px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.contact-value { font-size: clamp(1.4rem, 2.4vw, 2rem); font-weight: 600; letter-spacing: -0.025em; word-break: break-word; }
.contact-card .card-arrow { width: 26px; height: 26px; }

/* ===========================================================================
   PROJECT DETAIL PAGE
   ========================================================================== */
.project-page .eyebrow { margin-bottom: 24px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 36px;
  transition: color 0.25s var(--ease);
}
.back-link:hover { color: var(--text); }
.back-link .arr-back { transition: transform 0.3s var(--ease); }
.back-link:hover .arr-back { transform: translateX(-4px); }

.project-actions { margin-top: 42px; display: flex; flex-wrap: wrap; gap: 14px; }
.btn .arr-ext { transition: transform 0.3s var(--ease); }
.btn-primary:hover .arr-ext { transform: translate(3px, -3px); }

.project-chips { margin-top: 36px; }

.project-overview { margin-top: 66px; max-width: 72ch; }
.project-overview .col-label { margin-bottom: 18px; }
.project-overview p { margin-top: 16px; color: var(--text-dim); font-size: 1.08rem; line-height: 1.6; }

.project-media { margin-top: 60px; }
.media-placeholder {
  border: 1px dashed var(--border-mid);
  border-radius: var(--radius);
  padding: 72px 30px;
  text-align: center;
  background: var(--surface);
}
.media-placeholder .media-tag {
  display: inline-block;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.media-placeholder p { color: var(--text-faint); font-size: 1.05rem; }

.project-learned { margin-top: 60px; max-width: 72ch; }
.project-learned .col-label { margin-bottom: 24px; }
.project-learned .points { margin-top: 0; }

.project-media .col-label { margin-bottom: 18px; }
.project-media .gallery-label { margin-top: 48px; }
.project-gallery { display: grid; grid-template-columns: 1fr; gap: 22px; }
.project-gallery .shot {
  margin: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
}
.project-gallery .shot img,
.project-gallery .shot video { display: block; width: 100%; height: auto; }
.project-gallery .shot figcaption {
  margin-top: auto;
  padding: 16px 22px 18px;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text-faint);
  border-top: 1px solid var(--border-soft);
}

/* ===========================================================================
   FOOTER
   ========================================================================== */
.footer {
  position: relative; z-index: 2;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
.footer-inner {
  padding: 38px 0 46px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.footer-status { display: inline-flex; align-items: center; gap: 10px; }
.footer-status .nav-dot { animation: pulse 2.6s var(--ease) infinite; }

/* ===========================================================================
   MOTION — staggered reveal on route render
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(14px); animation: rise 0.7s var(--ease) forwards; }
@keyframes rise { to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ===========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1320px) {
  .hero-figure { right: -10px; }
}

@media (max-width: 980px) {
  :root { --pad: 28px; }
  .explore-grid { grid-template-columns: 1fr 1fr; }
  .skill-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-figure { right: 0; width: clamp(240px, 30vw, 320px); }
}

@media (max-width: 760px) {
  :root { --pad: 22px; --nav-h: 116px; }
  .nav-wrap { justify-content: flex-start; }
  .nav { width: 100%; }
  /* portrait flows between badge and headline */
  .hero-figure {
    position: relative;
    top: auto; right: auto;
    width: min(320px, 72vw);
    margin: 34px 0 -8px;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .row-card { grid-template-columns: 1fr; gap: 20px; padding: 30px; }
  .proj-grid, .contact-grid { grid-template-columns: 1fr; }
  .explore-grid { grid-template-columns: 1fr; }
  .skill-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .skill { padding: 26px 16px 24px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 36px 24px; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
}

@media (max-width: 460px) {
  .nav-link { padding: 8px 12px; font-size: 13.5px; }
}

/* ===========================================================================
   PROJECT DETAIL — optional rich blocks
   Used by projects that carry `diagram`, `groups`, `alsoShipped`,
   `stackGroups` or `nda` in data.js. Projects without them are unaffected.
   ========================================================================== */
.project-block { margin-top: 60px; }

/* --- router fan-out diagram ---------------------------------------------- */
.project-diagram {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface) 0%, var(--card-grad-end) 100%);
  padding: 34px 32px 30px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.project-diagram svg { width: 100%; height: auto; display: block; }
.project-diagram figcaption {
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.55;
  max-width: 64ch;
}

.dg-box { fill: var(--surface-2); stroke: var(--border-mid); stroke-width: 1; }
.dg-hub { stroke: var(--accent-line); }
.dg-edge { fill: none; stroke: var(--border-mid); stroke-width: 1; }
.dg-arrowhead { fill: var(--border-mid); }

.dg-hub-title {
  fill: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
}
.dg-hub-sub { fill: var(--text-dim); font-family: var(--font-sans); font-size: 13px; }
.dg-name { fill: var(--text); font-family: var(--font-sans); font-size: 17px; font-weight: 600; }
.dg-sub {
  fill: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
}
.dg-meta { fill: var(--text-dim); font-family: var(--font-mono); font-size: 12px; }

/* --- labelled feature groups --------------------------------------------- */
.project-groups {
  margin-top: 26px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  max-width: 900px;
}
.project-groups-compact { grid-template-columns: 1fr 1fr; }

.group-card { padding: 32px 34px 34px; }
.group-card .proj-tag { padding-top: 0; margin-bottom: 22px; }
.group-card .points { margin-top: 0; gap: 16px; }
.group-card .point span strong { color: var(--text); font-weight: 600; font-size: 1.02rem; }
.group-card .point-detail {
  display: block;
  margin-top: 4px;
  font-style: normal;
  color: var(--text-dim);
  font-size: 0.98rem;
  line-height: 1.55;
}
.group-card .chips { margin-top: 0; }

/* chips that carry a brand mark */
.chip-icon { display: inline-flex; align-items: center; gap: 7px; }
.chip-logo { width: 13px; height: 13px; flex: none; opacity: 0.9; }

.project-nda {
  margin-top: 54px;
  max-width: 72ch;
  color: var(--text-faint);
  font-size: 0.95rem;
  line-height: 1.6;
}

@media (max-width: 820px) {
  .project-groups-compact { grid-template-columns: 1fr; }
  .group-card { padding: 26px 24px 28px; }
  .project-diagram { padding: 24px 18px 22px; }
}
