:root {
  color-scheme: dark;
  --bg: #141414;
  --text: #f0f0ed;
  --muted: #a6a6a3;
  --quiet: #70706e;
  --line: #383838;
  --surface: #202020;
  --surface-strong: #292929;
  --inverse: #141414;
  --scene-main: #aeb5b7;
  --scene-dark: #202526;
  --scene-light: #eef2ef;
  --scene-glow: #83999e;
  font-family: Inter, "Segoe UI", Helvetica, Arial, sans-serif;
  font-synthesis: none;
  background: var(--bg);
  color: var(--text);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #dedede;
  --text: #181a1b;
  --muted: #5e6263;
  --quiet: #7b7f80;
  --line: #b8b9b6;
  --surface: #d2d2d2;
  --surface-strong: #c8c8c8;
  --inverse: #ededeb;
  --scene-main: #596063;
  --scene-dark: #171a1b;
  --scene-light: #cbd0cf;
  --scene-glow: #718b90;
}

:root[data-theme="ocean"] {
  color-scheme: dark;
  --bg: #14232e;
  --text: #e8f0f1;
  --muted: #9bb0b8;
  --quiet: #617984;
  --line: #2c424c;
  --surface: #203540;
  --surface-strong: #29414c;
  --inverse: #14232e;
  --scene-main: #89aab7;
  --scene-dark: #162c36;
  --scene-light: #d3e6e8;
  --scene-glow: #43839b;
}

:root[data-theme="copper"] {
  color-scheme: dark;
  --bg: #0f3040;
  --text: #f4ece8;
  --muted: #d6b6aa;
  --quiet: #a56f63;
  --line: #464858;
  --surface: #183a49;
  --surface-strong: #464858;
  --inverse: #0f3040;
  --scene-main: #a56f63;
  --scene-dark: #464858;
  --scene-light: #d99b7f;
  --scene-glow: #d99b7f;
}

:root[data-theme="plum"] {
  color-scheme: dark;
  --bg: #261d2b;
  --text: #f0e9ee;
  --muted: #b6a5b2;
  --quiet: #7d6979;
  --line: #443748;
  --surface: #342a3a;
  --surface-strong: #403346;
  --inverse: #261d2b;
  --scene-main: #aa91a8;
  --scene-dark: #33263a;
  --scene-light: #eadde6;
  --scene-glow: #8c5c84;
}

:root[data-theme="mist"] {
  color-scheme: light;
  --bg: #b7bbc0;
  --text: #17191c;
  --muted: #454a50;
  --quiet: #686e74;
  --line: #8f959b;
  --surface: #abb0b6;
  --surface-strong: #9ea4aa;
  --inverse: #d8dbe0;
  --scene-main: #53616a;
  --scene-dark: #252c31;
  --scene-light: #cbd1d5;
  --scene-glow: #6d818d;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; background: var(--bg); }
body { margin: 0; overflow-x: hidden; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.6; transition: background-color 350ms ease, color 350ms ease; }
::selection { color: var(--bg); background: var(--text); }
a { color: inherit; text-underline-offset: 5px; }
button, a { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--text); outline-offset: 5px; }
p, h1, h2, h3 { margin: 0; }
img { max-width: 100%; }

.site-frame { position: fixed; inset: 0; z-index: 20; pointer-events: none; border: 1px solid color-mix(in srgb, var(--line) 72%, transparent); }
.page { width: min(1080px, calc(100% - 80px)); margin: 0 auto; }
.skip { position: fixed; top: -100px; left: 20px; z-index: 30; padding: 10px 16px; background: var(--text); color: var(--bg); }
.skip:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.header { position: relative; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 32px; min-height: 106px; border-bottom: 1px solid var(--line); }
.brand { display: block; width: 185px; flex: 0 0 auto; }
.brand img { display: block; width: 100%; height: auto; }
:root[data-theme="light"] .brand img,
:root[data-theme="mist"] .brand img { filter: invert(1); }
nav { display: flex; align-items: center; gap: clamp(20px, 3vw, 44px); font-size: 13px; }
nav a { position: relative; color: var(--muted); text-decoration: none; transition: color 180ms ease; }
nav a::after { content: ""; position: absolute; right: 0; bottom: -7px; left: 0; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform 220ms ease; }
nav a:hover { color: var(--text); }
nav a:hover::after { transform: scaleX(1); transform-origin: left; }

