/* =========================================================
   Jechel Sanchez — portfolio
   Theming is driven by three attributes on <html>, set by the
   inline script in <head>:
     data-theme  = light | dark
     data-accent = terracotta | violet | yellow | cobalt
     data-vibe   = editorial | warm | dev | playful   (preview only)
   ========================================================= */

/* ---------- Base tokens (light) ---------- */
:root {
  --bg: #FAFAF9;
  --surface: #FFFFFF;
  --ink: #18181B;
  --ink-2: #3F3F46;
  --muted: #52525B;
  --line: #E4E4E7;
  --line-strong: #D4D4D8;
  --chip: #F4F4F5;
  --header-bg: rgba(250, 250, 249, .82);

  --accent: #C2410C;       /* fills: buttons, dots */
  --accent-ink: #C2410C;   /* text-safe accent: links */
  --on-accent: #FFFFFF;    /* text on accent fills */
  --img-hue: 157deg;       /* rotates the blue in the illustrations to the accent */

  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", monospace;
  --display: var(--font);
  --display-weight: 600;
  --display-tracking: -.025em;

  --container: 1000px;
  --radius: 8px;
  --radius-lg: 12px;
}

/* ---------- Dark ---------- */
:root[data-theme="dark"] {
  --bg: #0F0F11;
  --surface: #17171A;
  --ink: #F4F4F5;
  --ink-2: #D4D4D8;
  --muted: #A1A1AA;
  --line: #27272A;
  --line-strong: #3F3F46;
  --chip: #222226;
  --header-bg: rgba(15, 15, 17, .82);
  color-scheme: dark;
}

