/* Atalaya AI — shared styles v3 (night-sea theme). Tokens and rationale: products/site/DESIGN.md */
@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-var-latin.woff2") format("woff2-variations"), url("/fonts/archivo-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --sea: #06101d;
  --sea-2: #0a1828;
  --panel: rgba(14, 30, 50, 0.72);
  --panel-solid: #0e1e32;
  --panel-2: rgba(20, 42, 68, 0.6);
  --line: rgba(130, 190, 215, 0.16);
  --line-2: rgba(130, 190, 215, 0.3);
  --text: #e7eef6;
  --text-2: #b4c4d4;
  --muted: #8399ae;
  --lamp: #f2b23e;
  --lamp-glow: rgba(242, 178, 62, 0.35);
  --signal: #4fd6cf;
  --signal-glow: rgba(79, 214, 207, 0.25);
  --buoy: #ff6a55;
  --ok: #f2b23e;
  --mono: ui-monospace, "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
  --measure: 66ch;
  --wide: 1160px;
  --nav-h: 64px;
  --radius: 14px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--sea);
  color: var(--text);
  font: 400 17px/1.6 "Archivo", system-ui, sans-serif;
  font-stretch: 100%;
  font-feature-settings: "kern", "liga";
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--signal); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #8ff0ea; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 4px; }
::selection { background: rgba(242, 178, 62, 0.35); color: #fff; }
code, pre { font-family: var(--mono); }

.wrap { width: min(100% - 32px, var(--wide)); margin-inline: auto; }
.prose { max-width: var(--measure); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--panel-solid); padding: 8px 12px; color: var(--text); }
.quiet { color: var(--muted); }
.small { font-size: 0.9rem; }
.num { font-variant-numeric: tabular-nums; }

/* background layers */
#sea-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none; }
.sea-glow { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60vw 40vw at 85% 8%, rgba(242, 178, 62, 0.09), transparent 60%),
    radial-gradient(70vw 50vw at 0% 100%, rgba(79, 214, 207, 0.07), transparent 60%); }
/* no lighthouse on the page: drop the amber lamp glow, keep the sea */
body:not(:has(#tower-lamp)) .sea-glow { background: radial-gradient(70vw 50vw at 0% 100%, rgba(79, 214, 207, 0.07), transparent 60%); }

/* type */
h1, h2, h3 { margin: 0; color: var(--text); text-wrap: balance; }
.display { font-stretch: 125%; font-weight: 800; font-size: clamp(2.4rem, 5.6vw, 4.4rem); line-height: 1.02; letter-spacing: -0.022em; }
h2 { font-stretch: 118%; font-weight: 760; font-size: clamp(1.7rem, 3.2vw, 2.4rem); line-height: 1.1; letter-spacing: -0.012em; }
h3 { font-weight: 700; font-size: 1.12rem; line-height: 1.3; }
p { margin: 0 0 1em; }
.lede { font-size: 1.18rem; line-height: 1.55; color: var(--text-2); }
.kicker { font-family: var(--mono); font-size: 0.82rem; color: var(--signal); margin: 0 0 14px; }

/* fixed navbar */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--nav-h);
  background: rgba(6, 16, 29, 0.62); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line); transition: background-color .25s, border-color .25s; }
