/* ModESP Cloud landing — no build step; CSP style-src 'self': no inline styles anywhere.
   Frost paper: a cold, ruled document rather than a dark control room. The app is the
   control room; this page is the dossier a person reads before asking for a pilot. */
:root {
  --paper: #f3f6f9; --paper-2: #ffffff; --paper-3: #eaf0f6;
  --ink: #0d1c2c; --ink-2: #2f4256; --muted: #5b6d82;
  --line: #d4dde7; --line-2: #e7ecf2;
  --ice: #0b6e8f; --ice-ink: #084e66; --ice-2: #d6ecf5; --ice-3: #eef7fb;
  --signal: #d3480f; --signal-2: #fdece3; --ok: #1e7a4c; --amber: #b7791f; --amber-2: #fbf1dc;
  --dark: #0d1c2c; --dark-2: #142839; --dark-line: #26405a; --dark-text: #e6eef6; --dark-muted: #9fb3c8; --dark-ice: #8fd3ea;
  --display: 'Piazzolla', Georgia, 'Times New Roman', serif;
  --sans: 'IBM Plex Sans', 'Segoe UI', Tahoma, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --max: 1160px; --radius: 14px; --radius-s: 8px;
  --shadow: 0 1px 2px rgba(13, 28, 44, .06), 0 14px 36px -14px rgba(13, 28, 44, .22);
  /* aliases the generated legal pages (build-legal.js) rely on */
  --warn: var(--amber); --card: var(--paper-2); --bg-2: var(--paper-3);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-size: 1.02rem; line-height: 1.6; color: var(--ink); background: var(--paper); }
