/* ==========================================================================
   AB STUDIO — Portfolio design system
   A technical-editorial theme: paper, ink, hairline rails, mono metadata,
   serif accents and quiet motion.
   ========================================================================== */

/* --------------------------------------------------------------------------
   01. Tokens
   -------------------------------------------------------------------------- */
:root {
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", "Menlo", monospace;
  --font-serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --font-hand: "Caveat", "Segoe Script", cursive;

  --bg: #fbfbfa;
  --bg-deep: #f2f2ef;
  --surface: #ffffff;
  --surface-2: #f7f7f5;
  --surface-3: #f0f0ed;
  --fg: #0b0b0c;
  --fg-soft: #3d3d42;
  --muted: #6c6c74;
  --faint: #9a9aa1;
  --line: #e6e6e2;
  --line-strong: #d5d5d0;
  --dot: rgba(10, 10, 12, 0.1);
  --accent: #2d5cff;
  --accent-soft: rgba(45, 92, 255, 0.09);
  --accent-line: rgba(45, 92, 255, 0.28);
  --accent-purple: #7b61d6;
  --accent-pink: #cf5c8e;
  --accent-green: #128a4b;
  --accent-warm: #c8552b;
  --success: #128a4b;
  --success-soft: rgba(18, 138, 75, 0.12);
  --warm: #c8552b;
  --warm-soft: rgba(200, 85, 43, 0.11);
  --selection: #0b0b0c;
  --selection-fg: #fbfbfa;

  --frame: 896px;
  --gutter: clamp(18px, 4vw, 40px);
  --header-h: 64px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --shadow-sm: 0 1px 2px rgba(16, 16, 20, 0.04);
  --shadow-md: 0 18px 50px -24px rgba(16, 16, 20, 0.28);
  --shadow-lg: 0 32px 90px -32px rgba(16, 16, 20, 0.36);

  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0b0b0c;
  --bg-deep: #080809;
  --surface: #111113;
  --surface-2: #161618;
  --surface-3: #1c1c1f;
  --fg: #f4f4f2;
  --fg-soft: #d3d3d6;
  --muted: #a1a1a8;
  --faint: #6f6f77;
  --line: #232326;
  --line-strong: #35353a;
  --dot: rgba(255, 255, 255, 0.1);
  --accent: #8fa7ff;
  --accent-soft: rgba(143, 167, 255, 0.1);
  --accent-line: rgba(143, 167, 255, 0.32);
  --accent-purple: #a996ff;
  --accent-pink: #ec8fb7;
  --accent-green: #4ade80;
  --accent-warm: #ff9a72;
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, 0.12);
  --warm: #ff9a72;
  --warm-soft: rgba(255, 154, 114, 0.12);
  --selection: #f4f4f2;
  --selection-fg: #0b0b0c;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 20px 60px -28px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 40px 100px -32px rgba(0, 0, 0, 0.9);

  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   02. Reset & base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

html.no-scroll,
html.no-scroll body {
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg-deep);
  background-image:
    radial-gradient(ellipse 80% 55% at 50% -12%, color-mix(in oklab, var(--accent) 7%, transparent), transparent 62%),
    radial-gradient(circle, var(--dot) 1px, transparent 1.15px);
  background-size: 100% 100%, 24px 24px;
  background-attachment: fixed;
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-synthesis-weight: none;
  overflow-x: clip;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    520px circle at var(--mx, 50%) var(--my, 20%),
    color-mix(in oklab, var(--accent) 6%, transparent),
    transparent 68%
  );
  opacity: 0.9;
  transition: background 0.3s linear;
}

