/* Someone Said AI. Now What? - Opening Edition
   Deep Night palette (AMTL portfolio standard). No external fonts, no trackers. */
:root{
  --bg:#0A0E14; --surface:#12181F; --surface-2:#18212B;
  --gold:#C9944A; --ink:#E8E4DC; --muted:#A9B1BB;
  --line:#26313D; --field:#6B7888;
  --on-accent:#0A0E14; --accent-hover:#D6A55E;
  --read:Georgia,"Iowan Old Style","Palatino Linotype",Palatino,serif;
  --ui:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
}
/* Light theme (reader choice, stored in localStorage) */
:root[data-theme="light"]{
  --bg:#FAF8F4; --surface:#FFFFFF; --surface-2:#F1ECE3;
  --gold:#8A5A1A; --ink:#17212C; --muted:#4A5563;
  --line:#DDD6CA; --field:#6B7888;
  --on-accent:#FFFFFF; --accent-hover:#7A5418;
  color-scheme:light;
}
:root{color-scheme:dark}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
:root[data-size="1"]{font-size:112.5%} :root[data-size="2"]{font-size:125%} :root[data-size="3"]{font-size:137.5%} :root[data-size="4"]{font-size:150%}
h1,h2,h3,.prose,.fig,.toc{overflow-wrap:break-word}
body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--ui);font-size:1.0625rem;line-height:1.6;min-height:100vh;display:flex;flex-direction:column}
a{color:var(--gold);text-underline-offset:.18em}
a:hover{text-decoration-thickness:2px}
:focus-visible{outline:3px solid var(--gold);outline-offset:3px;border-radius:2px}
.skip{position:absolute;left:-999px;top:0;background:var(--gold);color:var(--on-accent);padding:.6rem 1rem;z-index:10;font-weight:600}
.skip:focus{left:1rem;top:1rem}
.visually-hidden{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* Header: logo top-left, quote middle, seal top-right */
.site-header{display:grid;grid-template-columns:auto 1fr auto auto;grid-template-areas:'logo quote ctrl seal' 'panel panel panel panel';align-items:center;column-gap:16px;row-gap:0;padding:.75rem clamp(1rem,4vw,2.5rem);border-bottom:1px solid var(--line)}
/* BRAND RULE (Mani, standing): the AMTL seal is always shown on every page, in both themes,
   bigger than the logo and legible. Sizes are in px so text-size changes never shrink it.
   Desktop seal 88px vs logo 48px; phone seal 64px vs logo 36px. Do not hide it at any breakpoint. */
.brand-logo{grid-area:logo}.brand-seal{grid-area:seal;display:block;flex:none}
.brand-logo img{display:block;height:48px;width:auto}
.brand-logo .logo-dark{display:none}
:root[data-theme="light"] .brand-logo .logo-light{display:none}
:root[data-theme="light"] .brand-logo .logo-dark{display:block}
.display-toggle{grid-area:ctrl;display:inline-flex;align-items:center;justify-content:center;gap:.45rem;min-width:44px;min-height:44px;padding:0 14px;border:1px solid var(--field);border-radius:999px;background:transparent;color:var(--ink);font:500 14px/1 var(--ui);cursor:pointer}
.display-toggle:hover,.display-toggle[aria-expanded="true"]{border-color:var(--gold);color:var(--gold)}
.display-toggle .aa{font:700 16px/1 var(--read)}
.display-toggle[hidden]{display:none}
.display-panel{grid-area:panel;display:flex;flex-wrap:wrap;gap:12px 32px;justify-content:flex-end;padding:12px 0 4px;border-top:1px solid var(--line);font:15px/1.3 var(--ui)}
.display-panel[hidden]{display:none}
.dp-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.dp-label{color:var(--muted)}
.seg{display:inline-flex;align-items:center;border:1px solid var(--field);border-radius:8px;overflow:hidden}
.seg button{min-width:48px;min-height:44px;padding:0 12px;border:0;background:transparent;color:var(--ink);font:600 15px/1 var(--ui);cursor:pointer}
.seg button+button,.seg output+button,.seg button+output{border-left:1px solid var(--field)}
.seg button[aria-pressed="true"]{background:var(--gold);color:var(--on-accent)}
.seg button:disabled{color:var(--muted);opacity:.55;cursor:default}
.seg output{min-width:56px;text-align:center;color:var(--ink);font:600 15px/44px var(--ui)}
.dp-reset{min-height:44px;padding:0 10px;border:0;background:transparent;color:var(--gold);font:500 15px/1 var(--ui);text-decoration:underline;text-underline-offset:.18em;cursor:pointer}
.dp-reset:disabled{color:var(--muted);text-decoration:none;cursor:default;opacity:.55}
.header-quote{grid-area:quote;margin:0;text-align:center;text-wrap:balance;font-family:var(--read);font-style:italic;color:var(--muted);font-size:16px;line-height:1.3}
.brand-seal img{display:block;height:88px;width:88px}
@media (max-width:560px){.site-header{grid-template-columns:auto 1fr auto;grid-template-areas:'logo ctrl seal' 'quote quote quote' 'panel panel panel';column-gap:10px}.display-toggle{justify-self:end;padding:0 12px}.display-toggle .dt-label{display:none}.brand-logo img{height:36px}.brand-seal img{height:64px;width:64px}.header-quote{font-size:14px;padding:6px 0 2px;border-top:1px solid var(--line);margin-top:8px}.display-panel{justify-content:flex-start}}

main{flex:1;width:100%}
.wrap{max-width:44rem;margin:0 auto;padding:2.5rem clamp(1rem,5vw,1.5rem) 3.5rem}
.wrap-wide{max-width:60rem}

/* Type */
h1,h2,h3{font-family:var(--ui);line-height:1.25;color:var(--ink)}
h1{font-size:clamp(1.8rem,5vw,2.4rem);margin:.2rem 0 1.4rem;letter-spacing:-.01em}
h2{font-size:1.35rem;margin:2.6rem 0 .9rem}
h3{font-size:1.1rem;margin:2rem 0 .6rem;color:var(--gold)}
p{margin:0 0 1.05rem}
.eyebrow{font-size:.8125rem;letter-spacing:.08em;text-transform:uppercase;color:var(--gold);margin:0}
.muted{color:var(--muted)}
.lede{font-size:1.2rem;color:var(--muted);font-family:var(--read)}

/* Reading pages */
.prose{font-family:var(--read);font-size:1.15rem;line-height:1.75}
.prose h2,.prose h3{font-family:var(--ui)}
.prose ul,.prose ol{padding-left:1.4rem}
.prose li{margin:.35rem 0}
.prose blockquote{margin:1.2rem 0;padding-left:1rem;border-left:3px solid var(--gold);color:var(--muted)}
.chapter-note{font-family:var(--ui);font-size:.95rem;color:var(--muted);border-left:3px solid var(--gold);padding:.2rem 0 .2rem .9rem;margin:0 0 2rem}
.blank{display:block;border-bottom:1px solid var(--field);height:1.6em;margin:.1rem 0 .6rem}
.crumbs{font-size:.95rem;margin:0 0 1.5rem}
.pager{display:flex;justify-content:space-between;gap:1rem;margin-top:3.5rem;padding-top:1.5rem;border-top:1px solid var(--line);font-size:1rem}
.pager a{display:block;max-width:48%;text-decoration:none}
.pager a span{display:block;font-size:.8125rem;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}
.pager a strong{text-decoration:underline;text-underline-offset:.18em;font-weight:600}
.pager .next{margin-left:auto;text-align:right}
.pager a,[data-mr]{overflow-wrap:anywhere}
@media (max-width:560px){.pager{flex-direction:column}.pager a{max-width:100%}.pager .next{text-align:left;margin-left:0}}

/* Buttons */
.actions{display:flex;flex-wrap:wrap;gap:.8rem;margin:2rem 0 1rem}
.btn{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:.7rem 1.4rem;border-radius:6px;font:600 1rem/1.2 var(--ui);text-decoration:none;cursor:pointer;border:1px solid var(--gold)}
.btn-primary{background:var(--gold);color:var(--on-accent)}
.btn-primary:hover{background:var(--accent-hover);border-color:var(--accent-hover)}
.btn-quiet{background:transparent;color:var(--gold)}
.btn-quiet:hover{background:var(--surface)}
.btn-small{min-height:44px;padding:.5rem 1rem;font-size:.95rem}

/* Home */
.home{text-align:left}
.home h1{font-family:var(--read);font-size:clamp(2.2rem,8vw,3.4rem);font-weight:normal;margin:.6rem 0 1rem}
.promise{font-size:1rem;color:var(--muted);margin:0}
.byline{font-size:1rem;color:var(--muted);margin:0 0 1.6rem}

/* Contents */
.toc{list-style:none;padding:0;margin:0}
.toc li{display:flex;flex-wrap:wrap;align-items:baseline;gap:.2rem .8rem;padding:.8rem 0;border-bottom:1px solid var(--line)}
.toc .label{flex:0 0 7.5rem;font-size:.875rem;color:var(--muted)}
.toc .title{flex:1 1 14rem}
.toc a{font-weight:600}
.toc .soon .title{color:var(--muted)}
.tag{font-size:.75rem;letter-spacing:.04em;color:var(--muted);border:1px solid var(--field);border-radius:999px;padding:.05rem .55rem;white-space:nowrap}
details.more{margin:1.2rem 0;border:1px solid var(--line);border-radius:8px;background:var(--surface)}
details.more>summary{cursor:pointer;padding:.9rem 1rem;font-weight:600;color:var(--gold);min-height:44px}
details.more>div{padding:0 1rem 1rem}

/* Callout */
.callout{background:var(--surface);border:1px solid var(--line);border-left:3px solid var(--gold);border-radius:6px;padding:1rem 1.1rem;margin:1.6rem 0;font-family:var(--ui);font-size:1rem}
.callout p:last-child{margin:0}

/* Figures (web: Deep Night) */
.fig{margin:2.2rem 0;padding:1.2rem;background:var(--surface);border:1px solid var(--line);border-radius:8px;font-family:var(--ui);font-size:1rem;line-height:1.5}
.fig-id{font-size:.75rem;letter-spacing:.1em;color:var(--gold);margin:0 0 .3rem}
.fig-title{font-size:1.15rem;font-weight:700;margin:0 0 1rem;color:var(--ink)}
.fig .grid{display:grid;grid-template-columns:1fr 1fr;gap:.9rem 1.2rem}
.fig .journey{display:grid;grid-template-columns:repeat(3,1fr);gap:.9rem 1.2rem}
.fig .item{border-top:2px solid var(--gold);padding:.6rem 0 0;min-width:0;overflow-wrap:anywhere}
.fig .item-h{font-weight:700;margin:0 0 .2rem;color:var(--ink)}
.fig .item p{margin:0;color:var(--muted)}
.fig ol{padding-left:1.4rem;margin:0}
.fig table{border-collapse:collapse;width:100%;font-size:.95rem}
.fig th,.fig td{border:1px solid var(--field);padding:.6rem;text-align:left;vertical-align:top}
.fig thead th{background:var(--surface-2);color:var(--gold)}
.fig tbody th{color:var(--ink)}
.fig td{color:var(--muted)}
.fig figcaption{margin-top:1rem;font-size:.9rem;color:var(--muted)}
.fig-tool .actions{margin:1rem 0 .2rem}
@media (max-width:560px){.fig{padding:1rem}.fig .grid,.fig .journey{grid-template-columns:1fr}.fig th,.fig td{padding:.5rem .6rem;overflow-wrap:break-word}}

/* Tool */
.tool fieldset{border:0;padding:0;margin:0 0 1.8rem}
.tool legend{font-weight:700;font-size:1.1rem;padding:0;margin-bottom:.6rem}
.tool label{display:block;font-size:.95rem;color:var(--muted);margin:.7rem 0 .3rem}
.tool .hint{font-size:.9rem;color:var(--muted);margin:.1rem 0 .4rem}
.tool textarea{width:100%;min-height:5.2rem;padding:.7rem .8rem;background:var(--surface);color:var(--ink);border:1px solid var(--field);border-radius:6px;font:1rem/1.5 var(--ui);resize:vertical}
.tool textarea.short{min-height:3.2rem}
.tool textarea:focus{border-color:var(--gold)}
.tool details.more{margin-top:.5rem}
.status{min-height:1.5em;font-size:.9rem;color:var(--muted);margin:.4rem 0 0}
.privacy-line{font-size:.95rem;color:var(--muted)}
.toolbar{display:flex;flex-wrap:wrap;gap:.6rem;margin:1.5rem 0 .5rem}

/* History */
.history{list-style:none;padding:0;margin:0}
.history li{padding:1rem 0;border-bottom:1px solid var(--line)}
.history time{display:block;font-size:.875rem;color:var(--gold);font-weight:600}

/* Footer */
.site-footer{border-top:1px solid var(--line);background:var(--surface);padding:1.6rem clamp(1rem,4vw,2.5rem);font-size:.9375rem;color:var(--muted)}
.site-footer .ambient{max-width:60rem;margin:0 auto 1.1rem;font-size:.875rem;color:var(--muted)}
.site-footer .ambient-weather::before{content:' · '}
.site-footer .cols{max-width:60rem;margin:0 auto;display:flex;flex-wrap:wrap;gap:1rem 2.5rem;justify-content:space-between}
.site-footer p{margin:0 0 .4rem}
.site-footer ul{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:.3rem 1.2rem}
.site-footer li a{display:inline-block;padding:.35rem 0}

@media (prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}

/* Print: light, ink-friendly */
@media print{
  :root{--bg:#fff;--surface:#fff;--surface-2:#f3f1ec;--ink:#111;--muted:#333;--line:#bbb;--field:#777;--gold:#7a5516}
  body{background:#fff;color:#111;font-size:11pt}
  .site-header,.site-footer,.pager,.crumbs,.toolbar,.skip,.no-print{display:none!important}
  .tool textarea{border:1px solid #777;background:#fff;color:#111;min-height:4rem}
  details.more>div{display:block!important}
  a{color:#111}
}

/* Phones (any text size): stack figure tables as cards so words never split */
@media (max-width:560px){
  .fig table{table-layout:auto}
  .fig thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  .fig tr,.fig th,.fig td{display:block;width:auto!important}
  .fig tbody th{border-bottom:0;padding-bottom:.2rem;font-size:1rem}
  .fig tr{margin-bottom:.8rem}
}
/* Never split words inside figures */
.fig th,.fig td{hyphens:none!important;word-break:normal}
/* Round 2 figure types: step sequences (incl. converted SVG diagrams) and route tables */
.fig .sequence{list-style:decimal;padding-left:1.6rem;margin:0}
.fig .sequence li{margin:0 0 .9rem;padding:0;color:var(--muted)}
.fig .sequence li:last-child{margin-bottom:0}
.fig .sequence li strong{color:var(--ink)}
.fig .sequence li::marker{color:var(--gold);font-weight:700}
@media (max-width:560px){.fig td[data-label]::before{content:attr(data-label);display:block;font-weight:700;color:var(--gold);font-size:.85rem;margin-bottom:.15rem}}
