/* Tilely — brutalist dark marketing site */

@font-face {
  font-family: "IBM Plex Sans";
  src: url("assets/fonts/IBMPlexSans-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/fonts/IBMPlexMono-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #141416;
  --bg-deep: #0a0a0c;
  --bg-elevated: #1a1a1e;
  --text: #fafafa;
  --muted: #a1a1aa;
  --faint: #52525b;
  --line: rgba(255, 255, 255, 0.1);
  --icon-border: #8a8a92;
  --green: #34c759;
  --red: #ff3b30;
  --grey-heat: #6b6b76;
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --max: 1320px;
  /* Desktop mockup: +30% then +15% from original 280px baseline → ~419px */
  --phone-w: 419px;
  --phone-h: calc(var(--phone-w) * 3000 / 1470);
  --nav-h: 0px; /* no site header — full viewport for sticky stage */
  --footer-h: 56px;
  /* Center phone in the viewport */
  --phone-sticky-top: max(
    8px,
    calc((100dvh - var(--phone-h)) / 2)
  );
  /*
   * mockup-phone.png (1470×3000) — display glass under Dynamic Island.
   * Top inset ~54/3000 — ~5px higher than prior on the 364px mockup.
   */
  --screen-inset-l: 5.102%;
  --screen-inset-r: 5.102%;
  --screen-inset-t: 1.80%;
  --screen-inset-b: 2.200%;
  /* Outer device silhouette (clips any square screen layers) */
  --phone-outer-radius: 22.5% / 11.05%;
  /* Inner display corner radius */
  --screen-radius: 12% / 5.85%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* Allow normal vertical scroll recovery on iOS (none was trapping at bottom) */
  overscroll-behavior-y: auto;
  /* Safari paints overscroll / status bar from this color — never white */
  background-color: #0a0a0c;
  color-scheme: dark;
  /* Stable min-height: svh doesn’t jump when iOS toolbars show/hide */
  min-height: 100%;
  min-height: 100svh;
  min-height: -webkit-fill-available;
}

body {
  margin: 0;
  /* Solid base + uniform linear gradient (no radial falloff) */
  background-color: #0a0a0c;
  background-image: linear-gradient(180deg, #1c1c20 0%, #121214 45%, #0a0a0c 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  color: var(--text);
  font-family: var(--sans);
  font-weight: 600;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
  min-height: 100svh;
  min-height: -webkit-fill-available;
  overscroll-behavior-y: auto;
  padding: 0;
}

/* Noise grain — uniform full-viewport film grain (not a radial falloff) */
.noise-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  margin: 0;
  padding: 0;
  pointer-events: none;
  opacity: 0.14;
  mix-blend-mode: soft-light;
  filter: grayscale(100%);
}

.noise-bg-svg {
  display: block;
  width: 100%;
  height: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--muted);
}

/* —— Nav (removed site-wide — section rail is the only chrome) —— */

.site-nav {
  display: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.brand.small {
  font-size: 13px;
  gap: 8px;
}

.brand-icon-wrap {
  display: inline-flex;
  perspective: 900px;
  transform-style: preserve-3d;
  border-radius: 12px;
  /* Larger hit area for tilt without layout shift */
  padding: 4px;
  margin: -4px;
}

.brand-icon-wrap.sm {
  perspective: 400px;
  border-radius: 6px;
  padding: 0;
  margin: 0;
}

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: block;
  object-fit: cover;
  border: 1.5px solid var(--icon-border);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 4px 14px rgba(0, 0, 0, 0.45);
  transform-style: preserve-3d;
  transition: transform 0.08s ease-out, box-shadow 0.2s ease;
  will-change: transform;
  /* Avoid subpixel layout jump from 3D transforms */
  backface-visibility: hidden;
}

.brand-icon-wrap.sm .brand-icon {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border-width: 1px;
  box-shadow: none;
}

.brand:hover .brand-icon {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 10px 28px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}

.nav-links {
  display: flex;
  gap: 28px;
  font-size: 13px;
  color: var(--muted);
}

.nav-links a:hover {
  color: var(--text);
}

/* —— Story layout (mobile-first, desktop-like one-text ↔ one-screenshot) —— */