::selection {
  background: var(--selection);
  color: var(--selection-fg);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

ul,
ol,
dl,
dd,
figure,
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
h4 {
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 500;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

strong {
  font-weight: 600;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.sr-only,
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 50%;
  z-index: 300;
  translate: -50% -160%;
  padding: 9px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--fg);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  transition: translate 0.2s var(--ease);
}

.skip-link:focus {
  translate: -50% 0;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 99px;
  background: var(--line-strong);
  background-clip: content-box;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

/* --------------------------------------------------------------------------
   03. Layout shell
   -------------------------------------------------------------------------- */
.shell {
  position: relative;
  width: min(calc(100% - 20px), var(--frame));
  margin-inline: auto;
  background: var(--bg);
  border-inline: 1px solid var(--line);
  isolation: isolate;
}

@media (max-width: 640px) {
  .shell {
    width: calc(100% - 12px);
  }
}

.page-main {
  position: relative;
}

.frame-width {
  width: min(100% - (var(--gutter) * 2), 760px);
  margin-inline: auto;
}

.panel {
  position: relative;
  border-bottom: 1px solid var(--line);
}

.panel:last-child {
  border-bottom: 0;
}

.panel-inner {
  padding: var(--gutter);
}

.screen-line {
  border-top: 1px solid var(--line);
}

/* Diagonal striped separator, inspired by technical drawings */
.stripe-sep {
  position: relative;
  height: 34px;
  border-bottom: 1px solid var(--line);
  background-image: repeating-linear-gradient(
    315deg,
    var(--line) 0,
    var(--line) 1px,
    transparent 1px,
    transparent 6px
  );
  background-size: 100% 100%;
  overflow: hidden;
}

.stripe-sep--subtle {
  opacity: 0.62;
}

.stripe-sep::before,
.stripe-sep::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  translate: 0 -50%;
}

.stripe-sep::before {
  left: -4px;
}

.stripe-sep::after {
  right: -4px;
}

/* Registration marks used on framed media */
.reg-mark {
  position: absolute;
  z-index: 2;
  width: 9px;
  height: 9px;
  pointer-events: none;
  color: var(--line-strong);
}

.reg-mark::before,
.reg-mark::after {
  content: "";
  position: absolute;
  background: currentColor;
}

.reg-mark::before {
  top: 4px;
  left: 0;
  width: 9px;
  height: 1px;
}

.reg-mark::after {
  top: 0;
  left: 4px;
  width: 1px;
  height: 9px;
}

.reg-mark--tl {
  top: -4px;
  left: -4px;
}

.reg-mark--tr {
  top: -4px;
  right: -4px;
}

.reg-mark--bl {
  bottom: -4px;
  left: -4px;
}

.reg-mark--br {
  right: -4px;
  bottom: -4px;
}

/* --------------------------------------------------------------------------
   04. Type utilities
   -------------------------------------------------------------------------- */
.mono {
  font-family: var(--font-mono);
  font-feature-settings: "ss01", "zero";
}

.label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.label::before {
  content: "";
  width: 5px;
  height: 5px;
  border: 1px solid currentColor;
  rotate: 45deg;
}

.label--plain::before {
  display: none;
}

.muted {
  color: var(--muted);
}

.faint {
  color: var(--faint);
}

.accent {
  color: var(--accent);
}

.serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.hand {
  font-family: var(--font-hand);
  font-weight: 500;
  line-height: 1.15;
  color: var(--muted);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow__dot {
  position: relative;
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft);
}

.eyebrow__dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: inherit;
  animation: ping 2.8s var(--ease-soft) infinite;
}

.eyebrow__sep {
  width: 18px;
  height: 1px;
  background: var(--line-strong);
}

.lede {
  font-size: clamp(1.02rem, 1.8vw, 1.2rem);
  line-height: 1.55;
  color: var(--muted);
  max-width: 52ch;
}

.lede strong {
  color: var(--fg);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   05. Buttons, tags, inputs
   -------------------------------------------------------------------------- */
.btn,
.btn-primary,
.btn-secondary,
.btn--primary,
.btn--outline,
.btn--ghost {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.005em;
  white-space: nowrap;
  text-decoration: none;
  transition:
    background-color 0.22s var(--ease-soft),
    color 0.22s var(--ease-soft),
    border-color 0.22s var(--ease-soft),
    transform 0.22s var(--ease-soft),
    box-shadow 0.22s var(--ease-soft);
}

.btn:active,
.btn-primary:active,
.btn-secondary:active,
.btn--primary:active,
.btn--outline:active {
  transform: translateY(1px) scale(0.995);
}

.btn i,
.btn svg,
.btn-primary i,
.btn-secondary i {
  font-size: 12px;
  transition: transform 0.3s var(--ease);
}

.btn:hover i.fa-arrow-right,
.btn-primary:hover i.fa-arrow-right,
.btn-secondary:hover i.fa-arrow-right,
.btn:hover svg.arrow,
.btn-primary:hover svg.arrow {
  transform: translateX(3px);
}

.btn-primary,
.btn--primary {
  border-color: var(--fg);
  background: var(--fg);
  color: var(--bg);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 8px 20px -12px rgba(10, 10, 12, 0.55);
}

.btn-primary:hover,
.btn--primary:hover {
  background: color-mix(in oklab, var(--fg) 88%, var(--accent));
  border-color: transparent;
  color: var(--bg);
}

.btn-secondary,
.btn--outline {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--fg);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover,
.btn--outline:hover {
  border-color: color-mix(in oklab, var(--line-strong) 60%, var(--fg));
  background: var(--surface-2);
}

.btn--ghost {
  border-color: transparent;
  color: var(--muted);
}

.btn--ghost:hover {
  background: var(--surface-2);
  color: var(--fg);
}

.btn--sm,
.btn-sm {
  height: 34px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 8px;
}

.btn--lg {
  height: 46px;
  padding: 0 20px;
  font-size: 14px;
}

.btn--invert {
  border-color: var(--bg);
  background: var(--bg);
  color: var(--fg);
}

.btn--invert:hover {
  background: color-mix(in oklab, var(--bg) 86%, var(--accent));
  color: var(--fg);
}

.btn--on-dark-outline {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
  color: var(--bg);
}

.btn--on-dark-outline:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.09);
}

.btn[disabled],
.btn-primary[disabled],
.btn-secondary[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  transition:
    color 0.2s,
    border-color 0.2s,
    background-color 0.2s,
    transform 0.2s var(--ease);
}

.icon-btn:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--fg);
  transform: translateY(-1px);
}

.icon-btn svg,
.icon-btn i {
  width: 15px;
  height: 15px;
  font-size: 14px;
}

.tag,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--fg-soft);
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  inset: 0;
}

