/* Sofaverse Studios. Colors come from the Cornelius app (App/Views/Theme.swift).
   System fonts only, so the site makes no requests to other servers.
   Everything under .motion needs motion.js; without it the page is static and complete. */
:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --panel: #14171c;
  --border: #262b33;
  --text: #e6e8eb;
  --text2: #9aa1ab;
  --accent: #fab283;
  --blue: #5c9cf5;
  --green: #7fd88f;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 var(--sans);
}

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 2px; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 12px; background: var(--panel); padding: 6px 12px; z-index: 40; }

/* Scroll progress, along the very top */
.bar { display: none; }
.motion .bar {
  display: block;
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--blue));
  transform: scaleX(0);
  transform-origin: left;
}

/* Header and footer */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px max(24px, calc((100% - 1032px) / 2));
  background: rgba(11, 13, 16, 0.74);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  font-family: var(--mono);
  font-size: 15px;
}

.mark { color: var(--text); font-weight: 600; text-decoration: none; }
.mark span { color: var(--accent); font-weight: 400; }

.top nav { display: flex; gap: 22px; }
.top nav a { color: var(--text2); text-decoration: none; }
.top nav a:hover, .top nav a[aria-current] { color: var(--accent); }

.bottom, main, .wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

main { flex: 1; padding-top: 24px; padding-bottom: 72px; }
main.full { max-width: none; padding: 0 0 72px; }

.bottom {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 32px;
  padding-top: 28px;
  padding-bottom: 36px;
  color: var(--text2);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
}
.bottom::before { content: ""; grid-column: 1 / -1; height: 1px; margin-bottom: 24px; background: var(--border); }
.bottom p { margin: 0; grid-column: 1; }
.bottom .legal-name { color: var(--text); }
.bottom nav { grid-column: 2; grid-row: 2 / span 2; display: flex; flex-direction: column; align-items: flex-end; }
.bottom a { color: var(--text2); }
.bottom a:hover { color: var(--accent); }

/* Long text */
.prose > * { max-width: 712px; }
.prose h1 { font: 500 clamp(28px, 5vw, 38px)/1.2 var(--mono); margin: 12px 0 8px; letter-spacing: -0.02em; }
.prose h1 + p { color: var(--text2); font-family: var(--mono); font-size: 14px; }
.prose h2 { font: 500 19px/1.35 var(--mono); color: var(--accent); margin: 40px 0 8px; }
.prose li { margin-bottom: 10px; }
.prose ul { padding-left: 22px; }
.prose li::marker { color: var(--text2); }

/* Shared */
.label {
  margin: 0 0 14px;
  color: var(--text2);
  font: 13px/1.4 var(--mono);
}
.label::before { content: "> "; color: var(--accent); }

.block { margin-top: 112px; }
.block h2, .pin h2 { font: 500 clamp(26px, 3.8vw, 38px)/1.2 var(--mono); margin: 0 0 16px; letter-spacing: -0.02em; }
.block > p, .pin p.text { max-width: 62ch; }

.page-title { font: 500 clamp(32px, 5vw, 44px)/1.15 var(--mono); letter-spacing: -0.02em; margin: 0 0 16px; }
.intro { max-width: 62ch; }