/* ---------- Accents ---------- */
:root[data-accent="terracotta"] { --accent: #C2410C; --accent-ink: #C2410C; --on-accent: #FFFFFF; --img-hue: 157deg; }
:root[data-accent="violet"]     { --accent: #6D28D9; --accent-ink: #6D28D9; --on-accent: #FFFFFF; --img-hue: 40deg; }
:root[data-accent="yellow"]     { --accent: #FACC15; --accent-ink: #A16207; --on-accent: #18181B; --img-hue: 185deg; }
:root[data-accent="cobalt"]     { --accent: #1D4ED8; --accent-ink: #1D4ED8; --on-accent: #FFFFFF; --img-hue: 0deg; }

:root[data-theme="dark"][data-accent="terracotta"] { --accent: #FB923C; --accent-ink: #FDBA74; --on-accent: #1C0D04; }
:root[data-theme="dark"][data-accent="violet"]     { --accent: #A78BFA; --accent-ink: #C4B5FD; --on-accent: #150B2E; }
:root[data-theme="dark"][data-accent="yellow"]     { --accent: #FACC15; --accent-ink: #FDE047; --on-accent: #18181B; }
:root[data-theme="dark"][data-accent="cobalt"]     { --accent: #7AA2FF; --accent-ink: #A5BFFF; --on-accent: #0B1330; }

/* ---------- Vibes ---------- */
/* Calm & editorial: serif display type, more air, quiet surfaces */
:root[data-vibe="editorial"] {
  --display: "Newsreader", Georgia, serif;
  --display-weight: 500;
  --display-tracking: -.015em;
}

/* Warm & personal: cream ground, soft rounded shapes, friendly serif */
:root[data-vibe="warm"] {
  --display: "Fraunces", Georgia, serif;
  --display-weight: 600;
  --display-tracking: -.02em;
  --radius: 12px;
  --radius-lg: 20px;
}
:root[data-vibe="warm"]:not([data-theme="dark"]) {
  --bg: #FBF6EF;
  --surface: #FFFDF9;
  --line: #EADFD2;
  --line-strong: #DCCDBB;
  --chip: #F4EBDF;
  --ink: #1F1A17;
  --ink-2: #44403C;
  --muted: #57534E;
  --header-bg: rgba(251, 246, 239, .85);
}
:root[data-vibe="warm"][data-theme="dark"] { --bg: #14110F; --surface: #1C1815; --line: #2E2823; --line-strong: #453C35; --chip: #26201C; --header-bg: rgba(20, 17, 15, .85); }

/* Developer flavour: monospace display, square corners, faint grid */
:root[data-vibe="dev"] {
  --display: var(--mono);
  --display-weight: 600;
  --display-tracking: -.04em;
  --radius: 4px;
  --radius-lg: 6px;
}

/* Playful: geometric display, chunkier shapes, small surprises */
:root[data-vibe="playful"] {
  --display: "Space Grotesk", var(--font);
  --display-weight: 700;
  --display-tracking: -.03em;
  --radius: 10px;
  --radius-lg: 16px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s, color .25s;
}
:root[data-vibe="dev"] body {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 32px 32px;
  background-attachment: fixed;
  background-position: -1px -1px;
}
:root[data-vibe="dev"] body::before { /* fade the grid so text stays calm */
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at top, transparent 0%, var(--bg) 70%);
}
img, svg { display: block; }
a { color: inherit; }
h1, h2, h3, p, dl, dd, ul, ol, figure { margin: 0; }
h1, h2, .display { font-family: var(--display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); }
.icon { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.skip-link {
  position: absolute; left: 16px; top: -60px;
  padding: 10px 14px; border-radius: var(--radius);
  background: var(--ink); color: var(--bg); z-index: 50;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--on-accent); }

.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header (sticky) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--header-bg);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header .container,
.site-footer .container {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 24px;
}
.site-header .container { padding-top: 10px; padding-bottom: 10px; }
.brand { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; text-decoration: none; padding: 12px 0; }
.brand__dev { display: none; font-family: var(--mono); font-weight: 500; }
:root[data-vibe="dev"] .brand__name { display: none; }
:root[data-vibe="dev"] .brand__dev { display: inline; }
.caret { display: inline-block; width: .55em; height: 1.1em; margin-left: 2px; background: var(--accent); vertical-align: -.15em; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px; font-size: 14px; }
.nav a:not(.btn) { position: relative; color: var(--muted); text-decoration: none; padding: 12px 0; transition: color .15s; }
.nav a:not(.btn):hover, .nav a.is-active { color: var(--ink); }
.nav a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 6px; height: 2px; border-radius: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.nav a.is-active::after { transform: scaleX(1); }
.nav__tools { display: inline-flex; align-items: center; gap: 8px; }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink);
  cursor: pointer; transition: border-color .15s, transform .15s;
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn .i-sun { display: none; }
:root[data-theme="dark"] .icon-btn .i-sun { display: block; }
:root[data-theme="dark"] .icon-btn .i-moon { display: none; }

.site-footer { border-top: 1px solid var(--line); position: relative; }
.site-footer .container { padding-top: 28px; padding-bottom: 28px; font-size: 13px; color: var(--muted); }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 14px; font-weight: 500; text-decoration: none;
  cursor: pointer; transition: border-color .15s, background .15s, transform .15s, box-shadow .15s;
}
.btn:hover { border-color: var(--ink); }
.btn--lg { min-height: 48px; padding: 0 22px; font-size: 15px; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--primary:hover { border-color: var(--accent); filter: brightness(1.06); }
.btn--outline { border-color: var(--ink); }

.text-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
  color: var(--accent-ink); font-weight: 500; text-decoration: none;
}
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.text-link .icon, .project__cta .icon { transition: transform .2s ease; }
.text-link:hover .icon { transform: translateX(3px); }

/* ---------- Typography helpers ---------- */
.eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
:root[data-vibe="dev"] .section-head .eyebrow::before,
:root[data-vibe="dev"] .work__head .eyebrow::before { content: "// "; color: var(--accent-ink); }
.section { padding: 72px 0 88px; border-top: 1px solid var(--line); }
:root[data-vibe="editorial"] .section { padding: 96px 0 104px; }
.section-title { margin-top: 8px; font-size: 30px; }
:root[data-vibe="editorial"] .section-title { font-size: 36px; }
:root[data-vibe="dev"] .section-title { font-size: 26px; }
.section-head { margin-bottom: 36px; }
.lead { font-size: 18px; line-height: 1.65; color: var(--muted); max-width: 640px; }
.body { font-size: 15px; line-height: 1.65; color: var(--muted); }

/* ---------- Hero ---------- */
.hero { padding: 96px 0 56px; }
:root[data-vibe="editorial"] .hero { padding: 120px 0 72px; }
.hero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 24px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.hero__meta .sep { opacity: .5; }
.dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; animation: ping 2.4s ease-out infinite; }
@keyframes ping { 0% { transform: scale(.6); opacity: .7; } 80%, 100% { transform: scale(1.6); opacity: 0; } }
.hero h1 { max-width: 800px; font-size: clamp(36px, 5.5vw, 58px); line-height: 1.08; }
:root[data-vibe="editorial"] .hero h1 { font-size: clamp(40px, 6.2vw, 68px); line-height: 1.04; }
:root[data-vibe="dev"] .hero h1 { font-size: clamp(30px, 4.6vw, 48px); line-height: 1.15; }
.hero .lead { margin-top: 24px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

/* emphasis inside the headline changes with the vibe */
.hl { font-style: normal; }
:root[data-vibe="editorial"] .hl,
:root[data-vibe="warm"] .hl { font-style: italic; color: var(--accent-ink); }
:root[data-vibe="dev"] .hl { color: var(--accent-ink); }
:root[data-vibe="dev"] .hero h1::after { content: ""; display: inline-block; width: .5em; height: .9em; margin-left: 6px; background: var(--accent); vertical-align: -.08em; animation: blink 1.1s steps(1) infinite; }
:root[data-vibe="playful"] .hl {
  background: linear-gradient(transparent 58%, color-mix(in srgb, var(--accent) 45%, transparent) 58%);
  padding: 0 .08em; border-radius: 2px;
}

/* warm: hand-drawn underline under the name in the eyebrow */
.squiggle { display: none; }
:root[data-vibe="warm"] .squiggle { display: block; width: 120px; height: 10px; margin-top: -18px; margin-bottom: 18px; color: var(--accent); }

/* ---------- Currently strip (hide with data-show="false") ---------- */
.currently {
  padding: 18px 20px;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface);
}
.currently[data-show="false"] { display: none; }
.currently__label { margin-bottom: 14px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.currently__list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 16px; }
.currently__item { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.currently__icon {
  display: grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent-ink);
}
.currently__item small { display: block; font-size: 12px; color: var(--muted); }
.currently__item b { display: block; margin-top: 2px; font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--ink); overflow-wrap: anywhere; }
@media (max-width: 560px) { .currently__list { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Notice ---------- */
.notice {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 20px 24px; margin-bottom: 72px;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface);
  font-size: 15px; line-height: 1.6; color: var(--ink-2);
}
.notice .icon { width: 20px; height: 20px; margin-top: 2px; stroke-width: 1.8; color: var(--ink); }
.notice strong { color: var(--ink); font-weight: 600; }

/* ---------- Work list ---------- */
.work { padding-bottom: 88px; }
.work__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 28px; }
.work__note { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; max-width: 520px; font-size: 14px; line-height: 1.55; color: var(--muted); }
.work__note .icon { width: 14px; height: 14px; margin-top: 3px; color: var(--ink-2); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters[hidden] { display: none; }
.chip-btn {
  min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2);
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; transition: all .15s;
}
:root[data-vibe="dev"] .chip-btn { border-radius: var(--radius); font-family: var(--mono); font-size: 12px; }
.chip-btn:hover { border-color: var(--ink); }
.chip-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.project-list { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.project-list li { border-bottom: 1px solid var(--line); }
.project-list li[hidden] { display: none; }
.project {
  position: relative; isolation: isolate;
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px 32px;
  padding: 28px 0; text-decoration: none; color: var(--ink);
}
/* hover colour: a soft accent wash that bleeds slightly past the row */
.project::before {
  content: ""; position: absolute; inset: 6px -16px; z-index: -1; border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  opacity: 0; transform: scale(.985); transition: opacity .25s ease, transform .3s ease;
}
.project:hover::before, .project:focus-visible::before { opacity: 1; transform: none; }
.project:hover h3 { color: var(--accent-ink); }
.project h3 { transition: color .2s; }
:root[data-vibe="dev"] .project:hover h3::before { content: "> "; color: var(--accent-ink); }
.project__main { flex: 999 1 400px; min-width: 0; }
.project__main .eyebrow { margin-bottom: 8px; letter-spacing: .06em; }
.project h3 { font-family: var(--display); font-size: 21px; font-weight: var(--display-weight); letter-spacing: -.01em; }
:root[data-vibe="dev"] .project h3 { font-size: 18px; }
.project:hover h3 { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.project__summary { margin-top: 8px; max-width: 600px; font-size: 15px; line-height: 1.6; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tag { padding: 4px 10px; border-radius: 6px; background: var(--chip); color: var(--ink-2); font-size: 12px; font-weight: 500; }
:root[data-vibe="dev"] .tag { font-family: var(--mono); font-size: 11px; border-radius: 3px; }
.project__meta { flex: 1 0 150px; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.project__year { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.project__cta { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--accent-ink); }
.project:hover .project__cta .icon { transform: translate(2px, -2px); }
.project__thumb { flex: 0 0 200px; transition: transform .3s ease, box-shadow .3s ease; }
.project:hover .project__thumb { transform: translateY(-2px); box-shadow: 0 8px 24px -12px rgba(0,0,0,.25); }
:root[data-vibe="playful"] .project:hover .project__thumb { transform: rotate(-2deg) scale(1.03); }
.work__foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px; margin-top: 16px; }
.result-count { font-size: 13px; color: var(--muted); }
.work__foot .work__note { margin: 0; align-items: center; font-size: 13px; }
.work__foot .work__note .icon { margin-top: 0; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 999px;
  font-size: 12px; font-weight: 500; color: var(--ink-2); white-space: nowrap; background: var(--surface);
}
.badge .icon { width: 12px; height: 12px; stroke-width: 2.2; }
:root[data-vibe="playful"] .project .badge { transform: rotate(2deg); }
:root[data-vibe="dev"] .badge { border-radius: 3px; font-family: var(--mono); font-size: 11px; }

/* ---------- Columns (principles, skills) ---------- */
.cols { display: flex; flex-wrap: wrap; gap: 32px 24px; }
.cols > * { flex: 1 1 260px; min-width: 0; }
.cols--2 > * { flex-basis: 380px; }
.principle { padding-top: 20px; border-top: 2px solid var(--ink); }
:root[data-vibe="warm"] .principle,
:root[data-vibe="playful"] .principle { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
:root[data-vibe="playful"] .principle { border-top: 4px solid var(--accent); }
.principle h3 { font-size: 17px; font-weight: 600; }
.principle p { margin-top: 10px; }

.skill-group h3 { margin-bottom: 14px; font-size: 14px; font-weight: 600; }
.skill-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; }
.skill-list li { padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: 14px; transition: border-color .15s, transform .15s; }
.skill-list li:hover { border-color: var(--accent); }
:root[data-vibe="playful"] .skill-list li:hover { transform: translateY(-2px) rotate(-1.5deg); }
:root[data-vibe="dev"] .skill-list li { font-family: var(--mono); font-size: 12px; }

/* ---------- "Built for" strip (full-bleed band under the hero) ---------- */
.strip {
  margin: 8px calc(50% - 50vw) 72px; /* break out of the container to full width */
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.strip__inner { max-width: 1240px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 24px; min-height: 72px; }
.strip__label { flex-shrink: 0; font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.strip__viewport {
  flex: 1 1 auto; min-width: 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}
.strip__track { display: flex; width: max-content; list-style: none; margin: 0; padding: 0; }
.strip__track li {
  display: inline-flex; align-items: center; padding-right: 44px; white-space: nowrap;
  font-family: var(--display); font-weight: var(--display-weight); font-size: 18px; letter-spacing: -.01em;
  color: var(--muted); transition: color .2s;
}
.strip__track li::before { content: ""; width: 6px; height: 6px; margin-right: 44px; border-radius: 50%; background: var(--accent); opacity: .7; }
:root[data-vibe="dev"] .strip__track li::before { content: "/"; width: auto; height: auto; margin-right: 40px; border-radius: 0; background: none; color: var(--accent-ink); opacity: 1; }
:root[data-vibe="playful"] .strip__track li::before { border-radius: 2px; transform: rotate(45deg); }
.strip__track li:hover { color: var(--ink); }
.strip.is-ready .strip__track { animation: marquee var(--dur, 50s) linear infinite; }
.strip:hover .strip__track, .strip.is-paused .strip__track { animation-play-state: paused; }
.strip__toggle {
  flex-shrink: 0; display: inline-grid; place-items: center; width: 44px; height: 44px;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--bg); color: var(--ink); cursor: pointer;
}
.strip__toggle:hover { border-color: var(--ink); }
.strip__toggle .i-play { display: none; }
.strip.is-paused .strip__toggle .i-play { display: block; }
.strip.is-paused .strip__toggle .i-pause { display: none; }
.strip__toggle .icon { fill: currentColor; stroke: none; width: 14px; height: 14px; }
@media (max-width: 640px) {
  .strip__inner { gap: 12px; }
  .strip__label { display: none; }
  .strip__track li { font-size: 16px; }
}

/* ---------- Education cards ---------- */
.edu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.edu-card {
  display: flex; align-items: flex-start; gap: 16px; padding: 24px;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface);
  transition: border-color .2s, transform .25s ease, box-shadow .25s ease;
}
.edu-card:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); transform: translateY(-2px); box-shadow: 0 14px 30px -20px rgba(0, 0, 0, .3); }
.edu-card__icon, .tenet__num {
  display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent-ink);
}
.edu-card__icon .icon { width: 20px; height: 20px; }
.edu-card h3 { font-size: 17px; font-weight: 600; }
.edu-card__where { margin-top: 4px; font-size: 14px; color: var(--muted); }
.edu-card__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pill { padding: 4px 10px; border-radius: 999px; background: var(--chip); color: var(--ink-2); font-family: var(--mono); font-size: 12px; }
.pill--accent { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-ink); font-family: var(--font); font-weight: 600; }

/* ---------- Design philosophy: dark card, vertical statement roll + tabs ---------- */
.tenet__num { width: 40px; height: 40px; font-family: var(--mono); font-size: 13px; font-weight: 600; transition: transform .25s ease, background .25s, color .25s; }
.philo {
  --card-ink: #FAFAF9; --card-muted: #A1A1AA; --card-line: rgba(255, 255, 255, .12);
  --roll: color-mix(in srgb, var(--accent) 72%, #FFFFFF);
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-wrap: wrap; gap: 40px 56px; align-items: center;
  padding: clamp(32px, 5.5vw, 64px); border-radius: calc(var(--radius-lg) * 1.6);
  background: #141416; color: var(--card-ink);
}
:root[data-theme="dark"] .philo { background: var(--surface); border: 1px solid var(--line); }
.philo::before { /* dot texture */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1.3px); background-size: 20px 20px;
  -webkit-mask-image: linear-gradient(100deg, #000 0%, transparent 60%); mask-image: linear-gradient(100deg, #000 0%, transparent 60%);
}
.philo::after { /* accent glow */
  content: ""; position: absolute; z-index: -1; left: -160px; bottom: -200px; width: 560px; height: 560px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 40%, transparent), transparent 65%);
  filter: blur(30px); opacity: .7; animation: drift 18s ease-in-out infinite alternate;
}
.philo__stage { flex: 1 1 340px; min-width: 0; }
.philo__kicker { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--card-muted); }
.philo__kicker span { color: var(--roll); }
.philo__roll {
  --line: 1.18em;
  margin-top: 14px; height: calc(var(--line) * 2); overflow: hidden;
  font-family: var(--display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking);
  font-size: clamp(28px, 3.6vw, 42px); line-height: var(--line); color: var(--card-ink);
}
.philo__reel { display: flex; flex-direction: column; transition: transform .75s cubic-bezier(.65, 0, .35, 1); }
.philo__reel > span { display: block; height: calc(var(--line) * 2); }
:root[data-vibe="playful"] .philo__reel { transition-timing-function: cubic-bezier(.34, 1.4, .64, 1); }
:root[data-vibe="dev"] .philo__roll { font-size: clamp(22px, 2.8vw, 32px); }
.philo__quote { margin-top: 24px; max-width: 420px; font-size: 15px; line-height: 1.6; color: var(--card-muted); font-style: italic; }