.tag--accent {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

.tag--warm {
  border-color: color-mix(in oklab, var(--warm) 30%, transparent);
  background: var(--warm-soft);
  color: var(--warm);
}

.tag--success {
  border-color: color-mix(in oklab, var(--success) 28%, transparent);
  background: var(--success-soft);
  color: var(--success);
}

.field {
  display: grid;
  gap: 7px;
}

.field > label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.input,
.textarea,
.select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--fg);
  font-size: 14px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    background-color 0.2s;
}

.input,
.select {
  height: 42px;
  padding: 0 13px;
}

.textarea {
  min-height: 128px;
  padding: 12px 13px;
  resize: vertical;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--faint);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.select {
  appearance: none;
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 19px,
    calc(100% - 12px) 19px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* --------------------------------------------------------------------------
   06. Header & navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  height: var(--header-h);
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
}

.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-line), transparent);
  opacity: 0;
  transition: opacity 0.4s;
}

.site-header.is-scrolled::after {
  opacity: 1;
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 100%;
  padding: 0 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  border-radius: 6px;
}

.brand__mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  overflow: hidden;
  border-radius: 7px;
  background: var(--fg);
  color: var(--bg);
  clip-path: polygon(0 0, 71% 0, 100% 29%, 100% 100%, 0 100%);
  transition:
    transform 0.4s var(--ease),
    background-color 0.3s,
    color 0.3s;
}

.brand__mark::before {
  content: "";
  position: absolute;
  z-index: 1;
  right: 4px;
  bottom: 4px;
  width: 3px;
  height: 3px;
  border-radius: 1px;
  background: var(--accent);
  transition: background-color 0.3s;
}

.brand__mark::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 0;
  right: 0;
  width: 30%;
  height: 30%;
  background: linear-gradient(225deg, transparent 44%, var(--accent) 45% 56%, transparent 57%);
  opacity: 0.8;
}

.brand__mark-type {
  display: flex;
  align-items: baseline;
  margin-top: -1px;
  font-family: var(--font-serif);
  font-size: 15px;
  font-style: italic;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.07em;
}

.brand__mark-type em {
  margin-left: -2.5px;
  font-style: normal;
  color: var(--accent);
  transition: color 0.3s;
}

.brand:hover .brand__mark {
  transform: rotate(-5deg) scale(1.05);
  background: var(--accent);
  color: #fff;
}

.brand:hover .brand__mark-type em {
  color: #fff;
}

.brand:hover .brand__mark::before {
  background: #fff;
}

.brand__name {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.brand__name span {
  color: var(--accent);
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-inline: auto;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  transition:
    color 0.2s,
    background-color 0.2s;
}

.nav-link:hover {
  background: var(--surface-2);
  color: var(--fg);
}

.nav-link[aria-current="page"],
.nav-link.is-active {
  color: var(--fg);
}

.nav-link[aria-current="page"]::after,
.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
  translate: -50% 0;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown__trigger {
  border: 0;
  background: transparent;
  font-family: var(--font-sans);
}

.nav-dropdown__trigger svg,
.nav-dropdown__trigger i {
  width: 11px;
  height: 11px;
  font-size: 10px;
  color: var(--faint);
  transition: transform 0.25s var(--ease);
}

.nav-dropdown.is-open .nav-dropdown__trigger svg,
.nav-dropdown.is-open .nav-dropdown__trigger i {
  transform: rotate(180deg);
}

.nav-dropdown__menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 90;
  min-width: 236px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.985);
  transform-origin: top right;
  transition:
    opacity 0.2s var(--ease-soft),
    transform 0.2s var(--ease-soft),
    visibility 0.2s;
}

.nav-dropdown.is-open .nav-dropdown__menu,
.nav-dropdown:hover .nav-dropdown__menu,
.nav-dropdown:focus-within .nav-dropdown__menu {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.nav-dropdown__menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  color: var(--fg-soft);
  font-size: 12.5px;
  transition:
    background-color 0.16s,
    color 0.16s;
}

.nav-dropdown__menu a:hover,
.nav-dropdown__menu a.is-active {
  background: var(--surface-2);
  color: var(--fg);
}

.nav-dropdown__menu a i,
.nav-dropdown__menu a svg {
  width: 15px;
  font-size: 12px;
  color: var(--faint);
}

.nav-dropdown__menu small {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--faint);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.header-actions .divider {
  width: 1px;
  height: 20px;
  margin: 0 4px;
  background: var(--line);
}

.header-cta {
  height: 32px;
  padding: 0 12px;
  border-radius: 7px;
  font-size: 12px;
}

.header-cta svg,
.header-cta i {
  width: 12px;
  height: 12px;
  font-size: 10px;
}

.theme-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  transition:
    color 0.2s,
    background-color 0.2s,
    border-color 0.2s;
}

.theme-toggle:hover {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--fg);
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
  overflow: visible;
  transition: transform 0.55s var(--ease);
}

.theme-toggle .icon-moon {
  display: none;
}

html[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

html[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-toggle svg {
  rotate: 180deg;
}

.menu-btn {
  display: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--fg);
}

.menu-btn svg {
  width: 17px;
  height: 17px;
}

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  padding: 16px;
  background: var(--bg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition:
    opacity 0.25s var(--ease-soft),
    transform 0.3s var(--ease),
    visibility 0.25s;
}

.mobile-nav.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.mobile-nav__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.mobile-nav__close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--fg);
}