.hero { position: relative; display: flex; min-height: calc(100svh - 106px); overflow: hidden; align-items: stretch; border-bottom: 1px solid var(--line); isolation: isolate; }
.hero-copy { position: relative; z-index: 2; display: flex; width: 100%; min-height: 650px; padding: clamp(64px, 8vh, 88px) 0 82px; flex-direction: column; justify-content: center; pointer-events: none; }
.hero-copy a { pointer-events: auto; }
.eyebrow { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .14em; line-height: 1.4; text-transform: uppercase; }
.hero .eyebrow { margin-bottom: 30px; }
h1 { max-width: 900px; font-size: clamp(48px, 6.6vw, 80px); font-weight: 500; letter-spacing: -.065em; line-height: 1.02; }
h1 span { display: block; width: fit-content; }
h1 .muted-line { color: var(--muted); }
.hero-bottom { display: grid; grid-template-columns: minmax(230px, .9fr) minmax(280px, 380px); gap: 60px; width: min(870px, 100%); margin-top: clamp(42px, 7vh, 72px); align-items: end; }
.hero-bottom p { color: var(--muted); font-size: 15px; }
.hero-bottom > p { width: 320px; max-width: 100%; margin-left: -190px; }
.button { display: inline-flex; width: fit-content; min-width: 222px; align-items: center; justify-content: space-between; gap: 28px; padding: 14px 17px; border: 1px solid var(--text); border-radius: 2px; background: var(--text); color: var(--inverse); font-size: 13px; font-weight: 650; text-decoration: none; transition: background-color 180ms ease, color 180ms ease; }
.button:hover { background: transparent; color: var(--text); }
.button span { font-size: 18px; font-weight: 400; }
.hero-visual { position: absolute; inset: 0 -8vw 0 34%; z-index: 1; pointer-events: none; }
#scene-canvas { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity 900ms ease; }
.webgl-ready #scene-canvas { opacity: .9; }
.hero-object-fallback { position: absolute; top: 50%; left: 58%; width: min(38vw, 480px); aspect-ratio: 1; transform: translate(-50%, -50%) rotate(-9deg); transition: opacity 400ms ease; }
.hero-object-fallback i { position: absolute; inset: 12%; display: block; border: 1px solid var(--quiet); transform: rotate(45deg); }
.hero-object-fallback i:nth-child(2) { inset: 27%; transform: rotate(18deg); background: var(--surface); }
.hero-object-fallback i:nth-child(3) { inset: 40%; transform: rotate(63deg); background: var(--scene-main); opacity: .7; }
.webgl-ready .hero-object-fallback { opacity: 0; }

.section { position: relative; padding: clamp(68px, 8vw, 96px) 0; border-bottom: 1px solid var(--line); }
.section-heading { margin-bottom: clamp(52px, 7vw, 76px); }
.section-heading h2 { max-width: 760px; }
h2 { font-size: clamp(34px, 4.4vw, 52px); font-weight: 500; letter-spacing: -.05em; line-height: 1.08; }
h3 { font-size: 26px; font-weight: 500; letter-spacing: -.035em; line-height: 1.15; }

.statement-copy { width: min(820px, 76%); margin-left: auto; }
.statement-copy h2 { max-width: 930px; }
.statement-copy > p { max-width: 530px; margin: 54px 0 0 auto; color: var(--muted); font-size: 18px; }

.service-list { border-top: 1px solid var(--line); }
.service-row { position: relative; display: grid; grid-template-columns: .28fr .9fr 1.25fr; gap: 32px; padding: 37px 0; border-bottom: 1px solid var(--line); overflow: hidden; isolation: isolate; align-items: start; }
.service-row::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--surface); transform: translateY(101%); transition: transform 320ms cubic-bezier(.2,.7,.2,1); }
.service-row:hover::before { transform: translateY(0); }
.service-number, .principle-grid span { color: var(--quiet); font-size: 11px; letter-spacing: .11em; }
.service-row p { max-width: 520px; color: var(--muted); }