.button {
  display: inline-block;
  padding: 11px 20px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  font: 15px/1.4 var(--mono);
  text-decoration: none;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.button:hover { background: var(--accent); color: var(--bg); box-shadow: 0 0 34px rgba(250, 178, 131, 0.45); }

.reveal { transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
.motion .reveal:not(.in) { opacity: 0; transform: translateY(28px); }

/* The hero: a scene of layers that move at different speeds */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  height: calc(100svh - 68px);
  min-height: 600px;
  overflow: hidden;
  overflow: clip;
}
.hero-app { height: calc(88svh - 68px); min-height: 540px; }
.hero-app .stage { --size: min(46vw, 70svh); }

.layer { position: absolute; pointer-events: none; }

.dots {
  inset: -30% 0;
  background-image: radial-gradient(rgba(154, 161, 171, 0.26) 1px, transparent 1.6px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse 62% 56% at 68% 50%, #000, transparent);
  mask-image: radial-gradient(ellipse 62% 56% at 68% 50%, #000, transparent);
}

.ghost {
  left: -1vw;
  bottom: 1%;
  color: transparent;
  -webkit-text-stroke: 1px #2f3640;
  font: 700 19vw/0.9 var(--mono);
  letter-spacing: -0.05em;
  white-space: nowrap;
}

.stage {
  --size: min(52vw, 82svh);
  position: absolute;
  top: 50%;
  right: max(0px, calc((100% - 1500px) / 2));
  width: var(--size);
  height: var(--size);
  margin-top: calc(var(--size) / -2);
  pointer-events: none;
}
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: repeating-linear-gradient(0deg, rgba(11, 13, 16, 0.3) 0 2px, transparent 2px 5px);
  -webkit-mask: url(/assets/gorilla.png) center / contain no-repeat;
  mask: url(/assets/gorilla.png) center / contain no-repeat;
}

.glow {
  position: absolute;
  inset: -4%;
  background: radial-gradient(closest-side, rgba(250, 178, 131, 0.3), rgba(92, 156, 245, 0.08) 60%, transparent);
}
.motion .glow { animation: breathe 6s ease-in-out infinite; }
@keyframes breathe {
  0%, 100% { opacity: 0.72; }
  50% { opacity: 1; }
}

/* One gorilla, three times: the app's blue and orange behind the white */
.ape {
  position: absolute;
  inset: 0;
  background: var(--text);
  -webkit-mask: url(/assets/gorilla.png) center / contain no-repeat;
  mask: url(/assets/gorilla.png) center / contain no-repeat;
}
.ape-blue { inset: 6px 12px -6px -12px; background: var(--blue); }
.ape-orange { inset: -6px -12px 6px 12px; background: var(--accent); }

.chip {
  position: absolute;
  z-index: 3;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(20, 23, 28, 0.86);
  color: var(--text2);
  font: 13px/1.4 var(--mono);
  white-space: nowrap;
}
.chip::before { content: "✓ "; color: var(--green); }
.chip b { color: var(--blue); font-weight: 400; }
.chip-1 { top: 7%; left: 2%; }
.chip-2 { top: 20%; right: 3%; }
.chip-3 { top: 54%; left: 3%; }
.chip-4 { bottom: 24%; right: 1%; }
.chip-5 { bottom: 7%; left: 12%; }

.hero-copy { position: relative; z-index: 4; }
.hero-copy > * { max-width: min(500px, 46vw); }
.hero h1 { font: 500 clamp(44px, 5.4vw, 74px)/1.04 var(--mono); letter-spacing: -0.045em; margin: 0 0 22px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lead { font-size: clamp(18px, 2vw, 21px); line-height: 1.55; color: var(--text2); margin: 0 0 30px; }

.cue {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 18px;
  width: 1px;
  height: 46px;
  overflow: hidden;
  background: var(--border);
}
.cue::after { content: ""; position: absolute; left: 0; top: 0; width: 1px; height: 18px; background: var(--accent); }
.motion .cue::after { animation: drop 2.2s ease-in-out infinite; }
@keyframes drop {
  from { transform: translateY(-20px); }
  to { transform: translateY(48px); }
}

.motion .hero-copy > * { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.motion .hero-copy > :nth-child(2) { animation-delay: 0.1s; }
.motion .hero-copy > :nth-child(3) { animation-delay: 0.2s; }
.motion .hero-copy > :nth-child(4) { animation-delay: 0.3s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: none; }
}

/* Words that slide sideways with the scroll */
.band { overflow: hidden; overflow: clip; padding: 22px 0; border-block: 1px solid var(--border); }
.band-row {
  width: max-content;
  margin-left: -30vw;
  color: var(--text);
  font: 500 clamp(32px, 5.6vw, 70px)/1.3 var(--mono);
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.band-row span { color: var(--accent); }
.band-row.outline { color: transparent; -webkit-text-stroke: 1px var(--text2); }
.band-row.outline span { color: transparent; -webkit-text-stroke: 1px var(--accent); }

/* The tool log, as the app draws it, played out by the scroll */
.pin { padding: 112px 0 0; }
.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px;
  align-items: center;
}
.motion .pin { padding: 0; height: 280vh; }
.motion .pin-stage {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  height: 100svh;
}

.log {
  position: relative;
  margin: 0;
  padding: 20px 22px 24px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 0 90px rgba(250, 178, 131, 0.07);
  font: 15px/1.8 var(--mono);
}
.log div { white-space: pre-wrap; }
.log .you { color: var(--text); }
.log .you::before { content: "> "; color: var(--accent); }
.log .tool { color: var(--text2); padding-left: 16px; }
.log .tool b { color: var(--blue); font-weight: 400; }
.log .tool::before { content: "✓ "; color: var(--green); }
.log .reply { color: var(--text); margin-top: 10px; }
.log .note { color: var(--text2); font-size: 12px; margin-bottom: 8px; }
.log .fill { display: none; }
.motion .log .fill {
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--blue));
  transform: scaleX(0);
  transform-origin: left;
}
.motion .log [data-at] { opacity: 0; transform: translateX(-10px); transition: opacity 0.35s, transform 0.35s; }
.motion .log [data-at].on { opacity: 1; transform: none; }

/* A statement that lights up word by word */
.statement { padding-top: 150px; padding-bottom: 40px; }
.big { margin: 0; font: 500 clamp(30px, 5.2vw, 62px)/1.2 var(--mono); letter-spacing: -0.03em; }
.motion .big .w { opacity: 0.18; transition: opacity 0.3s; }
.motion .big .w.on { opacity: 1; }

/* Company facts */
dl.facts { margin: 0; border-top: 1px solid var(--border); }
dl.facts div { display: grid; grid-template-columns: 170px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
dl.facts dt { color: var(--text2); font: 14px/1.6 var(--mono); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }

/* Cornelius */
.app-head { display: flex; align-items: center; gap: 22px; margin-bottom: 24px; }
.app-head img { width: 96px; height: 96px; border-radius: 22px; border: 1px solid var(--border); flex: none; }
.app-head h1 { font-size: clamp(40px, 6.4vw, 72px); margin: 0; }
.app-head p { margin: 4px 0 0; color: var(--accent); font: 16px/1.4 var(--mono); }

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.features div {
  --mx: 50%;
  --my: 0;
  padding: 22px;
  background: radial-gradient(240px circle at var(--mx) var(--my), rgba(250, 178, 131, 0), transparent), var(--bg);
}
.features div:hover { background: radial-gradient(240px circle at var(--mx) var(--my), rgba(250, 178, 131, 0.13), transparent), var(--bg); }
.features h3 { font: 500 15px/1.4 var(--mono); color: var(--accent); margin: 0 0 6px; }
.features p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--text2); }
.features .reveal:nth-child(3n + 2) { transition-delay: 0.08s; }
.features .reveal:nth-child(3n) { transition-delay: 0.16s; }