.mobile-nav__close svg {
  width: 18px;
  height: 18px;
}

.mobile-nav__links {
  display: flex;
  flex-direction: column;
  padding-top: 10px;
}

.mobile-nav__links a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 12px 2px;
  border-bottom: 1px dashed var(--line);
  font-size: clamp(1.6rem, 8vw, 2.3rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  color: var(--fg);
}

.mobile-nav__links a span {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--faint);
}

.mobile-nav__links a[aria-current="page"] {
  color: var(--accent);
}

.mobile-nav__foot {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 18px;
}

.mobile-nav__foot .btn {
  width: 100%;
}

/* --------------------------------------------------------------------------
   07. Page lead (shared by inner pages)
   -------------------------------------------------------------------------- */
.page-lead {
  position: relative;
  padding: clamp(30px, 5vw, 54px) var(--gutter) clamp(26px, 4vw, 42px);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.page-lead::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 46%;
  height: 100%;
  background-image:
    linear-gradient(to right, transparent, var(--bg) 85%),
    radial-gradient(circle, var(--dot) 1px, transparent 1.1px);
  background-size: 100% 100%, 18px 18px;
  opacity: 0.75;
  pointer-events: none;
}

.page-lead__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: clamp(28px, 5vw, 56px);
  align-items: end;
}

.page-lead__copy {
  display: grid;
  gap: 18px;
  max-width: 620px;
}

.page-lead__index {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.page-lead__index strong {
  color: var(--fg);
  font-weight: 500;
}

.page-lead__title {
  font-size: clamp(2.65rem, 6.6vw, 4.5rem);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.055em;
}

.page-lead__title em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.025em;
}

.page-lead__desc {
  max-width: 54ch;
  font-size: clamp(0.98rem, 1.7vw, 1.1rem);
  line-height: 1.55;
  color: var(--muted);
}

.page-lead__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.page-lead__aside {
  display: grid;
  gap: 14px;
  align-self: start;
  padding-top: 6px;
}

.lead-meta {
  display: grid;
  gap: 0;
  border-top: 1px dashed var(--line-strong);
}

.lead-meta__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}

.lead-meta__row dt {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.lead-meta__row dd {
  font-size: 12px;
  color: var(--fg-soft);
  text-align: right;
}

.lead-meta__row dd a {
  border-bottom: 1px solid var(--line-strong);
  transition: border-color 0.2s;
}

.lead-meta__row dd a:hover {
  border-color: var(--fg);
}

.lead-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
}

.lead-note .eyebrow__dot {
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   08. Section header
   -------------------------------------------------------------------------- */
.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 26px var(--gutter) 20px;
  border-bottom: 1px solid var(--line);
}

.panel-head__copy {
  display: grid;
  gap: 9px;
}

.panel-head__row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-head__index {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--faint);
}

.panel-title {
  font-size: clamp(1.55rem, 3.4vw, 2.15rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.panel-title em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
}

.panel-title sup {
  margin-left: 6px;
  top: -0.7em;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--faint);
}

.panel-head__desc {
  max-width: 52ch;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.panel-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
  transition:
    color 0.2s,
    border-color 0.2s;
}

.panel-link svg,
.panel-link i {
  width: 11px;
  height: 11px;
  font-size: 10px;
  transition: transform 0.25s var(--ease);
}

.panel-link:hover {
  color: var(--fg);
  border-bottom-color: var(--line-strong);
}

.panel-link:hover svg,
.panel-link:hover i {
  transform: translateX(3px);
}

.panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px var(--gutter);
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.panel-foot__note {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--faint);
}

/* --------------------------------------------------------------------------
   09. Home hero
   -------------------------------------------------------------------------- */
.home-hero {
  position: relative;
  overflow: hidden;
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, var(--dot) 1px, transparent 1.1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 90% 70% at 80% 0%, black, transparent 70%);
  opacity: 0.55;
}

.hero-topline {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px var(--gutter);
  border-bottom: 1px dashed var(--line);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--faint);
}

.hero-topline__right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--success);
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(28px, 4.5vw, 54px);
  padding: clamp(30px, 5vw, 54px) var(--gutter) 0;
  align-items: start;
}

.hero-copy {
  display: grid;
  gap: 20px;
  padding-top: 4px;
}

.hero-title {
  font-size: clamp(3.1rem, 8.1vw, 5.35rem);
  font-weight: 500;
  line-height: 0.88;
  letter-spacing: -0.065em;
  text-wrap: nowrap;
}

.hero-title em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.03em;
}

.hero-title .hero-title__dot {
  color: var(--accent);
}

.hero-title__check {
  display: inline-grid;
  place-items: center;
  width: 0.34em;
  height: 0.34em;
  margin-left: 0.12em;
  translate: 0 -0.42em;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.9em;
}

.hero-title__check svg {
  width: 68%;
  height: 68%;
}

.hero-role {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  font-family: var(--font-mono);
  font-size: clamp(0.78rem, 1.4vw, 0.9rem);
  color: var(--muted);
}

