/* Photon Studio — black & white, light/dark/system, one long scroll with depth */

:root {
  --bg: #ffffff;
  --fg: #0a0a0a;
  --muted: #5c5c5c;
  --line: rgba(0, 0, 0, 0.12);
  --card: #ffffff;
  --shadow: 0 1px 1px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.08), 0 32px 64px rgba(0,0,0,.08);
  --ghost: rgba(0, 0, 0, 0.05);
  --scroll: 0;          /* set by site.js, in px */
  --max: 1080px;
  --pad: clamp(20px, 5vw, 56px);
  color-scheme: light;
}

/* Dark values: used when the user picks dark, or picks system and the OS is dark */
:root[data-theme="dark"] {
  --bg: #0a0a0a;
  --fg: #f4f4f4;
  --muted: #a3a3a3;
  --line: rgba(255, 255, 255, 0.14);
  --card: #121212;
  --shadow: 0 1px 1px rgba(0,0,0,.5), 0 8px 24px rgba(0,0,0,.5), 0 32px 64px rgba(0,0,0,.6);
  --ghost: rgba(255, 255, 255, 0.06);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0a;
    --fg: #f4f4f4;
    --muted: #a3a3a3;
    --line: rgba(255, 255, 255, 0.14);
    --card: #121212;
    --shadow: 0 1px 1px rgba(0,0,0,.5), 0 8px 24px rgba(0,0,0,.5), 0 32px 64px rgba(0,0,0,.6);
    --ghost: rgba(255, 255, 255, 0.06);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .4s ease, color .4s ease;
}
a { color: inherit; }
::selection { background: var(--fg); color: var(--bg); }

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--fg); color: var(--bg); padding: 8px 12px; z-index: 100;
}
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }

/* ---------- Header ---------- */
.bar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 14px var(--pad);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -.01em; }
.logo { width: 28px; height: 28px; display: block; }
.brand--small .logo { width: 22px; height: 22px; }

/* Two-file logo option: show the matching one for the active theme */
.logo--on-dark { display: none; }
:root[data-theme="dark"] .logo--on-light { display: none; }
:root[data-theme="dark"] .logo--on-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo--on-light { display: none; }
  :root:not([data-theme="light"]) .logo--on-dark { display: block; }
}

.nav { display: flex; gap: 22px; margin-left: auto; font-size: 15px; }
.nav a { text-decoration: none; color: var(--muted); transition: color .2s; }
.nav a:hover { color: var(--fg); }

.theme {
  display: inline-flex; padding: 3px; gap: 2px;
  border: 1px solid var(--line); border-radius: 999px;
}
.theme button {
  width: 30px; height: 30px; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted); cursor: pointer;
  display: grid; place-items: center; transition: background .2s, color .2s;
}
.theme button:hover { color: var(--fg); }
.theme button[aria-checked="true"] { background: var(--fg); color: var(--bg); }
.theme svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

@media (max-width: 640px) {
  .nav { display: none; }
  .theme { margin-left: auto; }
}

/* ---------- Hero with parallax depth field ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid; place-items: center;
  overflow: hidden;
  perspective: 900px;
}
.hero__field {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  pointer-events: none;
}
.ring, .dot {
  position: absolute;
  /* deeper layers (smaller --d) move slower and sit further back */
  transform:
    translate3d(var(--x, 0), calc(var(--y, 0px) + var(--scroll) * var(--d) * -0.35px), calc((var(--d) - 1) * 220px));
  will-change: transform;
}
.ring {
  width: var(--s); height: var(--s);
  border: 1px solid var(--line);
  border-radius: 50%;
}
.ring:nth-child(1) { box-shadow: 0 0 120px var(--ghost) inset; }
.dot {
  width: calc(10px * var(--d)); height: calc(10px * var(--d));
  border-radius: 50%;
  background: var(--fg);
  opacity: calc(.25 + var(--d) * .3);
  animation: drift 9s ease-in-out infinite alternate;
}
.dot:nth-child(5) { animation-duration: 12s; }
.dot:nth-child(6) { animation-duration: 7s; }
.dot:nth-child(7) { animation-duration: 14s; }
@keyframes drift {
  to { margin-top: 18px; margin-left: -12px; }
}

