/* Ultimate Kami — "Built like a god". Pure black throughout, so the
   black-background Rotato renders disappear into the page; the god, his
   blue and his glow only appear where no video sits. */
:root {
  --black: #000;
  --text: #f2f6fa;
  --muted: #8b97a4;
  --blue: #43bcfd;
  --line: rgba(255, 255, 255, 0.12);

  --f-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --f-body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --gutter: clamp(20px, 5vw, 72px);
  /* Headline size shared by the pinned "Gods" and every rule beside it. */
  --rule-size: clamp(3rem, 7vw, 7.4rem);
  /* A press that locks out: up, a hair past, and settle. */
  --lockout: cubic-bezier(.2, 1.22, .36, 1);
  --ease: cubic-bezier(.22, .9, .3, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--black); color: var(--text);
  font-family: var(--f-body); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }

h1, h2 { margin: 0; font-family: var(--f-display); font-weight: 900; font-variation-settings: "opsz" 144; letter-spacing: -0.035em; line-height: .95; text-wrap: balance; }
.art { display: block; width: 100%; height: auto; color: var(--blue); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(16px + env(safe-area-inset-top, 0px)) var(--gutter) 16px;
  background: linear-gradient(#000 30%, transparent);
}
.nav-mark { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 800; font-size: 1.05rem; letter-spacing: -0.01em; }
.nav-mark img { border-radius: 8px; }
.nav-store { font-size: .85rem; font-weight: 600; color: #000; background: var(--blue); padding: 8px 16px; border-radius: 99px; transition: background .2s; }
.nav-store:hover { background: #8ad8ff; }

/* ---------- App Store badge ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 24px 12px 18px; border-radius: 14px;
  background: var(--blue); color: #000;
  transition: transform .45s var(--lockout), background .2s;
}
.badge:hover { transform: translateY(-4px); background: #8ad8ff; }
.badge svg { width: 26px; height: 26px; fill: currentColor; flex: none; }
.badge span { display: flex; flex-direction: column; line-height: 1.08; font-size: 1.2rem; font-weight: 600; }
.badge small { font-size: .68rem; font-weight: 500; }

/* ---------- Hero ---------- */
.hero {
  max-width: 1500px; margin: 0 auto; min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 3vw;
  padding: calc(100px + env(safe-area-inset-top, 0px)) var(--gutter) 60px;
}
.hero h1 { font-size: clamp(3.6rem, 9.4vw, 10rem); line-height: .86; letter-spacing: -0.045em; }
.lede { color: var(--muted); font-size: clamp(1.05rem, 1.35vw, 1.22rem); max-width: 28em; margin: 30px 0 36px; }
.hero-god { position: relative; }
/* His own light. It stays inside the hero, well clear of any video. */
.hero-god::before {
  content: ""; position: absolute; inset: 6% 6% 10%; border-radius: 50%; z-index: -1;
  background: radial-gradient(closest-side, rgba(67, 188, 253, .28), rgba(67, 188, 253, .08) 60%, transparent);
}
.hero-god .art { filter: drop-shadow(0 0 28px rgba(67, 188, 253, .35)); }
.js .hero-god { animation: press 1.8s var(--lockout) .15s both; }
.js .hero-god::before { animation: ignite 2.4s var(--ease) .5s both; }
.js .hero-copy > * { animation: arrive 1s var(--ease) both; }
.js .hero-copy .lede { animation-delay: .15s; }
.js .hero-copy .badge { animation-delay: .3s; }
@keyframes press { from { transform: translateY(110px); opacity: 0; } 30% { opacity: 1; } }
@keyframes ignite { from { opacity: 0; transform: scale(.7); } 60% { opacity: 1; } }
@keyframes arrive { from { opacity: 0; transform: translateY(24px); } }

/* ---------- Rotato clips ----------
   A plain rectangle on black. The still and the video are both feathered
   at the edges so the frame never shows against the page. */
.clip { margin: 0; }
.rotato { position: relative; aspect-ratio: 16 / 9; width: 100%; background: #000; }
.rotato > img, .rotato > video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent), linear-gradient(to bottom, transparent, #000 7%, #000 93%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent), linear-gradient(to bottom, transparent, #000 7%, #000 93%, transparent);
  mask-composite: intersect;
}
.clip figcaption { margin-top: 6px; font-size: .86rem; color: var(--muted); text-align: center; }
.clip figcaption .rt { color: var(--blue); }
.clip figcaption .rt::before { content: " · "; color: var(--muted); }
.clip-wide { max-width: 1500px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- The rules ---------- */
.rules {
  max-width: 1500px; margin: 0 auto;
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: .32em;
  padding: 8vh var(--gutter) 0; font-size: var(--rule-size);
}
.rules-subject { position: relative; }
.rules-subject span {
  position: sticky; top: 24vh; display: block;
  font-family: var(--f-display); font-weight: 900; font-variation-settings: "opsz" 144;
  letter-spacing: -0.035em; line-height: .95; color: var(--blue);
}
.rules-subject span.flash { animation: flash 1.3s var(--ease); }
@keyframes flash {
  25% { text-shadow: 0 0 .35em rgba(67, 188, 253, .9), 0 0 1.2em rgba(67, 188, 253, .5); color: #9fe0ff; }
}
.rules-list { font-size: 17px; }
.rule { padding: 16vh 0 6vh; }
.rule:first-child { padding-top: 22vh; }
.rule h2 { font-size: var(--rule-size); }
/* The pinned "Gods" stands in for each rule's subject on wide screens. */
.rule h2 .subject { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rule > p { color: var(--muted); font-size: clamp(1.05rem, 1.35vw, 1.22rem); max-width: 30em; margin: 30px 0 34px; }

.facts { margin: 0; max-width: 38em; border-top: 2px solid var(--blue); }
.facts div { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; color: var(--muted); }
.facts-main dt, .facts-main dd { font-family: var(--f-display); font-weight: 800; font-size: 1.35rem; color: var(--text); }

/* ---------- Close ---------- */
.close { position: relative; overflow: hidden; text-align: center; padding-top: clamp(140px, 22vh, 240px); min-height: 100vh; min-height: 100svh; --art: min(900px, 120vw); }
.close-copy { position: relative; z-index: 2; padding: 0 var(--gutter); }
.close h2 { font-size: clamp(3.4rem, 9vw, 9rem); line-height: .9; margin-bottom: 38px; }
/* Hung so the bar (23.4% down the art) sits just under the button. */
.close-art {
  width: var(--art); margin: calc(26px - var(--art) * .234) auto 0;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.12) 0%, rgba(0,0,0,.12) 21%, #000 27%, #000 58%, transparent 82%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.12) 0%, rgba(0,0,0,.12) 21%, #000 27%, #000 58%, transparent 82%);
  transition: transform 1.6s var(--lockout);
}
.js .close:not(.pressed) .close-art { transform: translateY(90px); }

.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding: 24px var(--gutter) calc(28px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem;
}
.footer p { margin: 0; }

/* ---------- Reveal: things lift into place ---------- */
.js .reveal { opacity: 0; transform: translateY(56px); transition: opacity .8s var(--ease), transform 1.2s var(--lockout); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .hero-god, .js .hero-god::before, .js .hero-copy > *, .rules-subject span.flash { animation: none; }
  .js .reveal, .js .close:not(.pressed) .close-art { opacity: 1; transform: none; transition: none; }
}

/* ---------- Narrow screens ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 24px; padding-bottom: 40px; }
  .hero-god { width: min(520px, 100%); justify-self: center; }
  :root { --rule-size: clamp(2.5rem, 10.5vw, 4.4rem); }
  .rules { grid-template-columns: minmax(0, 1fr); padding-top: 0; }
  .rules-subject { display: none; }
  .rule, .rule:first-child { padding: 12vh 0 4vh; }
  .rule h2 .subject { position: static; width: auto; height: auto; overflow: visible; clip: auto; color: var(--blue); }
  /* The renders are wide with the phone in the middle; on a phone, crop to
     the middle square so the phone itself is bigger. */
  .rule .rotato, .clip-wide .rotato { aspect-ratio: 1 / 1; }
  .clip-wide { padding: 0; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .facts div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
