:root {
  color-scheme: dark;
  --bg: #08121c;
  --bg-deep: #050c13;
  --ink: #f1f0eb;
  --ink-secondary: #a9b9c5;
  --ink-muted: #96a2ad;
  --line: #52606b;
  --focus: #d0bd9e;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --gutter: clamp(24px, 5.5vw, 104px);
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --space-5: 64px;
  --copy-size: clamp(38px, 4.5vw, 76px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
html { background: var(--bg-deep); scroll-behavior: auto; scrollbar-gutter: stable; }
/* Scroll lock while the contact dialog is open; the reserved gutter prevents layout shift. */
html.dialog-open { overflow: hidden; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
}
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, [tabindex="-1"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 6px; }
::selection { background: #395568; color: var(--ink); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: 12px;
  left: var(--gutter);
  z-index: 50;
  padding: 12px 16px;
  background: var(--ink);
  color: var(--bg-deep);
  transform: translateY(-200%);
}
.skip-link:focus { transform: translateY(0); }
.scroll-story { position: relative; }
.experience {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(ellipse at 78% 54%, #1c34452b, transparent 46%),
    linear-gradient(115deg, var(--bg), var(--bg-deep));
}
.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: max(28px, env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
}
.identity { display: flex; flex-direction: column; gap: 10px; }
.identity-name { font-size: 13px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; }
.identity-role { color: var(--ink-muted); font-size: 11px; line-height: 1.6; letter-spacing: .025em; }
.mobile-break { display: none; }
.top-links { display: flex; align-items: center; gap: clamp(20px, 2.8vw, 44px); margin-top: -12px; }
.top-links a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 12px; color: var(--ink-secondary); }
.top-links a:hover { color: var(--ink); }
.composition { padding: clamp(72px, 12vw, 160px) var(--gutter) var(--space-5); }
.copy-frame { position: relative; z-index: 2; max-width: 760px; }
.copy-states { display: grid; gap: clamp(80px, 16vh, 160px); }
.copy-state {
  margin: 0;
  font-size: var(--copy-size);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -.045em;
  text-wrap: pretty;
}
.copy-state span { display: block; }
.copy-secondary { color: var(--ink-secondary); }
.copy-state-final .copy-secondary { margin-top: .3em; font-size: .79em; line-height: 1.15; letter-spacing: -.035em; }
.contact-actions { display: flex; gap: 32px; margin-top: var(--space-4); width: fit-content; scroll-margin-top: 32px; }
.contact-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  min-height: 48px;
  padding: 8px 0;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  letter-spacing: .01em;
  transition: border-color 160ms ease, color 160ms ease;
}
.contact-link:hover { color: var(--focus); border-color: var(--focus); }
.visual-stage {
  position: relative;
  width: min(70vw, 420px);
  aspect-ratio: 1;
  margin: var(--space-5) auto 0;
  pointer-events: none;
}
.scene-canvas { display: none; width: 100%; height: 100%; }
.logo-reveal { position: absolute; inset: 0; display: grid; place-items: center; }
.logo-mark { width: 70%; height: auto; filter: drop-shadow(0 22px 28px #0005); }
.scroll-hint { display: none; }

/* Motion is a progressive enhancement. The default document is fully readable. */
.is-enhanced { height: 850svh; }
.is-enhanced .experience { position: sticky; top: 0; height: 100svh; overflow: clip; }
.is-enhanced .composition {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  inset: 136px max(var(--gutter), env(safe-area-inset-right)) 72px max(var(--gutter), env(safe-area-inset-left));
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 72px);
  padding: 0;
}
.is-enhanced .copy-frame::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -80px -100px;
  background: radial-gradient(ellipse at 38% 46%, #07111bc2 0%, #07111b80 40%, #07111b00 73%);
  pointer-events: none;
}
.is-enhanced .contact-actions { pointer-events: auto; }
.is-enhanced .copy-states { gap: 0; text-shadow: 0 2px 20px #030a1266; }
.is-enhanced .copy-state { grid-area: 1 / 1; align-self: start; opacity: 0; }
.is-enhanced .copy-state:first-child { opacity: 1; }
.is-enhanced .contact-actions { visibility: hidden; }
.is-enhanced .contact-actions.is-visible { visibility: visible; }
.is-enhanced .visual-stage {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  aspect-ratio: auto;
}
.is-enhanced .logo-reveal {
  inset: auto;
  left: 75%;
  top: 54%;
  width: min(58vh, 42vw);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  opacity: var(--fallback-opacity, .18);
}
.is-enhanced .logo-mark { width: 100%; }
.is-enhanced .has-webgl .logo-reveal { display: none; }
.is-enhanced .has-webgl .scene-canvas { display: block; opacity: 0; transition: opacity 900ms ease; }
/* The scene fades in once its shaders are ready; text never waits for it. */
.is-enhanced .has-webgl.is-ready .scene-canvas { opacity: 1; }
.is-enhanced .site-header::before {
  content: "";
  position: absolute;
  inset: 0 0 -60px;
  z-index: -1;
  background: linear-gradient(#07111bba, #07111b00);
  pointer-events: none;
}
.is-enhanced .scroll-hint {
  position: absolute;
  z-index: 3;
  left: var(--gutter);
  bottom: max(28px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: .04em;
}
.scroll-line { height: 1px; width: 32px; background: var(--line); }

@media (min-width: 1600px) {
  .is-enhanced .composition { max-width: 1560px; margin-inline: auto; }
}
@media (max-width: 859px) {
  :root { --copy-size: clamp(32px, 7.8vw, 58px); }
  .mobile-break { display: initial; }
  .identity-role { font-size: 10px; }
  .is-enhanced .composition {
    inset: 148px var(--gutter) 52px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: var(--space-2);
    align-items: start;
  }
  .is-enhanced .logo-reveal { left: 50%; top: 73%; width: min(80vw, 52vh); }
  .is-enhanced .copy-frame::before { inset: -64px -56px; }
  .is-enhanced .copy-frame { max-width: 610px; }
  .is-enhanced .contact-actions { display: flex; gap: 32px; margin-top: var(--space-3); }
  .is-enhanced .scroll-hint { bottom: max(22px, env(safe-area-inset-bottom)); }
}
@media (max-width: 480px) {
  .site-header { gap: var(--space-2); }
  .identity-name { font-size: 11px; letter-spacing: .16em; }
  .identity-role { max-width: 210px; }
  .top-links { flex-direction: column; align-items: flex-end; gap: 0; }
  .top-links a { font-size: 11px; }
  .is-enhanced .composition { top: 156px; }
}
@media (max-width: 359px) {
  :root { --gutter: 20px; }
  .identity-role { font-size: 10px; max-width: 160px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
@media print {
  :root { --ink: #111; --ink-secondary: #333; --ink-muted: #444; --copy-size: 24pt; }
  body, .experience { background: white; }
  .scroll-story.is-enhanced { height: auto; }
  .is-enhanced .experience { position: static; height: auto; overflow: visible; }
  .is-enhanced .composition { position: static; display: block; padding: 48px var(--gutter); }
  .is-enhanced .copy-states { gap: 32px; }
  .is-enhanced .copy-state { grid-area: auto; opacity: 1 !important; transform: none !important; break-inside: avoid; }
  .is-enhanced .contact-actions { visibility: visible; }
  .visual-stage, .is-enhanced .scroll-hint, .top-links, .skip-link, .motion-toggle, .contact-dialog { display: none; }
}

/* Motion control: a quiet glyph; its label surfaces on hover and keyboard focus. */
.motion-toggle {
  position: absolute;
  right: max(calc(var(--gutter) - 14px), env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  background: none;
  color: #7c8893;
  font-size: 11px;
  letter-spacing: .04em;
}
.motion-label {
  opacity: 0;
  transform: translateX(4px);
  transition: opacity 200ms ease, transform 200ms ease;
  white-space: nowrap;
  color: var(--ink-muted);
}
.motion-toggle:hover .motion-label,
.motion-toggle:focus-visible .motion-label { opacity: 1; transform: none; }
.motion-toggle:hover { color: var(--ink); }
.motion-toggle:focus-visible { outline-offset: 0; }
.motion-glyph { position: relative; width: 8px; height: 9px; flex: none; }
.motion-glyph::before,
.motion-glyph::after {
  content: "";
  position: absolute;
  top: 0;
  width: 2px;
  height: 9px;
  background: currentColor;
}
.motion-glyph::before { left: 0; }
.motion-glyph::after { right: 0; }
.motion-toggle[data-paused="true"] .motion-glyph::before {
  left: 1px;
  width: 0;
  height: 0;
  background: none;
  border-style: solid;
  border-width: 4.5px 0 4.5px 7px;
  border-color: transparent transparent transparent currentColor;
}
.motion-toggle[data-paused="true"] .motion-glyph::after { display: none; }

/* Contact dialog */
.contact-dialog {
  width: min(540px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: clamp(28px, 5vw, 52px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #53657459;
  background: #0b1721;
  color: var(--ink);
  box-shadow: 0 40px 120px #02070cb3;
}
.contact-dialog[open] { animation: dialog-in 260ms cubic-bezier(.2, .7, .2, 1); }
.contact-dialog::backdrop { background: #03090fc7; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px); } }
.dialog-close {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 44px;
  margin: -12px -8px 20px auto;
  padding: 0 8px;
  color: var(--ink-muted);
  font-size: 12px;
}
.dialog-close:hover { color: var(--ink); }
.dialog-title {
  margin: 0;
  font-size: clamp(30px, 5vw, 42px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -.04em;
}
.dialog-title:focus { outline: none; }
.dialog-title:focus-visible { outline: 2px solid var(--focus); outline-offset: 6px; }
.dialog-intro { margin: 14px 0 0; color: var(--ink-secondary); font-size: 16px; line-height: 1.5; }
.contact-view[data-contact-view="success"] .contact-link { margin-top: var(--space-4); }
.contact-form { display: grid; gap: 22px; margin-top: var(--space-4); }
.field { display: grid; gap: 8px; }
.field label {
  color: var(--ink-secondary);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.field input,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px; /* 16px avoids iOS zoom on focus */
  line-height: 1.5;
  transition: border-color 160ms ease;
}
.field textarea { resize: vertical; min-height: 104px; }
.field input:hover,
.field textarea:hover { border-color: #7a8a97; }
.field input:focus,
.field textarea:focus { outline: none; border-color: var(--focus); }
.field input:focus-visible,
.field textarea:focus-visible { box-shadow: 0 1px 0 var(--focus); }
.field [aria-invalid="true"] { border-color: #e0a295; }
.field-error { min-height: 0; margin: 0; color: #eab1a5; font-size: 13px; line-height: 1.4; }
.field-error:empty { display: none; }
.form-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; margin-top: 8px; }
.form-submit { min-width: 140px; color: var(--ink); }
.form-submit:disabled { cursor: progress; opacity: .6; }
.form-alt { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--ink-muted); font-size: 12px; }
.form-alt:hover { color: var(--ink); }
.form-status { margin: 0; color: var(--ink-secondary); font-size: 14px; line-height: 1.5; }
.form-status:empty { display: none; }
.form-status.is-error { color: #eab1a5; }

/* Without JavaScript, #contact-form opens the panel via :target and the form posts normally. */
:root:not(.has-contact-dialog) .contact-dialog:target {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 60;
  margin: auto;
  height: fit-content;
}

@media (max-width: 480px) {
  .contact-dialog { width: calc(100% - 24px); max-height: calc(100dvh - 24px); padding: 24px 22px 28px; }
  .dialog-close { margin-bottom: 8px; }
  .form-actions { flex-direction: column; align-items: stretch; }
  .form-alt { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .contact-dialog[open] { animation: none; }
}

/* Simple pages: form confirmation (no-JavaScript fallback) and 404. */
.plain {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 20px;
  min-height: 100svh;
  padding: 48px var(--gutter);
  background: linear-gradient(115deg, var(--bg), var(--bg-deep));
}
.plain .identity { position: absolute; top: max(28px, env(safe-area-inset-top)); }
.plain .dialog-intro { margin: 0 0 20px; }