.philo__tabs { flex: 1 1 380px; min-width: 0; list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.philo__tab {
  position: relative; overflow: hidden; width: 100%; display: flex; align-items: flex-start; gap: 16px;
  padding: 16px 16px 18px; border: 0; border-radius: var(--radius-lg); background: transparent;
  color: var(--card-muted); font: inherit; text-align: left; cursor: pointer; transition: background .25s, color .25s;
}
.philo__tab:hover { background: rgba(255, 255, 255, .04); color: var(--card-ink); }
.philo__tab.is-active { background: rgba(255, 255, 255, .06); color: var(--card-ink); }
.philo__tab .tenet__num { background: rgba(255, 255, 255, .08); color: var(--card-muted); }
.philo__tab.is-active .tenet__num { background: var(--accent); color: var(--on-accent); transform: rotate(-6deg); }
.philo__text b { display: block; font-size: 16px; font-weight: 600; color: inherit; }
.philo__text > span {
  display: block; margin-top: 4px; font-size: 14px; line-height: 1.55; color: var(--card-muted);
  max-height: 0; opacity: 0; overflow: hidden; transition: max-height .4s ease, opacity .3s ease;
}
.philo__tab.is-active .philo__text > span, .philo__tab:hover .philo__text > span { max-height: 6em; opacity: 1; }
.philo__bar { position: absolute; left: 16px; right: 16px; bottom: 8px; height: 2px; border-radius: 2px; background: var(--card-line); opacity: 0; }
.philo__bar::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--roll); transform-origin: left; transform: scaleX(0); }
.philo__tab.is-active .philo__bar { opacity: 1; }
.philo__tab.is-active .philo__bar::after { animation: philo-fill var(--philo-int, 4.5s) linear forwards; }
.philo.is-paused .philo__bar { opacity: 0; }
@keyframes philo-fill { to { transform: scaleX(1); } }

