/* ============================================================================
   Lodestone — landing + support styles
   Mirrors the app's design language: deep indigo field, rainbow pitch-class hue,
   SF Rounded display type, the orb that fills as you near tune, contour motif.
   ========================================================================== */

:root {
  /* page field — the icon's dark indigo-navy */
  --bg:        #0b0917;
  --bg-bloom:  #1d1742;
  --stage-idle:#0c0a1c;

  --text:  #eef1f7;
  --muted: #9aa3b8;
  --soft:  #d7dcea;
  --hair:  rgba(255, 255, 255, 0.07);
  --card:  rgba(255, 255, 255, 0.035);

  /* the gem rainbow (matches the app's hue wheel) */
  --rainbow: linear-gradient(90deg,
    #ff5e5b 0%, #ff9e2c 18%, #ffd23f 34%,
    #4ecb71 54%, #4aa3ff 76%, #9b6cff 100%);

  --display: ui-rounded, "SF Pro Rounded", "SF Pro Display",
             -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --body:    -apple-system, BlinkMacSystemFont, "SF Pro Text",
             system-ui, "Segoe UI", sans-serif;

  --maxw: 680px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--body);
  background:
    radial-gradient(1200px 620px at 50% -10%, var(--bg-bloom) 0%, var(--bg) 58%),
    var(--bg);
  color: var(--text);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: #9db8ff; text-decoration: none; }
a:hover { color: #c4d2ff; }

.rainbow-bar {
  height: 6px; width: 88px; border-radius: 999px;
  background: var(--rainbow);
}

/* ---------------------------------------------------------------- layout -- */

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.site-head {
  /* above the .start tuner overlay (z 6) so the nav links stay tappable;
     still below the sheet/scrim (z 40) so the sheet covers the header */
  position: absolute; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 26px;
  pointer-events: none;
}
.site-head a { pointer-events: auto; }
.brand {
  font-family: var(--display); font-weight: 600; letter-spacing: 0.14em;
  font-size: 0.82rem; text-transform: lowercase;
  color: rgba(255,255,255,0.62); display: inline-flex; align-items: center; gap: 9px;
}
.brand img { width: 22px; height: 22px; border-radius: 6px; display: block; }
.head-link { color: rgba(255,255,255,0.5); font-size: 0.82rem; }
.head-link:hover { color: rgba(255,255,255,0.85); }

/* ========================================================== the tuner stage */

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: hidden;
  background: var(--stage-idle);
  /* JS floods this with the live note color */
  background-color: var(--note-bg, var(--stage-idle));
  transition: background-color 0.5s ease;
}

/* concentric contour field + soft vignette — echoes the icon */
.stage::before {
  content: ""; position: absolute; inset: -10%;
  background:
    repeating-radial-gradient(circle at 50% 46%,
      transparent 0 37px,
      rgba(255,255,255,0.035) 37px 38px,
      transparent 38px 76px);
  -webkit-mask-image: radial-gradient(circle at 50% 46%, #000 0%, transparent 72%);
          mask-image: radial-gradient(circle at 50% 46%, #000 0%, transparent 72%);
  opacity: 0.9; pointer-events: none;
}
.stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 30%, transparent 55%, rgba(0,0,0,0.45) 100%);
}

/* faint drifting sparkles */
.stars { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.stars i {
  position: absolute; width: 2px; height: 2px; border-radius: 50%;
  background: #fff; opacity: 0.5;
  animation: twinkle var(--tw, 4s) ease-in-out infinite;
}
@keyframes twinkle { 0%,100% { opacity: 0.12; } 50% { opacity: 0.6; } }

/* edge glow that blooms when locked in tune */
.edge-glow {
  position: absolute; inset: 0; z-index: 4; pointer-events: none;
  box-shadow: inset 0 0 70px 14px rgba(255,255,255,0.9);
  opacity: 0; transition: opacity 0.4s ease;
}
.stage.in-tune .edge-glow { opacity: 0.85; }

.tuner {
  position: relative; z-index: 3;
  display: flex; flex-direction: column; align-items: center;
  width: 100%; padding: 0 28px;
  transition: opacity 0.5s ease, filter 0.5s ease;
}

/* top cents label */
.cents {
  font-family: var(--display); font-weight: 500;
  font-size: 1.15rem; letter-spacing: 0.01em;
  color: rgba(255,255,255,0.6);
  min-height: 1.5em; opacity: 0; transition: opacity 0.4s ease;
}
.stage.has-note .cents { opacity: 1; }
.stage.in-tune .cents { color: rgba(255,255,255,0.95); }

/* the ring: particle canvas + the big letter */
.ring {
  position: relative;
  width: min(82vw, 360px); height: min(82vw, 360px);
  display: grid; place-items: center;
}
.ring canvas { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity 0.5s ease; }
/* before the user starts, quiet the field so "Tap to tune" reads clearly */
.stage.pre-start canvas { opacity: 0.45; }
.stage.pre-start .idle-hint { opacity: 0; }

.letter {
  position: relative; z-index: 2;
  font-family: var(--display); font-weight: 200;
  font-size: clamp(96px, 30vw, 168px); line-height: 1;
  color: rgba(255,255,255,0.84);
  display: inline-flex; align-items: flex-start;
  transition: color 0.35s ease, transform 0.35s ease, opacity 0.35s ease;
  letter-spacing: -0.02em;
}
.stage.in-tune .letter { color: #fff; }
.letter sup {
  font-size: 0.4em; font-weight: 200; margin-left: 0.02em; line-height: 1;
  align-self: flex-start; margin-top: 0.06em;
}
.letter .oct { font-size: 0.26em; align-self: flex-end; margin-bottom: 0.42em;
  margin-left: 0.04em; color: rgba(255,255,255,0.5); font-weight: 300; }

.idle-hint {
  position: absolute; z-index: 2;
  font-family: var(--display); font-size: 1.3rem; font-weight: 300;
  color: rgba(255,255,255,0.55);
  transition: opacity 0.4s ease;
}
.stage.has-note .idle-hint { opacity: 0; }
.stage.has-note .letter { }
.letter.hidden { opacity: 0; transform: scale(0.82); }

/* note + frequency */
.readout {
  font-family: var(--display); font-weight: 400; font-size: 1.0rem;
  color: rgba(255,255,255,0.62); letter-spacing: 0.02em;
  min-height: 1.5em; margin-top: 14px;
  opacity: 0; transition: opacity 0.4s ease;
}
.stage.has-note .readout { opacity: 1; }
.stage.in-tune .readout { color: rgba(255,255,255,0.9); }

/* the dial: track + center tick + the orb that fills */
.dial {
  position: relative; width: min(72vw, 300px); height: 64px; margin-top: 10px;
  opacity: 0; transition: opacity 0.4s ease;
}
.stage.has-note .dial { opacity: 1; }
.dial .track {
  position: absolute; top: 50%; left: 0; right: 0; height: 3px;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.14); border-radius: 999px;
}
.dial .center {
  position: absolute; top: 50%; left: 50%; width: 2px; height: 16px;
  transform: translate(-50%, -50%);
  background: rgba(255,255,255,0.45);
}
.orb {
  position: absolute; top: 50%; left: 50%; width: 52px; height: 52px;
  transform: translate(-50%, -50%);
  transition: left 0.22s cubic-bezier(0.2, 0.9, 0.25, 1);
  display: grid; place-items: center;
}
.orb .rim {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.9);
}
.orb .fill {
  width: 46px; height: 46px; border-radius: 50%; background: #fff;
  transform: scale(var(--fill, 0));
  box-shadow: 0 0 calc(6px + 18px * var(--fill, 0)) rgba(255,255,255,calc(0.2 + 0.5 * var(--fill, 0)));
}

.wordmark {
  position: absolute; bottom: 34px; z-index: 3;
  font-family: var(--display); font-weight: 500; font-size: 0.72rem;
  letter-spacing: 0.22em; color: rgba(255,255,255,0.32);
  opacity: 1; transition: opacity 0.4s ease;
}
.stage.has-note .wordmark { opacity: 0; }

/* start / permission overlay */
.start {
  position: absolute; z-index: 6; inset: 0; border: 0; background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; cursor: pointer; color: var(--text);
  transition: opacity 0.4s ease;
}
.start[hidden] { display: none; }
.start .disc {
  width: 96px; height: 96px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  display: grid; place-items: center;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  transition: transform 0.3s ease, background 0.3s ease;
}
.start:hover .disc { transform: scale(1.04); background: rgba(255,255,255,0.12); }
.start .disc svg { width: 38px; height: 38px; fill: rgba(255,255,255,0.92); }
.start .label {
  font-family: var(--display); font-weight: 500; font-size: 1.15rem;
  color: rgba(255,255,255,0.92); text-shadow: 0 1px 14px rgba(0,0,0,0.55);
}
.start .sub {
  font-size: 0.85rem; color: rgba(255,255,255,0.55); margin-top: -8px;
  text-shadow: 0 1px 14px rgba(0,0,0,0.55);
}

.scroll-cue {
  position: absolute; bottom: 22px; z-index: 3; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.4); font-size: 0.75rem; letter-spacing: 0.12em;
  font-family: var(--display); text-transform: uppercase;
  animation: bob 2.4s ease-in-out infinite;
}
.start:not([hidden]) ~ .scroll-cue { opacity: 0; }
@keyframes bob { 0%,100% { transform: translateX(-50%) translateY(0);} 50% { transform: translateX(-50%) translateY(5px);} }

