/* AccessCheck: optician's eye chart meets clinical report.
   Type: Atkinson Hyperlegible (Braille Institute). Colour: ink, cobalt, high-visibility yellow. */
:root {
  --paper: #FFFFFF;
  --wash: #EEF1FB;
  --ink: #0F1B3D;
  --text: #24304F;
  --muted: #4A5470;
  --rule: #D5DBEC;
  --cobalt: #2442D6;
  --cobalt-deep: #1A2FA3;
  --signal: #FFD100;
  --critical: #C0262D; --serious: #B4530A; --moderate: #3B5BDB; --minor: #5F6B85;
  --good: #11753F; --warn: #B4530A; --bad: #C0262D;
  --sans: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "Atkinson Hyperlegible Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 400 1.0625rem/1.6 var(--sans); color: var(--text); background: var(--paper); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { color: var(--ink); line-height: 1.15; margin: 0 0 .5em; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.125rem; }
p { margin: 0 0 1em; }
a { color: var(--cobalt); text-underline-offset: .18em; }
a:hover { color: var(--cobalt-deep); }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; box-shadow: 0 0 0 6px var(--ink); border-radius: 4px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 720px; }
.center { text-align: center; }
.pad { padding-top: 56px; padding-bottom: 56px; }
.muted { color: var(--muted); }
.small, .fine { font-size: .9rem; }
.fine { color: var(--muted); }
.opt { font-weight: 400; color: var(--muted); }
.inline { display: inline; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 10px; background: var(--signal); color: var(--ink); font-weight: 800; padding: 10px 14px; border-radius: 6px; z-index: 20; }
.skip:focus { left: 10px; }