.philo__toggle {
  position: absolute; right: 18px; bottom: 18px; display: grid; place-items: center; width: 44px; height: 44px;
  border: 1px solid var(--card-line); border-radius: 50%; background: rgba(255, 255, 255, .06); color: var(--card-ink); cursor: pointer;
}
.philo__toggle:hover { background: rgba(255, 255, 255, .14); }
.philo__toggle .icon { fill: currentColor; stroke: none; width: 14px; height: 14px; }
.philo__toggle .i-play, .philo.is-paused .philo__toggle .i-pause { display: none; }
.philo.is-paused .philo__toggle .i-play { display: block; }
@media (max-width: 640px) { .philo { padding-bottom: 80px; } }

/* ---------- Skills marquee ---------- */
.marquee { display: grid; gap: 14px; }
.marquee__row { display: flex; align-items: center; gap: 12px 28px; }
.marquee__label { flex: 0 0 160px; font-size: 14px; font-weight: 600; color: var(--ink); }
.marquee__viewport {
  flex: 1 1 auto; min-width: 0; overflow: hidden; padding: 6px 0;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
}
.marquee__track { display: flex; width: max-content; list-style: none; margin: 0; padding: 0; }
/* each chip carries its own right margin (not flex gap) so the -50% loop lands exactly */
.chip {
  margin-right: 10px; padding: 9px 14px; white-space: nowrap;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  font-size: 14px; transition: border-color .2s, color .2s, transform .2s;
}
.chip:hover { border-color: var(--accent); color: var(--accent-ink); }
:root[data-vibe="dev"] .chip { font-family: var(--mono); font-size: 12px; }
:root[data-vibe="playful"] .chip:hover { transform: translateY(-2px) rotate(-2deg); }
.marquee.is-ready .marquee__track { animation: marquee var(--dur, 40s) linear infinite; }
.marquee.is-ready .marquee__row[data-dir="right"] .marquee__track { animation-direction: reverse; }
.marquee__row:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (max-width: 640px) {
  .marquee__row { flex-direction: column; align-items: stretch; }
  .marquee__label { flex-basis: auto; }
}

