/* ==========================================================================
   Richard G Hilton - portfolio
   Palette pulled from the circuit-city hero art: ember orange + circuit teal on night navy.
   ========================================================================== */

:root {
  --bg: #07090f;
  --bg-2: #0b1019;
  --surface: rgba(255, 255, 255, .035);
  --surface-2: rgba(255, 255, 255, .06);
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .18);
  --text: #e9eef6;
  --muted: #96a3b8;
  --accent: #ff7a1a;
  --accent-ink: #1a0c02;
  --accent-2: #2de2c8;
  --glow: rgba(255, 122, 26, .35);
  --glow-2: rgba(45, 226, 200, .22);
  --shadow: 0 30px 60px -30px rgba(0, 0, 0, .8);
  --radius: 18px;
  --radius-sm: 10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --wrap: 1200px;
  --nav-h: 72px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f5f3ee;
  --bg-2: #ebe8e1;
  --surface: rgba(255, 255, 255, .7);
  --surface-2: #fff;
  --line: rgba(12, 20, 32, .1);
  --line-strong: rgba(12, 20, 32, .2);
  --text: #0d1420;
  --muted: #535f73;
  --accent: #e0600a;
  --accent-ink: #fff;
  --accent-2: #0b8f7d;
  --glow: rgba(224, 96, 10, .22);
  --glow-2: rgba(11, 143, 125, .16);
  --shadow: 0 30px 60px -34px rgba(30, 30, 50, .35);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--font);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
kbd {
  font: 600 .72em/1 var(--mono); padding: .3em .45em; border-radius: 6px; border: 1px solid var(--line-strong);
  background: var(--surface-2); color: var(--text); box-shadow: inset 0 -1px 0 var(--line-strong);
}
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }
.page-pad { padding-top: calc(var(--nav-h) + 56px); padding-bottom: 96px; }
.icon { width: 1.2em; height: 1.2em; flex: none; }

.skip { position: fixed; left: 16px; top: -60px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: 8px; font-weight: 600; }
.skip:focus { top: 16px; }

.progress { position: fixed; inset: 0 0 auto; height: 2px; z-index: 60; pointer-events: none; }
.progress span { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); background: linear-gradient(90deg, var(--accent-2), var(--accent)); }

/* Buttons ---------------------------------------------------------------- */
.btn {
  --b: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: .55em; padding: .8em 1.25em;
  border-radius: 999px; border: 1px solid var(--b); text-decoration: none; font-weight: 600; font-size: .95rem;
  cursor: pointer; background: transparent; white-space: nowrap; position: relative; isolation: isolate;
  transition: transform .25s var(--ease), background-color .25s, border-color .25s, box-shadow .25s, color .25s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 30px -10px var(--glow); }
.btn--primary:hover { box-shadow: 0 16px 40px -12px var(--glow), 0 0 0 4px var(--glow); }
.btn--ghost { background: var(--surface); backdrop-filter: blur(8px); }
.btn--ghost:hover { border-color: var(--accent-2); color: var(--accent-2); }
.btn--sm { padding: .55em 1em; font-size: .85rem; }
.btn--lg { padding: .95em 1.5em; font-size: 1rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn .icon { width: 1.05em; height: 1.05em; transition: transform .25s var(--ease); }
.btn:hover .icon { transform: translateX(3px); }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; text-decoration: none; transition: border-color .2s, color .2s, background-color .2s;
}
.icon-btn:hover { border-color: var(--accent-2); color: var(--accent-2); }
.icon-btn--sm { width: 30px; height: 30px; border-radius: 8px; }
.linkish { background: none; border: 0; padding: 0; cursor: pointer; color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: transparent; transition: text-decoration-color .2s; }
.linkish:hover { text-decoration-color: currentColor; }