/* ============================================================= page content */

.section { padding: 84px 0; }
.section.tight { padding: 56px 0; }

.eyebrow {
  font-family: var(--display); font-weight: 600; font-size: 0.74rem;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 14px;
}
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; font-weight: 600; }
h1 { font-size: clamp(2rem, 7vw, 2.6rem); margin: 0 0 10px; line-height: 1.08; }
h2 { font-size: clamp(1.5rem, 5vw, 1.9rem); margin: 0 0 14px; line-height: 1.12; }
h3 { font-size: 1.08rem; margin: 0 0 6px; }
p  { margin: 0 0 16px; color: var(--soft); }
.lead { font-size: 1.18rem; color: #c5cce0; }

/* icon feature */
.icon-feature { text-align: center; }
.icon-hero {
  width: 168px; height: 168px; border-radius: 38px; display: inline-block;
  box-shadow: 0 26px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
  margin-bottom: 28px;
}
.muted-line { color: var(--muted); font-style: italic; }

/* feature grid */
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.feature {
  background: var(--card); border-radius: 18px; padding: 22px 22px;
  box-shadow: 0 12px 26px rgba(0,0,0,0.28);
}
.feature .ic { font-size: 1.4rem; margin-bottom: 10px; display: block; }
.feature h3 { margin-bottom: 4px; }
.feature p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* download CTA */
.cta { text-align: center; }

/* Enchant-style button: black round-rect, white text */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--display); font-weight: 600; font-size: 1rem;
  color: #fff; background: #000;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 13px; padding: 13px 26px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.btn:hover {
  color: #fff; background: #16161b;
  border-color: rgba(255, 255, 255, 0.26); transform: translateY(-1px);
}
.btn-sm {
  font-size: 0.82rem; padding: 8px 17px; border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.34);
}