.hero-role__prefix {
  color: var(--faint);
}

.flip-role {
  position: relative;
  display: inline-block;
  height: 1.5em;
  overflow: hidden;
  color: var(--fg);
  vertical-align: bottom;
}

.flip-role__track {
  display: flex;
  flex-direction: column;
  animation: role-flip 16s var(--ease-soft) infinite;
}

.flip-role__track span {
  display: block;
  height: 1.5em;
  line-height: 1.5em;
  white-space: nowrap;
}

@keyframes role-flip {
  0%, 18% { transform: translateY(0); }
  22%, 40% { transform: translateY(-1.5em); }
  44%, 62% { transform: translateY(-3em); }
  66%, 84% { transform: translateY(-4.5em); }
  88%, 100% { transform: translateY(-6em); }
}

.hero-desc {
  max-width: 47ch;
  font-size: clamp(0.95rem, 1.55vw, 1.04rem);
  line-height: 1.6;
  color: var(--muted);
}

.hero-desc strong {
  color: var(--fg-soft);
  font-weight: 500;
}

.hero-desc a {
  color: var(--fg);
  border-bottom: 1px solid var(--line-strong);
  transition: border-color 0.2s;
}

.hero-desc a:hover {
  border-color: var(--accent);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.hero-socials {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-top: 2px;
}

.hero-socials .icon-btn:first-child {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--fg);
}

.hero-socials__label {
  margin-left: 4px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

/* Portrait */
.hero-visual {
  position: relative;
  padding-top: 2px;
}

.portrait {
  position: relative;
  padding: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  transform: rotate(1.15deg);
  transition:
    transform 0.7s var(--ease),
    box-shadow 0.7s var(--ease);
}

.portrait:hover {
  transform: rotate(0deg) translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.portrait::before {
  content: "";
  position: absolute;
  inset: -14px 14px 14px -14px;
  z-index: -1;
  border: 1px dashed var(--line-strong);
  border-radius: 4px;
  background-image: radial-gradient(circle, var(--dot) 1px, transparent 1.1px);
  background-size: 12px 12px;
  opacity: 0.8;
}

.portrait__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: 2px;
  background: var(--surface-3);
}

.portrait__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 28%;
  filter: grayscale(0.22) contrast(1.02);
  transition:
    filter 0.8s var(--ease),
    transform 1.2s var(--ease);
}

.portrait:hover .portrait__media img {
  filter: grayscale(0) contrast(1);
  transform: scale(1.025);
}

.portrait__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(8, 8, 10, 0.36));
  pointer-events: none;
}

.portrait__index {
  position: absolute;
  left: calc(100% + 12px);
  top: 8px;
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}

.portrait__caption {
  position: absolute;
  left: 17px;
  right: 17px;
  bottom: 16px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.portrait__caption span {
  opacity: 0.76;
}

.portrait-badge {
  position: absolute;
  right: 18px;
  bottom: -15px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
}

.portrait-badge .eyebrow__dot {
  width: 6px;
  height: 6px;
}

.hand-note {
  position: absolute;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  color: var(--muted);
  font-family: var(--font-hand);
  font-size: 1.18rem;
  line-height: 1.05;
  text-align: right;
  pointer-events: none;
}

.hand-note svg {
  width: 38px;
  height: 30px;
  color: var(--faint);
}

.hero-visual .hand-note {
  top: -30px;
  right: 4px;
  transform: rotate(4deg);
}

/* Overview rows */
.hero-overview {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: clamp(28px, 4vw, 44px);
  border-top: 1px solid var(--line);
}

.overview-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 12px var(--gutter);
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  appearance: none;
  color: var(--fg-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: left;
  transition: background-color 0.2s;
}

.overview-item:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.overview-item:hover {
  background: var(--surface-2);
}

.overview-item__icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
}

.overview-item__icon svg {
  width: 13px;
  height: 13px;
}

.overview-item__body {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.overview-item__label {
  color: var(--faint);
}

.overview-item__value {
  color: var(--fg);
  border-bottom: 1px solid transparent;
  white-space: nowrap;
}

.overview-item:hover .overview-item__value {
  border-bottom-color: var(--line-strong);
}

.overview-item__value--accent {
  color: var(--accent);
}

.overview-item .live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft);
}

/* Marquee strip */
.marquee-strip {
  position: relative;
  display: flex;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  user-select: none;
}

.marquee-strip__track {
  display: flex;
  flex: none;
  width: max-content;
  animation: marquee 42s linear infinite;
}

.marquee-strip:hover .marquee-strip__track {
  animation-play-state: paused;
}

.marquee-strip__group {
  display: flex;
  align-items: center;
  flex: none;
}

.marquee-strip span {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  padding: 9px 18px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}

.marquee-strip span::after {
  content: "✳";
  font-size: 10px;
  color: var(--accent);
  opacity: 0.65;
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* --------------------------------------------------------------------------
   10. Stats panel
   -------------------------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--surface-2);
}

.stat {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 20px var(--gutter);
  border-right: 1px solid var(--line);
}

.stat:last-child {
  border-right: 0;
}

.stat::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.5s var(--ease);
}

.stat:hover::before {
  width: 100%;
}

