/*
 * Quiet — a small, restrained design system shared by Mostafa Amer's project demos.
 *
 * Built from studying apple.com product/compare pages (near-black type on white, very large
 * tightly-tracked headlines, giant numerals as "hero data", hairline dividers, one blue accent,
 * pill buttons), Plausible (small-caps metric labels, ranked rows with a tinted bar behind them)
 * and Linear (two-tone headlines that continue in grey).
 *
 * Rules: one accent per page, no gradients or glows, no emoji, content is the hero.
 */

:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #86868b;
  --hair: #d2d2d7;
  --hair-soft: #e8e8ed;
  --accent: #0071e3;
  --accent-ink: #ffffff;
  --seg-on: #ffffff;
  --good: #248a3d;
  --bad: #d70015;
  --radius: 18px;
  --radius-sm: 10px;
  --max: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --bg-alt: #161617;
    --ink: #f5f5f7;
    --ink-2: #a1a1a6;
    --ink-3: #86868b;
    --hair: #38383a;
    --hair-soft: #2a2a2c;
    --accent: #2997ff;
    --seg-on: #48484a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* Global nav: thin, quiet, like apple.com */
.q-nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hair-soft); }
.q-nav .q-wrap { display: flex; align-items: center; justify-content: space-between; height: 48px; font-size: 13px; }
.q-nav .q-brand { color: var(--ink); font-weight: 600; letter-spacing: -0.01em; }
.q-nav .q-links { display: flex; gap: 22px; }
.q-nav .q-links a { color: var(--ink-2); }
.q-nav .q-links a:hover { color: var(--ink); text-decoration: none; }

/* Hero */
.q-hero { padding-top: 88px; padding-bottom: 40px; }
.q-eyebrow { font-size: 14px; font-weight: 600; color: var(--accent); letter-spacing: -0.01em; margin: 0 0 14px; }
.q-title { font-size: clamp(40px, 6vw, 64px); line-height: 1.04; font-weight: 600; letter-spacing: -0.035em; margin: 0; max-width: 19ch; }
.q-title .q-muted { color: var(--ink-3); }
.q-lede { font-size: 21px; line-height: 1.38; color: var(--ink-2); max-width: 40ch; margin: 22px 0 0; letter-spacing: -0.02em; }

/* Section rhythm */
.q-section { padding-top: 72px; padding-bottom: 72px; }
.q-section + .q-section { border-top: 1px solid var(--hair-soft); }
.q-h2 { font-size: 40px; line-height: 1.1; font-weight: 600; letter-spacing: -0.03em; margin: 0 0 28px; }
.q-h2 .q-muted { color: var(--ink-3); }
.q-h3 { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 6px; }
.q-small { font-size: 14px; color: var(--ink-2); letter-spacing: -0.01em; }
.q-caps { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-3); }

/* Hero data: giant numerals (apple.com compare "Summary") */
.q-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0; border-top: 1px solid var(--hair); }
.q-figure { padding: 28px 24px 8px 0; }
.q-figure .q-num { font-size: 56px; line-height: 1; font-weight: 600; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.q-figure .q-num small { font-size: 0.45em; letter-spacing: -0.02em; color: var(--ink-2); font-weight: 500; }
.q-figure .q-label { margin-top: 10px; font-size: 15px; color: var(--ink-2); line-height: 1.35; max-width: 24ch; }

/* Buttons and links */
.q-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 18px; border-radius: 980px; border: 0;
  background: var(--accent); color: var(--accent-ink); font: 500 15px/1 var(--font); letter-spacing: -0.01em; cursor: pointer; }
.q-btn:hover { filter: brightness(1.08); text-decoration: none; }
.q-btn:disabled { opacity: 0.4; cursor: default; }
.q-btn.q-ghost { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.q-more::after { content: " ›"; }

/* Segmented control (iOS/macOS) */
.q-seg { display: inline-flex; padding: 2px; background: var(--bg-alt); border-radius: 9px; gap: 2px; }
.q-seg button { border: 0; background: transparent; color: var(--ink); font: 500 13px/1 var(--font); padding: 7px 12px; border-radius: 7px; cursor: pointer; letter-spacing: -0.01em; }
.q-seg button[aria-pressed="true"] { background: var(--seg-on); box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.06); }

/* Slider */
.q-range { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 2px; background: var(--hair); outline: none; }
.q-range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25), 0 0 0 .5px rgba(0,0,0,.08); cursor: pointer; }
.q-range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 1px 4px rgba(0,0,0,.25); }

/* Switch */
.q-switch { position: relative; width: 44px; height: 26px; flex: none; }
.q-switch input { opacity: 0; width: 0; height: 0; }
.q-switch span { position: absolute; inset: 0; background: var(--hair); border-radius: 13px; transition: background .2s; cursor: pointer; }
.q-switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.q-switch input:checked + span { background: var(--good); }
.q-switch input:checked + span::after { transform: translateX(18px); }

/* Settings list (grouped rows, like System Settings) */
.q-list { border-radius: var(--radius); background: var(--bg-alt); padding: 4px 18px; }
.q-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; }
.q-row + .q-row { border-top: 1px solid var(--hair-soft); }
.q-row label { font-size: 15px; }
.q-row .q-val { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 15px; min-width: 3ch; text-align: right; }

/* Ranked rows with a tinted bar behind them (Plausible) */
.q-ranked { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.q-ranked th { text-align: left; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); padding: 0 0 10px; }
.q-ranked th:not(:first-child), .q-ranked td:not(:first-child) { text-align: right; width: 16%; }
.q-ranked td { padding: 4px 0; }
.q-ranked .q-bar { position: relative; padding: 7px 10px; border-radius: 6px; overflow: hidden; white-space: nowrap; }
.q-ranked .q-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 6px; opacity: .16; }
.q-ranked .q-bar b { position: relative; font-weight: 500; }

/* Plain table */
.q-table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.q-table th, .q-table td { padding: 12px 12px 12px 0; text-align: left; border-bottom: 1px solid var(--hair-soft); vertical-align: top; }
.q-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; }
.q-table td.num, .q-table th.num { text-align: right; }
.q-table tr.q-hl td { font-weight: 600; }

/* Steps (numbered, no cards) */
.q-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 36px; counter-reset: s; }
.q-step { counter-increment: s; }
.q-step::before { content: counter(s, decimal-leading-zero); display: block; font: 600 13px var(--mono); color: var(--ink-3); margin-bottom: 12px; }
.q-step p { margin: 0; color: var(--ink-2); font-size: 15px; }

.q-code { font-family: var(--mono); font-size: 13px; background: var(--bg-alt); border-radius: var(--radius-sm); padding: 16px 18px; overflow-x: auto; line-height: 1.55; letter-spacing: 0; }
.q-note { font-size: 13px; color: var(--ink-3); }

.q-foot { padding: 40px 0 60px; font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--hair-soft); }
.q-foot .q-wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

@media (max-width: 640px) {
  .q-hero { padding-top: 56px; padding-bottom: 24px; }
  .q-section { padding-top: 52px; padding-bottom: 52px; }
  .q-h2 { font-size: 30px; }
  .q-figure .q-num { font-size: 44px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