/* ---------- Two-column rows (experience, case study) ---------- */
.rows { list-style: none; padding: 0; }
.row { display: flex; flex-wrap: wrap; gap: 8px 40px; padding: 28px 0; border-top: 1px solid var(--line); }
.row:last-child { border-bottom: 1px solid var(--line); }
.row__label { flex: 0 0 180px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.row__body { flex: 999 1 420px; min-width: 0; }
.row__body h3 { font-size: 18px; font-weight: 600; }
.row__body h3 span { font-weight: 400; color: var(--muted); }
.row__body p { margin-top: 10px; }
.bullets { margin-top: 12px; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.6; color: var(--muted); }
.bullets li::marker { color: var(--accent-ink); }

/* ---------- About + cat corner ---------- */
.about { display: flex; flex-wrap: wrap; gap: 32px 56px; align-items: flex-start; }
.about .portrait { flex: 0 0 260px; max-width: 260px; margin: 0; }
.about__text { flex: 999 1 380px; min-width: 0; }
.about__text .section-title { margin-bottom: 20px; }
.about-text { font-size: 17px; line-height: 1.7; color: var(--ink-2); }
.about-text + .about-text { margin-top: 14px; }
.about-text em { font-style: italic; color: var(--ink); }
.about__text .currently { margin: 28px 0 0; }

.cats { margin-top: 64px; padding-top: 32px; border-top: 1px dashed var(--line-strong); }
.cats__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 16px; }
.cats__head h3 { font-family: var(--display); font-weight: var(--display-weight); font-size: 20px; letter-spacing: -.01em; }
.cats__head p { font-size: 13px; color: var(--muted); }
.cat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; list-style: none; padding: 0; }
@media (max-width: 820px) { .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px) { .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cat .media { aspect-ratio: 1 / 1; border-radius: var(--radius-lg); }
.cat .media img { transition: transform .4s ease; }
.cat:hover .media img { transform: scale(1.05); }
.cat.is-remembered .media img { filter: grayscale(.35); }
:root[data-vibe="playful"] .cat:nth-child(odd):hover .media { transform: rotate(-2deg); }
:root[data-vibe="playful"] .cat:nth-child(even):hover .media { transform: rotate(2deg); }
.cat .media { transition: transform .3s ease; }
.cat h4 { margin: 10px 0 0; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.cat p { margin-top: 4px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.cat .heart { width: 14px; height: 14px; color: var(--accent-ink); fill: currentColor; stroke: none; }

/* ---------- Contact ---------- */
.contact-title { margin-top: 8px; font-size: clamp(30px, 4.5vw, 46px); }
.contact .lead { margin-top: 16px; font-size: 17px; }
.email-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 28px; }
.email {
  display: inline-flex; align-items: center; gap: 12px; min-height: 48px;
  font-size: clamp(18px, 2.6vw, 24px); font-weight: 500; overflow-wrap: anywhere;
  text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 6px;
}
.email:hover { text-decoration-color: var(--accent); }
.email .icon { width: 22px; height: 22px; stroke-width: 1.8; }
.copy-btn[data-copied="true"] { border-color: var(--accent); color: var(--accent-ink); }
.local-time { margin-top: 20px; font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.local-time .icon { color: var(--accent-ink); }
.contact .actions { margin-top: 28px; }

/* ---------- Media (images + placeholders) ----------
   .media shows a hatched box with its data-label until the <img> loads;
   main.js removes the <img> if the file is missing. */
.media {
  position: relative; overflow: hidden; aspect-ratio: 3 / 2;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface);
}
.media::before {
  content: attr(data-label);
  position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; text-align: center;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  background-image: repeating-linear-gradient(45deg, transparent 0 10px, var(--line) 10px 11px);
}
.media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.portrait { aspect-ratio: 4 / 5; max-width: 260px; border-radius: var(--radius-lg); }
.portrait img { object-position: 50% 30%; }
:root[data-vibe="playful"] .portrait { transform: rotate(-3deg); }
:root[data-vibe="warm"] .portrait { border-radius: 140px 140px var(--radius-lg) var(--radius-lg); }

/* Illustrations follow the theme:
   – hue-rotate turns the blue linework into the current accent (greys are unaffected)
   – multiply/screen blends the off-white artwork background into the page surface
   – in dark mode the artwork is inverted, then hue-corrected, so it reads as light lines on dark */
.media--art { background: var(--surface); }
.media--art::before { content: none; }
.media--art img { filter: hue-rotate(var(--img-hue)); mix-blend-mode: multiply; }
:root[data-theme="dark"] .media--art img {
  filter: invert(1) hue-rotate(calc(180deg + var(--img-hue))) saturate(1.3) brightness(1.05);
  mix-blend-mode: screen;
}
:root[data-accent="yellow"] .media--art img { filter: hue-rotate(var(--img-hue)) saturate(1.8) brightness(1.04); }
:root[data-theme="dark"][data-accent="yellow"] .media--art img { filter: invert(1) hue-rotate(calc(180deg + var(--img-hue))) saturate(1.8) brightness(1.05); }

/* ---------- Case study ---------- */
.cs-hero { padding: 80px 0 48px; }
.cs-hero__top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 20px; }
.cs-hero h1 { font-size: clamp(34px, 5vw, 54px); line-height: 1.1; }
.cs-hero .lead { margin-top: 20px; max-width: 680px; font-size: 19px; line-height: 1.6; }

.facts { display: flex; flex-wrap: wrap; margin-top: 44px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts > div { flex: 1 1 200px; padding: 20px 20px 20px 0; }
.facts dt { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin-top: 6px; font-size: 15px; font-weight: 500; }

.cover { margin-bottom: 80px; }
.cover figcaption { margin-top: 12px; font-size: 13px; color: var(--muted); }

.cs-details { margin-bottom: 72px; }
.cs-details .row { padding: 32px 0; }
.cs-details h2 { flex: 0 0 180px; font-family: var(--font); font-size: 17px; font-weight: 600; letter-spacing: 0; }
.cs-details .row__body { font-size: 16px; line-height: 1.7; color: var(--ink-2); }
.cs-details ul { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.cs-details li::marker { color: var(--accent-ink); }

.cta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px;
  padding: 32px; margin-bottom: 56px;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface);
}
.cta > div { flex: 1 1 360px; min-width: 0; }
.cta h2 { font-size: 22px; }
.cta p { margin-top: 8px; }

.pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding: 28px 0 80px; border-top: 1px solid var(--line); }
.pager a { display: inline-flex; flex-direction: column; gap: 4px; min-height: 44px; justify-content: center; text-decoration: none; }
.pager__next { align-items: flex-end; text-align: right; }
.pager__title { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; }
.pager a:hover .pager__title { text-decoration: underline; text-underline-offset: 4px; }
.pager__back { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 500; }