/* cards used on support / privacy pages */
.card {
  background: var(--card); border-radius: 16px; padding: 22px 24px; margin: 14px 0;
  box-shadow: 0 12px 26px rgba(0,0,0,0.26);
}
.card .q { font-family: var(--display); font-weight: 600; color: var(--text); margin: 0 0 6px; }
.card p:last-child { margin-bottom: 0; }
.email { font-size: 1.12rem; font-weight: 600; font-family: var(--display); }

/* doc (privacy / support) page shell */
.doc { max-width: var(--maxw); margin: 0 auto; padding: 96px 24px 90px; }
.doc h1 { margin-bottom: 6px; }
.doc .tag { color: var(--muted); margin: 0 0 36px; font-size: 1.05rem; }
.doc h2 { font-size: 1.2rem; margin: 38px 0 10px; }

/* a note from the maker */
.story .story-body { max-width: 600px; }
.story p { color: #c9d0e2; }
.story .sig {
  font-family: var(--display); color: var(--muted); line-height: 1.45;
  margin-top: 22px; margin-bottom: 0;
}

/* ===================================================== iOS-style bottom sheet */
.sheet-scrim {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(4, 3, 10, 0.55);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; transition: opacity 0.35s ease;
}
.sheet-scrim.show { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  width: min(560px, 100%); margin: 0 auto;
  max-height: 86vh; max-height: 86svh;
  display: flex; flex-direction: column;
  background: #16121f;
  border-radius: 22px 22px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 -24px 70px rgba(0, 0, 0, 0.55);
  transform: translateY(100%);
  transition: transform 0.44s cubic-bezier(0.22, 0.9, 0.24, 1);
  padding-bottom: env(safe-area-inset-bottom);
  outline: none;
}
.sheet.show { transform: translateY(0); }
.sheet-grab {
  flex: none; align-self: center; cursor: grab;
  width: 40px; height: 5px; padding: 0; border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  margin: 11px auto 4px; touch-action: none;
}
.sheet-grab:hover { background: rgba(255, 255, 255, 0.34); }
.sheet-body {
  overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y;
  padding: 8px 26px 32px;
}
.sheet-body h2 { font-size: 1.5rem; margin: 6px 0 8px; }
.sheet-sub { color: var(--muted); margin: 0 0 16px; }
.sheet-email {
  display: inline-block; font-family: var(--display); font-weight: 600;
  font-size: 1.15rem; margin-bottom: 18px;
}
.sheet-faq .card { margin: 12px 0; }
.sheet-faq .card:last-child { margin-bottom: 0; }

footer {
  color: var(--muted); font-size: 0.86rem;
  border-top: 1px solid var(--hair); padding: 28px 0 64px; margin-top: 40px;
}
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; }
footer nav { display: flex; gap: 22px; }
footer .spacer { flex: 1; }
footer a { color: var(--soft); }

@media (max-width: 540px) {
  .features { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .stars i, .scroll-cue { animation: none; }
  .stage, .letter, .orb, .cents, .readout, .dial { transition: none; }
}