:root {
  --mobile-phone-pad: max(12px, env(safe-area-inset-top, 0px));
  /* ~15% larger phone for better one-section ratio */
  --mobile-phone-h: min(483px, 64svh);
  --mobile-phone-stack: calc(var(--mobile-phone-pad) + var(--mobile-phone-h) + 8px);
  --mobile-text-h: calc(100svh - var(--mobile-phone-stack));
}

.story {
  display: flex;
  flex-direction: column;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px 0;
  padding-right: 28px;
  position: relative;
  z-index: 1;
  /* Footer is last grid/flex child inside story */
}

main {
  position: relative;
  z-index: 1;
}

.story-left {
  --stage-h: var(--mobile-text-h);
  position: relative;
  order: 1;
  width: 100%;
  min-width: 0;
  padding: 0;
  flex: 0 0 auto;
}

/* Transparent sticky bar — seamless with page gradient + noise (no dark plate) */
.story-right {
  order: -1;
  position: sticky;
  top: 0;
  z-index: 5;
  width: 100%;
  box-sizing: border-box;
  padding: var(--mobile-phone-pad) 0 8px;
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  /* No backface/isolation hacks — those cause black flashes on iOS sticky */
}

/* —— Feature copy: sticky stage + one active panel (same model as desktop) —— */

.feature-text-stage {
  position: sticky;
  top: var(--mobile-phone-stack);
  z-index: 2;
  height: var(--mobile-text-h);
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  pointer-events: none;
  box-sizing: border-box;
  background: transparent;
}

.feature-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0 4px 0 0;
  opacity: 0;
  pointer-events: none;
  box-sizing: border-box;
  color: var(--text);
  transition: opacity 0.35s ease;
  background: transparent;
}

.feature-panel.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* Scroll runway — shorter blocks = snappier section changes on mobile */
.feature-spacers {
  display: block;
  /* Pull the runway up past the sticky phone stack too, so the hero step
     starts at scroll 0 and is exactly as short as every other section. */
  margin-top: calc(-1 * (var(--mobile-text-h) + var(--mobile-phone-stack)));
  padding-bottom: 0;
}

.feature-block {
  /* Short runway — one scroll flick to the next section */
  min-height: 55svh;
  padding: 0;
  border-bottom: none;
  scroll-margin-top: calc(var(--mobile-phone-stack) + 8px);
  pointer-events: none;
  background: transparent;
}

/* .feature-block.feature-close sizing is defined with the footer rules below */

/* —— Section rail (aligned to text band on mobile) —— */

.section-rail {
  position: fixed;
  right: 4px;
  left: auto;
  /* Center of the text stage under the phone */
  top: calc(var(--mobile-phone-stack) + var(--mobile-text-h) * 0.5);
  transform: translateY(-50%);
  z-index: 35;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.section-rail-item {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-height: 0;
  min-width: 36px;
  padding: 5px 6px;
  color: var(--faint);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  line-height: 1;
  transition: color 0.25s ease;
  box-sizing: border-box;
}

.section-rail-item:hover {
  color: var(--muted);
}

.section-rail-line {
  display: block;
  width: 14px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
  transition:
    width 0.3s ease,
    opacity 0.25s ease,
    background-color 0.25s ease;
}

.section-rail-num {
  min-width: 1.4em;
  opacity: 0.7;
  transition: opacity 0.25s ease, color 0.25s ease;
}

.section-rail-item.is-active {
  color: var(--text);
}

.section-rail-item.is-active .section-rail-line {
  width: 28px;
  opacity: 1;
  background: var(--text);
}

.section-rail-item.is-active .section-rail-num {
  opacity: 1;
}

.section-rail-item:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.35);
  outline-offset: 4px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .feature-panel {
    transition: none;
  }

  .section-rail-line,
  .section-rail-item,
  .section-rail-num {
    transition: none;
  }

  .close-icon-large {
    transition: none;
  }
}

.eyebrow {
  margin: 0 0 16px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.feature-panel h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 7vw, 40px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--text);
}