/* ---------- Footer cat (all vibes) ----------
   Eyes follow the cursor; hover and it plays (ears twitch, paw swipes, it
   follows you); hover too long or click and it gets annoyed (accent bursts,
   squint, head shake, ears back). */
.cat-peek {
  position: absolute; right: calc(10% - 28px); top: -72px; padding: 24px 28px 0;
  color: var(--ink); cursor: grab; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.cat-peek svg { width: 96px; height: 48px; overflow: hidden; }
.cat-peek { --cat-fur: #17171A; --cat-edge: #17171A; --cat-eye: #F2C14E; --cat-detail: #D4D4D8; --cat-inner: #52525B; }
:root[data-theme="dark"] .cat-peek { --cat-fur: #0A0A0B; --cat-edge: #52525B; }
.cat-peek__cat { transition: transform .45s cubic-bezier(.34, 1.56, .64, 1); }
.cat-peek__head { transform-box: fill-box; transform-origin: 50% 100%; }
.cat-peek .pupil { transition: transform .12s ease-out; }
.cat-peek .eyes { transform-box: fill-box; transform-origin: center; animation: cat-blink 5s infinite; transition: transform .15s; }
.cat-peek .ear { transform-box: fill-box; transition: transform .25s ease; }
.cat-peek .ear--l { transform-origin: 100% 100%; }
.cat-peek .ear--r { transform-origin: 0% 100%; }
.cat-peek .paw { transform-box: fill-box; transform-origin: 50% 100%; transform: translateY(12px); transition: transform .3s ease; }
.cat-peek .brows { opacity: 0; transition: opacity .15s; }
.cat-peek .annoy path { opacity: 0; transform-box: fill-box; transform-origin: center; }

.cat-peek.is-playing { cursor: grabbing; }
.cat-peek.is-playing .ear--l { animation: ear-l .7s ease-in-out infinite; }
.cat-peek.is-playing .ear--r { animation: ear-r .7s ease-in-out infinite .15s; }
.cat-peek.is-playing .paw { animation: paw-swipe .5s ease-in-out infinite alternate; }

.cat-peek.is-annoyed .eyes { animation: none; transform: scaleY(.35); }
.cat-peek.is-annoyed .brows { opacity: 1; }
.cat-peek.is-annoyed .ear--l { animation: none; transform: rotate(-30deg); }
.cat-peek.is-annoyed .ear--r { animation: none; transform: rotate(30deg); }
.cat-peek.is-annoyed .cat-peek__head { animation: head-shake .4s ease-in-out 2; }
.cat-peek.is-annoyed .paw { animation: paw-swat .3s ease-in-out 3; }
.cat-peek.is-annoyed .annoy path { animation: annoy-pop .9s cubic-bezier(.34, 1.56, .64, 1) both; }
.cat-peek.is-annoyed .annoy path:nth-child(2), .cat-peek.is-annoyed .annoy path:nth-child(5) { animation-delay: .08s; }
.cat-peek.is-annoyed .annoy path:nth-child(3), .cat-peek.is-annoyed .annoy path:nth-child(6) { animation-delay: .16s; }

@keyframes cat-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes ear-l { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-12deg); } }
@keyframes ear-r { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(12deg); } }
@keyframes paw-swipe { from { transform: translateY(2px) rotate(8deg); } to { transform: translate(-3px, -6px) rotate(-22deg); } }
@keyframes paw-swat { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translate(-6px, -9px) rotate(-38deg); } }
@keyframes head-shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-7deg); } 75% { transform: rotate(7deg); } }
@keyframes annoy-pop {
  0% { opacity: 0; transform: scale(.2); }
  35% { opacity: 1; transform: scale(1.25); }
  70% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.1); }
}

/* =========================================================
   Motion — each vibe has its own entrance, applied to the hero on
   load and to sections / staggered items as they scroll in.
   ========================================================= */