.projects-heading { display: block; }
.project-preview { position: relative; display: block; height: clamp(390px, 51vw, 620px); overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); text-decoration: none; clip-path: inset(var(--project-clip, 0%) round 3px); }
.project-browserbar { position: absolute; top: 0; right: 25px; left: 25px; display: grid; height: 54px; grid-template-columns: 1fr auto 1fr; align-items: center; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; letter-spacing: .04em; }
.project-browserbar > :last-child { justify-self: end; color: var(--text); font-size: 15px; }
.browser-mark { display: flex; gap: 5px; }
.browser-mark i { width: 5px; height: 5px; border-radius: 50%; background: var(--quiet); }
.project-image { position: absolute; top: 78px; right: 25px; bottom: 25px; left: 25px; overflow: hidden; border: 1px solid var(--line); background: #f1eee6; }
.project-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 68%, #0005); pointer-events: none; }
.project-image img { display: block; width: 100%; height: 100%; object-fit: cover; transform: translateY(var(--project-shift, 0px)) scale(var(--project-scale, 1.02)); will-change: transform; }
.project-caption { display: grid; grid-template-columns: .8fr 1.25fr auto; gap: clamp(30px, 5vw, 72px); padding-top: 32px; align-items: start; }
.project-caption > p { max-width: 570px; color: var(--muted); }
.project-link { display: inline-flex; gap: 12px; align-items: baseline; white-space: nowrap; color: var(--text); font-size: 13px; text-decoration-color: var(--quiet); }
.project-link:hover { text-decoration-color: currentColor; }

.principles .section-heading { margin-bottom: 74px; }
.principle-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.principle-grid article { min-height: 265px; padding: 25px 34px 30px 0; border-right: 1px solid var(--line); }
.principle-grid article + article { padding-left: 34px; }
.principle-grid article:last-child { border-right: 0; }
.principle-grid h3 { margin-top: 68px; }
.principle-grid p { max-width: 300px; margin-top: 15px; color: var(--muted); }

.contact { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; }
.contact-layout { display: grid; grid-template-columns: 1.8fr .8fr; gap: 70px; align-items: end; }
.contact h2 { font-size: clamp(44px, 6vw, 68px); }
.contact-layout > div > p { max-width: 530px; margin-top: 30px; color: var(--muted); font-size: 18px; }
.contact-actions { justify-self: end; padding-bottom: 10px; }
.contact-link { display: inline-flex; align-items: center; gap: 22px; font-size: 17px; text-decoration: none; white-space: nowrap; }
.contact-link > span:first-child { border-bottom: 1px solid var(--quiet); }
.contact-circle { display: grid; width: 64px; height: 64px; border: 1px solid var(--line); border-radius: 50%; place-items: center; font-size: 24px; }
.contact-circle svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; }
.copy-email { display: block; margin-top: 14px; padding: 6px 0; border: 0; background: none; color: var(--muted); cursor: pointer; font: inherit; font-size: 13px; text-decoration: underline; text-underline-offset: 4px; }
.copy-email[hidden], .email-fallback[hidden] { display: none; }
.copy-email:hover { color: var(--text); }
.copy-status { display: block; max-width: 280px; color: var(--muted); font-size: 13px; }
.email-fallback { width: 100%; max-width: 300px; margin-top: 8px; padding: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }

footer { display: flex; justify-content: space-between; gap: 24px; padding: 27px 0 72px; color: var(--muted); font-size: 11px; letter-spacing: .04em; }
footer a { text-decoration: none; }
footer a:hover { color: var(--text); }
.legal-links { display: flex; gap: 24px; }

.theme-picker { position: fixed; bottom: max(9px, env(safe-area-inset-bottom)); left: max(11px, env(safe-area-inset-left)); z-index: 22; display: flex; gap: 1px; padding: 3px; border: 1px solid var(--line); border-radius: 4px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); }
.theme-picker[hidden] { display: none; }
.theme-swatch { display: grid; width: 27px; height: 29px; padding: 6px; border: 0; border-radius: 2px; background: transparent; cursor: pointer; place-items: center; }
.theme-swatch span { width: 14px; height: 14px; border: 1px solid #ffffff30; border-radius: 2px; background: var(--swatch); }
.theme-swatch[aria-pressed="true"] span { outline: 1px solid var(--text); outline-offset: 3px; }
.theme-swatch:hover { background: var(--surface); }

.legal-dialog { width: min(680px, calc(100% - 32px)); max-height: calc(100dvh - 48px); padding: 0 28px 28px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--text); }
.legal-dialog::backdrop { background: #000a; backdrop-filter: blur(5px); }
html:has(.legal-dialog[open]) { overflow: hidden; }
.dialog-header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 0; background: var(--bg); }
.dialog-header h2 { font-size: 28px; }
.dialog-header button { width: 40px; height: 40px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--text); cursor: pointer; font-size: 24px; }
.legal-copy { overflow-wrap: anywhere; }
.legal-copy h3 { margin: 26px 0 10px; font-size: 19px; }
.legal-copy p { margin: 0 0 14px; color: var(--muted); }
.legal-page { width: min(720px, calc(100% - 40px)); margin: 40px auto; }
.legal-page h1 { margin: 32px 0; font-size: 36px; }
.legal-page section { margin-top: 40px; }
.legal-page h2 { margin-bottom: 24px; font-size: 36px; }