.feature-panel h2 {
  margin: 0 0 12px;
  font-size: clamp(20px, 5.2vw, 28px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.lede {
  margin: 0 0 20px;
  font-size: clamp(20px, 2.4vw, 26px);
  color: var(--muted);
  letter-spacing: -0.02em;
  max-width: 28ch;
}

.body {
  margin: 0;
  font-size: 16px;
  color: var(--muted);
  max-width: 38ch;
  line-height: 1.55;
}

.meta {
  margin: 28px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  letter-spacing: 0.02em;
}

/* —— Phone / close icon visual —— */

.sticky-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: fit-content;
  height: var(--mobile-phone-h);
  margin: 0 auto;
  padding: 0;
  z-index: 2;
  background: transparent;
}

.phone-frame {
  width: auto;
  height: 100%;
  max-height: 100%;
  max-width: min(78vw, 280px);
  aspect-ratio: 1470 / 3000;
  position: relative;
  flex-shrink: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
  filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.55));
  /* Rasterize once so the sticky phone doesn't re-filter each scroll frame */
  transform: translateZ(0);
  opacity: 1;
  visibility: visible;
  /* Smooth crossfade with icon */
  transition: opacity 0.5s ease, visibility 0s linear 0s, filter 0.5s ease;
  pointer-events: none;
  z-index: 2;
  margin: 0 auto;
}

/* Last step: crossfade phone → icon (no display:none — keeps transition) */
.story.is-close .phone-frame {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.5s ease, visibility 0s linear 0.5s, filter 0.5s ease;
}

.close-icon-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 3;
  perspective: 900px;
  transform-style: preserve-3d;
  transition: opacity 0.5s ease, visibility 0s linear 0.5s;
}

.story.is-close .close-icon-stage,
.close-icon-stage.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.5s ease, visibility 0s linear 0s;
}

.close-icon-large {
  /* ~2× previous mobile size */
  width: min(296px, 84%);
  height: auto;
  aspect-ratio: 1;
  border-radius: 28%;
  border: 1.5px solid var(--icon-border);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.14) inset,
    0 24px 60px rgba(0, 0, 0, 0.55);
  object-fit: cover;
  display: block;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.08s ease-out, box-shadow 0.2s ease;
  backface-visibility: hidden;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 28px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: default;
  opacity: 0.92;
}

.cta-btn:disabled {
  cursor: default;
  opacity: 0.85;
}

.phone-bezel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
  z-index: 2;
  /* Bezel defines the visible silhouette; no extra compositing layer */
  display: block;
}

.phone-screen {
  position: absolute;
  left: var(--screen-inset-l);
  right: var(--screen-inset-r);
  top: var(--screen-inset-t);
  bottom: var(--screen-inset-b);
  border-radius: var(--screen-radius);
  /* Transparent — black square must never paint outside the glass */
  background: transparent;
  overflow: hidden;
  z-index: 1;
  /* No transform/isolation — those create a rectangular opaque layer */
}

.screen {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  display: block;
  margin: 0;
  padding: 0;
  background: transparent;
  overflow: hidden;
  border-radius: inherit;
}

.screen.is-active {
  opacity: 1;
  pointer-events: none;
  z-index: 1;
}

/* Real screenshots — fill display glass; status bar wraps Dynamic Island */
.screen-shot {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 0%;
  /* No scale transform — was creating a square overscan beyond the radius */
  border-radius: inherit;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* Screen chrome (legacy CSS mock — unused with real screenshots) */

.scr-status {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 10px;
  padding: 0 4px;
}

.scr-status.light {
  color: rgba(255, 255, 255, 0.7);
}

.scr-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  min-height: 22px;
}

.scr-title {
  font-size: 15px;
  letter-spacing: -0.02em;
}

.scr-chev,
.scr-back {
  color: var(--muted);
  font-size: 14px;
}

.scr-sort,
.scr-star {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}

.scr-periods {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--faint);
}

