/* Envolt Mail — site styles (D-S11.2). Semantic tokens; dark + light themes (CANON-047); system fonts only (no third-party
   requests under a strict CSP; fast LCP). Contrast targets: body text ≥ 7:1, muted text ≥ 4.5:1 in both themes. */
:root {
  --bg: #f6f7f3; --surface: #ffffff; --surface-2: #eef0e9; --border: #d5d9cd; --border-strong: #b9bfaf;
  --text: #0e1320; --muted: #4a5468; --link: #3a5a0f; --link-hover: #1f3306;
  --accent: #c8f560; --accent-ink: #0e1320; --accent-soft: #e9f8c4; --signal: #1e5bb8;
  --ok: #17794b; --focus: #1e5bb8; --shadow: 0 1px 2px rgb(14 19 32 / 6%), 0 8px 24px rgb(14 19 32 / 6%);
  --glow: radial-gradient(60rem 30rem at 85% -10%, rgb(200 245 96 / 35%), transparent 60%);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, "Liberation Mono", Menlo, monospace;
  --radius: 14px; --radius-sm: 9px; --max: 1120px; --gutter: clamp(16px, 4vw, 32px);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0a0e17; --surface: #111726; --surface-2: #172034; --border: #243049; --border-strong: #34425f;
  --text: #e8ecf4; --muted: #a3aec3; --link: #c8f560; --link-hover: #e2ff9c;
  --accent: #c8f560; --accent-ink: #0a0e17; --accent-soft: #1d2a12; --signal: #7cc4ff;
  --ok: #5ee6a8; --focus: #7cc4ff; --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 12px 32px rgb(0 0 0 / 35%);
  --glow: radial-gradient(60rem 30rem at 85% -10%, rgb(200 245 96 / 14%), transparent 60%);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0e17; --surface: #111726; --surface-2: #172034; --border: #243049; --border-strong: #34425f;
    --text: #e8ecf4; --muted: #a3aec3; --link: #c8f560; --link-hover: #e2ff9c;
    --accent: #c8f560; --accent-ink: #0a0e17; --accent-soft: #1d2a12; --signal: #7cc4ff;
    --ok: #5ee6a8; --focus: #7cc4ff; --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 12px 32px rgb(0 0 0 / 35%);
    --glow: radial-gradient(60rem 30rem at 85% -10%, rgb(200 245 96 / 14%), transparent 60%);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body { margin: 0; background: var(--glow), var(--bg); background-repeat: no-repeat; color: var(--text); font: 400 1.0625rem/1.65 var(--font); min-height: 100dvh; display: flex; flex-direction: column; overflow-x: hidden; }
main { flex: 1; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.3rem, 6vw, 4.1rem); font-weight: 750; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 720; }
h3 { font-size: 1.15rem; font-weight: 680; }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); color: var(--text); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.eyebrow { display: inline-flex; align-items: center; gap: .5em; font: 600 .78rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.dot { width: .55em; height: .55em; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.lede { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--muted); max-width: 40em; }
.muted { color: var(--muted); }

/* Header + nav */
.site-header { position: sticky; top: 0; z-index: 50; backdrop-filter: saturate(160%) blur(10px); background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 750; letter-spacing: -0.02em; font-size: 1.08rem; }
.brand svg { width: 32px; height: 32px; background: var(--accent); border-radius: 9px; padding: 2px; }
.brand small { font: 600 .68rem/1 var(--mono); color: var(--muted); letter-spacing: .06em; border: 1px solid var(--border); border-radius: 999px; padding: 4px 7px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 560; font-size: .95rem; padding: 8px 12px; border-radius: 9px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.icon-btn:hover { border-color: var(--border-strong); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
.menu-btn { display: none; margin-left: auto; }
.drawer { display: none; }
@media (max-width: 820px) {
  .nav { display: none; }
  .menu-btn { display: inline-grid; }
  .site-header .theme-toggle { margin-left: 0; }
  .drawer { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: flex; flex-direction: column; height: 100dvh; overflow-y: auto; overscroll-behavior: contain; padding: 16px var(--gutter) 32px; transform: translateY(-4px); opacity: 0; visibility: hidden; transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s; }
  .drawer.open { opacity: 1; transform: none; visibility: visible; transition: opacity .18s ease, transform .18s ease; }
  .drawer-top { display: flex; align-items: center; justify-content: space-between; min-height: 48px; margin-bottom: 12px; }
  .drawer a.navlink { display: block; padding: 16px 4px; font-size: 1.25rem; font-weight: 650; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
  .drawer .cta-row { margin-top: 24px; }
}
body.no-scroll { overflow: hidden; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .55em; font-weight: 650; font-size: 1rem; text-decoration: none; padding: 13px 20px; border-radius: 11px; border: 1px solid transparent; transition: transform .12s ease, box-shadow .12s ease, background .12s ease; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 20px rgb(200 245 96 / 28%); }
.btn-primary:hover { color: var(--accent-ink); transform: translateY(-1px); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--border-strong); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Hero */
.hero { padding: clamp(48px, 9vw, 112px) 0 clamp(40px, 7vw, 88px); }
.hero-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.hero h1 .hl { background: linear-gradient(transparent 62%, var(--accent-soft) 62%); padding: 0 .06em; }
:root[data-theme="dark"] .hero h1 .hl, .hero h1 .hl { color: inherit; }

/* The signature visual: an agent message as it arrives — header block, seal, disclosure */
.mailcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; font-size: .93rem; }
.mailcard-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); font: 600 .75rem/1 var(--mono); color: var(--muted); letter-spacing: .04em; }
.mailcard-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); display: inline-block; }
.mailcard-bar span { margin-left: 6px; }
.mailcard dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; padding: 16px 18px 6px; font-family: var(--mono); font-size: .82rem; }
.mailcard dt { color: var(--muted); }
.mailcard dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 9px; font: 650 .72rem/1.6 var(--mono); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); white-space: nowrap; }
.pill.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); background: color-mix(in srgb, var(--ok) 10%, var(--surface)); }
.pill.agent { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.mailcard .body { padding: 10px 18px 16px; color: var(--text); }
.mailcard .disclosure { margin: 0 18px 18px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px dashed var(--border-strong); color: var(--muted); font-size: .82rem; }
.mailcard .approve { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 18px 18px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: .85rem; }
.mailcard .approve b { font-weight: 650; }

/* Sections */
section.block { padding: clamp(44px, 8vw, 96px) 0; border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.section-head { max-width: 46em; margin-bottom: clamp(24px, 4vw, 44px); }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid.cols-4, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.card h3 { display: flex; align-items: center; gap: 10px; }
.card p { color: var(--muted); margin: 0; font-size: .98rem; }
.card .num { font: 700 .75rem/1 var(--mono); color: var(--accent-ink); background: var(--accent); border-radius: 7px; padding: 5px 7px; }
.glyph { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--text); margin-bottom: 14px; }
.glyph svg { width: 20px; height: 20px; }

/* Flow (how it works) */
.flow { counter-reset: step; display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .flow { grid-template-columns: 1fr; } }
.flow li { list-style: none; position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.flow li::before { counter-increment: step; content: "0" counter(step); font: 700 .78rem/1 var(--mono); color: var(--muted); display: block; margin-bottom: 12px; }
.flow { padding: 0; margin: 0; }
.flow b { display: block; font-size: 1.05rem; margin-bottom: 4px; }
.flow span { color: var(--muted); font-size: .96rem; }

/* Prose (legal, docs) */
.prose { max-width: 46rem; padding: clamp(40px, 7vw, 80px) 0; }
.prose h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
.prose h2 { font-size: 1.35rem; margin-top: 2em; }
.prose p, .prose li { color: var(--text); }
.prose .updated { color: var(--muted); font: 500 .85rem/1 var(--mono); }
.prose ul { padding-left: 1.2em; }
.prose li { margin: .35em 0; }
.callout { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); padding: 18px 20px; }

/* Coming-soon band */
.band { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(20px, 4vw, 32px); box-shadow: var(--shadow); }
.band h2 { margin: 0 0 .2em; font-size: clamp(1.3rem, 3vw, 1.7rem); }
.band p { margin: 0; color: var(--muted); }

/* Footer (CANON-006/042) */
.site-footer { border-top: 1px solid var(--border); padding: 36px 0 44px; color: var(--muted); font-size: .92rem; }
.site-footer .wrap { display: grid; gap: 18px; }
.foot-top { display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: center; justify-content: space-between; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot-links a { color: var(--muted); text-decoration: none; }
.foot-links a:hover { color: var(--text); text-decoration: underline; }
.foot-legal { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; font-size: .85rem; }
.foot-legal a { color: var(--muted); }
.staging-flag { position: fixed; right: 12px; bottom: 12px; z-index: 70; font: 700 .7rem/1 var(--mono); letter-spacing: .08em; background: var(--signal); color: #fff; padding: 7px 10px; border-radius: 8px; box-shadow: var(--shadow); }
:root[data-theme="dark"] .staging-flag { color: #0a0e17; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .staging-flag { color: #0a0e17; } }

/* 404 */
.center { text-align: center; padding: clamp(64px, 12vw, 140px) 0; }
.center .cta-row { justify-content: center; }

/* Utilities (no inline styles: strict CSP) */
.mt-lg { margin-top: 28px; }
.mt-md { margin-top: 18px; }
.mx-auto { margin-inline: auto; }
body:has(.staging-flag) .site-footer { padding-bottom: 76px; } /* keep the fixed staging flag off the legal line */