.plain-list { margin: 0; padding: 0; list-style: none; }
.plain-list li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.plain-list li:first-child { border-top: 1px solid var(--border); }

/* Support */
.faq { max-width: 760px; }
.faq h3 { font: 500 17px/1.4 var(--mono); color: var(--accent); margin: 30px 0 6px; }
.faq p { margin: 0; }

/* Phones and short windows: the log stops pinning and plays as it passes */
@media (max-width: 820px), (max-height: 640px) {
  .motion .pin { height: auto; padding: 96px 0 0; }
  .motion .pin-stage { position: static; height: auto; display: block; }
}

@media (max-width: 820px) {
  .split { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .block { margin-top: 80px; }
  .statement { padding-top: 96px; padding-bottom: 0; }
  .features { grid-template-columns: minmax(0, 1fr); }

  .hero, .hero-app {
    align-items: flex-end;
    height: auto;
    min-height: calc(100svh - 68px);
    padding-bottom: 72px;
  }
  .hero::after {
    content: "";
    position: absolute;
    z-index: 3;
    inset: 26% 0 0;
    background: linear-gradient(transparent, var(--bg) 40%);
  }
  .stage, .hero-app .stage { --size: min(96vw, 48svh); top: 0; right: -6vw; margin-top: 0; }
  .ape-blue { inset: 3px 6px -3px -6px; }
  .ape-orange { inset: -3px -6px 3px 6px; }
  .hero-copy > * { max-width: none; }
  .dots {
    -webkit-mask-image: radial-gradient(ellipse 90% 40% at 60% 22%, #000, transparent);
    mask-image: radial-gradient(ellipse 90% 40% at 60% 22%, #000, transparent);
  }
  .ghost { font-size: 31vw; bottom: auto; top: 22%; }
  .chip { font-size: 12px; }
  .chip-2, .chip-4 { display: none; }
  .chip-1 { left: 14%; }
  .chip-3 { left: 6%; top: 46%; }
  .chip-5 { display: none; }
  .cue { display: none; }
  .hero .hero-copy .label { display: none; }
}

/* Small phones: a smaller gorilla, so it clears the headline */
@media (max-width: 820px) and (max-height: 740px) {
  .stage, .hero-app .stage { --size: min(78vw, 37svh); right: 2vw; }
  .chip-3 { display: none; }
  .hero, .hero-app { padding-bottom: 36px; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .top { flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; }
  .top nav { gap: 16px; font-size: 14px; }
  .bottom { grid-template-columns: minmax(0, 1fr); }
  .bottom nav { grid-column: 1; grid-row: auto; flex-direction: row; gap: 18px; margin-top: 10px; }
  dl.facts div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .app-head img { width: 72px; height: 72px; border-radius: 16px; }
  .log { font-size: 14px; }
}
