/* FunOura site. Midnight navy from the logo, titanium for type and buttons, and green only
   where the ring's sensor light is: the LED, a tap, the feature being shown. */
:root {
  color-scheme: dark;
  --bg: #080b14;
  --navy: #15203b;
  --navy-hi: #2c3e6b;
  --ti: #eef0f4;
  --ti-2: #c3c8d1;
  --pewter: #8f97a6;
  --dim: #7a8394;
  --line: rgba(255, 255, 255, 0.09);
  --glass: rgba(255, 255, 255, 0.045);
  --sensor: #3ddc84;
  --spark: #ffd25e;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: min(1120px, 100% - 48px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ti);
  font: 400 17px/1.47 var(--font);
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ti); outline-offset: 4px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ti); color: var(--bg); padding: 10px 16px; border-radius: 10px; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50; height: 52px;
  transition: background-color 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(8, 11, 20, 0.66);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: var(--line);
}
.nav-in {
  width: var(--wrap); height: 100%; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 600; font-size: 17px; letter-spacing: -0.02em; text-decoration: none;
}
.brand img { border-radius: 6px; }
.nav-links { display: flex; gap: 30px; font-size: 13px; }
.nav-links a { color: var(--ti-2); text-decoration: none; transition: color 0.2s; }
.nav-links a:hover { color: var(--ti); }
.nav-gh {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 500; text-decoration: none;
  padding: 6px 13px; border-radius: 999px; background: rgba(255, 255, 255, 0.1);
  transition: background-color 0.2s;
}
.nav-gh:hover { background: rgba(255, 255, 255, 0.16); }
.nav-gh svg { width: 15px; height: 15px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  padding: calc(52px + clamp(28px, 6vh, 72px)) 0 clamp(32px, 6vh, 64px);
  display: flex; flex-direction: column; align-items: center;
  overflow: clip;
  background:
    radial-gradient(1100px 760px at 72% 12%, rgba(44, 62, 107, 0.85), transparent 62%),
    radial-gradient(900px 600px at 18% 96%, rgba(21, 32, 59, 0.9), transparent 70%),
    linear-gradient(180deg, #0f1628 0%, var(--bg) 100%);
}
.hero-head { width: var(--wrap); text-align: center; display: grid; justify-items: center; gap: 18px; }
.title {
  font-size: clamp(46px, 7.4vw, 104px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.042em;
  padding-bottom: 0.06em;
  /* brushed titanium; the sheen slides with the pointer */
  background: linear-gradient(100deg, #7b818f 0%, #e9ecf1 17%, #a3a9b5 33%, #ffffff 47%, #8a909d 63%, #dde1e7 80%, #7b818f 100%);
  background-size: 240% 100%;
  background-position: calc(50% + var(--sheen, 0) * 28%) 0;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  transition: background-position 0.9s var(--ease-out);
}
.lede {
  max-width: 34em;
  font-size: clamp(17px, 1.55vw, 21px);
  line-height: 1.42;
  color: var(--pewter);
  letter-spacing: -0.016em;
}

.stage {
  --ring-w: clamp(300px, 36vw, 520px);
  position: relative;
  width: min(1240px, 100% - 48px);
  margin-top: clamp(8px, 2vh, 24px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--ring-w) minmax(0, 1fr);
  align-items: center;
  gap: clamp(12px, 2.5vw, 40px);
}
.ring-cell { position: relative; height: clamp(290px, 46vh, 480px); }
.ring-canvas {   /* placed by main.js: fixed while it flies, absolute once it lands */
  position: fixed; left: 0; top: 0; z-index: 1;
  pointer-events: none;
  transform-origin: 50% 50%;
  will-change: transform;
}
.ring-canvas.is-docked { position: absolute; }
/* Page content sits above the ring (backgrounds stay below it), so the ring passes behind text. */
.hero > *, .app > *, .install > *, .foot { position: relative; z-index: 2; }
.ring-fallback { display: none; }
.no-webgl .ring-canvas { display: none; }
.no-webgl .ring-fallback {
  display: block; position: absolute; inset: 0; margin: auto; width: 70%; max-width: 260px; height: auto;
}

.features {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: clamp(20px, 4.5vh, 46px);
}
.features-l { justify-items: end; text-align: right; }
.feature {
  display: grid; gap: 6px;
  max-width: 290px;
  padding: 6px 4px;
  background: none; border: 0; text-align: inherit; cursor: pointer;
  opacity: 0.78;
  transition: opacity 0.4s var(--ease-out), transform 0.5s var(--ease-out);
}
.f-head { display: flex; align-items: center; gap: 10px; }
.features-l .f-head { flex-direction: row-reverse; }
.f-icon {
  width: 22px; height: 22px; flex: none;
  fill: none; stroke: var(--pewter); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  transition: stroke 0.3s, filter 0.3s;
}
.f-title { font-size: 22px; font-weight: 600; letter-spacing: -0.024em; color: var(--ti); }
.f-text { font-size: 15px; line-height: 1.42; color: var(--pewter); letter-spacing: -0.01em; }

.stage[data-active] .feature { opacity: 0.42; }
.stage[data-active] .feature.is-on { opacity: 1; }
.features-l .feature.is-on { transform: translateX(-6px); }
.features-r .feature.is-on { transform: translateX(6px); }
.feature.is-on .f-icon { stroke: var(--sensor); filter: drop-shadow(0 0 6px rgba(61, 220, 132, 0.55)); }
.feature:hover { opacity: 1; }

.hint {
  grid-column: 2; text-align: center;
  margin-top: clamp(-8px, -1vh, 0px);
  font-size: 13px; color: var(--dim); letter-spacing: 0;
  transition: opacity 0.6s;
}
.hint.is-gone { opacity: 0; }

.hero-foot { margin-top: clamp(20px, 4vh, 40px); display: grid; justify-items: center; gap: 14px; }
.ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  height: 48px; padding: 0 24px; border-radius: 999px;
  font-size: 17px; font-weight: 500; letter-spacing: -0.015em; text-decoration: none;
  transition: background-color 0.2s, transform 0.2s var(--ease-out), border-color 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--ti); color: #0a0d16; }
.btn-primary:hover { background: #ffffff; }
.btn-quiet { border: 1px solid rgba(255, 255, 255, 0.22); color: var(--ti); }
.btn-quiet:hover { border-color: rgba(255, 255, 255, 0.45); background: rgba(255, 255, 255, 0.04); }
.fineprint { font-size: 13px; color: var(--dim); letter-spacing: 0; }

/* The hero comes in once: the title, then the ring's features on either side. */
.js .title, .js .lede, .js .feature, .js .hero-foot, .js .hint {
  animation: rise 1s var(--ease-out) both paused;
}
.js.is-ready :is(.title, .lede, .feature, .hero-foot, .hint, .ring-canvas) { animation-play-state: running; }
.js .lede { animation-delay: 0.08s; }
.js .features-l li:nth-child(1) .feature, .js .features-r li:nth-child(1) .feature { animation-delay: 0.35s; }
.js .features-l li:nth-child(2) .feature, .js .features-r li:nth-child(2) .feature { animation-delay: 0.43s; }
.js .features-l li:nth-child(3) .feature, .js .features-r li:nth-child(3) .feature { animation-delay: 0.51s; }
.js .hint, .js .hero-foot { animation-delay: 0.6s; }
.js .ring-canvas { animation: fade 1.4s 0.1s var(--ease-out) both paused; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .js .title, .js .lede, .js .feature, .js .hero-foot, .js .hint, .js .ring-canvas { animation: none; }
}

/* ---------- Install ---------- */
.wrap { width: var(--wrap); margin: 0 auto; }
.install, .app { scroll-margin-top: 20px; }
.install {
  padding: clamp(72px, 12vh, 140px) 0 clamp(80px, 12vh, 140px);
  background: radial-gradient(1000px 700px at 82% 55%, rgba(44, 62, 107, 0.2), transparent 70%);
}
.section-head { display: grid; gap: 20px; max-width: 900px; }
.section-head h2, .app h2 {
  font-size: clamp(38px, 5.2vw, 68px);
  font-weight: 600; line-height: 1.04; letter-spacing: -0.038em;
  text-wrap: balance;
}
.section-head > p, .app-text > p {
  font-size: clamp(17px, 1.5vw, 21px); line-height: 1.45; color: var(--pewter); max-width: 34em;
}
.needs {
  list-style: none; padding: 0; margin: 8px 0 0;
  display: flex; flex-wrap: wrap; gap: 12px 32px;
  font-size: 15px; color: var(--ti-2);
}
.needs li { display: flex; align-items: center; gap: 10px; }
.needs svg { width: 22px; height: 22px; fill: none; stroke: var(--pewter); stroke-width: 1.5; }

.install-grid {
  margin-top: clamp(56px, 9vh, 96px);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(32px, 5vw, 80px);
}
.steps { list-style: none; margin: 0; padding: 0 0 12vh; }
.step {
  position: relative;
  min-height: 58vh;
  padding: 0 0 56px 56px;
  opacity: 0.38;
  transition: opacity 0.5s var(--ease-out);
}
.step.is-on { opacity: 1; }
.step:last-child { min-height: 0; }
.step::before {   /* the thread between the numbers */
  content: ""; position: absolute; left: 15px; top: 40px; bottom: 8px; width: 1px;
  background: linear-gradient(var(--line), transparent);
}
.step:last-child::before { display: none; }
.step-n {
  position: absolute; left: 0; top: 0;
  width: 31px; height: 31px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 15px; font-weight: 600; letter-spacing: 0;
  border: 1px solid rgba(255, 255, 255, 0.25); color: var(--ti-2);
  transition: background-color 0.4s, color 0.4s, border-color 0.4s;
}
.step.is-on .step-n { background: var(--ti); color: #0a0d16; border-color: var(--ti); }
.step h3 { font-size: clamp(24px, 2.3vw, 30px); font-weight: 600; letter-spacing: -0.028em; line-height: 1.15; margin: -1px 0 14px; }
.step p { color: var(--pewter); max-width: 30em; margin-bottom: 18px; }
.step p a { color: var(--ti-2); }
.step p:last-child { margin-bottom: 0; }
.caution {
  color: var(--ti-2) !important;
  padding: 14px 16px 14px 44px;
  border-radius: 14px;
  background: rgba(255, 210, 94, 0.07);
  border: 1px solid rgba(255, 210, 94, 0.18);
  position: relative; font-size: 15px;
}
.caution::before {
  content: ""; position: absolute; left: 16px; top: 17px; width: 16px; height: 16px;
  background: var(--spark);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.2 15 14H1z' fill='none' stroke='black' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M8 6v3.6M8 11.6v.1' stroke='black' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.2 15 14H1z' fill='none' stroke='black' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M8 6v3.6M8 11.6v.1' stroke='black' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.code {
  position: relative;
  margin: 0 0 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  padding: 14px 84px 14px 18px;
}
.code:last-child { margin-bottom: 0; }
.code-label { display: block; font-size: 12px; color: var(--dim); margin-bottom: 6px; letter-spacing: 0; }
.code pre { margin: 0; overflow-x: auto; scrollbar-width: none; }
.code pre::-webkit-scrollbar { display: none; }
.code code { font: 14px/1.7 var(--mono); color: var(--ti); letter-spacing: 0; }
.code .l { display: block; white-space: pre-wrap; overflow-wrap: anywhere; padding-left: 1.25em; text-indent: -1.25em; }
.code .l::before { content: "%"; display: inline-block; width: 1.25em; text-indent: 0; color: var(--dim); user-select: none; }
.copy {
  position: absolute; right: 10px; top: 10px;
  font-size: 12px; font-weight: 500; letter-spacing: 0;
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); color: var(--ti-2);
  cursor: pointer; transition: background-color 0.2s, color 0.2s;
}
.copy:hover { background: rgba(255, 255, 255, 0.12); color: var(--ti); }
.copy.is-done { color: var(--sensor); }
code.inline { font: 0.9em var(--mono); color: var(--ti-2); letter-spacing: 0; }

.reset {
  list-style: none; margin: 4px 0 22px; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
  counter-reset: r;
}
.reset li {
  display: grid; gap: 2px; justify-items: start;
  font-size: 13px; color: var(--pewter); line-height: 1.3;
  padding: 12px; border-radius: 12px; border: 1px solid var(--line);
}
.reset b { color: var(--ti); font-weight: 600; font-size: 14px; }
.reset i {
  width: 10px; height: 10px; border-radius: 50%; margin-bottom: 8px;
  background: var(--led); box-shadow: 0 0 10px 1px var(--led);
}

/* The terminal plays each step as you reach it. */
.term-col { position: sticky; top: calc(50vh - 250px); align-self: start; }
.menubar {
  height: 28px; margin-bottom: 14px; padding: 0 12px;
  display: flex; align-items: center; justify-content: flex-end; gap: 14px;
  border-radius: 9px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line);
  font-size: 12px; font-weight: 500; color: var(--ti-2); letter-spacing: 0;
}
.mb-ring { width: 18px; height: 18px; opacity: 0; transform: scale(0.6); transition: opacity 0.4s, transform 0.5s var(--ease-out); }
.mb-ring svg { width: 100%; height: 100%; fill: none; stroke: var(--ti); stroke-width: 2.2; }
.mb-ring .mb-dot { fill: var(--sensor); stroke: none; }
.launched .mb-ring { opacity: 1; transform: none; }
.terminal {
  border-radius: 14px;
  background: rgba(12, 15, 25, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 50px 100px -30px rgba(0, 0, 0, 0.7), 0 0 0 0.5px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
.term-bar { position: relative; height: 38px; display: flex; align-items: center; padding: 0 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.dots { display: flex; gap: 8px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.dots i:nth-child(2) { background: #febc2e; }
.dots i:nth-child(3) { background: #28c840; }
.term-title { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; color: var(--pewter); letter-spacing: 0; pointer-events: none; }
.term-body {
  height: 420px; padding: 16px 18px 20px; overflow: hidden;
  font: 12px/1.65 var(--mono); letter-spacing: 0; color: var(--ti-2);
  white-space: pre-wrap; word-break: break-word;
  -webkit-mask-image: linear-gradient(transparent 4px, #000 36px);
          mask-image: linear-gradient(transparent 4px, #000 36px);
}
.term-body .ln { min-height: 1.62em; }
.term-body .pr { color: var(--pewter); }
.term-body .cmd { color: var(--ti); }
.term-body .b { color: var(--ti); font-weight: 700; }
.term-body .dim { color: var(--dim); }
.term-body .ok::before { content: "✓ "; color: var(--sensor); }
.term-body .caret {
  display: inline-block; width: 0.6em; height: 1.2em; margin-left: 1px; vertical-align: -0.2em;
  background: var(--ti-2); animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.mb-panel {
  position: absolute; right: 18px; top: 38px; width: min(260px, 48%);
  border-radius: 13px;
  box-shadow: 0 30px 70px -10px rgba(0, 0, 0, 0.75), 0 0 0 0.5px rgba(255, 255, 255, 0.12);
  opacity: 0; transform: translateY(-10px) scale(0.96); transform-origin: 90% 0;
  transition: opacity 0.35s, transform 0.6s var(--ease-out);
  pointer-events: none;
}
.launched .mb-panel { opacity: 1; transform: none; }

/* ---------- The app ---------- */
.app { padding: clamp(96px, 16vh, 160px) 0 clamp(40px, 6vh, 72px); }
.app-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 40px; }
.app-text { display: grid; gap: 20px; }
.ring-dock { width: clamp(150px, 17vw, 230px); aspect-ratio: 1; cursor: pointer; }
.no-webgl .ring-dock { display: none; }
.panels {
  margin-top: clamp(40px, 7vh, 72px);
  display: flex; justify-content: safe center; gap: 24px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 8px 48px 24px;
  scrollbar-width: none;
}
.panels::-webkit-scrollbar { display: none; }
.panels figure { margin: 0; flex: 0 0 clamp(230px, (100vw - 192px) / 5, 272px); scroll-snap-align: center; display: grid; gap: 16px; align-content: start; }
.panels img { border-radius: 13px; box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.7), 0 0 0 0.5px rgba(255, 255, 255, 0.1); }
.panels figcaption { font-size: 14px; line-height: 1.4; color: var(--pewter); padding-right: 12px; }
.panels figcaption b { display: block; color: var(--ti); font-size: 17px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 2px; }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 40px 0 56px; font-size: 13px; color: var(--dim); letter-spacing: 0; }
.foot .wrap { display: grid; gap: 12px; max-width: 760px; margin-left: max(24px, (100% - 1120px) / 2); }
.foot a { color: var(--ti-2); text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.credit { color: var(--pewter); font-size: 14px; }
.foot-links { display: flex; gap: 20px; margin-top: 6px; }

/* ---------- Short windows (laptops with the browser's toolbars) ---------- */
@media (max-height: 860px) and (min-width: 861px) {
  .hero { padding-top: calc(52px + clamp(16px, 3vh, 32px)); padding-bottom: 24px; }
  .hero-head { gap: 12px; }
  .title { font-size: clamp(44px, 9.5vh, 80px); }
  .lede { font-size: 18px; }
  .stage { margin-top: 0; }
  .ring-cell { height: clamp(260px, 44vh, 400px); }
  .features { gap: clamp(12px, 2.4vh, 24px); }
  .f-title { font-size: 20px; }
  .f-text { font-size: 14px; }
  .hero-foot { margin-top: clamp(12px, 2vh, 20px); gap: 10px; }
}

/* ---------- Smaller screens ---------- */
@media (max-width: 1000px) {
  .nav-links { display: none; }
  .install-grid { grid-template-columns: 1fr; }
  .term-col { display: none; }
  .step { min-height: 0; opacity: 1; padding-bottom: 48px; }
  .step .step-n { background: var(--ti); color: #0a0d16; border-color: var(--ti); }
  .steps { padding-bottom: 0; }
}
@media (max-width: 860px) {
  .stage {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "ring ring" "hint hint" "l r";
    row-gap: 8px;
  }
  .ring-cell { grid-area: ring; height: clamp(240px, 42vh, 340px); }
  .features-l { grid-area: l; }
  .features-r { grid-area: r; }
  .features { gap: 14px; align-self: start; }
  .features-l { justify-items: start; text-align: left; }
  .features-l .f-head { flex-direction: row; }
  .features-l .feature.is-on, .features-r .feature.is-on { transform: none; }
  .f-title { font-size: 18px; }
  .f-text { font-size: 13.5px; }
  .f-icon { width: 19px; height: 19px; }
  .hint { grid-area: hint; margin: 0 0 12px; }
}
@media (max-width: 560px) {
  :root { --wrap: calc(100% - 32px); }
  .stage { width: calc(100% - 32px); column-gap: 16px; }
  .reset { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step { padding-left: 46px; }
  .code { padding-right: 72px; }
  .code code { font-size: 13px; }
  .btn { height: 46px; padding: 0 20px; font-size: 16px; }
  .ctas { flex-direction: column; justify-self: stretch; }
  .app-head { grid-template-columns: 1fr; gap: 8px; }
  .ring-dock { order: -1; width: 132px; margin-left: -10px; }
  .hero-foot { width: calc(100% - 32px); }
  .btn { justify-content: center; }
}