.stat__value {
  font-size: clamp(1.3rem, 2.8vw, 1.7rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
}

.stat__value span {
  color: var(--accent);
}

.stat__label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

/* --------------------------------------------------------------------------
   11. Home project rows
   -------------------------------------------------------------------------- */
.project-list {
  display: grid;
}

.project-row {
  position: relative;
  display: grid;
  grid-template-columns: 24px 184px minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  padding: 20px var(--gutter);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.25s var(--ease-soft);
}

.project-row:last-child {
  border-bottom: 0;
}

.project-row:hover {
  background: var(--surface-2);
}

.project-row__index {
  align-self: start;
  padding-top: 4px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--faint);
}

.project-row__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-3);
}

.project-row__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.42) contrast(1.02);
  transition:
    filter 0.55s var(--ease),
    transform 0.7s var(--ease);
}

.project-row:hover .project-row__media img {
  filter: grayscale(0) contrast(1);
  transform: scale(1.045);
}

.project-row__body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.project-row__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.project-row__title {
  font-size: clamp(1.03rem, 1.9vw, 1.18rem);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.project-row__type {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.project-row__desc {
  max-width: 48ch;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
}

.project-row__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-top: 3px;
}

.project-row__tags span {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.02em;
  color: var(--faint);
}

.project-row__tags span + span::before {
  content: "·";
  margin-right: 5px;
  color: var(--line-strong);
}

.project-row__side {
  display: flex;
  align-items: center;
  gap: 12px;
}

.project-row__year {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--faint);
}

.project-row__arrow {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  transition:
    background-color 0.25s,
    border-color 0.25s,
    color 0.25s,
    transform 0.35s var(--ease);
}

.project-row:hover .project-row__arrow {
  border-color: var(--fg);
  background: var(--fg);
  color: var(--bg);
  transform: rotate(-45deg);
}

.project-row__arrow svg {
  width: 13px;
  height: 13px;
}

/* --------------------------------------------------------------------------
   12. About panel
   -------------------------------------------------------------------------- */
.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(28px, 5vw, 58px);
  padding: clamp(26px, 4vw, 38px) var(--gutter);
}

.about-statement {
  font-size: clamp(1.38rem, 2.8vw, 1.85rem);
  line-height: 1.25;
  letter-spacing: -0.035em;
  max-width: 28ch;
}

.about-statement em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
}

.about-copy {
  display: grid;
  align-content: start;
  gap: 16px;
  padding-top: 5px;
}

.about-copy p {
  max-width: 54ch;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--muted);
}

.about-copy p strong {
  color: var(--fg-soft);
  font-weight: 500;
}

.about-copy .hand-note {
  position: static;
  align-items: flex-start;
  margin-top: 2px;
  font-size: 1.25rem;
  text-align: left;
  transform: rotate(-2deg);
}

.about-facts {
  display: grid;
  border-top: 1px dashed var(--line-strong);
  margin-top: 6px;
}

.about-fact {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.about-fact dt {
  color: var(--faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 9px;
}

.about-fact dd {
  color: var(--fg-soft);
  text-align: right;
}

.principles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: 6px;
  border-top: 1px dashed var(--line);
  border-left: 1px dashed var(--line);
}

.principle {
  padding: 12px;
  border-right: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
}

.principle__num {
  display: block;
  margin-bottom: 5px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--accent);
}

.principle h4 {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.principle p {
  margin-top: 2px;
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--faint);
}

/* --------------------------------------------------------------------------
   13. Stack panel
   -------------------------------------------------------------------------- */
.stack-list {
  display: grid;
}

.stack-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 16px var(--gutter);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.2s;
}

.stack-row:last-child {
  border-bottom: 0;
}

.stack-row:hover {
  background: var(--surface-2);
}

.stack-row__cat {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding-top: 2px;
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-soft);
}

.stack-row__num {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 400;
  color: var(--faint);
}

.stack-row__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.stack-row__tags .tag {
  height: 23px;
  font-size: 10px;
  background: transparent;
}

.stack-row:hover .tag {
  background: var(--bg);
}

/* --------------------------------------------------------------------------
   14. Testimonials
   -------------------------------------------------------------------------- */
.recommendations-slider {
  position: relative;
  padding: 0;
}

.scrolling-wrapper {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 20px var(--gutter) 22px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.scrolling-wrapper::-webkit-scrollbar {
  display: none;
}

.recommendation-card {
  position: relative;
  flex: 0 0 min(390px, 82vw);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  scroll-snap-align: start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  transition:
    border-color 0.25s,
    background-color 0.25s,
    box-shadow 0.35s var(--ease);
}

.recommendation-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    280px circle at var(--card-x, 70%) var(--card-y, 0%),
    var(--accent-soft),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.35s;
}

.recommendation-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  box-shadow: var(--shadow-md);
}

.recommendation-card:hover::before {
  opacity: 1;
}

.recommendation-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.recommendation-avatar {
  width: 38px;
  height: 38px;
  flex: none;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-3);
}

.recommendation-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
  transition: filter 0.5s var(--ease);
}

.recommendation-card:hover .recommendation-avatar img {
  filter: grayscale(0);
}

.recommendation-info {
  min-width: 0;
}