.scr-periods span {
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.scr-periods span.on {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.scr-periods.mini {
  justify-content: flex-start;
}

/* Treemap mock */

.scr-treemap {
  flex: 1;
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.9fr;
  grid-template-rows: 1.3fr 1fr 0.9fr;
  gap: 2px;
  min-height: 0;
}

.scr-treemap.dense {
  grid-template-columns: 1.5fr 1fr 1fr;
  grid-template-rows: 1.2fr 1fr 1fr 0.8fr;
}

.scr-treemap.dim {
  opacity: 0.85;
}

.tm {
  border-radius: 2px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 9px;
  color: #fff;
  min-height: 0;
  overflow: hidden;
}

.tm.big {
  grid-row: span 2;
}

.tm .up { color: #b8f5c0; }
.tm .dn { color: #ffc0c0; }
.tm .flat { color: rgba(255, 255, 255, 0.55); }

.tm-tech { background: linear-gradient(180deg, #2f7a48, #163d24); }
.tm-fin  { background: linear-gradient(180deg, #3a6b4a, #1a3324); }
.tm-hc   { background: linear-gradient(180deg, #6a3038, #3a1418); }
.tm-cd   { background: linear-gradient(180deg, #2f8a52, #184828); }
.tm-en   { background: linear-gradient(180deg, #8a3038, #4a1418); }
.tm-ind  { background: linear-gradient(180deg, #3a7a48, #1a3824); }
.tm-com  { background: linear-gradient(180deg, #2f6a88, #163848); }
.tm-util { background: linear-gradient(180deg, #3a3a48, #1a1a24); }

.scr-fab {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 44px;
  height: 28px;
  border-radius: 14px;
  background: rgba(40, 40, 44, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  letter-spacing: 0.08em;
}

/* Equal grid (RSI) */

.scr-grid-eq {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  min-height: 0;
}

.eq {
  border-radius: 2px;
  padding: 8px 6px;
  font-family: var(--mono);
  font-size: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.eq span { opacity: 0.85; font-size: 12px; }
.eq.hot  { background: linear-gradient(180deg, #3aa05a, #1a502c); }
.eq.mid  { background: linear-gradient(180deg, #3a3a44, #1e1e24); }
.eq.cold { background: linear-gradient(180deg, #8a3a42, #4a1a20); }

.scr-mode-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 8px;
  font-size: 9px;
  color: var(--faint);
  font-family: var(--mono);
}

.scr-mode-row .on {
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

/* Sector */

.scr-sector-band {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  margin-bottom: 8px;
}

.scr-sector-band .tm {
  min-height: 72px;
}

.scr-sector-band.muted {
  opacity: 0.45;
}

.scr-sector-label {
  text-align: center;
  font-size: 9px;
  color: var(--faint);
  font-family: var(--mono);
  margin: 6px 0 10px;
}

/* Extended hours banner */

.scr-banner {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 4px 12px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(40, 40, 48, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 9px;
  color: #fff;
  line-height: 1.3;
}

.scr-banner-icon {
  flex-shrink: 0;
}

/* Search */

.scr-search-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 12px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 13px;
}

.scr-search-q {
  color: #fff;
}

.scr-x {
  color: var(--muted);
  font-size: 12px;
}

.scr-search-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.scr-row {
  display: flex;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
}

.scr-row .tkr {
  font-family: var(--mono);
  min-width: 44px;
}

.scr-row .nm {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Watchlist */

.scr-watch {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  flex: 1;
  align-content: start;
}

.wq {
  aspect-ratio: 1;
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 10px;
  gap: 4px;
  background: #1a1a20;
}

.wq.up { background: linear-gradient(180deg, #2f7a48, #163d24); }
.wq.dn { background: linear-gradient(180deg, #8a3038, #4a1418); }
.wq.flat { background: linear-gradient(180deg, #3a3a48, #1a1a24); }

/* Detail */

.scr-detail-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 8px;
  min-height: 24px;
}

.scr-tkr-fly {
  margin-right: auto;
  margin-left: auto;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.scr-star-btn,
.scr-x-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.scr-detail-card {
  flex: 1;
  background: #000;
  border-radius: 14px 14px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: none;
  padding: 12px 10px 10px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.scr-detail-card.full {
  margin: 0 -2px;
}

.scr-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.scr-detail-head.compact {
  margin-bottom: 6px;
}

.scr-co {
  font-size: 13px;
  letter-spacing: -0.02em;
}

.scr-px {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.scr-price {
  font-family: var(--mono);
  font-size: 15px;
}

.scr-chg {
  font-family: var(--mono);
  font-size: 15px;
}

.scr-chg.up { color: var(--green); }
.scr-chg.dn { color: var(--red); }

.scr-past {
  font-size: 9px;
  color: var(--faint);
}

.scr-chart-mini {
  flex: 1;
  min-height: 80px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  padding: 8px;
}

.scr-line-svg {
  width: 100%;
  height: 100%;
}

/* Candles mock */

.scr-candles {
  position: relative;
  height: 100px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 3px;
  padding: 8px 2px 4px;
  margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  overflow: hidden;
}

.scr-candles .c {
  flex: 1;
  max-width: 8px;
  border-radius: 0;
  display: block;
  position: relative;
}

.scr-candles .c.u {
  background: var(--green);
  height: 40%;
}

.scr-candles .c.d {
  background: var(--red);
  height: 32%;
}

.scr-candles .c:nth-child(3n) { height: 55%; }
.scr-candles .c:nth-child(4n) { height: 28%; }
.scr-candles .c:nth-child(5n) { height: 48%; }

.scr-candles .sma {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  opacity: 0.7;
}

.scr-candles .s20 {
  top: 38%;
  background: #3d8bfd;
  transform: rotate(-4deg);
}

.scr-candles .s50 {
  top: 52%;
  background: #ff9f0a;
  transform: rotate(-2deg);
}

.scr-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
  font-size: 8px;
  font-family: var(--mono);
  color: var(--faint);
}

.scr-toggles span {
  padding: 2px 5px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.scr-toggles .on {
  color: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.25);
}

.scr-toggles span.r:nth-of-type(5) {
  margin-left: auto;
}

.scr-vol-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 28px;
  margin-bottom: 4px;
}

.scr-vol-bars i {
  flex: 1;
  background: rgba(52, 199, 89, 0.45);
  display: block;
  height: 40%;
}

.scr-vol-bars i:nth-child(odd) { height: 70%; background: rgba(255, 59, 48, 0.4); }
.scr-vol-bars i:nth-child(3n) { height: 50%; }

.scr-rsi-line {
  height: 20px;
  border-radius: 4px;
  background:
    linear-gradient(90deg, transparent 0%, #3d8bfd 20%, #3d8bfd 40%, transparent 55%, #3d8bfd 70%, #3d8bfd 90%, transparent);
  opacity: 0.7;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

/* —— Footer: sits in the last viewport (pinned while close is active) —— */

.feature-block.feature-close {
  position: relative;
  box-sizing: border-box;
  /* Exact one frame — no extra runway below the last section */
  height: 100svh;
  min-height: 100svh;
  max-height: 100svh;
}

.site-footer {
  /* Default: bottom of the close block (document end = last frame) */
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  height: var(--footer-h);
  min-height: var(--footer-h);
  box-sizing: border-box;
  border-top: none;
  margin: 0;
  padding: 0 4px;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

/*
 * While the last section is active, pin the footer to the real viewport bottom
 * so Terms / Lett Designs never sit on a second scroll past the last frame.
 */
.story.is-close .site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: none;
  z-index: 40;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.footer-inner {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 12px;
  color: var(--faint);
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  text-align: center;
}

.footer-links a {
  color: inherit;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
}

.link-btn {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}

.link-btn:hover {
  color: var(--text);
}

.sep {
  opacity: 0.4;
}


/* —— Standalone legal pages (/terms, /privacy) —— */

.legal-page {
  min-height: 100dvh;
  background-color: #0a0a0c;
  background-image: linear-gradient(180deg, #1c1c20 0%, #121214 45%, #0a0a0c 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  color: var(--text);
  font-family: var(--sans);
  font-weight: 600;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

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

.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

.legal-brand:hover {
  color: var(--text);
}

.legal-brand-icon-wrap {
  display: inline-flex;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.legal-brand-icon {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.legal-page-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.legal-page-title {
  margin: 0 0 8px;
  font-size: clamp(32px, 6vw, 48px);
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
}

.legal-page-meta {
  margin: 0 0 24px;
  font-size: 13px;
  color: var(--faint);
  font-family: var(--mono);
  letter-spacing: 0.02em;
}

.legal-page-intro {
  margin: 0 0 40px;
  font-size: 16px;
  color: var(--muted);
  line-height: 1.6;
}

.legal-section {
  margin-bottom: 40px;
}

.legal-section h2 {
  margin: 0 0 16px;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  font-family: var(--mono);
}

.legal-section p,
.legal-page-intro,
.legal-owner {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.65;
  margin: 0 0 16px;
}

.legal-section strong,
.legal-owner strong {
  color: var(--text);
  font-weight: 600;
}

.legal-list {
  margin: 0 0 16px;
  padding-left: 20px;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.65;
}

.legal-list li {
  margin-bottom: 8px;
}

.legal-link {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-link:hover {
  color: var(--text);
}

.legal-owner {
  margin-top: 32px;
  padding-top: 24px;
}

.legal-page-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px;
  text-align: center;
}


.legal-page-footer p {
  margin: 0;
  font-size: 13px;
  color: var(--faint);
}

.legal-page-footer a {
  color: var(--muted);
  text-decoration: none;
}

.legal-page-footer a:hover {
  color: var(--text);
}

@media (max-width: 960px) {
  .legal-page {
    background-attachment: scroll;
  }

  .legal-page-inner {
    padding: 32px 20px 64px;
  }

  .legal-header {
    padding: 20px 20px 0;
  }
}

/* —— Mobile polish —— */


@media (max-width: 960px) {
  body {
    /* fixed bg + sticky layers → black flash artefacts on iOS */
    background-attachment: scroll;
    background-color: #121214;
    background-image: linear-gradient(180deg, #1c1c20 0%, #121214 100%);
    background-size: 100% 100%;
  }

  html {
    background-color: #121214;
  }

  /* iOS: a fixed, blended, SVG-filtered full-screen layer forces a whole-viewport
     recomposite on every scroll frame. Drop the live grain on mobile. */
  .noise-bg {
    display: none;
  }

  .story-right,
  .feature-text-stage,
  .feature-spacers,
  .feature-block {
    background: transparent !important;
  }

  .feature-panel {
    background: transparent !important;
    /* keep centering transform only */
    transform: translateY(-50%);
  }

  .close-icon-stage {
    touch-action: none;
  }

  .feature-panel h1 {
    font-size: clamp(26px, 7vw, 34px);
  }

  .feature-panel h2 {
    font-size: clamp(18px, 5vw, 24px);
  }

  .feature-panel .lede {
    font-size: clamp(15px, 3.8vw, 17px);
  }

  .feature-panel .body {
    font-size: 14px;
    max-width: 34ch;
  }

  .site-footer {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

/* —— Desktop: side-by-side sticky phone + full-viewport text stage —— */

@media (min-width: 961px) {
  :root {
    --mobile-phone-h: var(--phone-h);
    --mobile-phone-stack: 0px;
    --mobile-text-h: 100dvh;
  }

  body {
    background-attachment: fixed;
    background-image: linear-gradient(180deg, #1c1c20 0%, #121214 50%, #0a0a0c 100%);
  }

  /* Uniform noise (same strength top → bottom; soft-light avoids black “void” mid-page) */
  .noise-bg {
    z-index: 50;
    opacity: 0.14;
    mix-blend-mode: soft-light;
  }

  .story {
    display: grid;
    flex-direction: unset;
    grid-template-columns: minmax(0, 1fr) minmax(440px, 480px);
    column-gap: 32px;
    padding: 0 24px 0;
    padding-right: 24px;
    align-items: stretch;
  }

  .story-left {
    order: unset;
    grid-column: 1;
    grid-row: 1;
    --stage-h: 100dvh;
  }

  .story-right {
    order: unset;
    position: relative;
    grid-column: 2;
    grid-row: 1;
    top: auto;
    z-index: auto;
    align-self: stretch;
    padding: var(--phone-sticky-top) 28px 48px 8px;
    background: transparent;
    display: block;
  }

  .sticky-visual {
    position: sticky;
    top: var(--phone-sticky-top);
    width: 100%;
    height: var(--phone-h);
    min-height: var(--phone-h);
    align-items: center;
  }

  .phone-frame {
    width: var(--phone-w);
    height: var(--phone-h);
    max-height: none;
    max-width: none;
    margin: 0;
    pointer-events: auto;
    filter: drop-shadow(0 22px 40px rgba(0, 0, 0, 0.55));
  }

  .close-icon-large {
    width: min(400px, 88%);
  }

  .feature-text-stage {
    top: 0;
    height: var(--stage-h);
  }

  .feature-spacers {
    margin-top: calc(-1 * var(--stage-h));
    padding-bottom: 0;
  }

  .feature-block {
    /* One scroll flick per section (was 100dvh ≈ two flicks) */
    min-height: 55dvh;
  }

  .feature-block.feature-close {
    /* Exactly one desktop viewport — last frame includes footer */
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    position: relative;
  }

  .site-footer {
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0;
  }

  .story.is-close .site-footer {
    /* Full-bleed under both text + phone columns */
    padding-left: 24px;
    padding-right: 24px;
    padding-bottom: 0;
  }

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

  .section-rail {
    left: 18px;
    right: auto;
    top: 50%;
    align-items: flex-start;
    gap: 12px;
  }

  .section-rail-item {
    flex-direction: row;
    padding: 0;
    min-width: 0;
    gap: 10px;
  }

  .section-rail-line {
    width: 14px;
    height: 1px;
  }

  .section-rail-item.is-active .section-rail-line {
    width: 28px;
  }

  .feature-panel {
    padding: 0;
  }

  .feature-panel h1 {
    font-size: clamp(48px, 8vw, 72px);
  }

  .feature-panel h2 {
    font-size: clamp(28px, 4.2vw, 40px);
  }
}

@media (min-width: 1200px) {
  .story {
    padding-left: 48px;
  }
}

@media (max-width: 480px) {
  :root {
    --mobile-phone-h: min(440px, 62svh);
  }

  .story {
    padding: 0 14px 0;
    padding-right: 26px;
  }

  .phone-frame {
    max-width: 82vw;
  }

  .close-icon-large {
    width: min(260px, 86%);
  }

  .lightbox-panel {
    padding: 24px 20px 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .screen {
    transition: none;
  }

  .brand-icon {
    transition: none;
  }

  .feature-panel {
    transition: none;
  }
}

/* ---- Hero TestFlight signup (button ⇄ email field) ---- */
.cta-btn.cta-btn-action {
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.cta-btn.cta-btn-action:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
}

.cta-signup {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 28px;
  padding: 6px 6px 6px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  max-width: 100%;
}

.cta-signup-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 190px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-family: var(--sans);
  /* 16px minimum — anything smaller makes iOS Safari zoom on focus */
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.cta-signup-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
  font-weight: 500;
}

.cta-signup-go {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background 160ms ease;
}

.cta-signup-go:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
}

.cta-signup-go:disabled {
  opacity: 0.5;
  cursor: default;
}

.cta-signup-note {
  margin-top: 10px;
  font-family: var(--sans);
  font-size: 12.5px;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.55);
}

.cta-signup-note.is-error {
  color: #ff7b7b;
}

/* ---- Mobile signup modal (keyboard-safe, no iOS zoom) ---- */
.cta-signup-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.cta-signup-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 6, 8, 0.82);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 0;
  padding: 0;
  margin: 0;
}

.cta-signup-modal-card {
  position: relative;
  width: min(420px, calc(100vw - 32px));
  margin-top: var(--cta-modal-top, 22vh);
  padding: 22px 20px 24px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #17171b;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.cta-signup-modal-title {
  margin: 0 0 4px;
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.cta-signup-modal-sub {
  margin: 0 0 16px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
}

.cta-signup-modal-card .cta-signup {
  margin-top: 0;
  display: flex;
  width: 100%;
}

.cta-signup-modal-card .cta-signup-input {
  width: auto;
}

.cta-signup-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

/* —— Support form —— */

.support-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 8px;
}

.support-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.support-label {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  font-family: var(--mono);
}

.support-input {
  width: 100%;
  /* 16px keeps iOS Safari from zooming on focus */
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.support-input::placeholder {
  color: var(--faint);
}

.support-input:focus {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.06);
}

.support-textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.55;
}

.support-file {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.support-file-input {
  display: none;
}

.support-file-btn {
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.support-file-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.28);
}

.support-file-name {
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 260px;
}

.support-file-clear {
  font: inherit;
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 4px;
}

.support-file-clear:hover {
  color: var(--text);
}

.support-error {
  margin: 0;
  font-size: 14px;
  color: #ff8a8a;
}

.support-submit {
  align-self: flex-start;
  font: inherit;
  font-size: 15px;
  color: #0a0a0c;
  background: var(--text);
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  cursor: pointer;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.support-submit:hover {
  opacity: 0.88;
}

.support-submit:disabled {
  opacity: 0.55;
  cursor: default;
}

.support-done {
  margin-top: 8px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.support-done-title {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--text);
}

.support-done-body {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
}

/* ---- Official App Store badge ---- */
.appstore-badge {
  display: inline-block;
  margin-top: 28px;
  padding-top: 20px;
  line-height: 0;
  border-radius: 10px;
  transition: opacity 160ms ease;
}

.appstore-badge img {
  display: block;
  width: 168px;
  height: auto;
}

.appstore-badge:hover {
  opacity: 0.88;
}

.appstore-badge:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 4px;
}

@media (max-width: 960px) {
  .appstore-badge img {
    width: 150px;
  }
}