/* ---- Header & footer ---- */
.top { border-bottom: 1px solid var(--rule); background: var(--paper); }
.top-inner { display: flex; justify-content: space-between; align-items: center; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; color: var(--ink); text-decoration: none; }
.brand-mark { width: 30px; height: 30px; color: var(--ink); }
.nav-link { font-weight: 600; color: var(--ink); text-decoration: none; padding: 8px 2px; border-bottom: 2px solid transparent; }
.nav-link:hover { border-bottom-color: var(--signal); color: var(--ink); }
.foot { margin-top: 96px; background: var(--ink); color: #C9D0E6; font-size: .9rem; }
.foot-inner { padding-top: 36px; padding-bottom: 36px; max-width: 1120px; }
.foot p { max-width: 70ch; }
.foot a { color: #fff; }

/* ---- Buttons & fields ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 800 1rem/1 var(--sans); padding: 15px 22px; border-radius: 10px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); cursor: pointer; text-decoration: none; transition: transform .15s var(--ease), box-shadow .15s var(--ease), background-color .15s; }
.btn:hover { color: var(--ink); }
.btn.signal { background: var(--signal); box-shadow: 4px 4px 0 var(--ink); }
.btn.signal:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn.signal:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn.primary { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.btn.primary:hover { background: var(--cobalt-deep); color: #fff; }
.btn.big { padding: 19px 28px; font-size: 1.1rem; }
.btn.small { padding: 6px 12px; font-size: .875rem; font-weight: 600; border-width: 1px; border-radius: 6px; }
.btn[aria-disabled="true"] { cursor: progress; }
.field { display: flex; flex-direction: column; gap: 6px; }
label { font-weight: 600; font-size: .95rem; color: var(--ink); }
input[type=text], input[type=email], input[type=password], textarea { font: inherit; padding: 14px 15px; border: 2px solid #8C95B0; border-radius: 10px; width: 100%; background: var(--paper); color: var(--ink); transition: border-color .15s; }
input:hover, textarea:hover { border-color: var(--ink); }
input:focus-visible, textarea:focus-visible { border-color: var(--ink); border-radius: 10px; }
::placeholder { color: #737D97; }
.alert { background: #FDECEC; border: 2px solid var(--critical); color: #7A1419; padding: 13px 16px; border-radius: 10px; font-weight: 600; }
.alert.ok { background: #E7F5EC; border-color: var(--good); color: #0B4D29; }

/* ---- Home: eye-chart hero ---- */
.hero { padding: 64px 0 72px; background:
  radial-gradient(1200px 420px at 50% -120px, var(--wash), transparent 70%); }
.chart { position: relative; margin: 0 auto 36px; max-width: 980px; text-align: center; overflow: hidden; padding: 6px 0 10px; }
.chart-rows { display: block; }
.row { position: relative; display: block; font-weight: 800; line-height: 1; color: var(--ink); letter-spacing: .14em; margin-left: .14em; animation: focus-in 1s var(--ease) both; }
.row-text { display: inline-block; }
.r1 { font-size: clamp(4.4rem, 15vw, 10.5rem); animation-delay: .05s; }
.r2 { font-size: clamp(2.3rem, 8.4vw, 6rem); margin-top: .14em; animation-delay: .25s; }
.r3 { font-size: clamp(1.75rem, 5.6vw, 4rem); margin-top: .22em; animation-delay: .45s; }
.r4 { font-size: clamp(1.4rem, 4vw, 2.85rem); margin-top: .3em; animation-delay: .65s; }
.acuity { position: absolute; right: 0; top: 50%; transform: translateY(-50%); font: 400 .8rem/1 var(--mono); letter-spacing: 0; color: var(--muted); }
.r1 .acuity { font-size: .95rem; }
@keyframes focus-in {
  from { filter: blur(14px); opacity: .25; transform: scale(1.03); }
  60% { filter: blur(2px); opacity: 1; }
  to { filter: blur(0); opacity: 1; transform: none; }
}
.scanline { position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--signal); box-shadow: 0 0 24px 6px rgba(255, 209, 0, .55); opacity: 0; pointer-events: none; }
.is-scanning .row { animation: refocus 1.4s ease-in-out infinite alternate; }
.is-scanning .r2 { animation-delay: .15s; } .is-scanning .r3 { animation-delay: .3s; } .is-scanning .r4 { animation-delay: .45s; }
.is-scanning .scanline { opacity: 1; animation: sweep 1.6s ease-in-out infinite alternate; }
@keyframes refocus { from { filter: blur(0); } to { filter: blur(7px); opacity: .55; } }
@keyframes sweep { from { top: 0; } to { top: calc(100% - 6px); } }

.hero-lead { max-width: 44ch; margin: 0 auto 30px; text-align: center; font-size: clamp(1.1rem, 1.8vw, 1.3rem); color: var(--text); }
.hero .alert { max-width: 860px; margin: 0 auto 16px; }
.scan-form { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 14px; align-items: end; max-width: 900px; margin: 0 auto; padding: 22px; background: var(--paper); border: 2px solid var(--ink); border-radius: 18px; box-shadow: 8px 8px 0 var(--ink); }
.scan-status { grid-column: 1 / -1; margin: 0; min-height: 0; font-weight: 600; color: var(--ink); }
.scan-status:empty { display: none; }
.hero-note { text-align: center; color: var(--muted); font-size: .95rem; margin: 22px auto 0; }

.checks { display: grid; grid-template-columns: 1fr 1.6fr; gap: 56px; padding-top: 72px; align-items: start; }
.checks-intro p { color: var(--muted); max-width: 40ch; }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; border-top: 2px solid var(--ink); }
.check-list li { padding: 16px 18px 16px 0; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 2px; }
.check-list li:nth-child(odd) { padding-right: 24px; }
.check-list strong { color: var(--ink); font-weight: 800; }
.check-list span { color: var(--muted); font-size: .95rem; }