/* Nav -------------------------------------------------------------------- */
.nav { position: fixed; inset: 0 0 auto; z-index: 50; height: var(--nav-h); transition: background-color .3s, border-color .3s, backdrop-filter .3s; border-bottom: 1px solid transparent; }
.nav.is-scrolled { background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(14px) saturate(1.4); border-color: var(--line); }
.nav__inner { height: 100%; width: min(1320px, 100% - 32px); margin-inline: auto; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }
.brand img { border-radius: 50%; transition: transform .6s var(--ease); }
.brand:hover img { transform: rotate(120deg); }
.brand__text { display: grid; line-height: 1.15; }
.brand__text strong { font: 700 1.02rem var(--display); letter-spacing: -.01em; }
.brand__text small { font-size: .72rem; color: var(--muted); letter-spacing: .02em; }
.nav__links { display: flex; gap: 4px; }
.nav__links a { text-decoration: none; font-size: .92rem; padding: .5em .8em; border-radius: 999px; color: var(--muted); transition: color .2s, background-color .2s; }
.nav__links a:hover, .nav__links a.is-active { color: var(--text); background: var(--surface-2); }
.nav__tools { display: flex; align-items: center; gap: 8px; }
.nav__burger { display: none; }
.nav__burger span { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .3s var(--ease); grid-area: 1 / 1; }
.nav__burger span:first-child { transform: translateY(-4px); }
.nav__burger span:last-child { transform: translateY(4px); }
.nav__burger[aria-expanded="true"] span:first-child { transform: rotate(45deg); }
.nav__burger[aria-expanded="true"] span:last-child { transform: rotate(-45deg); }

@media (max-width: 1080px) {
  .brand__text small { display: none; }
}
@media (max-width: 880px) {
  .nav__burger { display: inline-grid; }
  .nav__links {
    position: fixed; inset: var(--nav-h) 0 auto; flex-direction: column; padding: 16px 20px 24px; gap: 2px;
    background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line);
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity .25s, transform .25s var(--ease), visibility .25s;
  }
  .nav__links.is-open { transform: none; opacity: 1; visibility: visible; }
  .nav__links a { font-size: 1.1rem; padding: .8em 1em; }
  .nav { background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(14px); }
}

/* Type helpers ---------------------------------------------------------- */
.eyebrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; font: 600 .78rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent-2); }
.eyebrow::before { content: ""; width: 22px; height: 1px; background: currentColor; }
.case .eyebrow::before { display: none; }
.section { position: relative; padding: clamp(80px, 11vw, 140px) 0; }
.section__head { max-width: 760px; margin-bottom: 48px; }
.section__head--split { max-width: none; display: flex; justify-content: space-between; align-items: end; gap: 32px; flex-wrap: wrap; }
.section__title { font: 700 clamp(2rem, 4.4vw, 3.3rem)/1.06 var(--display); letter-spacing: -.03em; margin: 0 0 16px; text-wrap: balance; }
.section__sub { color: var(--muted); margin: 0; max-width: 60ch; }
.lead-p { color: var(--muted); font-size: 1.06rem; max-width: 62ch; }
.tag { display: inline-block; font: 600 .68rem var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: .35em .7em; border-radius: 999px; background: var(--glow-2); color: var(--accent-2); }

/* Reveal on scroll ------------------------------------------------------ */
.js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* Hero ------------------------------------------------------------------ */
.hero { position: relative; min-height: 100svh; padding: calc(var(--nav-h) + 40px) 0 48px; display: flex; flex-direction: column; justify-content: center; overflow: hidden; isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -2; background: radial-gradient(60% 50% at 75% 40%, var(--glow) 0%, transparent 60%), radial-gradient(50% 50% at 10% 90%, var(--glow-2) 0%, transparent 60%); opacity: .7; }
.hero::after { content: ""; position: absolute; inset: auto 0 0; height: 30%; z-index: -1; background: linear-gradient(transparent, var(--bg)); pointer-events: none; }
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: .9; }
.hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.status { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 26px; padding: 7px 14px 7px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); backdrop-filter: blur(8px); font-size: .85rem; color: var(--muted); }
.status__dot { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 0 rgba(61, 220, 132, .6); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(61, 220, 132, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); } }
.hero__title { font: 700 46px/.95 var(--display); letter-spacing: -.045em; margin: 0 0 22px; }
.hero__hello { display: block; font-size: .32em; letter-spacing: 0; font-weight: 500; color: var(--muted); margin-bottom: .5em; }
.hero__role { font: 500 clamp(1.05rem, 2.2vw, 1.45rem) var(--mono); color: var(--accent); margin: 0 0 22px; min-height: 1.6em; display: flex; align-items: center; gap: .6em; }
.hero__prompt { color: var(--accent-2); }
.caret { width: .55em; height: 1.1em; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero__intro { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--muted); max-width: 52ch; margin: 0 0 34px; }