.recommendation-author {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.recommendation-role {
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.02em;
  color: var(--faint);
}

.recommendation-icon {
  margin-left: auto;
  color: var(--line-strong);
  font-size: 17px;
}

.recommendation-body {
  position: relative;
  z-index: 1;
}

.recommendation-body p {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--fg-soft);
  text-wrap: pretty;
}

.rec-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  box-shadow: var(--shadow-sm);
  translate: 0 -50%;
  transition:
    color 0.2s,
    background-color 0.2s,
    border-color 0.2s,
    opacity 0.2s;
}

.rec-nav:hover {
  border-color: var(--fg);
  background: var(--fg);
  color: var(--bg);
}

.rec-nav:disabled {
  opacity: 0;
  pointer-events: none;
}

.rec-nav--prev {
  left: 8px;
}

.rec-nav--next {
  right: 8px;
}

.rec-nav i,
.rec-nav svg {
  font-size: 11px;
  width: 12px;
  height: 12px;
}

/* --------------------------------------------------------------------------
   15. Field notes / writing
   -------------------------------------------------------------------------- */
.notes {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: clamp(24px, 4vw, 54px);
  align-items: end;
  padding: clamp(26px, 4vw, 38px) var(--gutter);
  background: var(--surface-2);
}

.notes__copy {
  display: grid;
  gap: 12px;
}

.notes__title {
  max-width: 22ch;
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.notes__title em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
}

.notes__topics {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.notes__link {
  justify-self: start;
}

/* --------------------------------------------------------------------------
   16. CTA
   -------------------------------------------------------------------------- */
.cta-wrap {
  padding: var(--gutter);
}

.cta {
  position: relative;
  overflow: hidden;
  padding: clamp(30px, 5vw, 52px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: #111214;
  color: #f7f6f2;
  box-shadow: 0 30px 70px -46px rgba(0, 0, 0, 0.9);
  isolation: isolate;
}

.cta .btn--invert {
  border-color: #f7f6f2;
  background: #f7f6f2;
  color: #111214;
}

.cta .btn--invert:hover {
  border-color: #fff;
  background: #fff;
  color: #111214;
}

.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.12) 1px, transparent 1.2px),
    radial-gradient(ellipse 80% 90% at 100% 0%, rgba(45, 92, 255, 0.45), transparent 65%);
  background-size: 18px 18px, 100% 100%;
  opacity: 0.55;
  mask-image: linear-gradient(120deg, transparent 25%, black 100%);
}

.cta::after {
  content: "";
  position: absolute;
  inset: 10px;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  pointer-events: none;
}

.cta__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(30px, 5vw, 48px);
}

.cta .label {
  color: rgba(255, 255, 255, 0.48);
}

.cta__status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.cta__status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.15);
}

.cta__title {
  max-width: 16ch;
  font-size: clamp(2.15rem, 5.5vw, 3.9rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.055em;
  color: #fff;
}

.cta__title em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
}

.cta__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: clamp(26px, 4vw, 38px);
}

.cta__email {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.62);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.cta__email:hover {
  color: #fff;
}

.cta__email svg {
  width: 13px;
  height: 13px;
}

.cta__mark {
  position: absolute;
  right: -18px;
  bottom: -44px;
  font-family: var(--font-serif);
  font-size: clamp(9rem, 22vw, 15rem);
  line-height: 1;
  letter-spacing: -0.08em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.13);
  pointer-events: none;
  user-select: none;
}

.cta__spin {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 86px;
  height: 86px;
  opacity: 0.55;
  animation: spin 22s linear infinite;
  pointer-events: none;
}

.cta__spin text {
  fill: rgba(255, 255, 255, 0.55);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   17. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  position: relative;
  margin-top: 0;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.footer-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px var(--gutter);
  border-bottom: 1px solid var(--line);
  color: var(--faint);
}

.footer-bar__socials {
  display: flex;
  align-items: center;
  gap: 2px;
}

.footer-bar__socials a {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
  transition:
    color 0.2s,
    background-color 0.2s;
}

.footer-bar__socials a:hover {
  background: var(--surface-2);
  color: var(--fg);
}

.footer-bar__socials svg {
  width: 14px;
  height: 14px;
}

.footer-bar__sep {
  width: 1px;
  height: 16px;
  background: var(--line);
}

.footer-bar__copy {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--faint);
}

.footer-bar__top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--faint);
  transition:
    color 0.2s,
    border-color 0.2s;
}

.footer-bar__top:hover {
  border-color: var(--line-strong);
  color: var(--fg);
}

.footer-bar__top svg {
  width: 11px;
  height: 11px;
}

.footer-wordmark {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: clamp(22px, 3.4vw, 38px) 10px 0;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  user-select: none;
}

.footer-wordmark span {
  display: block;
  white-space: nowrap;
  font-size: clamp(3.1rem, 11.8vw, 9.4rem);
  font-weight: 500;
  line-height: 0.76;
  letter-spacing: -0.07em;
  color: transparent;
  -webkit-text-stroke: 1px var(--line-strong);
  transition:
    color 0.5s var(--ease),
    -webkit-text-stroke-color 0.5s var(--ease);
}

.footer-wordmark:hover span {
  color: var(--fg);
  -webkit-text-stroke-color: transparent;
}