.js .reveal { opacity: 0; transform: translateY(30px); transition: opacity 800ms cubic-bezier(.2,.7,.2,1), transform 800ms cubic-bezier(.2,.7,.2,1); }
.js .reveal.in-view { opacity: 1; transform: none; }
.js .service-row:nth-child(2), .js .principle-grid article:nth-child(2) { transition-delay: 80ms; }
.js .service-row:nth-child(3), .js .principle-grid article:nth-child(3) { transition-delay: 140ms; }
.js .service-row:nth-child(4) { transition-delay: 200ms; }

@media (max-width: 900px) {
  .page { width: calc(100% - 48px); }
  .hero-copy { min-height: 650px; padding-top: 65px; }
  .hero-visual { left: 18%; opacity: .8; }
  .hero-bottom > p { margin-left: -60px; }
  .statement-copy { width: 88%; }
  .service-row { grid-template-columns: 50px .8fr 1.2fr; }
  .project-preview { height: min(68vw, 650px); }
  .project-caption { grid-template-columns: 1fr 1.4fr; }
  .principle-grid article { padding-right: 20px; }
  .principle-grid article + article { padding-left: 20px; }
  .contact-layout { grid-template-columns: 1.4fr .6fr; }
}

@media (max-width: 650px) {
  .page { width: calc(100% - 34px); }
  .header { min-height: 90px; align-items: flex-start; flex-direction: column; justify-content: center; gap: 9px; }
  .brand { width: 158px; }
  nav { width: 100%; justify-content: space-between; }
  .hero { min-height: calc(100svh - 90px); }
  .hero-copy { min-height: 610px; padding: 50px 0 80px; justify-content: flex-start; }
  .hero .eyebrow { margin-bottom: 25px; }
  h1 { font-size: clamp(44px, 13vw, 66px); }
  .hero-visual { inset: 15% -45% 4% 0; opacity: .72; }
  .hero-bottom { grid-template-columns: 1fr; gap: 24px; margin-top: auto; }
  .hero-bottom p { max-width: 380px; }
  .hero-bottom > p { margin-left: 0; }
  .section { padding: 82px 0; }
  h2 { font-size: clamp(38px, 11vw, 56px); }
  .statement-copy { width: 100%; }
  .statement-copy > p { margin-top: 35px; font-size: 16px; }
  .section-heading { margin-bottom: 50px; }
  .service-row { grid-template-columns: 34px 1fr; gap: 13px; padding: 27px 0; }
  .service-row p { grid-column: 2; font-size: 14px; }
  .projects-heading .project-type { text-align: left; }
  .project-preview { height: 62vw; min-height: 230px; }
  .project-browserbar { right: 13px; left: 13px; height: 44px; }
  .project-image { top: 58px; right: 13px; bottom: 13px; left: 13px; }
  .project-caption { grid-template-columns: 1fr; gap: 25px; }
  .principle-grid { grid-template-columns: 1fr; }
  .principle-grid article, .principle-grid article + article { min-height: 0; padding: 24px 0 30px; border-right: 0; border-bottom: 1px solid var(--line); }
  .principle-grid article:last-child { border-bottom: 0; }
  .principle-grid h3 { margin-top: 35px; }
  .contact { min-height: auto; }
  .contact-layout { grid-template-columns: 1fr; gap: 52px; margin-top: 70px; }
  .contact h2 { font-size: clamp(52px, 15vw, 78px); }
  .contact-layout > div > p { font-size: 16px; }
  .contact-actions { justify-self: start; }
  footer { flex-wrap: wrap; padding-bottom: 74px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .project-image img { transform: none; }
}
