/* ───────── Tokens ───────── */
:root {
  --paper: #F7FAFF;
  --paper-2: #E9F1FC;
  --ink: #10131C;
  --ink-2: #4E5566;
  --ink-3: #848B9C;
  --line: rgba(16, 19, 28, .09);

  --sky: #8FCFFF;
  --sky-2: #BFE3FF;
  --sky-3: #E2F2FF;
  --violet: #7B5CFA;
  --violet-2: #A48EFF;
  --violet-3: #E6E0FF;

  --serif: "Instrument Serif", ui-serif, Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
  --radius: 28px;
  --gutter: clamp(20px, 4vw, 56px);
  --max: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img, canvas, svg { display: block; }
::selection { background: var(--violet); color: #fff; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ───────── Buttons ───────── */
.btn {
  display: inline-flex; align-items: center; height: 44px; padding: 0 20px;
  border-radius: 999px; font-weight: 500; font-size: 15px; letter-spacing: -.01em;
  transition: transform .16s var(--ease-out), background-color .2s;
}
.btn-dark { background: var(--ink); color: #fff; }
.btn-accent { background: var(--violet); color: #fff; box-shadow: 0 6px 18px -8px rgba(123, 92, 250, .7); }
@media (hover: hover) { .btn-accent:hover { background: #6A4BEB; } }
.btn-round {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: #fff;
  transition: transform .16s var(--ease-out);
}
.btn:active, .btn-round:active { transform: scale(.96); }
@media (hover: hover) {
  .btn-dark:hover { background: #262B38; }
  .btn-round:hover svg { transform: translate(1px, -1px); }
}
.btn-round svg { transition: transform .2s var(--ease-out); }
.btn-pair { display: flex; gap: 6px; margin-top: 22px; }

/* ───────── Nav ───────── */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px var(--gutter);
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
.nav-pill {
  display: flex; align-items: center; gap: 2px;
  height: 52px; padding: 0 8px 0 10px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-radius: 999px;
  box-shadow: 0 0 0 1px var(--line), 0 6px 24px -10px rgba(16, 19, 28, .18);
}
.nav-pill a { padding: 8px 12px; border-radius: 999px; font-size: 15px; font-weight: 500; transition: background-color .2s; }
.nav-pill .logo { padding: 6px 10px 6px 4px; }
.nav-pill .logo svg { fill: var(--ink); transition: transform .3s var(--ease-out); }
@media (hover: hover) {
  .nav-pill a:not(.logo):hover { background: rgba(16, 19, 28, .06); }
  .nav-pill .logo:hover svg { transform: rotate(-8deg) scale(1.06); }
}
.nav-cta { display: flex; gap: 6px; }

/* ───────── Hero ───────── */
.hero {
  position: relative; min-height: 100svh; display: grid; place-items: center;
  overflow: hidden; isolation: isolate;
}
.clouds { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; image-rendering: pixelated; }
.hero-inner { text-align: center; padding: 120px var(--gutter) 80px; max-width: 980px; }
.hero-title {
  margin: 0; font: italic 400 clamp(60px, 10vw, 136px)/.92 var(--serif);
  letter-spacing: -.035em;
}
.hero-title .word {
  display: inline-block;
  opacity: 0; transform: translateY(.18em); filter: blur(8px);
  animation: wordIn .9s var(--ease-out) forwards;
}
.hero-title .word:nth-child(1) { animation-delay: .05s; }
.hero-title .word:nth-child(2) { animation-delay: .11s; }
.hero-title .word:nth-of-type(3) { animation-delay: .17s; }
.hero-title .word:nth-of-type(4) { animation-delay: .23s; }
.hero-title .word:nth-of-type(5) { animation-delay: .29s; }
.hero-title .word:nth-of-type(6) { animation-delay: .35s; }
.hero-title .shake {
  color: var(--violet); cursor: default;
  animation: wordIn .9s .23s var(--ease-out) forwards, shake .7s 1.5s cubic-bezier(.36, .07, .19, .97) both;
}
@media (hover: hover) { .hero-title .shake:hover { animation: shake .6s cubic-bezier(.36, .07, .19, .97) both; } }
@keyframes shake {
  0%, 100% { transform: none; opacity: 1; filter: none; }
  15% { transform: translateX(-.04em) rotate(-3deg); opacity: 1; filter: none; }
  30% { transform: translateX(.05em) rotate(3deg); opacity: 1; filter: none; }
  45% { transform: translateX(-.04em) rotate(-2deg); opacity: 1; filter: none; }
  60% { transform: translateX(.03em) rotate(1.5deg); opacity: 1; filter: none; }
  75% { transform: translateX(-.015em) rotate(-.5deg); opacity: 1; filter: none; }
}
@keyframes wordIn { to { opacity: 1; transform: none; filter: blur(0); } }
.hero-sub {
  max-width: 34ch; margin: 36px auto 0; font-size: clamp(17px, 1.6vw, 20px); line-height: 1.5;
  color: var(--ink); text-wrap: balance;
}

/* ───────── Sections ───────── */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(80px, 12vw, 160px) var(--gutter) 0; }
.section-head {
  display: grid; grid-template-columns: 1fr minmax(0, 360px); gap: 32px; align-items: end;
  margin-bottom: 48px;
}
.section-head h2 { margin: 0; font: 500 clamp(44px, 6vw, 80px)/1 var(--sans); letter-spacing: -.045em; }
.section-head p { margin: 0; color: var(--ink-2); }

/* ───────── Work cases ───────── */
.work { display: grid; gap: clamp(72px, 9vw, 120px); padding-top: 40px; }
.case-frame {
  position: relative; display: block; overflow: hidden; isolation: isolate;
  aspect-ratio: 16 / 9.2; border-radius: var(--radius);
  padding: clamp(28px, 5vw, 64px) clamp(28px, 5vw, 64px) 0;
}
.frame-sky { background: var(--sky); }
.frame-violet { background: var(--violet); }
.frame-pixels { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; image-rendering: pixelated; }
.frame-arrow {
  position: absolute; right: 18px; top: 18px; width: 40px; height: 40px; border-radius: 50%; z-index: 3;
  background: var(--ink); color: #fff; display: grid; place-items: center;
  transition: transform .3s var(--ease-out);
}
.shot-desktop {
  margin: 0; position: relative; width: 86%; border-radius: 14px 14px 0 0; overflow: hidden; background: #fff;
  box-shadow: 0 30px 60px -20px rgba(10, 20, 60, .4), 0 0 0 1px rgba(0, 0, 0, .06);
  transition: transform .6s var(--ease-out);
}
.browser-bar { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; background: #F4F6FA; border-bottom: 1px solid #E6EAF1; }
.browser-bar span { width: 10px; height: 10px; border-radius: 50%; background: #D9DEE8; }
.browser-bar p { margin: 0 auto; padding: 3px 14px; border-radius: 6px; background: #fff; font: 500 11.5px var(--mono); color: var(--ink-3); transform: translateX(-20px); }
.shot-desktop img { width: 100%; height: auto; }
.shot-phone {
  margin: 0; position: absolute; right: clamp(20px, 4vw, 52px); bottom: -8%; width: 21%; z-index: 2;
  border-radius: 26px; overflow: hidden; border: 6px solid #10131C; background: #10131C;
  box-shadow: 0 30px 50px -16px rgba(10, 20, 60, .55);
  transition: transform .7s var(--ease-out);
}
.shot-phone img { width: 100%; height: auto; border-radius: 20px; }
@media (hover: hover) {
  .case-frame:hover .shot-desktop { transform: translateY(-8px); }
  .case-frame:hover .shot-phone { transform: translateY(-18px) rotate(-2deg); }
  .case-frame:hover .frame-arrow { transform: rotate(45deg); }
}

.case-meta { padding: 22px 4px 0; }
.tags { list-style: none; margin: 0 0 14px; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.tags li { font-size: 12.5px; padding: 3px 9px; border-radius: 7px; background: var(--paper-2); color: var(--ink-2); }
.case-meta h3 { margin: 0; max-width: 24ch; font: 500 clamp(26px, 3.2vw, 40px)/1.12 var(--sans); letter-spacing: -.035em; text-wrap: balance; }
.case-meta p { margin: 10px 0 0; color: var(--ink-3); }

/* ───────── Play ───────── */
.play-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.tile {
  position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden;
  display: grid; place-items: center; padding: 22px;
}
.tile-mist { background: linear-gradient(160deg, #E2F2FF, #BFE3FF); }
.tile-ink { background: #10131C; }
.tile-lilac { background: linear-gradient(160deg, #C9B9FF, #8E73F5); }
.tile-sky { background: linear-gradient(170deg, #BFE3FF, #7DBEF5); }
.tile-night { background: linear-gradient(170deg, #2A2466, #141235); }
.card-inner {
  width: 100%; height: 100%; border-radius: 18px; background: rgba(252, 253, 255, .95);
  display: grid; place-items: center; position: relative;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 20px 40px -24px rgba(0, 0, 0, .35);
}
.tile-night .card-inner { background: rgba(255, 255, 255, .04); box-shadow: 0 0 0 1px rgba(255, 255, 255, .06) inset; }
.tile-label {
  position: absolute; left: 18px; bottom: 14px; font: 500 12px var(--mono); letter-spacing: .01em; color: var(--ink-3);
}
.tile-label.light { color: rgba(255, 255, 255, .5); }
.tile-ink .tile-label { left: 40px; bottom: 36px; }

/* switch */
.switch {
  width: 84px; height: 48px; border-radius: 999px; border: 0; padding: 4px; cursor: pointer;
  background: #D7DFEC; transition: background-color .3s var(--ease-out);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .12);
}
.switch i {
  display: block; width: 40px; height: 40px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18), 0 0 0 .5px rgba(0, 0, 0, .06);
  transition: transform .45s cubic-bezier(.34, 1.4, .64, 1), width .2s var(--ease-out);
}
.switch:active i { width: 48px; }
.switch[aria-checked="true"] { background: var(--violet); }
.switch[aria-checked="true"] i { transform: translateX(36px); }
.switch[aria-checked="true"]:active i { transform: translateX(28px); }

/* dot grid */
.dotgrid { position: absolute; inset: 18px; display: grid; grid-template-columns: repeat(var(--cols, 18), 1fr); align-content: center; gap: 0; }
.dotgrid i { aspect-ratio: 1; display: grid; place-items: center; }
.dotgrid i::after {
  content: ""; width: 4px; height: 4px; border-radius: 50%; background: rgba(255, 255, 255, .22);
  transform: scale(var(--s, 1)); transition: transform .25s var(--ease-out), background-color .25s;
}
.dotgrid i.hot::after { background: var(--violet); }

/* keys */
.keys { display: flex; gap: 10px; }
.keys button {
  width: 72px; height: 72px; border: 0; border-radius: 16px; cursor: pointer;
  font: 500 26px var(--sans); color: var(--ink);
  background: linear-gradient(#fff, #EEF2F8);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .07), 0 5px 0 #CBD3E1, 0 7px 14px rgba(0, 0, 0, .14);
  transition: transform .08s var(--ease-out), box-shadow .08s var(--ease-out);
}
.keys button:active, .keys button.down {
  transform: translateY(4px);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .07), 0 1px 0 #CBD3E1, 0 2px 4px rgba(0, 0, 0, .12);
}

/* flip clock */
.flip { display: flex; align-items: center; gap: 6px; font: 500 52px/1 var(--mono); font-variant-numeric: tabular-nums; }
.flip span {
  width: 58px; height: 80px; border-radius: 12px; background: var(--ink); color: #fff;
  display: grid; place-items: center; overflow: hidden; position: relative;
}
.flip span.tick { animation: tick .45s var(--ease-out); }
@keyframes tick { 0% { transform: translateY(0); } 30% { transform: translateY(3px) scaleY(.96); } 100% { transform: none; } }
.flip b { color: var(--ink); font-weight: 400; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: .2; } }

/* copy button */
.copy-btn {
  position: relative; height: 48px; padding: 0 24px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--ink); color: #fff; font-weight: 500; overflow: hidden; min-width: 150px;
  transition: transform .16s var(--ease-out), background-color .3s;
}
.copy-btn:active { transform: scale(.96); }
.copy-btn span { display: block; transition: transform .35s var(--ease-out), opacity .25s, filter .25s; }
.copy-btn .t2 { position: absolute; inset: 0; display: grid; place-items: center; transform: translateY(100%); opacity: 0; filter: blur(4px); }
.copy-btn.done { background: var(--violet); }
.copy-btn.done .t1 { transform: translateY(-100%); opacity: 0; filter: blur(4px); }
.copy-btn.done .t2 { transform: none; opacity: 1; filter: none; }

/* orb */
.orb {
  width: 46%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #F1ECFF, #8FCFFF 32%, #7B5CFA 64%, #2B1A80 100%);
  box-shadow: 0 0 80px 10px rgba(123, 92, 250, .35);
  animation: breathe 5s var(--ease-in-out) infinite;
}
@keyframes breathe {
  0%, 100% { transform: scale(.94); box-shadow: 0 0 60px 4px rgba(123, 92, 250, .25); }
  50% { transform: scale(1.04); box-shadow: 0 0 110px 22px rgba(143, 207, 255, .5); }
}

/* ───────── About / globe ───────── */
.about {
  position: relative; margin-top: clamp(100px, 14vw, 180px);
  background: var(--sky); color: var(--ink); overflow: hidden;
  padding: clamp(40px, 6vw, 80px) var(--gutter) clamp(120px, 14vw, 180px);
}
.globe { width: min(620px, 92vw); aspect-ratio: 1; margin: 0 auto; image-rendering: pixelated; }
.about-row {
  max-width: var(--max); margin: 40px auto 0;
  display: grid; grid-template-columns: 1fr minmax(0, 420px); gap: 32px; align-items: start;
}
.about-row h2 { margin: 0; font: 500 clamp(44px, 6vw, 80px)/1 var(--sans); letter-spacing: -.045em; }
.about-row p { margin: 6px 0 0; font-size: 18px; line-height: 1.5; }
.about-edge { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 96px; image-rendering: pixelated; }

/* ───────── Writing (stamps) ───────── */
.stamps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stamp {
  position: relative; display: block; padding: 16px 16px 20px; background: #fff;
  /* perforated edge: solid centre + a single ring of holes on the border line */
  -webkit-mask:
    linear-gradient(#000 0 0) center / calc(100% - 12px) calc(100% - 12px) no-repeat,
    radial-gradient(circle at 6px 6px, transparent 3.6px, #000 4.2px) -6px -6px / 12px 12px;
          mask:
    linear-gradient(#000 0 0) center / calc(100% - 12px) calc(100% - 12px) no-repeat,
    radial-gradient(circle at 6px 6px, transparent 3.6px, #000 4.2px) -6px -6px / 12px 12px;
  transition: transform .5s var(--ease-out);
}
.stamp:nth-child(odd) { transform: rotate(-1.2deg); }
.stamp:nth-child(even) { transform: rotate(1deg) translateY(10px); }
@media (hover: hover) { .stamp:hover { transform: rotate(0) translateY(-6px); } }
.stamp canvas { width: 100%; aspect-ratio: 1; image-rendering: pixelated; background: var(--wash); }
.stamp-meta { display: flex; justify-content: space-between; margin-top: 12px; font: 500 11px var(--mono); color: var(--ink); }
.stamp-meta span { color: var(--ink); }
.stamp h3 { margin: 6px 0 0; font: italic 400 26px/1.02 var(--serif); letter-spacing: -.01em; color: var(--ink); text-wrap: balance; }

/* ───────── FAQ ───────── */
.qa { max-width: 860px; border-top: 1px solid var(--line); }
.qa details { border-bottom: 1px solid var(--line); }
.qa summary {
  list-style: none; cursor: pointer; padding: 26px 4px; display: flex; justify-content: space-between; align-items: center; gap: 24px;
  font: 500 clamp(20px, 2.2vw, 26px)/1.25 var(--sans); letter-spacing: -.025em;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary i { position: relative; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--paper-2); transition: background-color .2s, transform .3s var(--ease-out); }
.qa summary i::before, .qa summary i::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 1.6px; background: var(--ink); border-radius: 2px;
  transform: translate(-50%, -50%); transition: transform .3s var(--ease-out);
}
.qa summary i::after { transform: translate(-50%, -50%) rotate(90deg); }
.qa details[open] summary i { background: var(--ink); }
.qa details[open] summary i::before, .qa details[open] summary i::after { background: #fff; }
.qa details[open] summary i::after { transform: translate(-50%, -50%) rotate(0); }
@media (hover: hover) { .qa summary:hover i { transform: scale(1.08); } }
.ans { padding: 0 4px 28px; color: var(--ink-2); max-width: 62ch; }
.ans p { margin: 0; font-size: 18px; }
.ans a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--violet); }
.qa details[open] .ans { animation: ansIn .4s var(--ease-out); }
@keyframes ansIn { from { opacity: 0; transform: translateY(-6px); } }

/* ───────── Footer ───────── */
.footer { max-width: var(--max); margin: clamp(100px, 14vw, 180px) auto 0; padding: 0 var(--gutter) 40px; }
.foot-top { display: flex; justify-content: space-between; align-items: end; gap: 32px; flex-wrap: wrap; padding-bottom: 40px; border-bottom: 1px solid var(--line); }
.foot-name { margin: 0; font: italic 400 clamp(56px, 9vw, 128px)/.9 var(--serif); letter-spacing: -.035em; }
.foot-right { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.socials { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; }
.socials a {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--paper-2); color: var(--ink);
  transition: background-color .2s, color .2s, transform .16s var(--ease-out);
}
.socials svg { fill: currentColor; }
.socials a:active { transform: scale(.94); }
@media (hover: hover) { .socials a:hover { background: var(--violet); color: #fff; } }
.foot-email { color: var(--ink-2); transition: color .2s; }
@media (hover: hover) { .foot-email:hover { color: var(--violet); } }
.clocks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 28px 0; }
.clock { display: grid; gap: 2px; }
.clock span { font-size: 13px; color: var(--ink-3); }
.clock b { font: 500 34px/1.1 var(--mono); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.clock small { font: 500 11px var(--mono); color: var(--ink-3); }
.foot-small { margin: 0; color: var(--ink-3); font-size: 13px; }

/* ───────── Reveal ───────── */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
.stamp.reveal.in:nth-child(odd) { transform: rotate(-1.2deg); }
.stamp.reveal.in:nth-child(even) { transform: rotate(1deg) translateY(10px); }
@media (hover: hover) { .stamp.reveal.in:hover { transform: rotate(0) translateY(-6px); } }
.play-grid .reveal:nth-child(2n) { transition-delay: .08s; }

/* ───────── Responsive ───────── */
@media (max-width: 900px) {
  .section-head, .about-row { grid-template-columns: 1fr; }
  .stamps { grid-template-columns: repeat(2, 1fr); }
  .case-frame { aspect-ratio: 4 / 3.4; }
  .shot-desktop { width: 100%; }
  .shot-phone { width: 30%; }
}
@media (max-width: 640px) {
  .nav { padding: 12px 14px; }
  .nav-pill { height: 48px; }
  .nav-pill a:not(.logo) { padding: 8px 7px; font-size: 14px; }
  .nav-cta .btn { display: none; }
  .play-grid { grid-template-columns: 1fr; }
  .clocks { grid-template-columns: 1fr; }
  .case-frame { aspect-ratio: 4 / 3.6; padding: 22px 18px 0; }
  .shot-phone { width: 34%; right: 14px; border-width: 4px; border-radius: 18px; }
  .shot-phone img { border-radius: 14px; }
  .frame-arrow { display: none; }
  .hero-title { font-size: clamp(56px, 16vw, 84px); }
}

/* ───────── Reduced motion ───────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .hero-title .word { opacity: 1; transform: none; filter: none; }
  .reveal { opacity: 1; transform: none; }
}