a { color: var(--ice); text-underline-offset: 2px; }
a:hover { color: var(--ice-ink); }
img, svg { max-width: 100%; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 820px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
h1, h2 { font-family: var(--display); font-weight: 500; line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.012em; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); line-height: 1.04; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); max-width: 24ch; }
h3 { font-size: 1.18rem; font-weight: 600; line-height: 1.3; margin: 0 0 .5em; }
h1 em, h2 em, p em { font-family: var(--display); font-style: italic; font-weight: 400; color: var(--ice-ink); }
p em { font-size: 1.06em; }
p { margin: 0 0 1em; }
.lead { font-size: clamp(1.05rem, 1.4vw, 1.22rem); color: var(--ink-2); max-width: 56ch; }
.lead-sm { max-width: 64ch; }
.kicker { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ice-ink); margin: 0 0 14px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; font: 600 .98rem var(--sans); text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, background .15s ease, border-color .15s ease, color .15s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ice); color: #fff; border-color: var(--ice); }
.btn-primary:hover { background: var(--ice-ink); border-color: var(--ice-ink); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-link { background: none; border: 0; padding: 10px 4px; color: var(--ice); font-weight: 500; }
.btn-lg { padding: 13px 22px; font-size: 1.05rem; }
.btn[hidden] { display: none; }

/* ── Header ── */
.top { position: sticky; top: 0; z-index: 20; background: rgba(243, 246, 249, .86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 500; font-size: 1.15rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: #fff; display: grid; place-items: center; }
.nav { display: flex; gap: 4px 18px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.nav a { color: var(--ink-2); text-decoration: none; font-size: .95rem; }
.nav a:hover { color: var(--ink); }
.nav .btn { padding: 8px 14px; font-size: .9rem; }
.nav .btn-primary { color: #fff; }

/* ── Hero ── */
.hero { position: relative; padding: 72px 0 44px; overflow: hidden;
  background:
    radial-gradient(900px 480px at 8% -10%, rgba(11, 110, 143, .16), transparent 60%),
    repeating-linear-gradient(to bottom, transparent 0 35px, rgba(13, 28, 44, .045) 35px 36px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 48px; align-items: center; }
.eyebrow { font-family: var(--mono); font-size: .8rem; letter-spacing: .06em; color: var(--ice-ink); margin-bottom: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin: 22px 0 26px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; margin: 0; padding-top: 18px; border-top: 1px solid var(--line); }
.facts div { display: flex; flex-direction: column; gap: 2px; }
.facts dt { font-family: var(--mono); font-size: 1.35rem; font-weight: 500; color: var(--ink); }
.facts dd { margin: 0; font-size: .9rem; color: var(--muted); line-height: 1.4; }

/* ── Sheets: a paper card with a header line ── */
.sheet { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px 16px; margin: 0; }
.sheet-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.sheet-title { font-weight: 600; }
.sheet-meta { font-size: .78rem; color: var(--muted); }
.hero-figure .chart svg { width: 100%; height: auto; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .74rem; color: var(--muted); margin-top: 8px; }
.lg { display: inline-block; width: 18px; height: 0; border-top: 2px solid; margin-right: 6px; vertical-align: middle; }
.lg-air { border-color: var(--ice); }
.lg-set { border-color: var(--muted); border-top-style: dashed; }
.lg-limit { border-color: var(--signal); border-top-style: dashed; }
.lg-alarm, .lg-defrost { width: 14px; height: 10px; border: 0; }
.lg-alarm { background: var(--signal-2); border-left: 2px solid var(--signal); }
.lg-defrost { background: var(--paper-3); border-left: 2px solid var(--line); }

/* the story chart (SVG built by app.js; presentation only through classes) */
.chart .grid { stroke: var(--line-2); stroke-width: 1; }
.chart .axis-text { font: 500 10px var(--mono); fill: var(--muted); }
.chart .line-set { stroke: var(--muted); stroke-dasharray: 4 4; stroke-width: 1.2; }
.chart .line-limit { stroke: var(--signal); stroke-dasharray: 4 4; stroke-width: 1.2; }
.chart .band-alarm { fill: var(--signal-2); }
.chart .band-defrost { fill: var(--paper-3); }
.chart .line-air { stroke: var(--ice); stroke-width: 2; fill: none; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 2600; stroke-dashoffset: 2600; animation: draw 2.8s cubic-bezier(.3, .7, .2, 1) .45s forwards; }
.chart .marker { fill: var(--paper-2); stroke-width: 2.5; }
.chart .marker-door { stroke: var(--amber); }
.chart .marker-alarm { stroke: var(--signal); }
.chart .marker-tech { stroke: var(--ice); }
.chart .marker-ok { stroke: var(--ok); }
.chart .marker-text { font: 500 10px var(--mono); fill: var(--ink-2); }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ── Sections ── */
.section { padding: 76px 0; border-top: 1px solid var(--line); }
.section-tint { background: var(--paper-3); }
.section-dark { background: var(--dark); color: var(--dark-text); border-color: var(--dark); }
.section-dark h2 { color: #fff; }
.section-dark .kicker { color: var(--dark-ice); }
.section-pilot { background: linear-gradient(180deg, var(--paper) 0%, var(--ice-3) 100%); }
.section-trust { padding: 44px 0; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.split-lead { position: sticky; top: 88px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 18px; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.card:hover { transform: translateY(-2px); border-color: rgba(11, 110, 143, .5); box-shadow: var(--shadow); }
.card p { color: var(--ink-2); }
.card p:last-child { margin-bottom: 0; }
.card-dark { background: var(--dark-2); border-color: var(--dark-line); }
.card-dark h3 { color: #fff; }
.card-dark p { color: var(--dark-muted); }
.card-dark:hover { border-color: var(--dark-ice); box-shadow: none; }
.role h3 { font-family: var(--display); font-weight: 500; font-size: 1.35rem; letter-spacing: -.01em; }
.ticks { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.ticks li { position: relative; padding-left: 22px; color: var(--ink-2); }
.ticks li::before { content: ''; position: absolute; left: 1px; top: .58em; width: 11px; height: 6px; border-left: 2px solid var(--ice); border-bottom: 2px solid var(--ice); transform: rotate(-45deg); }
.ticks-lg { gap: 10px; }
.ticks-lg li { padding-left: 26px; }
.ticks + p { margin-top: 14px; }

/* ── Timeline: one night ── */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 82px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline li { display: grid; grid-template-columns: 64px 1fr; gap: 30px; padding: 0 0 26px; position: relative; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::after { content: ''; position: absolute; left: 76px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--paper-2); border: 3px solid var(--ice); box-sizing: border-box; }
.timeline .tl-door::after { border-color: var(--amber); }
.timeline .tl-alarm::after { border-color: var(--signal); }
.timeline .tl-ok::after { border-color: var(--ok); }
.timeline .tl-report::after { border-color: var(--ink); }
.tl-time { font-size: 1.05rem; font-weight: 500; color: var(--ink); padding-top: 2px; text-align: right; }
.timeline strong { display: block; margin-bottom: 2px; color: var(--ink); }
.timeline div { color: var(--ink-2); }

/* ── Data sheet ── */
.datatable { width: 100%; border-collapse: collapse; font-size: .9rem; }
.datatable th, .datatable td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.datatable th { font-weight: 500; color: var(--ink-2); width: 30%; }
.datatable td:nth-child(2) { font-weight: 500; white-space: nowrap; }
.datatable td.muted { font-family: var(--sans); font-size: .82rem; }
.datatable tr:last-child th, .datatable tr:last-child td { border-bottom: 0; }

/* ── HACCP journal ── */
.journal-rule { font-size: .82rem; color: var(--ink-2); margin: 0 0 10px; }
.journal-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.journal-table th { text-align: left; font-weight: 600; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 6px; border-bottom: 1.5px solid var(--ink); }
.journal-table td { padding: 7px 6px; border-bottom: 1px solid var(--line-2); }
.journal-table .row-dev td { background: var(--signal-2); }
.journal-table .row-dev strong { color: var(--signal); }
.journal-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.journal-ex { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; color: var(--ink-2); }
.stamp { border: 1.5px dashed var(--ice); color: var(--ice-ink); padding: 8px 12px; border-radius: 6px; font-size: .74rem; line-height: 1.45; transform: rotate(-1.5deg); background: var(--paper-2); }
.notice { margin-top: 18px; padding: 14px 16px; border-left: 3px solid var(--amber); background: var(--amber-2); border-radius: 0 var(--radius-s) var(--radius-s) 0; color: var(--ink-2); font-size: .95rem; }

/* ── Pricing ── */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.plan { display: flex; flex-direction: column; gap: 6px; }
.plan .tag { align-self: flex-start; font: 500 .74rem var(--mono); letter-spacing: .04em; color: var(--ice-ink); background: var(--ice-2); padding: 3px 9px; border-radius: 999px; }
.plan h3 { font-family: var(--display); font-size: 1.5rem; font-weight: 500; margin: 6px 0 0; }
.plan .price { font-family: var(--mono); font-size: 1.2rem; font-weight: 500; }
.plan .price small { font-size: .76rem; color: var(--muted); font-weight: 400; margin-left: 2px; }
.plan .note { font-size: .84rem; color: var(--muted); }
.plan ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); font-size: .92rem; flex: 1; }
.plan .btn { margin-top: 14px; align-self: flex-start; }
.plan-featured { border-color: var(--ice); box-shadow: var(--shadow); }

/* ── Pilot form ── */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: .88rem; color: var(--ink-2); }
.form .full { grid-column: 1 / -1; }
.form input, .form select, .form textarea { font: 400 1rem var(--sans); color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; width: 100%; }
.form textarea { resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 3px solid var(--ice-2); border-color: var(--ice); }
.form .consent { flex-direction: row; align-items: flex-start; gap: 10px; font-size: .84rem; }
.form .consent input { width: auto; margin-top: 3px; }
.hp { position: absolute; left: -9999px; }
.form-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.form-msg { font-size: .9rem; }
.form-msg.ok { color: var(--ok); }
.form-msg.err { color: var(--signal); }

/* ── FAQ ── */
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 0; font-weight: 600; font-size: 1.05rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-family: var(--mono); font-size: 1.3rem; color: var(--ice); flex-shrink: 0; transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { margin: 0 0 18px; color: var(--ink-2); max-width: 70ch; }

/* ── Trust strip ── */
.trust { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.trust li { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--paper-2); }
.trust strong { font-family: var(--mono); font-weight: 500; }
.trust span { font-size: .82rem; color: var(--muted); }

/* ── Footer ── */
.foot { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: .9rem; color: var(--muted); }
.foot .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot-links, .foot-meta { display: flex; gap: 8px 18px; flex-wrap: wrap; align-items: center; }
.foot a { color: var(--ink-2); text-decoration: none; }
.foot a:hover { color: var(--ice); }
.foot a[hidden] { display: none; }

/* ── Motion: one orchestrated page load, then quiet reveals on scroll ── */
.rise { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
.hero-text > :nth-child(1) { animation-delay: .05s; }
.hero-text > :nth-child(2) { animation-delay: .15s; }
.hero-text > :nth-child(3) { animation-delay: .25s; }
.hero-text > :nth-child(4) { animation-delay: .35s; }
.hero-text > :nth-child(5) { animation-delay: .45s; }
.hero-figure.rise { animation-name: rise-tilt; animation-delay: .3s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes rise-tilt { from { opacity: 0; transform: translateY(18px) rotate(0); } to { opacity: 1; transform: rotate(-.6deg); } }
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .rise, .reveal { animation: none; transition: none; opacity: 1; transform: none; }
  .chart .line-air { animation: none; stroke-dashoffset: 0; }
  .card:hover { transform: none; }
}

/* ── Legal / long text pages (generated by build-legal.js into landing/legal/) ── */
.doc { max-width: 820px; margin: 0 auto; padding: 40px 20px 80px; }
.doc h1 { font-size: 1.9rem; }
.doc h2 { margin-top: 36px; font-size: 1.4rem; }
.doc h3 { margin-top: 24px; }
.doc blockquote { margin: 16px 0; padding: 12px 16px; border-left: 3px solid var(--warn); background: var(--amber-2); color: var(--ink-2); }
.doc table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: .95rem; }
.doc th, .doc td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.doc code { font-family: var(--mono); font-size: .9em; background: var(--bg-2); padding: 1px 5px; border-radius: 4px; }
.doc .back { display: inline-block; margin-bottom: 20px; }

/* ── Responsive ── */
@media (max-width: 960px) {
  .hero-grid, .split { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trust { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .split-lead { position: static; }
  h2 { max-width: none; }
}
@media (max-width: 640px) {
  .section { padding: 52px 0; }
  .hero { padding: 40px 0 28px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form { grid-template-columns: 1fr; padding: 16px; }
  .facts { gap: 12px 16px; }
  .facts dt { font-size: 1.15rem; }
  .timeline::before { left: 58px; }
  .timeline li { grid-template-columns: 46px 1fr; gap: 22px; }
  .timeline li::after { left: 52px; }
  .tl-time { font-size: .95rem; }
  .trust { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top .wrap { flex-direction: column; align-items: flex-start; padding: 10px 20px; }
  .nav { justify-content: flex-start; gap: 4px 14px; }
  .journal-table { font-size: .8rem; }
  .journal-table th:nth-child(3), .journal-table td:nth-child(3) { display: none; }
  .stamp { transform: none; }
}