.hero__visual { position: relative; height: min(76svh, 720px); }
.hero__portrait { position: absolute; bottom: 0; left: 50%; translate: -50% 0; z-index: 2; height: 100%; width: auto; max-width: none; object-fit: contain; -webkit-mask-image: linear-gradient(#000 78%, transparent); mask-image: linear-gradient(#000 78%, transparent); }
.orbit { position: absolute; inset: 6% -6% auto; aspect-ratio: 1; z-index: 1; }
.orbit__ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--line-strong); }
.orbit__ring--1 { inset: 4%; border: 2px dashed color-mix(in srgb, var(--accent) 60%, transparent); animation: spin 40s linear infinite; }
.orbit__ring--2 { inset: 14%; border-color: color-mix(in srgb, var(--accent-2) 45%, transparent); border-width: 1px 1px 6px 1px; animation: spin 26s linear infinite reverse; }
.orbit__ring--3 { inset: 26%; background: radial-gradient(circle, var(--glow) 0%, transparent 70%); border: 0; animation: pulse 5s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(1turn); } }
@keyframes pulse { 50% { transform: scale(1.12); opacity: .7; } }
.float-tags { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.float-tags li { position: absolute; left: var(--x); top: var(--y); font: 600 .78rem var(--mono); padding: .5em .85em; border-radius: 10px; background: color-mix(in srgb, var(--bg) 70%, transparent); border: 1px solid var(--line-strong); backdrop-filter: blur(10px); box-shadow: var(--shadow); animation: bob 6s ease-in-out var(--d) infinite; }
.float-tags li::before { content: "● "; color: var(--accent-2); }
@keyframes bob { 50% { transform: translateY(-12px); } }


@media (max-width: 940px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__visual { order: -1; height: 340px; margin-bottom: 8px; }
  .orbit { inset: 0 auto auto 50%; width: 360px; translate: -50% 0; }
  .float-tags { display: none; }
}

/* About ----------------------------------------------------------------- */
.about { overflow: hidden; }
.about__bg { position: absolute; inset: -15% 0; background-size: cover; background-position: center; opacity: .16; z-index: -1; -webkit-mask-image: linear-gradient(transparent, #000 25%, #000 75%, transparent); mask-image: linear-gradient(transparent, #000 25%, #000 75%, transparent); will-change: transform; }
[data-theme="light"] .about__bg { opacity: .08; }
.about__grid { display: grid; grid-template-columns: 1.3fr .9fr; gap: 64px; align-items: center; }
.about__edu { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: .92rem; }
.about__edu .icon { color: var(--accent-2); }
.quote { margin: 0; padding: 40px 36px 32px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(160deg, var(--surface-2), var(--surface)); backdrop-filter: blur(14px); box-shadow: var(--shadow); position: relative; }
.quote__mark { width: 44px; height: 44px; color: var(--accent); margin-bottom: 12px; }
.quote blockquote { margin: 0 0 24px; font: 500 1.2rem/1.55 var(--display); letter-spacing: -.01em; }
.quote figcaption { display: grid; }
.quote figcaption span { color: var(--muted); font-size: .9rem; }
@media (max-width: 880px) { .about__grid { grid-template-columns: 1fr; gap: 40px; } }

/* Services (mouse spotlight) ------------------------------------------- */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.service { position: relative; padding: 30px 28px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); overflow: hidden; isolation: isolate; }
.service::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .3s; background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), var(--glow), transparent 60%); }
.services:hover .service::before { opacity: 1; }
.service::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), var(--accent), transparent 60%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .3s; pointer-events: none; }
.services:hover .service::after { opacity: 1; }
.service__icon { display: inline-grid; place-items: center; width: 50px; height: 50px; border-radius: 14px; background: var(--glow-2); color: var(--accent-2); margin-bottom: 20px; }
.service__icon .icon { width: 26px; height: 26px; }
.service h3 { font: 600 1.18rem/1.3 var(--display); margin: 0 0 10px; }
.service p { margin: 0; color: var(--muted); font-size: .95rem; }
@media (max-width: 980px) { .services { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .services { grid-template-columns: 1fr; } }

/* Work ------------------------------------------------------------------ */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter { padding: .55em 1em; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: .88rem; color: var(--muted); transition: all .2s; }
.filter span { font: 600 .72rem var(--mono); margin-left: 4px; opacity: .7; }
.filter:hover { color: var(--text); border-color: var(--line-strong); }
.filter.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }
.skill-filter { margin: -24px 0 24px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.skill-filter strong { color: var(--accent); }

/* Two featured cards share row one; the rest run in threes. Dense packing fills holes a filter leaves. */
.work { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-flow: dense; gap: 20px; }
.card { grid-column: span 2; display: flex; flex-direction: column; text-decoration: none; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-2); overflow: hidden; position: relative; transform-style: preserve-3d; transition: border-color .3s, box-shadow .4s var(--ease), opacity .4s, transform .4s var(--ease); }
.card--featured { grid-column: span 3; }
.card:hover { border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 30px 60px -30px var(--glow); }
.card__media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.card__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 55%, color-mix(in srgb, var(--bg-2) 85%, transparent)); }
.card__media img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 1.2s var(--ease), object-position 3s ease; }
.card:hover .card__media img { transform: scale(1.04); object-position: bottom; }
.card__body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card__tags { display: flex; gap: 6px; flex-wrap: wrap; }
.card__title { font: 600 1.25rem/1.25 var(--display); letter-spacing: -.01em; }
.card__summary { color: var(--muted); font-size: .94rem; flex: 1; }
.card__more { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .9rem; color: var(--accent); }
.card__more .icon { transition: transform .25s var(--ease); }
.card:hover .card__more .icon { transform: translateX(4px); }
.card.is-hidden { display: none; }
.card.is-entering { animation: card-in .5s var(--ease) both; }
@keyframes card-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.work__empty { color: var(--muted); }
@media (max-width: 980px) { .card, .card--featured { grid-column: span 3; } }
@media (max-width: 640px) { .work { grid-template-columns: 1fr; } .card, .card--featured { grid-column: auto; } }

