/* Theme tokens mirrored from src/ui/public/css/clipclep.css. */
/* ─── ClipClep theme ───
   Loaded after styles.css. Re-points the legacy tokens at the ClipClep palette
   (#F9F7F7 / #DBE2EF / #3F72AF / #112D4E) and restyles the app shell to match
   design-handoff/ClipClep.dc.html. Light is the default; dark follows the OS
   unless the user pins a theme with <html data-theme="light|dark">. */

:root {
  --cl-offwhite: #F9F7F7;
  --cl-mist: #DBE2EF;
  --cl-blue: #3F72AF;
  --cl-navy: #112D4E;

  --bg: #F9F7F7;
  --bg2: #EEF1F6;
  --surface: #FFFFFF;
  --surface2: #DBE2EF;
  --surface3: #E8EDF5;
  --border: rgba(17, 45, 78, 0.10);
  --border-hover: rgba(17, 45, 78, 0.22);
  --text: #112D4E;
  --text2: rgba(17, 45, 78, 0.72);
  --text3: rgba(17, 45, 78, 0.52);

  --accent: #3F72AF;
  --accent-hover: #35629A;
  --accent-2: #6B9AD1;
  --accent-edge: #2F5A8F;
  --accent-subtle: rgba(63, 114, 175, 0.12);
  --accent-dim: rgba(63, 114, 175, 0.08);
  --accent-glow: rgba(63, 114, 175, 0.28);
  --on-accent: #F9F7F7;

  --green: #2E9E6B;
  --green-subtle: rgba(46, 158, 107, 0.12);
  --green-border: rgba(46, 158, 107, 0.30);
  --red: #D64B4B;
  --red-subtle: rgba(214, 75, 75, 0.10);
  --red-border: rgba(214, 75, 75, 0.30);
  --blue: #3F72AF;
  --blue-subtle: rgba(63, 114, 175, 0.10);
  --blue-border: rgba(63, 114, 175, 0.28);
  --yellow: #D9A233;
  --amber: #C48A1A;

  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(17, 45, 78, 0.08);
  --glass-hi: rgba(255, 255, 255, 0.6);
  --shadow-sm: 0 1px 2px rgba(17, 45, 78, 0.08);
  --shadow-md: 0 8px 24px -8px rgba(17, 45, 78, 0.18);
  --overlay: rgba(17, 45, 78, 0.55);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  color-scheme: light;
}