.footer-wordmark span em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
}



/* --------------------------------------------------------------------------
   18. Toast
   -------------------------------------------------------------------------- */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  z-index: 400;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 32px);
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 11px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 10px);
  transition:
    opacity 0.25s var(--ease-soft),
    transform 0.3s var(--ease),
    visibility 0.25s;
}

.toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.toast::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

/* --------------------------------------------------------------------------
   19. Motion & theme transition
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  html.js [data-reveal] {
    opacity: 0;
    transform: translateY(16px);
    transition:
      opacity 0.7s var(--ease-soft),
      transform 0.9s var(--ease);
    transition-delay: var(--reveal-delay, 0ms);
  }

  html.js [data-reveal].is-visible {
    opacity: 1;
    transform: none;
  }

  html.js [data-reveal="left"] {
    transform: translateX(-16px);
  }

  html.js [data-reveal="scale"] {
    transform: translateY(10px) scale(0.985);
  }
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-new(root) {
  animation: theme-reveal 0.6s var(--ease-soft);
}

@keyframes theme-reveal {
  from {
    clip-path: circle(0 at var(--theme-x, 90%) var(--theme-y, 4%));
  }
  to {
    clip-path: circle(150% at var(--theme-x, 90%) var(--theme-y, 4%));
  }
}

@keyframes ping {
  0% { transform: scale(1); opacity: 0.5; }
  75%, 100% { transform: scale(2.3); opacity: 0; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------------------
   20. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) 260px;
  }

}

@media (max-width: 820px) {
  .nav-desktop {
    display: none;
  }

  .menu-btn {
    display: grid;
  }

  .header-cta {
    display: none;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .hero-visual {
    order: -1;
    width: min(240px, 62%);
  }

  .hero-visual .hand-note {
    right: auto;
    left: calc(100% + 10px);
    top: 6px;
    align-items: flex-start;
    text-align: left;
    transform: rotate(-3deg);
  }

  .hero-title {
    text-wrap: balance;
  }

  .page-lead__grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .page-lead__aside {
    grid-template-columns: 1fr 1fr;
    align-items: start;
    padding-top: 0;
  }

  .about-layout,
  .notes {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .project-row {
    grid-template-columns: 110px minmax(0, 1fr) auto;
    gap: 14px;
  }

  .project-row__index {
    display: none;
  }

  .project-row__side {
    gap: 6px;
  }

  .project-row__year {
    display: none;
  }

  .stack-row {
    grid-template-columns: 130px minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 58px;
    --gutter: 18px;
  }

  .site-header__inner {
    gap: 10px;
    padding: 0 12px;
  }

  .brand__name {
    display: none;
  }

  .header-actions {
    margin-left: auto;
  }

  .hero-topline {
    padding-inline: var(--gutter);
    font-size: 8.5px;
  }

  .hero-grid {
    padding-top: 26px;
  }

  .hero-title {
    font-size: clamp(2.75rem, 14.4vw, 3.6rem);
    text-wrap: balance;
  }

  .hero-visual {
    width: min(200px, 58%);
  }

  .hero-visual .hand-note {
    display: none;
  }

  .hero-overview {
    grid-template-columns: 1fr;
    margin-top: 30px;
  }

  .overview-item:nth-child(odd) {
    border-right: 0;
  }

  .overview-item {
    padding-inline: var(--gutter);
  }

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

  .stat {
    padding: 15px var(--gutter);
    border-bottom: 1px solid var(--line);
  }

  .stat:nth-child(2) {
    border-right: 0;
  }

  .stat:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .panel-head {
    padding-top: 22px;
  }

  .panel-head__desc {
    display: none;
  }

  .panel-link {
    font-size: 9.5px;
  }

  .project-row {
    grid-template-columns: 84px minmax(0, 1fr) auto;
    padding: 14px var(--gutter);
    gap: 11px;
  }

  .project-row__desc {
    display: none;
  }

  .project-row__tags {
    display: none;
  }

  .project-row__type {
    font-size: 8px;
  }

  .project-row__arrow {
    width: 28px;
    height: 28px;
  }

  .about-layout {
    padding-top: 24px;
  }

  .about-statement {
    max-width: 24ch;
  }

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

  .stack-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding-block: 14px;
  }

  .stack-row__tags .tag {
    height: 22px;
  }

  .notes {
    align-items: start;
  }

  .cta__spin {
    width: 64px;
    height: 64px;
    top: 18px;
    right: 14px;
  }

  .cta__mark {
    font-size: 9rem;
    right: -12px;
    bottom: -28px;
  }


  .footer-bar {
    flex-wrap: wrap;
    gap: 8px 10px;
    padding-block: 12px;
  }

  .footer-bar__copy {
    order: 4;
    width: 100%;
  }

  .footer-bar__top {
    order: 3;
    margin-left: auto;
  }


  .page-lead {
    padding-top: 30px;
  }

  .page-lead__title {
    font-size: clamp(2.5rem, 12vw, 3.4rem);
  }

  .page-lead__aside {
    grid-template-columns: 1fr;
  }

  .lead-note {
    display: none;
  }

  .rec-nav {
    display: none;
  }
}