.hero__copy {
  position: relative; z-index: 1;
  text-align: center;
  padding: 0 var(--pad);
  transform: translateY(calc(var(--scroll) * 0.18px));
  opacity: calc(1 - var(--scroll) / 700);
}
.eyebrow {
  font-size: 13px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 18px;
}
h1 {
  margin: 0;
  font-size: clamp(64px, 15vw, 196px);
  line-height: .86;
  letter-spacing: -.055em;
  font-weight: 700;
  text-shadow: 0 1px 0 var(--bg), 0 24px 48px var(--ghost);
}
.lede { max-width: 30ch; margin: 28px auto 0; font-size: clamp(18px, 2.2vw, 22px); color: var(--muted); }
.cue {
  display: inline-flex; flex-direction: column; align-items: center; gap: 4px;
  margin-top: 56px; font-size: 12px; letter-spacing: .2em; text-transform: uppercase;
  text-decoration: none; color: var(--muted);
}
.cue span { animation: bob 1.8s ease-in-out infinite; font-size: 18px; }
@keyframes bob { 50% { transform: translateY(6px); } }

/* ---------- Panels ---------- */
.panel {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(96px, 16vh, 180px) var(--pad);
  border-top: 1px solid var(--line);
}
.panel__num {
  position: absolute; right: var(--pad); top: clamp(40px, 8vh, 80px);
  font-size: clamp(96px, 18vw, 220px); font-weight: 700; letter-spacing: -.06em; line-height: 1;
  color: var(--ghost);
  pointer-events: none; user-select: none;
}
h2 {
  font-size: 13px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--muted); font-weight: 500; margin: 0 0 28px;
}
.big {
  font-size: clamp(26px, 3.6vw, 44px);
  line-height: 1.18; letter-spacing: -.02em;
  max-width: 22ch; margin: 0 0 28px;
}
.panel p:not(.big) { max-width: 58ch; color: var(--muted); }
.mail { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 100% 2px no-repeat; transition: background-size .3s; }
.mail:hover { background-size: 0 2px; background-position: 100% 100%; }

/* Scroll-reveal: rises out of the page toward the viewer */
.reveal {
  opacity: 0;
  transform: perspective(900px) translate3d(0, 40px, -60px) rotateX(6deg);
  transition: opacity .9s ease, transform .9s cubic-bezier(.2, .7, .2, 1);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- Cards with tilt ---------- */
.cards {
  display: grid; gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 16px;
  perspective: 1000px;
}
.card {
  position: relative;
  padding: 32px 28px 36px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  transform-style: preserve-3d;
  --rx: 0deg; --ry: 0deg;
}
.card.is-in { transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .25s ease, opacity .9s ease; }
.card:nth-child(2) { transition-delay: .08s; }
.card:nth-child(3) { transition-delay: .16s; }
.card h3 { font-size: 28px; letter-spacing: -.02em; margin: 6px 0 12px; }
.card p { margin: 0; }
.card__tag { font-size: 12px !important; letter-spacing: .18em; text-transform: uppercase; }
.card__link { display: inline-block; margin-top: 18px; font-weight: 600; text-decoration: none; }

/* ---------- Statement band: two layers at different depths ---------- */
.statement {
  position: relative;
  min-height: 70vh;
  display: grid; place-items: center;
  overflow: hidden;
  border-top: 1px solid var(--line);
  background: var(--fg); color: var(--bg);
}
.statement__layer { margin: 0; text-align: center; grid-area: 1 / 1; }
.statement__layer--back {
  font-size: clamp(120px, 30vw, 420px); font-weight: 700; letter-spacing: -.07em; line-height: 1;
  opacity: .08;
  transform: translateX(calc((var(--scroll) - var(--stmt-top, 2000)) * -0.15px));
}
.statement__layer--front {
  font-size: clamp(34px, 6vw, 76px); font-weight: 700; letter-spacing: -.035em; line-height: 1.05;
  padding: 0 var(--pad);
  transform: translateX(calc((var(--scroll) - var(--stmt-top, 2000)) * 0.05px));
}

/* ---------- Footer ---------- */
.foot {
  display: flex; align-items: center; gap: 20px;
  padding: 32px var(--pad);
  border-top: 1px solid var(--line);
  font-size: 14px; color: var(--muted);
}
.foot p { margin: 0; }
.foot a:last-child { margin-left: auto; }

/* ---------- Privacy page ---------- */
.doc { max-width: 720px; margin: 0 auto; padding: 96px var(--pad) 120px; }
.doc h1 { font-size: clamp(44px, 8vw, 84px); margin-bottom: 12px; }
.doc h2 { margin-top: 48px; }
.doc p, .doc li { color: var(--muted); }
.doc .updated { font-size: 14px; }

/* ---------- Reduced motion: no parallax, tilt or drifting ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ring, .dot, .hero__copy, .statement__layer { transform: none !important; animation: none !important; opacity: 1; }
  .dot { opacity: .5; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .cue span { animation: none; }
}
