/* Scylla — site-only rules: anchors, mobile menu, buy bar, and the tablet / phone layouts from the LandingMobile design. Hand-written; build.py doesn't touch it. */

html { scroll-behavior: smooth; }
body { overflow-x: clip; }
section, #results { scroll-margin-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* hamburger, hidden on desktop */
.burger { display: none; width: 44px; height: 44px; margin-right: -10px; place-content: center; gap: 6px; background: none; border: 0; cursor: pointer; }
.burger span { display: block; width: 20px; height: 1.5px; background: var(--ink); transition: transform .2s; }
.burger[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }

/* full-screen menu overlay */
.mnav { position: fixed; inset: 68px 0 0; z-index: 20; display: none; flex-direction: column; padding: var(--space-4); background: color-mix(in srgb, var(--ground) 90%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.mnav.is-open { display: flex; }
.mnav > a { display: flex; justify-content: space-between; align-items: center; height: 64px; border-bottom: 1px solid var(--line); font: 600 24px/1 var(--font-display); color: var(--ink); text-decoration: none; }
.mnav > a span { font: 500 12px/1 var(--font-mono); color: var(--ink-muted); }
.mnav-foot { margin-top: auto; display: grid; gap: var(--space-2); padding-bottom: var(--space-6); }
.mnav-foot .sc-btn { height: 48px; }
.mnav-social { justify-content: center; padding-top: var(--space-2); }

/* sticky buy bar, phones only */
.buybar { display: none; }

/* touch targets: the "?" info buttons keep their 16px look but take a 28px (phones: 44px) tap area and open on tap;
   the risk checkbox is 20px */
.sc-info::before { content: ""; position: absolute; inset: -6px; }
.sc-info.is-open { color: var(--ink); border-color: var(--ink-muted); }
.sc-info.is-open::after { display: block; }
@media (pointer: coarse) { .sc-info::before { inset: -14px; } }
.check input { flex: none; width: 20px; height: 20px; margin-top: -1px; }

/* wide tables scroll sideways instead of squeezing */
.heat-wrap, .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- tablet ---------- */
@media (max-width: 1024px) {
  .in { padding: 0 var(--space-6); }
  .hero { grid-template-columns: 1fr; padding: var(--space-12) 0 var(--space-8); }
  .hero > div:last-child { display: none; }
  .app-body { grid-template-columns: 1fr; }
  .app-main { border-right: 0; border-bottom: 1px solid var(--line); }
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .ann { display: none; }
  .res { grid-template-columns: minmax(0, 1fr); }
  .how, .quotes, .trades { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .heads { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .heads > div { border-left: 0 !important; border-top: 1px solid var(--line); }
  .heads > div:nth-child(2n) { border-left: 1px solid var(--line) !important; }
  .heads > div:nth-child(-n+2) { border-top: 0; }
  .buy { grid-template-columns: minmax(0, 1fr); }
  .faq { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
  .panel, .panel > * { min-width: 0; }
  .sc-field { grid-template-columns: minmax(0, 1fr); }
  .sc-copy { min-width: 0; }
  .sc-heat { min-width: 760px; }
  .sc-lb-card { grid-template-columns: 1fr; }
  .sc-lb-side { border-left: 0; border-top: 1px solid var(--line); }
  .sc-lb-media { min-height: 320px; }
}

/* ---------- phone ---------- */
@media (max-width: 720px) {
  body { padding-bottom: 84px; }
  .in { padding: 0 var(--space-4); }
  nav .in { height: 60px; }
  .mnav { inset: 61px 0 0; }
  .links, .nav-r .sc-btn--ghost, .nav-r .nav-buy { display: none; }
  .burger { display: grid; }
  section { padding: var(--space-12) 0; }
  h1 { font-size: 42px; line-height: 44px; }
  h2 { font-size: 30px; line-height: 34px; }
  .sec-head { flex-direction: column; align-items: flex-start; gap: var(--space-3); margin-bottom: var(--space-6); }
  .lead { font-size: 16px; line-height: 24px; }
  .ctas { flex-direction: column; }
  .ctas .sc-btn { width: 100%; height: 48px; }
  .trust { flex-direction: column; gap: var(--space-2); }
  .live { font-size: 11px; }

  .app-bar { gap: var(--space-4); }
  .app-tabs span { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpis > div:last-child { grid-column: 1 / -1; }
  .works { flex-wrap: wrap; gap: var(--space-3) var(--space-6); font-size: 13px; }
  .works .sc-micro { width: 100%; text-align: center; }

  .eq svg { height: 160px; }
  .kstats { grid-template-columns: 1fr; }
  .blk-head { flex-direction: column; align-items: flex-start; gap: var(--space-3); }
  .filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: var(--space-1); }
  .filters .sc-chips { flex-wrap: nowrap; }
  .filters .sc-chip { flex: none; }
  .fdiv { flex: none; }
  .app-chart-head .sc-micro:last-child { display: none; }

  /* trade history: each row becomes a two-line card (pair · side · result / time · view) */
  .sc-table thead { display: none; }
  .sc-table tr { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "pair side res" "date date date"; gap: 6px var(--space-3); align-items: center; padding: var(--space-3) 0; border-top: 1px solid var(--line); }
  .sc-table tbody tr:first-child { border-top: 0; }
  .sc-table td, .sc-table td:last-child { padding: 0; border: 0; text-align: left; }
  .sc-table tbody tr:hover td { background: none; }
  .sc-table td:nth-child(1) { grid-area: date; font-size: 11px; line-height: 15px; color: var(--ink-muted); white-space: nowrap; }
  .sc-table td:nth-child(2) { grid-area: pair; font-weight: 500; }
  .sc-table td:nth-child(3) { grid-area: side; }
  .sc-table td:nth-child(4), .sc-table td:nth-child(5), .sc-table td:nth-child(6) { display: none; }
  .sc-table td:nth-child(7) { grid-area: res; text-align: right; }
  .sc-table td[colspan] { grid-column: 1 / -1; grid-row: 1; text-align: center; }
  .hist-foot { flex-direction: column; align-items: flex-start; gap: var(--space-3); }

  .how, .quotes, .trades, .heads { grid-template-columns: minmax(0, 1fr); }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .heads > div, .heads > div:nth-child(2n) { border-left: 0 !important; border-top: 1px solid var(--line); }
  .heads > div:first-child { border-top: 0; }

  /* the two plans stack, recommended plan first */
  .plans { display: flex; flex-direction: column; gap: var(--space-3); }
  .plans .sc-card--featured { order: -1; }

  .grid2 { grid-template-columns: 1fr; }
  .sc-input, .sc-select { height: 48px; font-size: 16px; }
  .sc-input--mono { font-size: 16px; } /* 16px or more: iOS Safari doesn't zoom the page when the field is tapped */
  .sc-btn { min-height: 44px; }
  .sc-segment { max-width: 100%; overflow-x: auto; }
  .sc-segment button { height: 44px; padding: 0 var(--space-6); }
  .sc-chip { height: 44px; }

  .final { flex-direction: column; align-items: flex-start; padding: var(--space-6); }
  .foot { flex-direction: column; }
  .foot-links { flex-wrap: wrap; gap: var(--space-3) var(--space-6); }
  .foot-r { justify-items: start; }
  .sc-social a { width: 44px; height: 44px; }

  .buybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 88%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-top: 1px solid var(--line); transform: translateY(110%); transition: transform .3s cubic-bezier(.2, .7, .2, 1); }
  .buybar.is-on { transform: none; }
  .buybar small { display: block; font: 500 11px/14px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
  .buybar strong { font: 500 17px/22px var(--font-mono); }
  .buybar .sc-btn { height: 44px; }
}
