/* Redstone Tech: survey-report styling. Tokens from design-plan.md. */

@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-latin-wdth-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/source-serif-4-latin-wght.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/source-serif-4-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --limestone: #E3E6E6;
  --paper: #F8F9F8;
  --ink: #1E2731;
  --shale: #5A6670;
  --oxide: #93281D;
  --sandstone: #B89A72;
  --rule: #C3C9CC;

  --display: "Archivo", "Segoe UI", system-ui, sans-serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;

  /* 1.25 scale from 18px */
  --s-1: 0.889rem;
  --s0: 1.125rem;
  --s1: 1.406rem;
  --s2: 1.758rem;
  --s3: 2.197rem;
  --s4: 2.747rem;
  --s5: 3.433rem;

  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --measure: 68ch;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--limestone); color: var(--ink); scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--body);
  font-size: var(--s0);
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .wordmark, nav, .button, th, .layer-list dt, .finding-meta, .steps li::before {
  font-family: var(--display);
  font-stretch: 125%;
  line-height: 1.15;
  letter-spacing: -0.005em;
}

h1 { font-size: clamp(var(--s3), 4.2vw, var(--s5)); font-weight: 800; margin: 0 0 1.5rem; max-width: 16ch; }
h2 { font-size: clamp(var(--s2), 3vw, var(--s3)); font-weight: 750; margin: 0 0 1rem; }
h3 { font-size: var(--s1); font-weight: 700; margin: 0 0 0.5rem; }
p { margin: 0 0 1rem; max-width: var(--measure); }

a { color: var(--oxide); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--oxide); outline-offset: 3px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--paper); padding: 0.5rem 1rem; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  padding: 1.25rem var(--gutter);
  border-bottom: 1px solid var(--rule);
}
.wordmark { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; font-weight: 800; font-size: var(--s1); }
.mark { width: 4em; height: auto; display: block; }
nav { display: flex; gap: 1.5rem; flex-wrap: wrap; font-size: var(--s-1); font-weight: 600; font-stretch: 110%; }
nav a { color: var(--ink); text-decoration: none; }
nav a:hover { color: var(--oxide); }

/* Hero */
.hero {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 4vw, 4rem); align-items: center;
  padding: clamp(3rem, 7vw, 6rem) var(--gutter) clamp(3rem, 6vw, 5rem);
}
.lede { font-size: var(--s1); line-height: 1.5; color: var(--ink); }
.terms { font-style: italic; color: var(--shale); }
.button {
  display: inline-block; background: var(--ink); color: var(--paper); text-decoration: none;
  font-weight: 700; font-stretch: 110%; font-size: var(--s0); padding: 0.85rem 1.4rem; border-radius: 2px;
}
.button:hover { background: var(--oxide); }
.free-check { font-size: var(--s-1); color: var(--shale); margin-top: 1.25rem; max-width: 42ch; }

