@font-face {
  font-family: "Space Grotesk";
  src: url("assets/fonts/space-grotesk.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

@font-face {
  font-family: "Space Mono";
  src: url("assets/fonts/space-mono.woff2") format("woff2");
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f4f2eb;
  --ink: #171813;
  --quiet: #55554c;
  --rule: #d4d0c4;
  --accent: #7442a3;
  --accent-shadow: #543078;
  --accent-mid: #ba91d8;
  --accent-glint: #e8d5f6;
  --accent-ink: #241432;
  --metal: linear-gradient(132deg, var(--accent-mid), var(--accent-glint) 39%, var(--accent-mid) 73%, #a67ac6);
  --brand-icon: url("assets/icon.svg");
  --focus: #7442a3;
  --grid: #cec9bb38;
  --frame: #d4d0c499;
  --frame-glow: #dfcce680;
  --frame-axis: #cbc4b380;
  --frame-mark: #777264;
  --about-paper: #eae6db;
  --mono: "Space Mono", monospace;
  --gutter: clamp(20px, 5.1vw, 94px);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #191a16;
  --ink: #f4f2eb;
  --quiet: #c6c2b6;
  --rule: #4b4a40;
  --accent: #e5bd65;
  --accent-shadow: #845e23;
  --accent-mid: #d6ab54;
  --accent-glint: #ffedb5;
  --accent-ink: #241a0a;
  --metal: linear-gradient(132deg, var(--accent-mid), var(--accent-glint) 39%, var(--accent-mid) 73%, #bc8d3b);
  --brand-icon: url("assets/icon-dark.svg");
  --focus: #f4d589;
  --grid: #93867429;
  --frame: #595448a6;
  --frame-glow: #4c3c2199;
  --frame-axis: #61584d99;
  --frame-mark: #aaa18f;
  --about-paper: #282923;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "Space Grotesk", sans-serif; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 5px; }
::selection { color: var(--accent-ink); background: var(--accent-glint); }
[hidden] { display: none !important; }
.wrap { width: min(calc(100% - var(--gutter) * 2), 1440px); margin-inline: auto; }
section[id] { scroll-margin-top: 28px; }

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 3;
  padding: 12px;
  background: var(--paper);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.site-header, .site-footer { display: flex; align-items: center; justify-content: space-between; }
.site-header { min-height: 82px; border-bottom: 1px solid var(--rule); }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 700; font-size: 17px; letter-spacing: -.05em; white-space: nowrap; }
.brand-mark { width: 29px; aspect-ratio: 1; background: var(--brand-icon) center / cover; transition: transform .35s; }
.brand:hover .brand-mark { transform: rotate(45deg); }
nav { display: flex; align-items: center; gap: clamp(18px, 3.4vw, 54px); font-size: 14px; font-weight: 600; }
nav a:hover { text-decoration: underline; text-underline-offset: 5px; }
.contact-link { display: flex; align-items: center; gap: 18px; padding: 9px 12px 9px 15px; border: 1px solid var(--rule); transition: border-color .25s; }
.contact-link:hover { border-color: var(--ink); }
.contact-link span { font-size: 17px; line-height: 1; }

.hero {
  isolation: isolate;
  position: relative;
  display: grid;
  grid-template-columns: 1fr .93fr;
  align-items: center;
  min-height: clamp(580px, 46vw, 755px);
  padding-block: clamp(56px, 5vw, 82px);
  border-bottom: 1px solid var(--rule);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(to right, var(--grid) 1px, transparent 1px), linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(110deg, transparent 2%, #000 46%, #000 80%, transparent);
}
.hero-copy { position: relative; z-index: 1; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0; font: 12px/1.5 var(--mono); letter-spacing: .11em; text-transform: uppercase; }
.status-dot { width: 9px; height: 9px; background: var(--accent); transform: rotate(45deg); }
h1 { margin: 24px 0 22px -0.055em; font-size: clamp(72px, 10.25vw, 166px); font-weight: 700; line-height: .83; letter-spacing: -.062em; }
h1 > span { display: block; }
.period { color: var(--accent); }
.hero-description { max-width: 31ch; margin: 0 0 26px; color: var(--quiet); font-size: clamp(16px, 1.4vw, 21px); line-height: 1.45; }
.button { display: inline-flex; min-height: 51px; align-items: center; justify-content: space-between; gap: 35px; border: 0; padding: 0 15px 0 17px; background: var(--ink); color: var(--paper); font-size: 14px; font-weight: 600; transition: background .25s, color .25s; }
.button span { font-size: 21px; line-height: 1; transition: transform .25s; }
.button:hover { color: var(--accent-ink); background: var(--metal); }
.button:hover span { transform: translate(2px, 2px); }
.hero-copy > * { animation: rise-in .75s both cubic-bezier(.2,.75,.25,1); }
.hero-copy h1 { animation-delay: .08s; }
.hero-copy .hero-description { animation-delay: .16s; }
.hero-copy .button { animation-delay: .24s; }
@keyframes rise-in { from { opacity: 0; transform: translateY(18px); } }

.hero-art { min-width: 0; margin: 0; align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.art-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1.22;
  border: 1px solid var(--frame);
  background: radial-gradient(ellipse at center, var(--frame-glow), transparent 72%);
}
.art-frame::before, .art-frame::after { content: ""; position: absolute; pointer-events: none; }
.art-frame::before { left: 50%; inset-block: 0; border-left: 1px dashed var(--frame-axis); }
.art-frame::after { top: 50%; inset-inline: 0; border-top: 1px dashed var(--frame-axis); }
.corner { position: absolute; z-index: 1; width: 13px; height: 13px; border: solid var(--frame-mark); pointer-events: none; }
.top-left { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.top-right { top: -1px; right: -1px; border-width: 1px 1px 0 0; }
.bottom-left { bottom: -1px; left: -1px; border-width: 0 0 1px 1px; }
.bottom-right { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }
.crosshair { position: absolute; right: 15px; top: 11px; color: var(--frame-mark); font: 16px var(--mono); pointer-events: none; }
.art-fallback { position: absolute; inset: 17% 22%; border: clamp(22px, 5vw, 72px) solid var(--accent); border-radius: 46% 54% 42% 58%; transform: rotate(-30deg); box-shadow: inset 10px 7px var(--accent-shadow), 10px 7px var(--accent-shadow); }
.hero-art.ready .art-fallback { display: none; }
canvas { position: absolute; z-index: 1; inset: 0; display: block; width: 100%; height: 100%; }
.hero-art.ready canvas { cursor: grab; touch-action: pan-y; }
.hero-art.ready canvas:active { cursor: grabbing; }
figcaption { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 50px; color: var(--quiet); font: 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
figcaption > span { display: flex; align-items: center; gap: 12px; }
.caption-dot { width: 7px; height: 7px; background: var(--accent); }
#motion-toggle, .back-top, .close-dialog { display: grid; place-items: center; padding: 0; border: 1px solid var(--rule); background: transparent; transition: background .25s, border-color .25s; }
#motion-toggle { width: 34px; height: 34px; font: 16px/1 sans-serif; }
#motion-toggle:hover, .back-top:hover, .close-dialog:hover { color: var(--accent-ink); background: var(--metal); border-color: var(--accent); }

.work { padding-block: clamp(56px, 6vw, 96px); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.section-label::before { content: ""; width: 16px; height: 1px; background: var(--accent); }
h2 { margin: 10px 0 0; font-size: clamp(43px, 6vw, 88px); line-height: .98; letter-spacing: -.07em; }
.section-note { max-width: 28ch; margin: 0 0 3px; color: var(--quiet); font-size: 15px; line-height: 1.4; }
.project-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(18px, 2.4vw, 36px); }
.project-button { display: block; width: 100%; padding: 0; border: 0; text-align: left; background: transparent; }
.project-art { position: relative; display: grid; place-items: center; aspect-ratio: 1.68; overflow: hidden; isolation: isolate; }
.project-art::before { position: absolute; inset: 0; z-index: -1; content: ""; background-image: linear-gradient(to right, currentColor 1px, transparent 1px), linear-gradient(to bottom, currentColor 1px, transparent 1px); background-size: 31px 31px; opacity: .13; }
.form-art { background: var(--metal); color: var(--accent-ink); }
.signal-art { background: #252a25; color: #d8e6bc; }
.art-index, .art-plus { position: absolute; font: 11px var(--mono); }
.art-index { top: 14px; left: 15px; }
.art-plus { bottom: 12px; right: 15px; font-size: 18px; }
.form-shape { display: grid; width: 47%; aspect-ratio: 1; place-items: center; transform: rotate(-24deg); transition: transform .65s cubic-bezier(.2,.75,.25,1); }
.form-shape i { grid-area: 1 / 1; width: 28%; height: 97%; border: 2px solid currentColor; border-radius: 43%; transform: rotate(var(--angle)); }
.form-shape i:nth-child(1) { --angle: 0deg; }
.form-shape i:nth-child(2) { --angle: 20deg; }
.form-shape i:nth-child(3) { --angle: 40deg; }
.form-shape i:nth-child(4) { --angle: 60deg; }
.form-shape i:nth-child(5) { --angle: 80deg; }
.form-shape i:nth-child(6) { --angle: 100deg; }
.form-shape i:nth-child(7) { --angle: 120deg; }
.form-shape i:nth-child(8) { --angle: 140deg; }
.form-shape i:nth-child(9) { --angle: 160deg; }
.project-button:hover .form-shape, .project-button:focus-visible .form-shape { transform: rotate(17deg) scale(1.13); }
.signal-plot { display: flex; align-items: end; gap: 4%; width: 65%; height: 51%; padding-bottom: 6px; border-bottom: 1px solid #d8e6bc80; }
.signal-plot i { flex: 1; height: var(--height); background: currentColor; transition: transform .4s; transform-origin: bottom; }
.signal-plot i:nth-child(1) { --height: 13%; }
.signal-plot i:nth-child(2) { --height: 26%; }
.signal-plot i:nth-child(3) { --height: 20%; }
.signal-plot i:nth-child(4) { --height: 38%; }
.signal-plot i:nth-child(5) { --height: 52%; }
.signal-plot i:nth-child(6) { --height: 38%; }
.signal-plot i:nth-child(7) { --height: 60%; }
.signal-plot i:nth-child(8) { --height: 77%; }
.signal-plot i:nth-child(9) { --height: 63%; }
.signal-plot i:nth-child(10) { --height: 71%; }
.signal-plot i:nth-child(11) { --height: 88%; }
.signal-plot i:nth-child(12) { --height: 72%; }
.signal-plot i:last-child { --height: 94%; background: var(--metal); }
.project-button:hover .signal-plot i:nth-child(even), .project-button:focus-visible .signal-plot i:nth-child(even) { transform: scaleY(.72); }
.project-button:hover .signal-plot i:nth-child(odd), .project-button:focus-visible .signal-plot i:nth-child(odd) { transform: scaleY(1.1); }
.project-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px 0 17px; border-bottom: 1px solid var(--rule); }
.project-name, .project-type { display: block; }
.project-name { font-size: clamp(24px, 3vw, 39px); font-weight: 600; line-height: 1.12; letter-spacing: -.06em; }
.project-type { margin-top: 5px; color: var(--quiet); font-size: 13px; }
.project-arrow { display: grid; flex: 0 0 39px; height: 39px; place-items: center; border: 1px solid var(--rule); font-size: 21px; transition: background .25s, border-color .25s; }
.project-button:hover .project-arrow { color: var(--accent-ink); background: var(--metal); border-color: var(--accent); }

dialog { position: fixed; max-width: min(620px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: clamp(24px, 5vw, 55px); border: 1px solid var(--ink); background: var(--paper); color: var(--ink); }
dialog[open] { animation: rise-in .3s both; }
dialog::backdrop { background: #171813a6; }
dialog .eyebrow { padding-right: 30px; }
dialog h3 { margin: 10px 0 20px; font-size: clamp(36px, 6vw, 68px); line-height: 1; letter-spacing: -.08em; }
dialog h4 { margin: 24px 0 6px; }
dialog p:not(.eyebrow) { color: var(--quiet); line-height: 1.6; margin: 0 0 22px; }
.close-dialog { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; line-height: 1; font-size: 25px; }

.about { display: grid; grid-template-columns: .75fr 1fr; align-items: center; gap: clamp(25px, 8vw, 120px); border-block: 1px solid var(--rule); padding-block: clamp(40px, 6vw, 90px); }
.about-art { display: grid; place-items: center; position: relative; overflow: hidden; aspect-ratio: 1.35; background: var(--about-paper); }
.about-art span { grid-area: 1 / 1; width: 39%; aspect-ratio: 1; border: 1px solid var(--accent-shadow); transform: translateX(var(--offset)) skewY(-20deg) rotate(24deg); transition: transform .5s; }
.about-art span:nth-child(1) { --offset: -30%; background: var(--metal); }
.about-art span:nth-child(2) { --offset: 0%; background: var(--accent-mid); }
.about-art span:nth-child(3) { --offset: 30%; background: var(--accent-glint); }
.about-art:hover span { transform: translateX(calc(var(--offset) * 1.5)) skewY(-12deg) rotate(12deg); }
.about-copy > p:last-child, .contact p:last-child { max-width: 49ch; margin: 16px 0 0; color: var(--quiet); font-size: clamp(16px, 2vw, 20px); line-height: 1.55; }
.contact { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding-block: clamp(50px, 7vw, 105px); }
.back-top { flex: 0 0 46px; height: 46px; font-size: 25px; }
.site-footer { min-height: 76px; border-top: 1px solid var(--rule); }
.site-footer > span { color: var(--quiet); font: 10px var(--mono); text-transform: uppercase; }

.theme-toggle {
  position: fixed;
  z-index: 2;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 3px 12px #17181326;
  font: 26px/1 system-ui, sans-serif;
  transition: background .25s, border-color .25s, color .25s;
}
.theme-toggle:hover { border-color: var(--accent); background: var(--metal); color: var(--accent-ink); }
.theme-sun, [data-theme="dark"] .theme-moon { display: none; }
[data-theme="dark"] .theme-sun { display: block; }

@media (max-width: 900px) {
  .hero { min-height: 0; grid-template-columns: 1fr .85fr; }
  h1 { font-size: clamp(67px, 10.4vw, 101px); }
  .art-frame { aspect-ratio: 1; }
}

@media (max-width: 680px) {
  .site-header { min-height: 66px; }
  nav { gap: clamp(10px, 3vw, 22px); font-size: 13px; }
  .brand { gap: 7px; font-size: 15px; }
  .brand-mark { width: 23px; }
  .contact-link { gap: 4px; padding: 6px; }
  .hero { grid-template-columns: 1fr; gap: 35px; padding-block: 49px 15px; }
  h1 { font-size: clamp(64px, 17vw, 112px); margin-block: 19px; }
  .art-frame { aspect-ratio: 1.27; }
  .section-heading { display: block; }
  .section-note { margin-top: 11px; }
  .project-grid, .about { grid-template-columns: 1fr; }
  .about-art { order: 1; aspect-ratio: 1.75; }
  .site-footer { gap: 12px; padding-right: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.motion-paused *, .motion-paused *::before, .motion-paused *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