@keyframes m-rise  { from { opacity: 0; transform: translateY(var(--rise, 18px)); } to { opacity: 1; transform: none; } }
@keyframes m-float { from { opacity: 0; transform: translateY(22px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes m-wipe  { from { opacity: 1; clip-path: inset(-60px 100% -60px -60px); } to { opacity: 1; clip-path: inset(-60px -60px -60px -60px); } }
@keyframes m-pop {
  0% { opacity: 0; transform: translateY(18px) scale(.9) rotate(-2deg); }
  60% { opacity: 1; transform: translateY(-4px) scale(1.03) rotate(1deg); }
  100% { opacity: 1; transform: none; }
}
@keyframes m-fade  { from { opacity: 0; } to { opacity: 1; } }
@keyframes m-draw  { from { stroke-dashoffset: 160; } to { stroke-dashoffset: 0; } }
@keyframes m-rule  { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes m-marker { from { background-size: 0% 100%; } to { background-size: 100% 100%; } }

:root                        { --enter: m-rise;  --enter-dur: .7s;  --enter-ease: cubic-bezier(.2, .7, .2, 1); --stagger: 60ms; }
:root[data-vibe="editorial"] { --enter: m-rise;  --enter-dur: 1s;   --rise: 26px; --stagger: 90ms; }
:root[data-vibe="warm"]      { --enter: m-float; --enter-dur: .9s;  --enter-ease: cubic-bezier(.25, .8, .25, 1); --stagger: 70ms; }
:root[data-vibe="dev"]       { --enter: m-wipe;  --enter-dur: .6s;  --enter-ease: steps(14, end); --stagger: 45ms; }
:root[data-vibe="playful"]   { --enter: m-pop;   --enter-dur: .75s; --enter-ease: cubic-bezier(.34, 1.56, .64, 1); --stagger: 55ms; }

/* hero entrance (home + case studies) */
.js .hero > *, .js .cs-hero > * { animation: var(--enter) var(--enter-dur) var(--enter-ease) both; }
.js .hero > :nth-child(2), .js .cs-hero > :nth-child(2) { animation-delay: .08s; }
.js .hero > :nth-child(3), .js .cs-hero > :nth-child(3) { animation-delay: .16s; }
.js .hero > :nth-child(4), .js .cs-hero > :nth-child(4) { animation-delay: .26s; }
.js .hero > :nth-child(5), .js .cs-hero > :nth-child(5) { animation-delay: .36s; }
.js .hero > :nth-child(6) { animation-delay: .46s; }
.js[data-vibe="dev"] .hero h1 { animation: none; } /* typed out by main.js instead */

/* scroll reveal */
.js .reveal { opacity: 0; }
.js .reveal.is-visible { animation: var(--enter) var(--enter-dur) var(--enter-ease) both; }
.js .reveal:not(.is-visible) .stagger { opacity: 0; }
.js .reveal.is-visible .stagger {
  animation: var(--enter) var(--enter-dur) var(--enter-ease) both;
  animation-delay: calc(.15s + var(--i, 0) * var(--stagger));
}

/* editorial: an accent rule draws under each section title */
:root[data-vibe="editorial"] .section-head::after {
  content: ""; display: block; width: 56px; height: 2px; margin-top: 18px;
  background: var(--accent); transform-origin: left; transform: scaleX(0);
}
:root[data-vibe="editorial"] .is-visible .section-head::after { animation: m-rule .9s .35s cubic-bezier(.2, .7, .2, 1) both; }

/* warm: the squiggle draws itself; cards lift softly on hover */
:root[data-vibe="warm"] .squiggle path { stroke-dasharray: 160; animation: m-draw 1.3s .5s ease both; }
:root[data-vibe="warm"] .principle, :root[data-vibe="warm"] .currently { transition: transform .3s ease, box-shadow .3s ease; }
:root[data-vibe="warm"] .principle:hover, :root[data-vibe="warm"] .currently:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -18px rgba(60, 40, 20, .35); }

/* playful: the highlighter sweeps across the headline; buttons wiggle */
:root[data-vibe="playful"] .hl { background-repeat: no-repeat; background-size: 100% 100%; animation: m-marker .7s .75s ease-out both; }
:root[data-vibe="playful"] .btn:hover { animation: wiggle .4s ease; }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-3deg); } 75% { transform: rotate(3deg); } }

/* dev: blinking caret already on the brand + headline; rows get a "> " prompt on hover */

/* ---------- Background decor ----------
   One absolutely-positioned layer behind the whole page; each vibe turns on
   its own pieces. Kept to the page edges so nothing sits behind text. */
body { position: relative; }
.bg-deco { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-deco > * { position: absolute; display: none; }

/* dot field fading out below the hero (all vibes except dev, which has its grid) */
.bg-dots {
  inset: 0 0 auto 0; height: 900px;
  background-image: radial-gradient(var(--line-strong) 1.1px, transparent 1.4px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 70% 100% at 70% 0%, #000 0%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 100% at 70% 0%, #000 0%, transparent 75%);
  opacity: .7;
}
:root:not([data-vibe="dev"]) .bg-dots { display: block; }

/* editorial: hairline column guides */
.bg-cols {
  top: 0; bottom: 0; left: 50%; width: min(1000px, 100%); transform: translateX(-50%);
  background: repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px 25%);
  border-right: 1px solid var(--line);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 300px, #000 calc(100% - 300px), transparent);
          mask-image: linear-gradient(to bottom, transparent, #000 300px, #000 calc(100% - 300px), transparent);
  opacity: .55;
}
:root[data-vibe="editorial"] .bg-cols { display: block; }

/* warm: soft drifting colour blobs */
.blob { width: 560px; height: 560px; border-radius: 50%; filter: blur(50px); opacity: .55; animation: drift 26s ease-in-out infinite alternate; }
.blob--1 { top: -160px; right: -180px; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 35%, transparent), transparent 65%); }
.blob--2 { top: 34%; left: -260px; background: radial-gradient(circle, rgba(251, 191, 36, .35), transparent 65%); animation-duration: 32s; animation-delay: -8s; }
.blob--3 { top: 72%; right: -240px; background: radial-gradient(circle, rgba(244, 114, 182, .25), transparent 65%); animation-duration: 29s; animation-delay: -15s; }
:root[data-vibe="warm"] .blob { display: block; }
:root[data-theme="dark"] .blob { opacity: .35; }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(60px, 80px) scale(1.12); } }

