/* Clockwork theme, time-machine edition (13 Oct 2026): loaded after style.css when UI_THEME=clockwork (or the visitor
   picks it in the header). Brushed steel, copper and amber backlight, after the picture the operator chose.
   It only restyles: every page works the same in the classic look. The first clockwork look lives on as brass.css. */

:root {
  --bg: #080b0f;
  --surface: #11171e;
  --surface-2: #18202a;
  --text: #e6ecf1;
  --muted: #8f9dab;
  --border: #27313c;
  --accent: #ffa64d;
  --accent-text: #1b0e04;
  --pos: #4fe0a0;
  --neg: #ff6e5c;
  --warn-bg: #2e2210;
  --warn-text: #ffc266;
  --err-bg: #34161a;
  --ok-bg: #0f2a20;
  --info-bg: #142231;
  --radius: 12px;
  --chrome-hi: #f3f6f9;
  --copper-hi: #f4b98a;
  --copper: #c97b4a;
  --copper-lo: #6b3719;
  --amber: #ff9a2e;
  --glow: rgba(255, 150, 50, 0.45);
  --display: "Chakra Petch", "Bahnschrift", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}

body {
  background:
    radial-gradient(1100px 560px at 50% -12%, rgba(255, 140, 40, 0.13), transparent 62%),
    radial-gradient(900px 640px at 108% 110%, rgba(60, 110, 190, 0.12), transparent 60%),
    radial-gradient(700px 500px at -10% 60%, rgba(201, 123, 74, 0.07), transparent 60%),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px) 0 0 / 100% 36px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px) 0 0 / 36px 100%,
    var(--bg);
  background-attachment: fixed;
}
a { color: var(--accent); }
a:hover { color: #ffd29a; }
h1, h2, h3, .brand, legend { font-family: var(--display); }
h1 {
  font-weight: 700;
  letter-spacing: 0.03em;
  background: linear-gradient(180deg, #ffffff 0%, #cfd8e0 55%, #8b98a6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
h2 { color: var(--accent); font-size: 0.98rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em;
     text-shadow: 0 0 14px rgba(255, 150, 50, 0.35); }
h3 { color: #e3e9ee; font-weight: 600; letter-spacing: 0.04em; }
code { background: #0a0e13; color: #ffc58f; border: 1px solid var(--border); }
::selection { background: rgba(255, 154, 46, 0.35); }

/* top bar: dark steel with an amber light seam */
.topbar {
  position: relative;
  background: linear-gradient(180deg, #151c24, #0a0e13);
  border-bottom: 1px solid #2a343f;
  box-shadow: 0 10px 30px -14px rgba(255, 140, 40, 0.5);
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--amber) 25%, #ffe0b8 50%, var(--amber) 75%, transparent) 0 0 / 200% 100%;
  animation: tm-seam 9s linear infinite;
}
.brand { color: var(--chrome-hi); font-size: 1.06rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; }
.brand-mark { width: 30px; height: 30px; color: var(--amber); filter: drop-shadow(0 0 6px rgba(255, 150, 50, 0.7)); }
nav a, .linklike { color: #c5ced7; font-family: var(--display); font-size: 0.86rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; }
nav a:hover, .linklike:hover { color: #ffd29a; text-shadow: 0 0 10px var(--glow); }
nav a[aria-current=page] { color: var(--amber); font-weight: 600; text-shadow: 0 0 12px var(--glow); box-shadow: 0 2px 0 var(--amber); }
.theme-switch { opacity: 0.7; }

/* panels: brushed-steel plates, copper rivets, amber backlight along the top edge */
.card {
  position: relative;
  background:
    radial-gradient(circle at 11px 11px, var(--copper-hi) 0 0.9px, var(--copper) 1.6px, #2a160b 2.5px, transparent 3.2px),
    radial-gradient(circle at calc(100% - 11px) 11px, var(--copper-hi) 0 0.9px, var(--copper) 1.6px, #2a160b 2.5px, transparent 3.2px),
    radial-gradient(circle at 11px calc(100% - 11px), var(--copper-hi) 0 0.9px, var(--copper) 1.6px, #2a160b 2.5px, transparent 3.2px),
    radial-gradient(circle at calc(100% - 11px) calc(100% - 11px), var(--copper-hi) 0 0.9px, var(--copper) 1.6px, #2a160b 2.5px, transparent 3.2px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 120px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 3px),
    linear-gradient(165deg, var(--surface-2), var(--surface) 55%, #0d1218);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 0 0 1px rgba(0, 0, 0, 0.35),
    0 20px 40px -24px rgba(0, 0, 0, 0.9),
    0 0 36px -18px rgba(255, 140, 40, 0.3);
}
.card::before {
  content: ""; position: absolute; top: 0; left: 18px; right: 18px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 166, 77, 0.85), transparent);
}

/* buttons: polished copper that lights up */
.btn {
  background: linear-gradient(180deg, var(--copper-hi), var(--copper) 52%, #9a5229);
  color: var(--accent-text);
  border: 1px solid var(--copper-lo);
  border-radius: 8px;
  font-family: var(--display);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 0 0 1px rgba(0, 0, 0, 0.4), 0 6px 18px -8px rgba(255, 140, 40, 0.6);
  transition: box-shadow 0.2s, filter 0.2s;
}
.btn:hover { filter: brightness(1.08); color: var(--accent-text);
             box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.4), 0 0 22px -4px rgba(255, 150, 50, 0.75); }
.btn.ghost { background: rgba(255, 255, 255, 0.02); color: #ffc28a; border-color: #46515d; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05); }
.btn.ghost:hover { color: #ffd9b0; border-color: var(--amber); box-shadow: 0 0 16px -4px var(--glow); }
.btn.danger { background: linear-gradient(180deg, #ff8a78, #d9432f 55%, #9e2a1b); border-color: #5e1810; color: #fff4f0;
              box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 6px 18px -8px rgba(255, 80, 60, 0.6); }
.btn.danger:hover { color: #fff4f0; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 22px -4px rgba(255, 90, 70, 0.75); }

input[type=email], input[type=password], input[type=text], input[type=number], select {
  background: #0a0e13; border-color: #2c3742; color: var(--text); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}
input[type=email]:focus, input[type=password]:focus, input[type=text]:focus, input[type=number]:focus, select:focus {
  border-color: var(--amber); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6), 0 0 0 3px rgba(255, 154, 46, 0.18);
}
input[type=checkbox], input[type=radio] { accent-color: var(--amber); }
input:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
fieldset.choice { border-color: var(--border); background: rgba(0, 0, 0, 0.15); }

.pill { border: 1px solid rgba(255, 166, 77, 0.3); background: rgba(255, 154, 46, 0.08); color: #ffc58f; font-family: var(--display); letter-spacing: 0.08em; }
.pill.ok { background: rgba(79, 224, 160, 0.08); color: var(--pos); border-color: rgba(79, 224, 160, 0.35); box-shadow: 0 0 12px -4px rgba(79, 224, 160, 0.5); }
.pill.warn { background: rgba(255, 194, 102, 0.08); color: var(--warn-text); border-color: rgba(255, 194, 102, 0.35); }
.pill.live, .pill.neg-pill { background: rgba(255, 110, 92, 0.1); color: var(--neg); border-color: rgba(255, 110, 92, 0.4); box-shadow: 0 0 12px -4px rgba(255, 110, 92, 0.5); }
.pill.practice { background: rgba(110, 160, 230, 0.1); color: #9cc2f5; border-color: rgba(110, 160, 230, 0.38); }
.pill.ai { background: rgba(170, 140, 255, 0.1); color: #c9b6ff; border-color: rgba(170, 140, 255, 0.38); }

.status { font-family: var(--display); font-size: 1.15rem; letter-spacing: 0.06em; text-transform: uppercase; }
.status.on { text-shadow: 0 0 14px rgba(79, 224, 160, 0.55); }
.status.warn { text-shadow: 0 0 14px rgba(255, 194, 102, 0.45); }
.todo { color: var(--warn-text); }

/* number readouts: small recessed instrument windows */
.stats > div { background: rgba(0, 0, 0, 0.24); border: 1px solid #212b35; border-radius: 8px; padding: 8px 10px;
               box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), inset 0 -10px 20px -14px rgba(255, 140, 40, 0.25); }
.stats .label { font-family: var(--display); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; }
.stats .value { color: #f1f5f8; }
.stats .value.pos, .stats .value .pos { color: var(--pos); }
.stats .value.neg, .stats .value .neg { color: var(--neg); }

th { color: var(--muted); font-family: var(--display); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
th, td { padding: 7px 8px; border-bottom-color: #1f2831; }
td { font-size: 0.92rem; }
tr:hover td { background: rgba(255, 154, 46, 0.035); }
tr.current td { background: rgba(255, 154, 46, 0.1); box-shadow: inset 0 1px 0 rgba(255, 166, 77, 0.25), inset 0 -1px 0 rgba(255, 166, 77, 0.25); }
.events li, .briefs li, .verdicts li, .scenarios li, .checklist li, .views li { border-bottom-color: #1f2831; }
.grid.desk-row { grid-template-columns: minmax(300px, 1fr) minmax(380px, 1.3fr); }
@media (max-width: 860px) { .grid.desk-row { grid-template-columns: 1fr; } }

.flash { background: rgba(110, 160, 230, 0.08); border: 1px solid rgba(110, 160, 230, 0.25); border-left: 3px solid #6ea0e6; }
.flash.success { background: rgba(79, 224, 160, 0.07); border-color: rgba(79, 224, 160, 0.25); border-left-color: var(--pos); }
.flash.error { background: rgba(255, 110, 92, 0.08); border-color: rgba(255, 110, 92, 0.3); border-left-color: var(--neg); }
.flash.warning { background: rgba(255, 194, 102, 0.07); border-color: rgba(255, 194, 102, 0.3); border-left-color: var(--warn-text); }
.footer { color: #7b8996; }

/* --- dashboard: the time-machine panel --- */
.chrono-panel {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, 1fr); gap: 28px; align-items: center; padding: 24px 24px 24px 30px;
  overflow: hidden;  /* keeps the dial's glow inside the panel */
  border-color: #3b2e24;
  box-shadow:
    inset 0 0 0 1px rgba(255, 166, 77, 0.12),
    inset 0 0 60px -20px rgba(255, 140, 40, 0.35),
    0 0 50px -16px rgba(255, 140, 40, 0.45),
    0 24px 50px -28px #000;
}
.chrono-panel::after {  /* the door's copper hinges */
  content: ""; position: absolute; left: 0; top: 16%; bottom: 16%; width: 8px; pointer-events: none;
  background:
    linear-gradient(90deg, var(--copper-lo), var(--copper-hi) 45%, #9a5229) top / 100% 56px no-repeat,
    linear-gradient(90deg, var(--copper-lo), var(--copper-hi) 45%, #9a5229) bottom / 100% 56px no-repeat;
  border-radius: 0 3px 3px 0;
}
@media (max-width: 860px) { .chrono-panel { grid-template-columns: 1fr; padding: 16px 16px 16px 22px; } }
.chrono-col { background: radial-gradient(closest-side, rgba(255, 140, 40, 0.1), transparent); }
.chrono { max-width: 600px; margin: 0 auto; }
.chrono svg { width: 100%; height: auto; display: block; overflow: visible; }
.control-col h2.spaced { margin-top: 22px; }
.control-col .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.chrono-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; margin-top: 10px; color: var(--muted); }
.chrono-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chrono-legend .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.chrono-legend .dot.win { background: #13a866; box-shadow: 0 0 8px rgba(19, 168, 102, 0.7); }
.chrono-legend .dot.loss { background: #e2412f; box-shadow: 0 0 8px rgba(226, 65, 47, 0.7); }
.chrono-legend .dot.open { background: #ff9f1c; box-shadow: 0 0 8px rgba(255, 159, 28, 0.8); }
.chrono-legend .dot.veto { border: 2px solid #9fb0c0; width: 8px; height: 8px; }
.chrono-legend .bar { width: 16px; height: 6px; border-radius: 3px; display: inline-block; }
.chrono-legend .muted { flex-basis: 100%; text-align: center; font-family: var(--display); letter-spacing: 0.06em; }

/* the dial: polished steel bezel, copper ring, white enamel face, blue-steel hand, amber backlight */
.chrono .halo-in { stop-color: #ff8c28; stop-opacity: 0; }
.chrono .halo-mid { stop-color: #ff9a2e; stop-opacity: 0.55; }
.chrono .halo-out { stop-color: #ff8c28; stop-opacity: 0; }
.chrono .brass-hi { stop-color: #ffffff; }
.chrono .brass-mid { stop-color: #a7b2bd; }
.chrono .brass-lo { stop-color: #343d47; }
.chrono .copper-hi { stop-color: #f6c49a; }
.chrono .copper-mid { stop-color: #c97b4a; }
.chrono .copper-lo { stop-color: #5e2f14; }
.chrono .face-hi { stop-color: #ffffff; }
.chrono .face-lo { stop-color: #d5dbe1; }
.chrono .glass-hi { stop-color: #18212b; }
.chrono .glass-lo { stop-color: #05080b; }
.chrono .bezel { stroke: #1e252d; stroke-width: 1.5; }
.chrono .bezel-groove { fill: none; stroke: #4b5561; stroke-width: 1.6; opacity: 0.9; }
.chrono .studs circle { fill: url(#copper); stroke: #3a1d0c; stroke-width: 0.6; }
.chrono .copper-ring { fill: none; stroke: url(#copper); stroke-width: 4; }
.chrono .face { stroke: #9aa6b2; stroke-width: 1; }
.chrono .track { fill: none; stroke: #aab6c2; stroke-width: 1; stroke-dasharray: 2 4; }
.chrono .tick-minor { stroke: #8593a1; stroke-width: 1; }
.chrono .tick-hour { stroke: #3d4b5a; stroke-width: 1.6; }
.chrono .tick-major { stroke: #16202b; stroke-width: 3; stroke-linecap: round; }
.chrono .numeral { font-family: var(--display); font-size: 18px; font-weight: 700; fill: #172331; text-anchor: middle; dominant-baseline: central; }

.chrono .session { opacity: 0.7; stroke: rgba(255, 255, 255, 0.6); stroke-width: 0.8; }
.chrono .session:hover { opacity: 1; }
.s-sydney { fill: #4f86e8; background: #4f86e8; }
.s-tokyo { fill: #d35d9e; background: #d35d9e; }
.s-london { fill: #2fb378; background: #2fb378; }
.s-newyork { fill: #f28c28; background: #f28c28; }

.chrono .sub-face { fill: #f4f6f8; stroke: url(#brass); stroke-width: 3.5; }
.chrono .sub-sweep { fill: none; stroke: #a9b4bf; stroke-width: 1.4; }
.chrono .sub-zone { fill: none; stroke: #e2412f; stroke-width: 4; stroke-linecap: round; }
.chrono .sub-tick { stroke: #4a5868; stroke-width: 1.1; }
.chrono .sub-needle { stroke: #1f4d99; stroke-width: 2.2; stroke-linecap: round; }
.chrono .sub-hub { fill: url(#copper); }
.chrono .sub-value { font-family: var(--display); font-size: 13.5px; font-weight: 700; fill: #172331; text-anchor: middle; }
.chrono .sub-label { font-family: var(--display); font-size: 8px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; fill: #5b6a79; text-anchor: middle; }
.chrono .subdial.pos .sub-value { fill: #0f8a55; }
.chrono .subdial.neg .sub-value { fill: #c7362a; }

/* the readout is a dark glass window with a glowing number, like the machine's display */
.chrono .readout-frame { fill: url(#brass); stroke: #1e252d; stroke-width: 1; }
.chrono .readout-glass { fill: url(#glass); stroke: #000; stroke-width: 0.8; }
.chrono .centre-label { font-family: var(--display); font-size: 10.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; fill: #8ea2b5; text-anchor: middle; }
.chrono .centre-value { font-family: var(--display); font-size: 31px; font-weight: 700; fill: #ffb054; text-anchor: middle; filter: url(#glow); }
.chrono .centre-value.pos { fill: #4fe0a0; }
.chrono .centre-value.neg { fill: #ff6e5c; }
.chrono .centre-sub { font-family: var(--display); font-size: 12px; letter-spacing: 0.06em; fill: #a7b6c4; text-anchor: middle; }

.chrono .marker { stroke: #ffffff; stroke-width: 1.8; cursor: help; }
.chrono .marker.win { fill: #13a866; }
.chrono .marker.loss { fill: #e2412f; }
.chrono .marker.flat { fill: #8b97a3; }
.chrono .marker.open { fill: #ff9f1c; animation: tm-pulse 2.4s ease-in-out infinite; }
.chrono .marker.veto circle { fill: #ffffff; stroke: #5b6b7b; stroke-width: 1.6; }
.chrono .marker.veto line { stroke: #5b6b7b; stroke-width: 1.6; stroke-linecap: round; }
.chrono .marker:focus { outline: none; stroke: var(--amber); stroke-width: 3; }

.chrono .hand-shaft { stroke: #1f4d99; stroke-width: 3.4; stroke-linecap: round; }
.chrono .hand-tail { stroke: #1f4d99; stroke-width: 6; stroke-linecap: round; }
.chrono .hand-tip { fill: #ff8a2a; stroke: #7a330b; stroke-width: 0.8; }
.chrono .hand { transition: transform 0.6s ease; }
.chrono .hub { fill: url(#brass); stroke: #1e252d; stroke-width: 1.2; }
.chrono .hub-pin { fill: url(#copper); }

.chrono .gear { fill: #24170f; stroke: #c27a48; stroke-width: 1.4; transform-box: fill-box; transform-origin: center; }
.chrono .g1 { animation: tm-spin 90s linear infinite; }
.chrono .g2 { animation: tm-spin 64s linear infinite reverse; }
.chrono .g3 { animation: tm-spin 110s linear infinite reverse; }
.chrono .g4 { animation: tm-spin 52s linear infinite; }

@keyframes tm-spin { to { transform: rotate(360deg); } }
@keyframes tm-pulse { 0%, 100% { stroke-opacity: 1; stroke-width: 1.8; } 50% { stroke-opacity: 0.4; stroke-width: 5; } }
@keyframes tm-seam { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .chrono .gear, .chrono .marker.open, .topbar::after { animation: none; }
  .chrono .hand { transition: none; }
}

/* scenarios */
.fan svg { background: rgba(0, 0, 0, 0.25); border: 1px solid var(--border); border-radius: 8px; }
.fan .grid { stroke: #1f2831; }
.fan .band-outer, .fan .band-inner { fill: var(--amber); }
.fan .median { stroke: #ffd29a; }
.sc-label { color: var(--accent); font-family: var(--display); }
.scenario-group h3 { color: #e3e9ee; }

/* performance chart */
.chart svg { background: rgba(0, 0, 0, 0.25); border: 1px solid var(--border); }
.chart .equity { stroke: var(--amber); }

/* AI desk & checklist */
.briefs .who { color: var(--accent); font-family: var(--display); letter-spacing: 0.1em; }
.op { border-color: var(--border); background: rgba(0, 0, 0, 0.22); }
.scan { border-left-color: var(--copper); }
.check-mark { border: 1px solid var(--border); font-family: var(--display); }
details.review summary:hover { background: rgba(255, 154, 46, 0.05); }
details.more summary { color: var(--accent); }