.ladder-wrap { padding-top: 88px; }
.ladder { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; align-items: end; }
.step { padding: 26px 26px 24px; border: 2px solid var(--ink); margin-left: -2px; background: var(--paper); }
.step:first-child { margin-left: 0; border-radius: 16px 0 0 16px; }
.step:last-child { border-radius: 0 16px 16px 0; }
.step h3 { margin-bottom: .2em; }
.step p { margin: 0; color: var(--muted); }
.step .step-price { font-size: 2rem; font-weight: 800; color: var(--ink); margin: 2px 0 10px; letter-spacing: -.02em; }
.s1 { min-height: 210px; }
.s2 { min-height: 260px; background: var(--wash); }
.s3 { min-height: 310px; background: var(--ink); color: #C9D0E6; border-color: var(--ink); }
.s3 h3, .s3 .step-price { color: #fff; }
.s3 p { color: #C9D0E6; }
.s3 .step-price { color: var(--signal); }

/* ---- Report ---- */
.report { padding-top: 48px; }
.report > .alert { margin-bottom: 24px; }
.summary { display: grid; grid-template-columns: auto 1fr; gap: 44px; align-items: center; padding: 36px; border: 2px solid var(--ink); border-radius: 20px; box-shadow: 8px 8px 0 var(--ink); }
.dial { position: relative; width: 210px; height: 210px; }
.dial svg { width: 100%; height: 100%; }
.dial circle { fill: none; stroke-width: 11; }
.dial-track { stroke: var(--wash); }
.dial-value { stroke-linecap: round; animation: dial-fill 1.4s var(--ease) .2s both; }
.dial.good .dial-value { stroke: var(--good); } .dial.warn .dial-value { stroke: var(--warn); } .dial.bad .dial-value { stroke: var(--bad); }
@keyframes dial-fill { from { stroke-dasharray: 0 400; } }
.dial-num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dial-num strong { font-size: 4.2rem; line-height: 1; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.dial-num span { font-size: .9rem; color: var(--muted); margin-top: 6px; }
.site { font-size: clamp(1.9rem, 4.4vw, 3.1rem); overflow-wrap: anywhere; margin-bottom: .3em; }
.verdict { font-size: 1.2rem; color: var(--ink); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.grade { display: inline-block; padding: 4px 12px; border-radius: 8px; font-weight: 800; color: #fff; font-size: 1rem; }
.grade.good { background: var(--good); } .grade.warn { background: var(--warn); } .grade.bad { background: var(--bad); }
.sevbar { display: flex; gap: 3px; height: 14px; margin: 6px 0 12px; }
.seg { flex-basis: 0; border-radius: 3px; transform-origin: left center; animation: grow .7s var(--ease) both; }
.seg.critical { background: var(--critical); } .seg.serious { background: var(--serious); } .seg.moderate { background: var(--moderate); } .seg.minor { background: var(--minor); }
@keyframes grow { from { transform: scaleX(0); } }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 20px; padding: 0; margin: 0 0 16px; font-size: .95rem; }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.legend strong { color: var(--ink); }
.legend .zero { color: var(--muted); }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend .critical .swatch { background: var(--critical); } .legend .serious .swatch { background: var(--serious); }
.legend .moderate .swatch { background: var(--moderate); } .legend .minor .swatch { background: var(--minor); }
.legend .zero .swatch { background: var(--rule); }
.scanned { color: var(--muted); font-size: .9rem; margin: 0; overflow-wrap: anywhere; }

.section-title { margin-top: 64px; }
.issues { list-style: none; margin: 18px 0 0; padding: 0; border-top: 2px solid var(--ink); }
.issue { position: relative; padding: 22px 0 22px 26px; border-bottom: 1px solid var(--rule); }
.issue::before { content: ""; position: absolute; left: 0; top: 24px; bottom: 24px; width: 5px; border-radius: 3px; background: var(--minor); }
.issue.critical::before { background: var(--critical); } .issue.serious::before { background: var(--serious); } .issue.moderate::before { background: var(--moderate); }
.issue-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 20px; flex-wrap: wrap; margin-bottom: 6px; }
.issue-head h3 { margin: 0; font-size: 1.2rem; }
.issue-meta { display: inline-flex; gap: 12px; align-items: center; white-space: nowrap; }
.sev { font-size: .85rem; font-weight: 800; padding: 2px 9px; border-radius: 6px; color: #fff; }
.sev.critical { background: var(--critical); } .sev.serious { background: var(--serious); } .sev.moderate { background: var(--moderate); } .sev.minor { background: var(--minor); }
.count { font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.why { max-width: 72ch; margin-bottom: 0; }
.fix { max-width: 72ch; margin: 12px 0 6px; padding: 12px 16px; background: var(--wash); border-radius: 10px; color: var(--ink); }
.wcag { font-size: .9rem; color: var(--muted); margin: 0; }
details { margin-top: 10px; }
summary { cursor: pointer; font-weight: 600; color: var(--cobalt); width: fit-content; }
details[open] summary { margin-bottom: 8px; }
.samples { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.samples li { display: grid; grid-template-columns: 72px 1fr; gap: 10px; align-items: baseline; }
.samples .line { font-size: .82rem; color: var(--muted); }
code { font: .85rem/1.55 var(--mono); background: #F3F5FB; border: 1px solid var(--rule); padding: 6px 9px; border-radius: 6px; overflow-wrap: anywhere; color: var(--ink); }

.locked { position: relative; margin-top: 0; }
.ghosts { padding-top: 6px; filter: blur(5px); opacity: .7; user-select: none; }
.ghost { padding: 22px 0 22px 26px; border-bottom: 1px solid var(--rule); display: grid; gap: 10px; }
.ghost span { display: block; height: 14px; border-radius: 7px; background: #CBD2E6; }
.ghost span:first-child { height: 18px; background: #9AA4C2; }
.unlock { position: relative; margin: -120px auto 0; max-width: 620px; text-align: center; padding: 30px 30px 26px; background: var(--paper); border: 2px solid var(--ink); border-radius: 18px; box-shadow: 8px 8px 0 var(--ink); }
.ghosts:empty + .unlock, .locked > .unlock:first-child { margin-top: 32px; }
.unlock h2 { margin-bottom: .35em; }
.unlock .btn { margin-top: 6px; }
.unlock .fine { margin: 14px 0 0; }

.fixbox { margin-top: 72px; display: grid; grid-template-columns: 1fr 1fr; gap: 44px; padding: 40px; background: var(--ink); border-radius: 20px; color: #C9D0E6; }
.fixbox h2 { color: #fff; }
.fixbox .fine { color: #AEB7D3; }
.fix-form { display: grid; gap: 14px; }
.fix-form label { color: #fff; }
.fix-form input, .fix-form textarea { border-color: var(--paper); }
.fix-form .btn.signal { box-shadow: 4px 4px 0 var(--cobalt); justify-self: start; }
.fix-form .btn.signal:hover { box-shadow: 5px 5px 0 var(--cobalt); }
.fixbox :focus-visible { box-shadow: 0 0 0 6px var(--cobalt); }

.manual { margin-top: 64px; max-width: 72ch; }
.manual ul { padding-left: 1.2em; margin: 0; }
.manual li { margin-bottom: 4px; }
.report-actions { margin-top: 40px; display: flex; gap: 24px; flex-wrap: wrap; font-weight: 600; }

/* ---- Admin & simple pages ---- */
.stack { display: grid; gap: 14px; max-width: 360px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.table-wrap { overflow-x: auto; border: 2px solid var(--ink); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { background: var(--wash); color: var(--ink); }
tr:last-child td { border-bottom: 0; }
.lead { font-size: 1.2rem; }

/* ---- Small screens ---- */
@media (max-width: 860px) {
  .scan-form { grid-template-columns: 1fr; box-shadow: 5px 5px 0 var(--ink); }
  .scan-form .btn { width: 100%; }
  .checks { grid-template-columns: 1fr; gap: 20px; }
  .ladder { grid-template-columns: 1fr; }
  .step, .step:first-child, .step:last-child { margin-left: 0; margin-top: -2px; border-radius: 0; min-height: 0; }
  .step:first-child { border-radius: 16px 16px 0 0; margin-top: 0; }
  .step:last-child { border-radius: 0 0 16px 16px; }
  .summary { grid-template-columns: 1fr; justify-items: start; padding: 24px; gap: 24px; box-shadow: 5px 5px 0 var(--ink); }
  .dial { width: 170px; height: 170px; }
  .dial-num strong { font-size: 3.4rem; }
  .fixbox { grid-template-columns: 1fr; padding: 28px; gap: 20px; }
  .unlock { box-shadow: 5px 5px 0 var(--ink); padding: 24px 20px; }
}
@media (max-width: 560px) {
  .check-list { grid-template-columns: 1fr; }
  .check-list li:nth-child(odd) { padding-right: 0; }
  .acuity { display: none; }
  .row { letter-spacing: .08em; margin-left: .08em; }
  .hero { padding-top: 40px; }
}

/* ---- Respect reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .is-scanning .scanline { opacity: 0; }
}

/* ---- Print ---- */
@media print {
  .top nav, .locked, .fix-form, .noprint, .skip, .foot a { display: none !important; }
  .summary, .unlock { box-shadow: none; }
  .fixbox { background: #fff; color: var(--text); border: 2px solid var(--ink); grid-template-columns: 1fr; }
  .fixbox h2 { color: var(--ink); }
  .foot { background: #fff; color: var(--muted); margin-top: 32px; }
  details > *:not(summary) { display: block; }
  * { animation: none !important; }
}

.fixbox .opt { color: #AEB7D3; }

.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