/* playful: floating outline shapes */
.shape { width: 44px; height: 44px; fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; opacity: .55; animation: bob 7s ease-in-out infinite; }
.shape--ring  { top: 120px; right: 6%; width: 56px; height: 56px; }
.shape--plus  { top: 26%; left: 3%; stroke: var(--line-strong); animation-delay: -2s; }
.shape--tri   { top: 44%; right: 3.5%; animation-delay: -4s; animation-duration: 9s; }
.shape--wave  { top: 63%; left: 2.5%; width: 84px; height: 20px; animation-delay: -1s; }
.shape--dot   { top: 12%; left: 8%; fill: var(--accent); stroke: none; width: 22px; height: 22px; opacity: .35; animation-delay: -3s; }
.shape--ring2 { top: 84%; right: 7%; stroke: var(--line-strong); animation-delay: -5s; }
:root[data-vibe="playful"] .shape { display: block; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-14px) rotate(10deg); } }

/* dev: floating code glyphs over the grid */
.glyph { font-family: var(--mono); font-size: 22px; font-weight: 500; color: var(--line-strong); animation: bob 9s ease-in-out infinite; }
.glyph--1 { top: 140px; right: 5%; color: var(--accent); opacity: .45; }
.glyph--2 { top: 30%; left: 2.5%; animation-delay: -3s; }
.glyph--3 { top: 52%; right: 3%; animation-delay: -6s; }
.glyph--4 { top: 72%; left: 3%; animation-delay: -2s; }
.glyph--5 { top: 88%; right: 6%; color: var(--accent); opacity: .4; animation-delay: -5s; }
:root[data-vibe="dev"] .glyph { display: block; }

@media (max-width: 1180px) { .shape, .glyph { display: none !important; } }

/* ---------- Hero extras ---------- */
/* rotating highlight words */
.hl[data-rotate] { display: inline-block; transition: opacity .3s ease, transform .35s cubic-bezier(.2, .7, .2, 1), filter .3s ease; }
.hl.is-out { opacity: 0; transform: translateY(-.35em); filter: blur(4px); }
.hl.is-in { opacity: 0; transform: translateY(.35em); filter: blur(4px); transition: none; }
:root[data-vibe="playful"] .hl.is-out { transform: translateY(-.3em) rotate(-4deg) scale(.9); }
:root[data-vibe="dev"] .hl.is-out, :root[data-vibe="dev"] .hl.is-in { opacity: 1; transform: none; filter: none; }

/* soft accent spotlight that follows the cursor */
.hero { position: relative; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  /* span the full viewport width (not past it) so the glow isn't boxed in but can't cause sideways scroll */
  top: -80px; bottom: -40px; left: calc(50% - 50vw); width: 100vw;
  background: radial-gradient(420px circle at var(--mx, 70%) var(--my, 40%), color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%);
  opacity: 0; transition: opacity .6s ease;
}
.hero.is-lit::before { opacity: 1; }
:root[data-theme="dark"] .hero::before { background: radial-gradient(420px circle at var(--mx, 70%) var(--my, 40%), color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%); }
html, body { overflow-x: clip; } /* full-bleed bands use 100vw, which includes the scrollbar */

/* ---------- Case-study sheet (opens over the home page like a new page) ---------- */
html { scrollbar-gutter: stable; }
html.sheet-open { overflow: hidden; }
.sheet {
  position: fixed; inset: 0; z-index: 30; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg);
  opacity: 0; transform: translateY(32px);
  transition: opacity .28s ease, transform .38s cubic-bezier(.2, .8, .2, 1);
}
.sheet[hidden] { display: none; }
.sheet.is-open { opacity: 1; transform: none; }
.sheet__bar {
  position: sticky; top: 0; z-index: 2;
  background: var(--header-bg); border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
}
.sheet__bar .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 10px; padding-bottom: 10px; }
.sheet__back {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 2px;
  border: 0; background: none; color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
}
.sheet__back:hover .icon { transform: translateX(-3px); }
.sheet__back .icon { transition: transform .2s ease; }
.sheet__tools { display: inline-flex; gap: 8px; }
.sheet h1:focus { outline: none; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 40; transform: translate(-50%, 20px);
  padding: 10px 16px; border-radius: var(--radius); background: var(--ink); color: var(--bg);
  font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  .hero { padding-top: 56px; }
  :root[data-vibe="editorial"] .hero { padding-top: 64px; }
  .project__thumb { flex-basis: 100%; }
  .project__meta { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
  .cta { padding: 24px; }
  .pager__next { align-items: flex-start; text-align: left; }
  .nav { gap: 0 16px; }
  .about .portrait { flex-basis: 180px; max-width: 180px; }
}

/* Reduced motion (OS setting): keep gentle fades and the cat, drop movement. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  :root, :root[data-vibe] { --enter: m-fade; --enter-dur: .6s; --enter-ease: ease; }
  .cat-peek__cat, .project__thumb, .skill-list li, .principle, .currently, .btn { transition-property: opacity, color, background-color, border-color !important; }
  .cat-peek.is-annoyed .cat-peek__head, .btn:hover, .bg-deco > *, .philo::after { animation: none !important; }
  /* skills stop moving and simply wrap */
  .marquee .marquee__track { animation: none !important; flex-wrap: wrap; width: auto; row-gap: 10px; }
  .marquee [data-clone] { display: none; }
  .marquee__viewport { -webkit-mask-image: none; mask-image: none; }
}
