/* Snorly — charcoal neumorphism + LED. Tokens mirror the iOS app (NeumorphicTile.swift, DesignTokens.swift). */
:root {
  color-scheme: dark;
  --bg: #1a1a1c;
  --surface: #1c1c1f;
  --surface-2: #202024;
  --line: rgba(255, 255, 255, 0.07);
  --text: rgba(255, 255, 255, 0.86);
  --text-2: rgba(255, 255, 255, 0.58);
  --text-3: rgba(255, 255, 255, 0.52);
  --led: #33e661;
  --led-soft: #7afe8d;
  --brand: #0aa34c;
  --quiet: #657bff;
  --light: #33e661;
  --moderate: #ffb000;
  --severe: #ff3a5e;
  --amber: #ffc857;
  --r-card: 16px;
  --r-btn: 12px;
  --r-chip: 20px;
  --hi: rgba(255, 255, 255, 0.14);
  --lo: rgba(0, 0, 0, 0.75);
  --convex: -2px -2px 3px var(--hi), 2px 2px 3px var(--lo);
  --convex-lg: -4px -4px 8px rgba(255, 255, 255, 0.1), 6px 6px 12px rgba(0, 0, 0, 0.6);
  --concave: inset 2px 2px 3px var(--lo), inset -2px -2px 3px var(--hi);
  --sans: "IBM Plex Sans", -apple-system, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --measure: 68ch;
  --gutter: clamp(16px, 4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--led-soft); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
.prose a:not(.btn):not(.card), .faq a, .legal a, .cta-card a:not(.btn) { text-decoration: underline; text-decoration-color: rgba(122, 254, 141, 0.45); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--led); outline-offset: 3px; border-radius: 4px; }
::selection { background: rgba(51, 230, 97, 0.3); }

h1, h2, h3, h4 { font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; color: #fff; margin: 0; }
h1 { font-size: clamp(2rem, 5.5vw, 3.25rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); margin-top: 2.2em; margin-bottom: 0.6em; }
h3 { font-size: 1.15rem; margin-top: 1.6em; margin-bottom: 0.4em; }
p { margin: 0 0 1.1em; }
strong { color: #fff; font-weight: 600; }
small, .small { font-size: 0.875rem; color: var(--text-2); }
hr { border: 0; height: 1px; background: var(--line); margin: 2.5rem 0; }
code, kbd { font-family: var(--mono); font-size: 0.9em; background: var(--surface-2); padding: 0.1em 0.4em; border-radius: 6px; }
blockquote { margin: 1.5em 0; padding: 0.2em 0 0.2em 1.2em; border-left: 3px solid var(--led); color: var(--text); font-style: italic; }
blockquote cite { display: block; margin-top: 0.4em; font-style: normal; font-family: var(--mono); font-size: 0.8rem; color: var(--text-2); }
ul, ol { padding-left: 1.3em; }
li { margin: 0.35em 0; }
li::marker { color: var(--led); font-family: var(--mono); }

/* Mono roles (app: value / caption / micro) */
.mono { font-family: var(--mono); }
.label { font-family: var(--mono); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-2); }
.label.led { color: var(--led); text-shadow: 0 0 8px rgba(51, 230, 97, 0.55); }
.led-text { color: var(--led); text-shadow: 0 0 10px rgba(51, 230, 97, 0.6); }
.led-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--led); box-shadow: 0 0 6px var(--led), 0 0 14px rgba(51, 230, 97, 0.5); vertical-align: middle; margin-right: 0.5em; }
.led-dot.red { background: var(--severe); box-shadow: 0 0 6px var(--severe), 0 0 14px rgba(255, 58, 94, 0.5); }

/* Surfaces */
.tile { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--convex); }
.tile-lg { background: var(--surface); border-radius: 24px; box-shadow: var(--convex-lg); }
.well { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--concave); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  min-height: 52px; padding: 0.7em 1.4em; border-radius: var(--r-btn);
  background: var(--surface); color: #fff; font: 600 1rem var(--sans);
  box-shadow: var(--convex); border: 0; cursor: pointer; white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { box-shadow: var(--concave); transform: scale(0.98); }