/* Dark tokens: declared twice (OS-driven and pinned) because CSS can't share a
   block between a media query and an attribute selector. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1F36;
    --bg2: #0E2742;
    --surface: #112D4E;
    --surface2: #1A3C63;
    --surface3: #17365A;
    --border: rgba(219, 226, 239, 0.12);
    --border-hover: rgba(219, 226, 239, 0.26);
    --text: #F9F7F7;
    --text2: rgba(219, 226, 239, 0.80);
    --text3: rgba(219, 226, 239, 0.56);
    --accent: #3F72AF;
    --accent-hover: #4E82C0;
    --accent-2: #6B9AD1;
    --accent-subtle: rgba(107, 154, 209, 0.16);
    --accent-dim: rgba(107, 154, 209, 0.10);
    --green: #5CCB97;
    --red: #F08080;
    --amber: #E2B04A;
    --glass-bg: rgba(17, 45, 78, 0.72);
    --glass-border: rgba(219, 226, 239, 0.10);
    --glass-hi: rgba(219, 226, 239, 0.06);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.5);
    --overlay: rgba(4, 14, 26, 0.72);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B1F36;
  --bg2: #0E2742;
  --surface: #112D4E;
  --surface2: #1A3C63;
  --surface3: #17365A;
  --border: rgba(219, 226, 239, 0.12);
  --border-hover: rgba(219, 226, 239, 0.26);
  --text: #F9F7F7;
  --text2: rgba(219, 226, 239, 0.80);
  --text3: rgba(219, 226, 239, 0.56);
  --accent: #3F72AF;
  --accent-hover: #4E82C0;
  --accent-2: #6B9AD1;
  --accent-subtle: rgba(107, 154, 209, 0.16);
  --accent-dim: rgba(107, 154, 209, 0.10);
  --green: #5CCB97;
  --red: #F08080;
  --amber: #E2B04A;
  --glass-bg: rgba(17, 45, 78, 0.72);
  --glass-border: rgba(219, 226, 239, 0.10);
  --glass-hi: rgba(219, 226, 239, 0.06);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.5);
  --overlay: rgba(4, 14, 26, 0.72);
  color-scheme: dark;
}


* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; }
body { margin: 0; font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); line-height: 1.7; }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: 4px; }
button, input { font: inherit; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 4px; }
.header { position: sticky; top: 0; z-index: 5; min-height: 80px; padding: 16px max(24px, calc((100vw - 1344px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 20px; background: var(--bg); border-bottom: 1px solid var(--border); }
.brand { display: flex; gap: 10px; align-items: center; text-decoration: none; font-size: 19px; font-weight: 700; white-space: nowrap; }
.brand img { border-radius: 8px; }
.brand-divider, .header-label { color: var(--text2); font-size: 14px; font-weight: 400; }
.header nav { display: flex; align-items: center; gap: 24px; font-size: 13px; }
.header nav a { text-decoration: none; }
.header nav a:hover, .back-top:hover { text-decoration: underline; }
.button { background: var(--accent); color: var(--on-accent); padding: 8px 18px; border-radius: 30px; font-weight: 600; }
.layout { display: grid; grid-template-columns: 260px minmax(0, 860px); gap: 72px; max-width: 1344px; margin: auto; padding: 0 24px; }
.sidebar { position: sticky; top: 106px; max-height: calc(100vh - 126px); overflow-y: auto; padding: 8px 16px 20px 0; }
.eyebrow { font: 600 11px/1.6 ui-monospace, monospace; letter-spacing: .1em; color: var(--text2); margin: 0 0 20px; }
aside { border-right: 1px solid var(--border); padding-top: 26px; }
label { display: block; font-size: 12px; margin-bottom: 6px; color: var(--text2); }
input { width: 100%; padding: 10px 12px; border: 1px solid var(--border-hover); border-radius: 9px; background: var(--surface); color: var(--text); font-size: 13px; }
input::placeholder { color: var(--text2); }
#clear-search { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 6px; cursor: pointer; margin-top: 8px; padding: 4px 10px; font-size: 12px; }
summary { cursor: pointer; font-size: 12px; color: var(--text2); padding: 22px 0 12px; }
[data-toc] { display: flex; flex-direction: column; gap: 3px; }
[data-toc] a { display: flex; align-items: baseline; gap: 12px; padding: 6px 8px; font-size: 13px; line-height: 1.5; border-radius: 6px; text-decoration: none; color: var(--text2); }
[data-toc] a span { font: 11px ui-monospace, monospace; color: var(--text2); }
[data-toc] a:hover, [data-toc] a[aria-current] { background: var(--accent-subtle); color: var(--text); }
.sidebar-footer { display: inline-block; margin: 24px 8px 0; font-size: 12px; color: var(--text2); }
main { min-width: 0; padding-top: 60px; }
.hero { padding-bottom: 30px; }
h1 { font-size: clamp(36px, 4vw, 54px); line-height: 1.1; letter-spacing: -.04em; margin: 0 0 24px; font-weight: 600; }
h1 span { display: block; font-family: Georgia, serif; font-style: italic; font-weight: 400; font-size: .83em; letter-spacing: -.035em; color: var(--text2); margin-top: 12px; }
.intro { font-size: 17px; color: var(--text2); max-width: 660px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px 24px; color: var(--text2); font: 11px/1.6 ui-monospace, monospace; margin: 28px 0; }
.journey { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border); background: var(--surface); border-radius: 12px; overflow: hidden; }
.journey span { font-size: 12px; padding: 14px 12px; text-align: center; }
.journey span + span { border-left: 1px solid var(--border); }
section { border-top: 1px solid var(--border); padding: 42px 0; scroll-margin-top: 10px; }
.section-number { font: 11px/1.6 ui-monospace, monospace; color: var(--text2); margin-bottom: 10px; }
h2 { font-size: 30px; line-height: 1.2; letter-spacing: -.025em; margin: 0 0 22px; font-weight: 600; }
h3 { font-size: 18px; line-height: 1.4; margin: 28px 0 10px; }
p, ul, ol { margin: 14px 0; }
article { font-size: 15px; }
article p, article li { color: var(--text2); }
article strong { color: var(--text); font-weight: 600; }
article a { font-weight: 600; }
li { padding-left: 5px; margin: 12px 0; }
ul, ol { padding-left: 24px; }
li::marker { color: var(--text); font-weight: 600; }
.note { background: var(--accent-subtle); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; padding: 16px 20px; font-size: 14px; margin-top: 24px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface); border: 1px solid var(--border); padding: 20px; border-radius: 12px; font-size: 13px; }
code { font-family: ui-monospace, monospace; }
.back-top { display: inline-block; margin-top: 18px; font-size: 12px; color: var(--text2); text-decoration: none; font-weight: 400; }
.guide-figure { width: min(100%, var(--shot-width)); margin: 28px 0 12px; }
.guide-figure > a { display: block; border: 1px solid var(--border-hover); border-radius: 12px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm); }
.guide-figure > a:hover { border-color: var(--accent); }
.guide-figure img { display: block; width: 100%; height: auto; }
.guide-figure figcaption { margin-top: 10px; color: var(--text2); font-size: 13px; line-height: 1.6; }
.figure-number { display: block; color: var(--text2); font: 11px/1.6 ui-monospace, monospace; letter-spacing: .06em; margin-bottom: 5px; }
.figure-zoom { display: block; margin-top: 5px; font-size: 12px; font-weight: 400; }
.screenshot-note { color: var(--text2); font-size: 13px; margin-top: 20px; }
.checklist { list-style-type: '✓  '; }
#search-result:not(:empty) { padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
footer { border-top: 1px solid var(--border); padding: 24px 0 60px; font-size: 13px; color: var(--text2); display: flex; justify-content: space-between; gap: 16px; align-items: baseline; flex-wrap: wrap; }
.skip-link { position: fixed; top: -100px; left: 20px; z-index: 10; background: var(--surface); padding: 10px 20px; }
.skip-link:focus { top: 8px; }
@media (max-width: 1000px) { .layout { gap: 36px; grid-template-columns: 230px minmax(0, 1fr); } }
@media (max-width: 760px) {
  .header { flex-wrap: wrap; padding: 14px 20px; gap: 12px; }
  .header nav { gap: 16px; }
  .header-label, .brand-divider { display: none; }
  .layout { display: block; padding: 0 20px; }
  aside { border-right: 0; border-bottom: 1px solid var(--border); padding: 20px 0; }
  .sidebar { position: static; max-height: none; padding: 0; }
  .sidebar > .eyebrow, .sidebar-footer { display: none; }
  [data-toc] { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
  summary { padding-top: 14px; }
  main { padding-top: 36px; }
  h2 { font-size: 26px; }
  section { padding: 32px 0; }
}
@media (max-width: 420px) {
  .header { gap: 8px; }
  .header nav { width: 100%; justify-content: space-between; }
  [data-toc] { grid-template-columns: 1fr; }
  .journey { grid-template-columns: 1fr 1fr; }
  .journey span:nth-child(3) { border-left: 0; }
  .journey span:nth-child(n+3) { border-top: 1px solid var(--border); }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print { .header, aside, .back-top, .skip-link, .hero-meta, .journey { display: none; } .layout { display: block; } main { padding-top: 0; } section[hidden] { display: block !important; } }
