/* CompliPass — cream background, red accent, hard-edged editorial style. System fonts only. */

:root {
  --bg: #f4f1ea;
  --surface: #fbfaf6;
  --panel: #efebe2;
  --ink: #121826;
  --muted: #4b5260;
  --rule: #c8c1b2;

  /* Red: --accent for large text and fills (white on it = 4.8:1),
     --accent-text for small text on cream (5.7:1). */
  --accent: #dc2626;
  --accent-hover: #c21f1f;
  --accent-text: #b91c1c;
  --accent-tint: #f9dcd6;
  --accent-soft: #fdecea;

  --pass: #15803d;
  --pass-bg: #e3f3e8;
  --fail: #b91c1c;
  --fail-bg: #fbe3e0;

  --border: 1.5px solid var(--ink);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang TC", "Noto Sans TC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --gutter: 40px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2 { font-weight: 900; text-transform: uppercase; margin: 0; }
h1 { font-size: clamp(3.4rem, 9.4vw, 8.4rem); line-height: 0.86; letter-spacing: -0.05em; }
h2 { font-size: clamp(2.5rem, 5.4vw, 4.6rem); line-height: 0.92; letter-spacing: -0.045em; }
h3 { font-size: 1.12rem; font-weight: 800; line-height: 1.3; letter-spacing: -0.01em; margin: 0 0 0.5em; }
p { margin: 0 0 1em; }
a { color: var(--accent-text); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
code { font-family: var(--mono); font-size: 0.86em; background: var(--panel); padding: 1px 6px; border: 1px solid var(--rule); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 30; }
.skip:focus { left: 12px; top: 12px; color: #fff; }

.container { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
.red { color: var(--accent); }

/* Mono label: "01 / THE PROBLEM" */
.label {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 0.74rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink); margin: 0 0 18px;
}
.label-tight { margin: 0; font-size: 0.68rem; color: var(--muted); }
.label-light { color: #fff; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }

/* ---------- Top stripe + header ---------- */
.stripe { display: flex; height: 5px; }
.stripe i { display: block; height: 100%; }
.stripe i:nth-child(1) { flex: 28; background: var(--accent); }
.stripe i:nth-child(2) { flex: 12; background: #f87171; }
.stripe i:nth-child(3) { flex: 12; background: #fecaca; }
.stripe i:nth-child(4) { flex: 48; background: var(--ink); }

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(244, 241, 234, 0.94);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.header-row { display: flex; align-items: center; gap: 32px; height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 40px; height: 40px; }
.brand-mark rect { fill: var(--accent); }
.brand-mark circle { fill: none; stroke: #fff; stroke-width: 1.6; }
.brand-mark .needle-n { fill: #fff; }
.brand-mark .needle-s { fill: #fff; opacity: 0.5; }
.brand-mark .pivot { fill: var(--accent); stroke: #fff; stroke-width: 1; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text b { font-size: 1.15rem; font-weight: 900; text-transform: uppercase; letter-spacing: -0.02em; }
.brand-text small { font-family: var(--mono); font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); margin-top: 5px; }
.nav { display: flex; gap: 30px; margin: 0 auto; }
.nav a { font-family: var(--mono); font-size: 0.74rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 18px;
  background: var(--accent); color: #fff;
  border: var(--border);
  padding: 17px 22px;
  font-family: var(--mono); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
  text-decoration: none; line-height: 1.2;
  box-shadow: 5px 5px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:hover { color: #fff; background: var(--accent-hover); transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
.btn-dark { background: var(--ink); }
.btn-dark:hover { background: #24304a; }
.btn-small { padding: 12px 16px; font-size: 0.72rem; box-shadow: 3px 3px 0 var(--accent); }
.btn-small:hover { box-shadow: 5px 5px 0 var(--accent); }
.btn-light { background: var(--surface); color: var(--ink); }
.btn-light:hover { background: #fff; color: var(--ink); }
.btn-tile {
  display: inline-flex; align-items: center; gap: 14px;
  background: var(--accent-tint); color: var(--ink);
  padding: 12px 16px; min-height: 56px;
  font-weight: 700; font-size: 0.92rem; text-decoration: none;
  border: 1px solid transparent;
  transition: border-color 0.12s ease;
}
.btn-tile:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 96px; overflow-x: clip; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 56px; align-items: end; }
.hero-copy { min-width: 0; }
.hero h1 { margin: 6px 0 34px; }
.hero h1 span { display: block; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 32em; }
.cta-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px; margin: 32px 0 44px; }
.stats { list-style: none; padding: 28px 0 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; border-top: 1px solid var(--rule); max-width: 620px; }
.stats strong { display: block; font-size: 2.7rem; font-weight: 900; letter-spacing: -0.04em; line-height: 1; color: var(--accent); }
.stats span { display: block; margin-top: 8px; font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink); }

/* Code card */
.hero-visual { position: relative; min-width: 0; padding: 26px 0 30px; }
.diff-card {
  margin: 0; min-width: 0;
  background: var(--surface); border: var(--border);
  box-shadow: 12px 12px 0 var(--ink);
}
.diff-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 14px 18px; background: var(--panel); border-bottom: var(--border); }
.diff-title { font-weight: 800; font-size: 0.95rem; }
.diff-file { margin: 0; padding: 10px 18px; font-family: var(--mono); font-size: 0.76rem; color: var(--muted); border-bottom: 1px solid var(--rule); }
.diff { margin: 0; padding: 14px 0; overflow-x: auto; font-family: var(--mono); font-size: 0.8rem; line-height: 1.85; }
.diff code { background: none; padding: 0; border: 0; font-size: inherit; }
.diff span { display: block; padding: 0 18px; white-space: pre; }
.diff .ctx { color: #6b6f78; }
.diff .add { color: #166534; background: var(--pass-bg); }
.diff .del { color: var(--fail); background: var(--fail-bg); }
.diff-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 18px; border-top: var(--border); font-size: 0.85rem; }
.status { font-family: var(--mono); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.status .fail { color: var(--fail); text-decoration: line-through; }
.status .pass { color: var(--pass); font-weight: 700; }

.tag-float {
  position: absolute; z-index: 2;
  background: var(--surface); border: var(--border);
  padding: 8px 12px;
  font-family: var(--mono); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--pass); white-space: nowrap;
  box-shadow: 4px 4px 0 var(--accent);
  --r: 0deg; transform: rotate(var(--r));
  animation: bob 5s ease-in-out infinite;
}
.f1 { top: 0; right: 28px; --r: 2deg; }
.f2 { bottom: 0; left: -18px; --r: -2deg; animation-delay: -2.5s; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(var(--r)); } 50% { transform: translateY(-6px) rotate(var(--r)); } }

/* ---------- Ticker ---------- */
.ticker { background: var(--ink); color: var(--bg); overflow: hidden; border-block: var(--border); }
.ticker-track { display: flex; width: max-content; animation: ticker 42s linear infinite; }
.ticker span {
  display: inline-flex; align-items: center; gap: 28px; padding: 16px 0 16px 28px;
  font-family: var(--mono); font-size: 0.76rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.16em; white-space: nowrap;
}
.ticker span::after { content: "✦"; color: #f87171; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { padding: 104px 0; border-top: 1px solid var(--rule); }
.ticker + .section { border-top: 0; }
.sec-head { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px 56px; align-items: end; margin-bottom: 48px; }
.sec-lede { color: var(--muted); font-size: 1.08rem; max-width: 30em; margin: 0; }

/* Bordered cell grid */
.grid { list-style: none; padding: 0; margin: 0; display: grid; border-top: var(--border); border-left: var(--border); background: var(--surface); }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.cell { position: relative; padding: 30px 28px 32px; border-right: var(--border); border-bottom: var(--border); display: flex; flex-direction: column; transition: background 0.15s ease; }
.cell:hover { background: #fff; }
.cell > p { color: var(--muted); }
.cell > p:last-child { margin-bottom: 0; }
.cell-num { font-size: 1.7rem; font-weight: 900; letter-spacing: -0.03em; line-height: 1; color: var(--accent) !important; margin-bottom: 22px !important; }
.cell-num span { font-family: var(--mono); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink); margin-left: 8px; vertical-align: middle; }
.cell-num.cross { font-size: 1.5rem; }

.checks { list-style: none; padding: 0; margin: 0 0 24px; }
.checks li { position: relative; padding-left: 28px; margin-bottom: 10px; font-size: 0.96rem; }
.checks li::before { content: ""; position: absolute; left: 0; top: 0.28em; width: 16px; height: 16px; border: var(--border); background: var(--surface); }
.checks li::after { content: ""; position: absolute; left: 5.5px; top: calc(0.28em + 2.5px); width: 4px; height: 8px; border: solid var(--accent); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.phase-meta {
  margin: auto 0 0 !important; padding-top: 16px; border-top: 1px dashed var(--rule);
  font-family: var(--mono); font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink) !important;
}

.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: auto !important; }
.chip { display: inline-block; font-family: var(--mono); font-size: 0.74rem; font-weight: 700; color: var(--accent-text); background: var(--accent-soft); border: 1px solid #f1b5ad; padding: 3px 8px; }
.chip-note { font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 72px; align-items: start; }
.about-grid h2 { margin-bottom: 28px; }
.about-grid p { color: var(--muted); }
.profile { background: var(--surface); border: var(--border); box-shadow: 10px 10px 0 var(--accent); margin-top: 40px; }
.profile-head { display: flex; align-items: center; gap: 16px; padding: 22px 24px; border-bottom: var(--border); background: var(--panel); }
.profile-head b { display: block; font-size: 1.15rem; font-weight: 900; text-transform: uppercase; letter-spacing: -0.01em; margin-bottom: 4px; }
.avatar { flex: none; display: grid; place-items: center; width: 60px; height: 60px; background: var(--accent); color: #fff; border: var(--border); font-weight: 900; font-size: 1.3rem; letter-spacing: -0.02em; }
.facts { list-style: none; padding: 0; margin: 0; }
.facts li { padding: 18px 24px; border-bottom: 1px solid var(--rule); }
.facts li:last-child { border-bottom: 0; }
.facts .label { display: flex; margin-bottom: 6px; }

/* ---------- FAQ ---------- */
.faq { max-width: 880px; border-top: var(--border); }
details { border-bottom: 1px solid var(--rule); }
summary { cursor: pointer; list-style: none; padding: 22px 56px 22px 0; font-weight: 800; font-size: 1.1rem; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; display: grid; place-items: center;
  border: var(--border); background: var(--surface);
  font-family: var(--mono); font-size: 1.05rem; font-weight: 700;
}
details[open] summary::after { content: "−"; background: var(--accent); color: #fff; }
details p { color: var(--muted); padding-right: 56px; }

/* ---------- CTA block ---------- */
.cta-block { background: var(--accent); color: #fff; border: var(--border); box-shadow: 14px 14px 0 var(--ink); padding: 80px 64px; }
.cta-block h2 { color: #fff; max-width: 12em; margin-bottom: 26px; }
.cta-block p { color: #fff; font-size: 1.15rem; max-width: 34em; }
.cta-block .btn { margin: 14px 0 22px; }
.cta-block a:not(.btn) { color: #fff; }
.small { font-size: 0.92rem !important; }

/* ---------- Footer ---------- */
.site-footer { border-top: var(--border); padding: 26px 0; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.footer-row p { margin: 0; }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tag-float, .ticker-track { animation: none; }
  .btn:hover, .btn:active { transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
  .hero-grid, .about-grid, .sec-head { grid-template-columns: 1fr; }
  .hero-grid { gap: 40px; }
  .grid.three { grid-template-columns: repeat(2, 1fr); }
  .phases.grid.three { grid-template-columns: 1fr; }
  .profile { margin-top: 0; }
  .f2 { left: 0; }
}

@media (max-width: 720px) {
  :root { --gutter: 16px; }
  body { font-size: 16px; }
  .header-row { height: 64px; gap: 12px; justify-content: space-between; }
  .nav { display: none; }
  .brand-mark { width: 34px; height: 34px; }
  .hero { padding: 44px 0 64px; }
  .cta-row .btn { width: 100%; }
  .btn-tile { flex: 1 1 140px; }
  .stats { gap: 14px; }
  .stats strong { font-size: 2.1rem; }
  .stats span { font-size: 0.62rem; letter-spacing: 0.08em; }
  .diff-card { box-shadow: 7px 7px 0 var(--ink); }
  .f1 { right: 8px; }
  .f2 { left: 8px; }
  .section { padding: 64px 0; }
  .grid.three { grid-template-columns: 1fr; }
  .cell { padding: 26px 20px; }
  .profile { box-shadow: 7px 7px 0 var(--accent); }
  .cta-block { padding: 52px 22px; box-shadow: 8px 8px 0 var(--ink); }
  .cta-block .btn { width: 100%; }
}