.btn-led { color: #0b1a0f; background: var(--led); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), 0 0 18px rgba(51, 230, 97, 0.45), var(--convex); }
.btn-led:hover { background: var(--led-soft); }
.btn .apple { width: 18px; height: 18px; fill: currentColor; }
.chip { display: inline-block; padding: 0.25em 0.8em; border-radius: var(--r-chip); background: var(--surface-2); font: 500 0.8rem var(--mono); color: var(--text-2); box-shadow: var(--concave); }

/* Layout */
.wrap { width: min(100% - 2 * var(--gutter), 1120px); margin-inline: auto; }
.prose { width: min(100% - 2 * var(--gutter), var(--measure)); margin-inline: auto; }
.prose > * + h2 { margin-top: 2.4em; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stack > * + * { margin-top: 1rem; }
.center { text-align: center; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(26, 26, 28, 0.85); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 1.15rem; color: #fff; letter-spacing: -0.01em; }
.logo:hover { text-decoration: none; }
.logo svg { width: 28px; height: 28px; }
.nav { display: flex; gap: 1.2rem; margin-left: auto; align-items: center; }
.nav a { color: var(--text-2); font-weight: 500; font-size: 0.95rem; }
.nav a[aria-current="page"], .nav a:hover { color: #fff; text-decoration: none; }
.nav .lang { font-family: var(--mono); font-size: 0.8rem; padding: 0.3em 0.7em; border-radius: 8px; box-shadow: var(--concave); color: var(--text-2); }
.nav .btn { min-height: 40px; padding: 0.4em 1em; font-size: 0.9rem; }
.nav .btn-led, .nav .btn-led:hover { color: #0b1a0f; }
@media (max-width: 720px) { .nav .hide-m { display: none; } .nav { gap: 0.8rem; } }

/* Hero */
.hero { padding: clamp(3rem, 9vw, 6.5rem) 0 clamp(2rem, 6vw, 4rem); position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: -20% -10% auto; height: 70%; background: radial-gradient(60% 50% at 50% 30%, rgba(51, 230, 97, 0.12), transparent 70%); pointer-events: none; }
.hero .wrap { display: grid; gap: 3rem; align-items: center; grid-template-columns: 1.1fr 0.9fr; position: relative; }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; } }
.hero h1 { margin: 0.6rem 0 1rem; }
.hero .lede { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--text-2); max-width: 34rem; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 1.6rem; align-items: center; }
.hero .meta { font-family: var(--mono); font-size: 0.8rem; color: var(--text-3); margin-top: 1rem; }
.phone { width: min(100%, 340px); margin-inline: auto; border-radius: 42px; padding: 10px; background: #0b0b0c; box-shadow: var(--convex-lg), 0 30px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05); }
.phone img { border-radius: 32px; }

/* Night board (LED dot-matrix timeline, pure CSS) */
.board { padding: 1.2rem; border-radius: var(--r-card); background: var(--surface); box-shadow: var(--convex); font-family: var(--mono); }
.board-head { display: flex; flex-wrap: wrap; gap: 0.2rem 1rem; justify-content: space-between; align-items: baseline; margin-bottom: 0.8rem; font-size: 0.95rem; }
.board-head b { color: #fff; font-weight: 600; }
.matrix { display: grid; grid-auto-flow: column; gap: 3px; align-items: end; height: 120px; padding: 6px; border-radius: 10px; background: #151517; box-shadow: var(--concave); }
.matrix i { display: block; width: 100%; border-radius: 2px; background: repeating-linear-gradient(to top, var(--c) 0 5px, transparent 5px 8px); height: calc(var(--h) * 1%); box-shadow: 0 0 6px color-mix(in srgb, var(--c) 60%, transparent); }
.matrix i.q { --c: var(--quiet); }
.matrix i.l { --c: var(--light); }
.matrix i.m { --c: var(--moderate); }
.matrix i.s { --c: var(--severe); }
.legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; margin-top: 0.8rem; font-size: 0.75rem; color: var(--text-2); }
.legend span::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; background: var(--c); box-shadow: 0 0 6px var(--c); vertical-align: middle; }
.legend .q { --c: var(--quiet); } .legend .l { --c: var(--light); } .legend .m { --c: var(--moderate); } .legend .s { --c: var(--severe); }
.axis { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-3); margin-top: 6px; }

/* Score ring */
.ring { --v: 92; width: 120px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; position: relative; font-family: var(--mono); background: conic-gradient(var(--led) 0 40%, var(--moderate) 40% 70%, var(--severe) 70% 100%); -webkit-mask: radial-gradient(circle, transparent 60%, #000 61%); mask: radial-gradient(circle, transparent 60%, #000 61%); }
.ring-wrap { position: relative; width: 120px; display: grid; place-items: center; }
.ring-wrap .v { position: absolute; font: 600 2rem/1 var(--mono); color: #fff; }
.ring-wrap .l { position: absolute; margin-top: 3.2rem; font: 600 0.6rem var(--mono); letter-spacing: 0.15em; color: var(--text-2); }

/* Clip rows */
.clip { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 0.8rem; padding: 0.7rem 0.9rem; border-radius: var(--r-card); background: var(--surface); box-shadow: var(--convex); font-family: var(--mono); }
.clip .play { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; box-shadow: var(--convex); color: #fff; background: var(--surface); }
.clip .play svg { width: 14px; height: 14px; fill: currentColor; margin-left: 2px; }
.clip b { font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clip time { color: var(--text-2); font-size: 0.85rem; }
.wave { grid-column: 2 / -1; height: 28px; border-radius: 14px; box-shadow: var(--concave); background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.25) 0 2px, transparent 2px 5px); -webkit-mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }

/* Seven-segment clock */
.clock { font-family: var(--mono); font-weight: 600; color: var(--led); text-shadow: 0 0 12px rgba(51, 230, 97, 0.8), 0 0 28px rgba(51, 230, 97, 0.35); letter-spacing: 0.08em; }

/* Feature cards */
.feature { padding: 1.4rem; border-radius: var(--r-card); background: var(--surface); box-shadow: var(--convex); }
.feature .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; box-shadow: var(--concave); margin-bottom: 1rem; color: var(--led); }
.feature .ico svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 6px rgba(51, 230, 97, 0.6)); }
.feature h3 { margin: 0 0 0.4rem; font-size: 1.1rem; }
.feature p { margin: 0; color: var(--text-2); font-size: 0.95rem; }

/* Section rhythm */
.section { padding: clamp(2.5rem, 7vw, 5rem) 0; }
.section-head { max-width: 40rem; margin-bottom: 2rem; }
.section-head p { color: var(--text-2); font-size: 1.05rem; }

/* Article */
.article-head { padding: clamp(2.5rem, 7vw, 4.5rem) 0 1.5rem; }
.article-head h1 { margin: 0.8rem 0 1rem; }
.byline { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; align-items: center; font-family: var(--mono); font-size: 0.8rem; color: var(--text-2); }
.byline a { color: var(--text); }
.byline .avatar { width: 28px; height: 28px; border-radius: 50%; box-shadow: var(--convex); }
.lead { font-size: 1.2rem; line-height: 1.55; color: var(--text); }
.cover { border-radius: var(--r-card); box-shadow: var(--convex-lg); margin: 1.5rem 0 2rem; }
.facts { padding: 1.2rem 1.4rem; border-radius: var(--r-card); background: var(--surface); box-shadow: var(--concave); margin: 1.6rem 0; }
.facts .label { margin-bottom: 0.6rem; display: block; }
.facts ul { margin: 0; padding-left: 1.2em; }
.facts li { margin: 0.45em 0; }
.tonight { padding: 1.3rem 1.4rem; border-radius: var(--r-card); background: var(--surface); box-shadow: var(--convex); border-left: 3px solid var(--led); margin: 2rem 0; }
.tonight .label { display: block; margin-bottom: 0.5rem; }
.tonight ol { margin: 0; }
.cta-card { display: grid; grid-template-columns: auto 1fr auto; gap: 1.2rem; align-items: center; padding: 1.3rem 1.4rem; border-radius: var(--r-card); background: var(--surface); box-shadow: var(--convex-lg); margin: 2.5rem 0; }
.cta-card img { width: 64px; height: 64px; border-radius: 16px; box-shadow: var(--convex); }
.cta-card p { margin: 0; color: var(--text-2); font-size: 0.95rem; }
.cta-card b { display: block; color: #fff; font-size: 1.05rem; }
@media (max-width: 600px) { .cta-card { grid-template-columns: auto 1fr; } .cta-card .btn { grid-column: 1 / -1; } }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; margin: 1.5rem 0; }
th, td { text-align: left; padding: 0.65em 0.8em; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); font-weight: 600; }
td:first-child { color: #fff; font-weight: 500; }
tr:hover td { background: rgba(255, 255, 255, 0.02); }
figure { margin: 2rem 0; }
figcaption { font-family: var(--mono); font-size: 0.78rem; color: var(--text-3); margin-top: 0.6rem; }
.sources { font-size: 0.85rem; color: var(--text-2); }
.sources li { margin: 0.5em 0; word-break: break-word; }
.faq h3 { font-size: 1.05rem; }
.related { margin-top: 3rem; }
.card-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.card-list li { margin: 0; }
.card { display: block; padding: 1.1rem 1.3rem; border-radius: var(--r-card); background: var(--surface); box-shadow: var(--convex); color: var(--text); }
.card:hover { text-decoration: none; box-shadow: var(--convex-lg); }
.card b { display: block; color: #fff; font-size: 1.05rem; margin-bottom: 0.25rem; }
.card span { color: var(--text-2); font-size: 0.9rem; }
.card time { display: block; margin-top: 0.5rem; font-family: var(--mono); font-size: 0.75rem; color: var(--text-3); }
.disclaimer { font-size: 0.8rem; color: var(--text-3); border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 2.5rem; }
.audio { margin: 1rem 0; }
audio { width: 100%; filter: invert(0.9) hue-rotate(180deg); border-radius: 12px; }

/* Comparison */
.vs-table td:first-child { white-space: nowrap; }
.yes { color: var(--led); } .no { color: var(--severe); } .part { color: var(--amber); }

/* Footer */
.site-footer { margin-top: 4rem; padding: 2.5rem 0 3rem; border-top: 1px solid var(--line); color: var(--text-2); font-size: 0.9rem; }
.site-footer .wrap { display: grid; gap: 2rem; grid-template-columns: 2fr 1fr 1fr; }
@media (max-width: 720px) { .site-footer .wrap { grid-template-columns: 1fr 1fr; } }
.site-footer .foot-h { font: 600 0.75rem var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); margin: 0 0 0.8rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 0.4em 0; }
.site-footer a { color: var(--text-2); }
.site-footer a:hover { color: #fff; }
.site-footer .legal { grid-column: 1 / -1; font-size: 0.78rem; color: var(--text-3); border-top: 1px solid var(--line); padding-top: 1.2rem; }

/* Motion */
@media (prefers-reduced-motion: no-preference) {
  .reveal { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .reveal:nth-child(2) { animation-delay: 0.08s; }
  .reveal:nth-child(3) { animation-delay: 0.16s; }
  .matrix i { animation: light 0.6s ease-out both; animation-delay: calc(var(--i, 0) * 25ms); }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  @keyframes light { from { height: 0; opacity: 0; } to { opacity: 1; } }
  .led-dot { animation: blink 2.4s ease-in-out infinite; }
  @keyframes blink { 50% { opacity: 0.45; } }
}
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: var(--led); color: #000; padding: 0.5em 1em; border-radius: 8px; z-index: 50; }