.hero-figure { margin: 0; }
.strata { width: 100%; height: auto; display: block; overflow: visible; }
.strata .fill { stroke: none; }
.strata pattern rect { fill: var(--ink); fill-opacity: 0.4; }
.strata pattern path { stroke: var(--ink); stroke-opacity: 0.35; stroke-width: 1.2; fill: none; }
.strata .dither { opacity: 0.5; }
.strata .layer-identity .dither { opacity: 0.55; }
.strata .contours path { fill: none; stroke: var(--ink); stroke-opacity: 0.16; stroke-width: 1; }
.strata .layer-identity .contours path { stroke: #F8F9F8; stroke-opacity: 0.1; }
.strata .grain { mix-blend-mode: multiply; opacity: 0.5; }
.strata .label-identity { fill: var(--paper); stroke: rgba(30, 39, 49, 0.6); }
.strata .bound { fill: none; stroke: var(--ink); stroke-opacity: 0.55; stroke-width: 1; }
.strata .ground { fill: none; stroke: var(--ink); stroke-width: 2.5; }
.strata .layer-label { font-family: var(--display); font-stretch: 125%; font-weight: 700; font-size: 15px; fill: var(--ink); paint-order: stroke; stroke: rgba(248, 249, 248, 0.75); stroke-width: 5px; stroke-linejoin: round; }
.strata .bound, .strata .ground { shape-rendering: crispEdges; }
.strata .core-casing { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; shape-rendering: crispEdges; }
.strata .wire-off { fill: #5E2A25; fill-opacity: 0.28; }
.strata .wire-on { fill: var(--oxide); }
.strata .rig { fill: none; stroke: var(--ink); stroke-width: 2.5; }
.strata .leader { stroke: var(--ink); stroke-width: 1.2; }
.strata .lamp-off { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; shape-rendering: crispEdges; }
.strata .lamp { fill: var(--oxide); stroke: var(--ink); stroke-width: 1.5; shape-rendering: crispEdges; }
.strata .lamp-core { fill: #E8705F; }
.strata .lamp-on { filter: drop-shadow(0 0 5px rgba(196, 58, 40, 0.55)); }
.strata .trace-off { fill: none; stroke: #5E2A25; stroke-opacity: 0.3; stroke-width: 3; }
.strata .trace-on { fill: none; stroke: var(--oxide); stroke-width: 3; }
.strata .terminal { fill: var(--paper); stroke: var(--ink); stroke-width: 2; }
.strata .gem-off { opacity: 0.35; filter: grayscale(1); }
.strata .gem-on { filter: drop-shadow(0 0 6px rgba(196, 58, 40, 0.6)); }
.strata .note { font-family: var(--body); font-style: italic; font-size: 16px; fill: var(--ink); paint-order: stroke; stroke: var(--paper); stroke-width: 6px; stroke-linejoin: round; }

figcaption { margin-top: 1rem; }
.caption { display: block; font-style: italic; font-size: var(--s-1); color: var(--shale); max-width: 52ch; }
.pin-list { display: none; margin: 0 0 0.75rem; padding: 0; list-style: none; }
.pin-list li { padding-left: 1.25rem; position: relative; margin-bottom: 0.35rem; }
.pin-list li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--oxide); }
.pin-list .layer-name { font-weight: 600; }

/* The one moment of motion: the signal runs down the wire, each stone lights as it's reached
   and its trace runs out to the note; the stone in the bedrock lights last. */
@media (prefers-reduced-motion: no-preference) {
  .strata .wire-on { transform-box: fill-box; transform-origin: top; animation: drill 1.8s steps(28, end) 0.3s both; }
  .strata .pin .gem-on, .strata .pin .note, .strata .pin .terminal { animation: power 0.12s steps(1, end) both; }
  .strata .trace-on { stroke-dasharray: 1; animation: trace 0.35s linear both; }
  .strata .pin-1 > * { animation-delay: 0.95s; }
  .strata .pin-2 > * { animation-delay: 1.25s; }
  .strata .pin-3 > * { animation-delay: 1.55s; }
  .strata .pin-4 > * { animation-delay: 1.9s; }
  .strata .pin .terminal, .strata .pin .note { animation-delay: inherit; }
  .strata .pin-1 .terminal, .strata .pin-1 .note { animation-delay: 1.3s; }
  .strata .pin-2 .terminal, .strata .pin-2 .note { animation-delay: 1.6s; }
  .strata .pin-3 .terminal, .strata .pin-3 .note { animation-delay: 1.9s; }
  .strata .pin-4 .terminal, .strata .pin-4 .note { animation-delay: 2.25s; }
  .strata .pin .gem-off, .strata .pin .trace-off { animation: none; }
  .strata .stone .gem-on { animation: power 0.15s steps(1, end) 2.15s both; }
  .strata .stone .trace-on { animation: trace 0.7s linear 2.25s both; }
}
@keyframes drill { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes trace { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes power { from { opacity: 0; } to { opacity: 1; } }

/* Sections */
.section { padding: clamp(3rem, 6vw, 5rem) var(--gutter); border-top: 1px solid var(--rule); }
.section-intro { max-width: var(--measure); margin-bottom: 2rem; }
.section-intro p { color: var(--ink); }
.also { font-style: italic; color: var(--shale); margin-top: 1.5rem; }

/* The sample finding: a page lifted out of the report */
.finding {
  background: var(--paper); max-width: 52rem; padding: clamp(1.5rem, 4vw, 2.75rem);
  border-left: 6px solid var(--oxide);
  box-shadow: 0 1px 0 var(--rule), 0 18px 40px -28px rgba(30, 39, 49, 0.45);
}
.finding-meta { display: flex; gap: 1rem; align-items: baseline; flex-wrap: wrap; font-size: var(--s-1); font-weight: 600; font-stretch: 110%; margin-bottom: 0.75rem; }
.severity { color: var(--oxide); }
.area { color: var(--shale); }
.example-tag { margin-left: auto; font-family: var(--body); font-style: italic; font-weight: 400; color: var(--shale); }
.finding h3 { font-size: var(--s2); margin-bottom: 1.25rem; }
.finding dl { margin: 0; display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 0.25rem 2rem; }
.finding dt { font-family: var(--display); font-stretch: 110%; font-weight: 700; font-size: var(--s-1); padding-top: 0.2rem; border-top: 1px solid var(--rule); padding-top: 0.9rem; }
.finding dd { margin: 0; border-top: 1px solid var(--rule); padding-top: 0.75rem; padding-bottom: 0.5rem; max-width: 60ch; }
.finding ol { margin: 0; padding-left: 1.25rem; }
.finding li { margin-bottom: 0.4rem; }

/* Layers list */
.layer-list { margin: 0; max-width: 56rem; }
.layer { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 2rem; padding: 1.1rem 0; border-top: 1px solid var(--rule); }
.layer:last-child { border-bottom: 1px solid var(--rule); }
.layer-list dt { font-weight: 700; font-size: var(--s0); display: flex; align-items: center; gap: 0.75rem; }
.layer-list dd { margin: 0; max-width: 60ch; }
.swatch { width: 1.6rem; height: 1.1rem; flex: none; border: 1px solid rgba(30, 39, 49, 0.5); background-size: auto; }
.swatch-identity { background-color: #8E99A2; background-image: linear-gradient(90deg, transparent 45%, rgba(30,39,49,.35) 45% 55%, transparent 55%), linear-gradient(transparent 45%, rgba(30,39,49,.35) 45% 55%, transparent 55%); background-size: 9px 9px; }
.swatch-devices { background-color: #B3BCC2; background-image: linear-gradient(rgba(30,39,49,.35) 1px, transparent 1px); background-size: 100% 6px; }
.swatch-email { background-color: #C7CDD1; background-image: linear-gradient(90deg, rgba(30,39,49,.35) 50%, transparent 50%); background-size: 10px 1px; background-repeat: repeat-x; background-position: 0 50%; }
.swatch-data { background-color: #DCCFBD; background-image: radial-gradient(rgba(30,39,49,.5) 1px, transparent 1.3px); background-size: 5px 5px; }
.swatch-copilot { background-color: #EEF0F0; }

/* Pricing table on report paper */
.table-wrap { overflow-x: auto; max-width: 58rem; background: var(--paper); box-shadow: 0 1px 0 var(--rule), 0 18px 40px -30px rgba(30, 39, 49, 0.4); }
table { width: 100%; border-collapse: collapse; font-size: var(--s0); }
th, td { text-align: left; padding: 0.8rem 1.1rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { font-size: var(--s1); font-weight: 750; border-bottom: 2px solid var(--ink); padding-top: 1.25rem; }
tbody th { font-weight: 600; font-stretch: 105%; font-size: var(--s-1); color: var(--ink); width: 34%; }
.price-row td { font-family: var(--display); font-stretch: 125%; font-weight: 800; font-size: var(--s2); }
td.no { color: var(--shale); font-style: italic; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }

/* Steps: a real sequence, so numbered */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; max-width: 76rem; }
.steps li { counter-increment: step; border-top: 2px solid var(--ink); padding-top: 1rem; }
.steps li::before { content: counter(step); display: block; font-size: var(--s3); font-weight: 800; color: var(--oxide); margin-bottom: 0.5rem; }
.steps h3 { font-size: var(--s0); }
.steps p { font-size: var(--s-1); line-height: 1.55; }

.prose { max-width: var(--measure); }

/* Contact */
.contact { padding-bottom: clamp(4rem, 8vw, 7rem); }
.contact .email { font-family: var(--display); font-stretch: 125%; font-weight: 800; font-size: clamp(var(--s2), 4.5vw, var(--s4)); margin: 1.5rem 0; line-height: 1.1; overflow-wrap: anywhere; }
.contact .email a { color: var(--ink); text-decoration-color: var(--oxide); text-decoration-thickness: 3px; text-underline-offset: 0.15em; }
.contact .email a:hover { color: var(--oxide); }
.alt { color: var(--shale); }

.site-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding: 1.5rem var(--gutter); border-top: 1px solid var(--rule); font-size: var(--s-1); color: var(--shale); }
.site-footer p { margin: 0; }

/* Narrow screens */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  :root { --s0: 1.0625rem; }
  .strata .pin text, .strata .leader { display: none; }
  .pin-list { display: block; }
  .finding dl { grid-template-columns: 1fr; }
  .finding dd { border-top: 0; padding-top: 0.25rem; }
  .layer { grid-template-columns: 1fr; gap: 0.5rem; }
  .steps { grid-template-columns: 1fr; }
  nav { gap: 1rem; }
}

/* Privacy page */
.page { padding: clamp(3rem, 6vw, 5rem) var(--gutter); }
.page h1 { max-width: none; }

/* Email security check */
nav a[aria-current="page"] { color: var(--oxide); }
.check-page { display: grid; gap: clamp(2.5rem, 5vw, 4rem); }
.check-page h1 { max-width: 20ch; }
.check-form { max-width: 44rem; margin-top: 2rem; }
.check-form label { display: block; font-family: var(--display); font-stretch: 110%; font-weight: 700; font-size: var(--s-1); margin-bottom: 0.5rem; }
.check-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.check-row input {
  flex: 1 1 18rem; min-width: 0; font: inherit; font-size: var(--s1); padding: 0.7rem 0.9rem;
  background: var(--paper); color: var(--ink); border: 2px solid var(--ink); border-radius: 2px;
}
.check-row input::placeholder { color: var(--shale); opacity: 0.7; }
.check-row .button { border: 0; cursor: pointer; font-family: var(--display); }
.check-row .button:disabled { opacity: 0.6; cursor: progress; }
.check-note { font-size: var(--s-1); color: var(--shale); margin-top: 0.75rem; }

.check-results { display: grid; gap: 1.5rem; max-width: 52rem; }
.check-summary h2 { margin-bottom: 0.5rem; overflow-wrap: anywhere; }
.check-tally { font-family: var(--display); font-stretch: 110%; font-weight: 700; margin-bottom: 0.5rem; }
.check-verdict { font-size: var(--s1); line-height: 1.45; }
.check-mx { color: var(--shale); font-style: italic; }
.check-message { font-style: italic; color: var(--shale); }
.check-message.error { color: var(--oxide); font-style: normal; }

.check-card {
  background: var(--paper); padding: clamp(1.25rem, 3vw, 2rem);
  border-left: 6px solid var(--rule);
  box-shadow: 0 1px 0 var(--rule), 0 18px 40px -30px rgba(30, 39, 49, 0.4);
}
.check-card h3 { font-size: var(--s1); margin-bottom: 1rem; }
.check-card dl { margin: 0; display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 0.25rem 1.5rem; }
.check-card dt { font-family: var(--display); font-stretch: 110%; font-weight: 700; font-size: var(--s-1); border-top: 1px solid var(--rule); padding-top: 0.8rem; }
.check-card dd { margin: 0; border-top: 1px solid var(--rule); padding: 0.65rem 0 0.4rem; }
.check-card ol { margin: 0; padding-left: 1.25rem; }
.check-card li { margin-bottom: 0.35rem; }
.check-card .evidence { margin: 0; padding: 0; list-style: none; font-family: Consolas, "Cascadia Mono", monospace; font-size: 0.8rem; color: var(--shale); overflow-wrap: anywhere; }
.check-status { font-weight: 700; }
.status-fail { border-left-color: var(--oxide); }
.status-fail .check-status { color: var(--oxide); }
.status-warn { border-left-color: #C58A3A; }
.status-warn .check-status { color: #8A5210; }
.status-pass { border-left-color: var(--ink); }
.status-pass .check-status { color: var(--ink); }
.status-unknown .check-status { color: var(--shale); }

.check-more { background: var(--ink); color: var(--paper); padding: clamp(1.75rem, 4vw, 3rem); max-width: 52rem; }
.check-more h2 { color: var(--paper); }
.check-more p { color: var(--paper); }
.check-more .button { background: var(--oxide); margin-right: 1.25rem; }
.check-more .button:hover { background: #B3372A; }
.check-more .text-link { color: var(--paper); }
.check-explain .layer { grid-template-columns: 8rem minmax(0, 1fr); }

@media (max-width: 640px) {
  .check-card dl { grid-template-columns: 1fr; }
  .check-card dd { border-top: 0; padding-top: 0.25rem; }
  .check-explain .layer { grid-template-columns: 1fr; }
  .check-more .button { margin-bottom: 1rem; }
}