.nav.scrolled { background: rgba(6, 16, 29, 0.86); border-bottom-color: var(--line-2); }
.nav .wrap { height: 100%; display: flex; align-items: center; gap: 18px; }
.mark { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-stretch: 125%; font-weight: 800; font-size: 1.08rem; letter-spacing: -0.01em; white-space: nowrap; }
.mark:hover { color: var(--text); }
.mark svg { width: 26px; height: 30px; filter: drop-shadow(0 0 8px var(--lamp-glow)); }
.mark .ai { color: var(--lamp); }
.nav-links { display: flex; gap: 4px; margin-left: 18px; }
.nav-links a { color: var(--text-2); text-decoration: none; font-size: 0.93rem; padding: 7px 11px; border-radius: 8px; transition: color .15s, background-color .15s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); background: rgba(130, 190, 215, 0.1); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lang-switch { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; }
.lang-switch a { padding: 5px 11px; font-size: 0.82rem; font-weight: 650; color: var(--text-2); text-decoration: none; }
.lang-switch a[aria-current="true"] { background: var(--signal); color: #04212a; }
.nav-burger { display: none; background: none; border: 1px solid var(--line-2); color: var(--text); border-radius: 8px; width: 40px; height: 40px; cursor: pointer; }
.progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--signal), var(--lamp)); }
main { padding-top: var(--nav-h); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 10px;
  border: 1px solid var(--line-2); background: rgba(130, 190, 215, 0.08); color: var(--text); font: inherit; font-weight: 700; font-size: 1rem;
  text-decoration: none; cursor: pointer; transition: transform .15s, background-color .2s, box-shadow .2s, border-color .2s; }
.btn:hover { background: rgba(130, 190, 215, 0.16); color: var(--text); border-color: var(--signal); }
.btn:active { transform: translateY(1px); }
.btn.lamp { background: var(--lamp); border-color: var(--lamp); color: #1d1404; box-shadow: 0 0 0 0 var(--lamp-glow); }
.btn.lamp:hover { background: #ffc35a; box-shadow: 0 0 28px var(--lamp-glow); color: #1d1404; }
.btn.signal { background: var(--signal); border-color: var(--signal); color: #04212a; }
.btn.signal:hover { background: #7ae6e0; box-shadow: 0 0 24px var(--signal-glow); color: #04212a; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 0.9rem; }
.btn[disabled] { opacity: .6; cursor: progress; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--signal); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 24px; }

/* panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.term { font-family: var(--mono); font-size: 0.86rem; color: var(--text-2); }
.term .ok { color: var(--lamp); } .term .bad { color: var(--buoy); } .term .dim { color: var(--muted); } .term .cy { color: var(--signal); }

/* light list (crawler table) */
.lights { width: 100%; border-collapse: collapse; font-size: 0.96rem; }
.lights caption { text-align: left; padding: 0 0 10px; color: var(--muted); font-size: 0.9rem; }
.lights th { text-align: left; font-weight: 600; color: var(--muted); font-size: 0.82rem; padding: 8px 10px; border-bottom: 1px solid var(--line-2); }
.lights td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.lights tr:last-child td { border-bottom: 0; }
.lights .who { color: var(--text-2); }
.lights code { font: 500 0.84rem/1.4 var(--mono); color: var(--text-2); }
.lamp-dot { width: 13px; height: 13px; border-radius: 50%; display: inline-block; vertical-align: -1px; border: 2px solid var(--muted); background: transparent; transition: background-color .35s, border-color .35s, box-shadow .35s; }
.st-allowed .lamp-dot { background: var(--lamp); border-color: #ffcf73; box-shadow: 0 0 12px var(--lamp-glow); }
.st-blocked .lamp-dot { background: transparent; border-color: var(--buoy); box-shadow: 0 0 10px rgba(255, 106, 85, .35); }
.st-partial .lamp-dot { background: linear-gradient(90deg, var(--lamp) 50%, transparent 50%); border-color: #ffcf73; }
.st-label { font-weight: 650; }
.st-allowed .st-label { color: var(--lamp); }
.st-blocked .st-label { color: var(--buoy); }
.cat { white-space: nowrap; color: var(--text-2); }

/* sections + reveal */
section { padding: 96px 0; position: relative; }
.sec-head { margin-bottom: 36px; }
.sec-head p { color: var(--text-2); max-width: 62ch; margin-top: 12px; }
[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); transition-delay: calc(var(--rd, 0) * 90ms); }
[data-reveal].in { opacity: 1; transform: none; }
.rd1 { --rd: 1; } .rd2 { --rd: 2; } .rd3 { --rd: 3; } .rd4 { --rd: 4; } .rd5 { --rd: 5; }

/* footer */
footer.site { padding: 48px 0 64px; color: var(--muted); font-size: 0.92rem; border-top: 1px solid var(--line); background: rgba(6, 16, 29, 0.6); }
footer.site .wrap { display: grid; gap: 14px; }
footer.site nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
footer.site nav a, footer.site nav button { color: var(--text-2); }
footer.site .linkish { color: var(--text-2); }

/* modal */
dialog.modal { width: min(820px, 100% - 24px); max-height: min(86vh, 900px); padding: 0; border: 1px solid var(--line-2); border-radius: 18px;
  background: rgba(10, 24, 40, 0.96); color: var(--text); box-shadow: 0 30px 120px rgba(0, 0, 0, .6), 0 0 0 1px rgba(79, 214, 207, .08); overflow: hidden; }
dialog.modal::backdrop { background: rgba(3, 8, 15, 0.7); backdrop-filter: blur(4px); }
dialog.modal[open] { animation: modal-in .32s cubic-bezier(.2,.8,.2,1); }
@keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(.98); } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: rgba(14, 30, 50, .8); }
.modal-head .dots { display: flex; gap: 6px; } .modal-head .dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); display: block; }
.modal-head .dots i:first-child { background: var(--buoy); } .modal-head .dots i:nth-child(2) { background: var(--lamp); } .modal-head .dots i:nth-child(3) { background: var(--signal); }
.modal-head h2 { font-size: 1rem; font-stretch: 100%; font-family: var(--mono); font-weight: 600; color: var(--text-2); }
.modal-head .close { margin-left: auto; background: none; border: 1px solid var(--line-2); color: var(--text); border-radius: 8px; width: 36px; height: 36px; cursor: pointer; font-size: 1.1rem; }
.modal-head .close:hover { border-color: var(--signal); }
.modal-body { padding: 24px 28px 32px; overflow-y: auto; max-height: calc(min(86vh, 900px) - 70px); }
.modal-body h1 { font-size: 1.6rem; font-stretch: 118%; margin-bottom: 4px; }
.modal-body h2 { font-size: 1.1rem; font-stretch: 105%; margin: 22px 0 6px; }
.modal-body p, .modal-body li { color: var(--text-2); }
.modal-body .meta { color: var(--muted); font-size: .9rem; }
.modal-body pre { white-space: pre-wrap; }
.md-h1 { font-size: 1.4rem; } .md-quote { border-left: 3px solid var(--lamp); padding: 4px 0 4px 14px; color: var(--text); margin: 10px 0 16px; }
.md-list { padding-left: 1.1em; } .md-list li { margin: 6px 0; }