/* Chips: a case study's skill list ------------------------------------- */
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: .45em .8em; border-radius: 10px; font-size: .88rem; text-decoration: none; border: 1px solid var(--line); background: var(--surface-2); transition: all .2s; }
a.chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 20px -10px var(--glow); }

/* Timeline -------------------------------------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 36px; position: relative; --fill: 0; }
.timeline::before, .timeline::after { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; }
.timeline::before { background: var(--line); }
.timeline::after { background: linear-gradient(var(--accent-2), var(--accent)); transform-origin: top; transform: scaleY(var(--fill)); }
.timeline__item { position: relative; display: grid; grid-template-columns: 150px 1fr; gap: 24px; padding-bottom: 22px; }
.timeline__item::before { content: ""; position: absolute; left: -36px; top: 8px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line-strong); transition: border-color .4s, box-shadow .4s; z-index: 1; }
.timeline__item.is-lit::before { border-color: var(--accent); box-shadow: 0 0 0 5px var(--glow); }
.timeline__years { font: 600 .9rem var(--mono); color: var(--accent-2); padding-top: 2px; }
.timeline__card { padding: 20px 24px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); transition: border-color .3s, transform .3s var(--ease); }
.timeline__card:hover { border-color: var(--line-strong); transform: translateX(4px); }
.timeline__card h3 { margin: 0; font: 600 1.12rem var(--display); }
.timeline__card h3 span { color: var(--muted); font-weight: 500; }
.timeline__card ul { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: .95rem; }
.timeline__card li::marker { color: var(--accent); }
.timeline__links { margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.timeline__links a { display: inline-flex; gap: 6px; align-items: center; font-size: .88rem; font-weight: 600; color: var(--accent); text-decoration: none; }
.timeline__links a:hover { text-decoration: underline; }
@media (max-width: 700px) { .timeline__item { grid-template-columns: 1fr; gap: 6px; } }


/* Contact --------------------------------------------------------------- */
.contact__grid { display: grid; gap: 56px; align-items: start; }
.contact__list { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.contact__list li { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.contact__list .icon { color: var(--accent-2); }
.contact__list a { text-decoration: none; color: var(--text); }
.contact__list a:hover { color: var(--accent); }
@media (max-width: 900px) { .contact__grid { gap: 36px; } }

/* Footer ---------------------------------------------------------------- */
.footer { border-top: 1px solid var(--line); padding: 44px 0 30px; background: var(--bg-2); }
.footer__inner { display: flex; flex-wrap: wrap; gap: 24px 40px; align-items: center; justify-content: space-between; }
.footer__brand { display: flex; gap: 14px; align-items: center; }
.footer__brand div { display: grid; }
.footer__brand span { color: var(--muted); font-size: .88rem; }
.footer__links { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.footer__links a { text-decoration: none; color: var(--muted); font-size: .92rem; }
.footer__links a:hover { color: var(--accent); }
.footer__social { display: flex; gap: 8px; }
.footer__meta { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px 30px; justify-content: space-between; color: var(--muted); font-size: .82rem; }

/* Overlays shared ------------------------------------------------------- */
.palette, .term, .modal, .lightbox { position: fixed; inset: 0; z-index: 80; }
.palette__backdrop, .term__backdrop, .modal__backdrop { position: absolute; inset: 0; background: rgba(3, 5, 10, .6); backdrop-filter: blur(6px); animation: fade .25s both; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }
body.is-locked { overflow: hidden; }

/* Palette */
.palette__panel { position: relative; width: min(640px, 100% - 24px); margin: 12vh auto 0; border-radius: 16px; border: 1px solid var(--line-strong); background: color-mix(in srgb, var(--bg-2) 94%, transparent); backdrop-filter: blur(20px); box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .7); overflow: hidden; animation: rise .3s var(--ease) both; }
.palette__search { display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette__search input { flex: 1; border: 0; background: none; padding: 18px 0; font-size: 1.05rem; outline: none; color: var(--text); }
.palette__list { list-style: none; margin: 0; padding: 8px; max-height: min(420px, 55vh); overflow: auto; }
.palette__group { padding: 10px 12px 6px; font: 600 .7rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.palette__item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.palette__item .icon { color: var(--muted); }
.palette__item small { margin-left: auto; color: var(--muted); font-size: .78rem; white-space: nowrap; }
.palette__item mark { background: none; color: var(--accent); font-weight: 600; }
.palette__item[aria-selected="true"] { background: var(--glow); }
.palette__item[aria-selected="true"] .icon { color: var(--accent); }
.palette__empty { padding: 26px; text-align: center; color: var(--muted); }
.palette__foot { display: flex; gap: 18px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: .76rem; color: var(--muted); }
.palette__foot kbd { margin-right: 3px; }

/* Terminal */
.term__window { position: relative; width: min(760px, 100% - 24px); height: min(520px, 80vh); margin: 10vh auto 0; display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; background: #05070c; color: #d6dde8; border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .8), 0 0 0 1px rgba(45, 226, 200, .08), 0 0 80px -20px rgba(45, 226, 200, .25); animation: rise .3s var(--ease) both; font: .9rem/1.6 var(--mono); }
.term__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 14px; background: #0b0f17; border-bottom: 1px solid rgba(255, 255, 255, .08); color: #8894a8; font-size: .78rem; }
.term__bar .icon-btn { background: transparent; border-color: rgba(255, 255, 255, .1); color: #8894a8; }
.term__dots { display: inline-flex; gap: 6px; }
.term__dots i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.term__dots i:nth-child(2) { background: #febc2e; }
.term__dots i:nth-child(3) { background: #28c840; }
.term__body { flex: 1; overflow: auto; padding: 16px 18px 4px; white-space: pre-wrap; word-break: break-word; }
.term__body a { color: #2de2c8; }
.term__body .c-accent { color: #ff9a4d; }
.term__body .c-teal { color: #2de2c8; }
.term__body .c-muted { color: #7b879b; }
.term__body .c-ok { color: #3ddc84; }
.term__body .c-err { color: #ff6b76; }
.term__prompt { display: flex; gap: 8px; padding: 6px 18px 16px; }
.term__prompt label { white-space: nowrap; }
.term__ps1 { color: #3ddc84; }
.term__path { color: #5aa9ff; }
.term__prompt input { flex: 1; background: none; border: 0; outline: none; color: #fff; font: inherit; caret-color: #ff7a1a; min-width: 0; }

/* Modal / case study */
.modal { overflow-y: auto; overscroll-behavior: contain; }
.modal__backdrop { position: fixed; }
.modal__panel { position: relative; width: min(1040px, 100% - 24px); margin: 5vh auto; border-radius: 22px; border: 1px solid var(--line-strong); background: var(--bg); box-shadow: 0 50px 100px -30px rgba(0, 0, 0, .8); animation: rise .4s var(--ease) both; outline: none; min-height: 300px; }
.modal__panel.is-loading::after { content: ""; position: absolute; inset: 50% auto auto 50%; width: 36px; height: 36px; margin: -18px; border: 3px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.case { padding: clamp(24px, 4vw, 48px); }
.case-page .case { padding: 24px 0 0; }
.back-link { color: var(--muted); text-decoration: none; font-size: .92rem; }
.back-link:hover { color: var(--accent); }
.case__head { position: relative; max-width: 780px; margin-bottom: 28px; }
.case__close { position: absolute; right: calc(-1 * clamp(8px, 2vw, 24px)); top: calc(-1 * clamp(8px, 2vw, 24px)); }
.modal .case__head { max-width: none; padding-right: 48px; }
.case__title { font: 700 clamp(1.8rem, 4vw, 2.8rem)/1.08 var(--display); letter-spacing: -.03em; margin: 0 0 12px; }
.case__summary { color: var(--muted); font-size: 1.1rem; margin: 0 0 20px; }
.case__facts { display: flex; flex-wrap: wrap; gap: 12px 40px; margin: 0; }
.case__facts dt { font: 600 .7rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.case__facts dd { margin: 2px 0 0; font-weight: 600; }
.case__gallery { margin-bottom: 36px; }
.case__stage { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); }
.case__zoom { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.case__stage img { width: 100%; max-height: 560px; object-fit: cover; object-position: top; transition: opacity .3s; }
.case__stage img.is-swapping { opacity: 0; }
.case__thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; }
.case__thumb { flex: none; width: 120px; aspect-ratio: 16 / 10; padding: 0; border-radius: 10px; overflow: hidden; border: 2px solid transparent; background: var(--surface-2); cursor: pointer; opacity: .6; transition: opacity .2s, border-color .2s; }
.case__thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.case__thumb:hover, .case__thumb.is-active { opacity: 1; }
.case__thumb.is-active { border-color: var(--accent); }
.case__body { display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; }
.case__body h2 { font: 600 .78rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent-2); margin: 0 0 14px; }
.case__story p { color: var(--muted); margin: 0 0 16px; font-size: 1.02rem; }
.case__story h2:not(:first-child) { margin-top: 28px; }
.case__stack { align-self: start; position: sticky; top: 20px; padding: 22px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); display: grid; gap: 18px; }
.case__stack h2 { margin: 0; }
.case__pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.case__pager a { display: grid; gap: 2px; text-decoration: none; padding: 14px 18px; border-radius: 12px; border: 1px solid var(--line); font-weight: 600; transition: border-color .2s, color .2s; }
.case__pager a:hover { border-color: var(--accent); color: var(--accent); }
.case__pager small { font: .72rem var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.case__pager-next { text-align: right; grid-column: 2; }
@media (max-width: 760px) { .case__body { grid-template-columns: 1fr; } .case__stack { position: static; } .case__pager { grid-template-columns: 1fr; } .case__pager-next { grid-column: auto; } }

.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video__poster { position: absolute; inset: 0; display: grid; place-items: center; background-size: cover; background-position: center; }
.video__play { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 10px var(--glow); transition: transform .25s var(--ease); }
.video__play .icon { width: 28px; height: 28px; fill: currentColor; margin-left: 4px; }
.video__poster:hover .video__play { transform: scale(1.08); }

/* Lightbox */
.lightbox { z-index: 90; background: rgba(3, 5, 10, .92); overflow: auto; display: grid; place-items: start center; padding: 60px 16px; animation: fade .2s both; cursor: zoom-out; }
.lightbox img { max-width: min(1400px, 100%); height: auto; border-radius: 10px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.lightbox__close { position: fixed; top: 14px; right: 14px; background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .2); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 95; translate: -50% 0; padding: 12px 18px; border-radius: 12px; background: var(--text); color: var(--bg); font-weight: 600; font-size: .92rem; box-shadow: var(--shadow); animation: rise .3s var(--ease) both; }

/* Pay page -------------------------------------------------------------- */
.pay__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pay__card { padding: 26px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); display: grid; gap: 16px; justify-items: center; text-align: center; transition: border-color .3s, box-shadow .3s; }
.pay__card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.pay__card h2 { margin: 0; font: 600 1.3rem var(--display); display: flex; gap: 10px; align-items: center; }
.pay__card img { width: 100%; max-width: 230px; height: auto; border-radius: 12px; background: #fff; }
.pay__note { margin: 0; color: var(--muted); font-size: .92rem; }
.pay__extra { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.pay__card--wide { justify-items: start; text-align: left; }
.pay__card--wide p { margin: 0; color: var(--muted); }
.fee { display: grid; gap: 8px; width: 100%; }
.fee > span:first-child { font-size: .85rem; font-weight: 600; }
.fee__input { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--bg); padding-left: 14px; }
.fee__input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow); }
.fee__input input { flex: 1; border: 0; background: none; padding: .8em 1em .8em .4em; outline: none; min-width: 0; }
.fee output { font: .88rem var(--mono); color: var(--accent-2); }
@media (max-width: 820px) { .pay__grid, .pay__extra { grid-template-columns: 1fr; } }

/* Motion preferences --------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}