/* doc pages (terms, privacy, guides) */
.doc { padding: calc(var(--nav-h) + 48px) 0 80px; }
.doc .prose h1 { font-stretch: 120%; font-size: clamp(1.9rem, 4vw, 2.8rem); margin: 6px 0 10px; }
.doc .prose h2 { font-size: 1.25rem; margin: 30px 0 8px; }
.doc .prose p, .doc .prose li { color: var(--text-2); }
.doc .meta { color: var(--muted); font-size: .92rem; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 48px 0; }

@media (max-width: 900px) {
  .nav-links { display: none; position: absolute; top: var(--nav-h); left: 0; right: 0; flex-direction: column; gap: 0; margin: 0; padding: 8px 16px 16px; background: rgba(6, 16, 29, 0.97); border-bottom: 1px solid var(--line-2); }
  .nav.open .nav-links { display: flex; }
  .nav-links a { padding: 12px 8px; }
  .nav-burger { display: inline-grid; place-items: center; }
  .nav-right .btn { display: none; }
  section { padding: 72px 0; }
  .lights .who, .lights th.who { display: none; }
  .lights { font-size: 0.86rem; }
  .lights th, .lights td { padding: 8px 5px; }
  .lights .cat { white-space: normal; }
  .lights strong { overflow-wrap: anywhere; }
  .lights code { display: block; overflow-wrap: anywhere; font-size: 0.78rem; }
  .modal-body { padding: 18px 18px 26px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
}

/* ---------- report page ---------- */
.report { padding: 24px 0 60px; }
.sample-note { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--lamp); border-radius: 10px; padding: 12px 16px; margin: 8px 0 28px; max-width: var(--measure); color: var(--text-2); }
.r-head { padding: 24px 0 8px; }
.r-head .display { font-size: clamp(2rem, 5vw, 3.4rem); overflow-wrap: anywhere; }
.r-score { display: grid; grid-template-columns: auto auto 1fr; align-items: end; gap: 8px 32px; padding: 24px 0 8px; }
.r-num { margin: 0; color: var(--text-2); }
.r-num .big { font-stretch: 125%; font-weight: 800; font-size: 4.2rem; line-height: 1; color: var(--text); text-shadow: 0 0 30px var(--signal-glow); }
.r-grade { margin: 0 0 10px; color: var(--text-2); }
.r-grade strong { font-stretch: 125%; font-size: 1.6rem; color: var(--lamp); }
.ruler { width: 100%; max-width: 520px; height: auto; margin-bottom: 6px; }
.ruler .track { fill: rgba(130, 190, 215, .15); } .ruler .fill { fill: var(--signal); }
.ruler .tick { stroke: var(--muted); stroke-width: 1; } .ruler text { fill: var(--muted); font-size: 9px; font-family: inherit; }
.ruler .marker { fill: var(--lamp); stroke: #fff; stroke-width: 1; }
.r-sec { padding: 36px 0 8px; border-top: 1px solid var(--line); margin-top: 28px; }
.r-sec h2 { margin-bottom: 18px; font-size: 1.6rem; }
.fixes { list-style: none; margin: 0; padding: 0; display: grid; max-width: 80ch; counter-reset: fix; }
.fixes li { padding: 16px 0 14px 46px; border-bottom: 1px solid var(--line); position: relative; counter-increment: fix; }
.fixes li::before { content: counter(fix); position: absolute; left: 0; top: 16px; font-stretch: 125%; font-weight: 800; font-size: 1.4rem; color: var(--signal); }
.fixes h3 { margin: 2px 0 6px; overflow-wrap: anywhere; }
.fixes p { margin: 0 0 6px; color: var(--text-2); overflow-wrap: anywhere; }
.fix-meta { display: flex; gap: 14px; font-size: 0.86rem; color: var(--muted); font-family: var(--mono); }
.sev { font-weight: 700; color: var(--text-2); }
.sev-critical .sev, .sev-high .sev { color: var(--buoy); }
.breakdown { border-collapse: collapse; width: 100%; max-width: 900px; }
.breakdown th { text-align: left; font-weight: 600; font-size: 0.84rem; color: var(--muted); padding: 6px 12px 6px 0; border-bottom: 1px solid var(--line-2); }
.breakdown td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); }
.nowrap { white-space: nowrap; }
.bar-cell { width: 34%; }
.bar { display: block; height: 8px; border-radius: 4px; background: rgba(130, 190, 215, .15); position: relative; overflow: hidden; }
.bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--p, 0%); background: linear-gradient(90deg, var(--signal), var(--lamp)); }
.b-fail .bar::after { background: var(--buoy); width: 4px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 22px; margin: 0; max-width: 80ch; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; overflow-wrap: anywhere; color: var(--text-2); }
.page { padding: 8px 0 20px; } .page h3 { margin-bottom: 10px; font-size: 1rem; overflow-wrap: anywhere; }
.r-foot { display: grid; gap: 14px; justify-items: start; }
@media (max-width: 720px) { .r-score { grid-template-columns: auto 1fr; } .r-score .ruler { grid-column: 1 / -1; } .fixes li { padding-left: 34px; } }

@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #111; font-size: 11pt; }
  #sea-canvas, .sea-glow, .nav, .no-print, footer.site nav, #vigia { display: none !important; }
  main { padding-top: 0; }
  section, .r-sec { padding: 14px 0; }
  .r-num .big, h1, h2, h3, .display { color: #111 !important; text-shadow: none; }
  p, dd, td, li, .r-num, .r-grade { color: #222 !important; }
  a { color: inherit; text-decoration: none; }
}
