:root {
  color-scheme: dark;
  --ink: #0d1312;
  --panel: #131b1a;
  --panel-2: #192321;
  --line: rgba(233, 225, 202, .15);
  --ivory: #eee7d3;
  --muted: #9da7a2;
  --red: #c6573e;
  --red-bright: #e26a4e;
  --mint: #77b8a1;
  --gold: #c5a968;
  --blue: #7aa8be;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--ink);
  color: var(--ivory);
  font-variant-numeric: tabular-nums lining-nums;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: #0d1312; }

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 7% 8%, rgba(72, 109, 94, .18), transparent 28rem),
    radial-gradient(circle at 93% 30%, rgba(149, 76, 52, .10), transparent 30rem),
    #0d1312;
  color: var(--ivory);
}

button, input, select { font: inherit; }
button, select { color: inherit; }

button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--red-bright);
  outline-offset: 3px;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .16;
  z-index: 20;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.24'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.topbar {
  min-height: 92px;
  padding: 18px clamp(22px, 4vw, 68px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 16, 15, .76);
  backdrop-filter: blur(14px);
  position: relative;
  z-index: 10;
}

.brand-lockup { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(238, 231, 211, .38);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--red-bright);
  font-family: Georgia, serif;
  font-size: 19px;
  box-shadow: inset 0 0 0 4px rgba(255,255,255,.025);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-family: Georgia, serif; font-weight: 500; font-size: 24px; letter-spacing: .035em; }

.mode-switch {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0b1110;
}

.mode {
  min-height: 35px;
  padding: 0 15px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.mode span { margin-left: 5px; color: #68726e; font-size: 8px; }
.mode.active { color: #fff8e7; background: #293431; box-shadow: inset 0 -2px var(--red); }
.mode:disabled { cursor: default; color: #56605c; }

.run-indicator { justify-self: end; display: flex; align-items: center; gap: 9px; color: var(--mint); font-size: 11px; letter-spacing: .13em; text-transform: uppercase; }
.run-indicator i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 13px currentColor; }
.run-indicator.paused { color: #727d78; }

main { width: min(1500px, calc(100% - 48px)); margin: 0 auto; }

.instrument-layout {
  display: grid;
  grid-template-columns: minmax(570px, 1.45fr) minmax(350px, .72fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
  padding: 38px 0 34px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #8e9893;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .17em;
  text-transform: uppercase;
}
.section-label span { color: var(--red-bright); }
.section-label::after { content: ""; width: 42px; height: 1px; background: var(--line); }

.watch-stage {
  position: relative;
  min-height: 660px;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.watch-stage::before {
  content: none;
}

#watch-svg {
  width: min(100%, 720px);
  height: auto;
  overflow: visible;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.dial-brand { fill: #262722; font: 600 12px/1 Georgia, "Times New Roman", serif; letter-spacing: 2.8px; }
.dial-small { fill: #555750; font: 600 9px/1 Georgia, serif; letter-spacing: 2px; }
.dial-swiss { fill: #4c4e49; font: 600 7px/1 Georgia, serif; letter-spacing: 2.2px; }
.fixed-minute-number { fill: #5a5d57; font: 600 7px/1 "SFMono-Regular", Consolas, monospace; }
.dial-hour-number { fill: #171916; font: 700 30px/1 "Times New Roman", Georgia, serif; }
.dial-angle-number { fill: #0e5199; font: 700 26px/1 Georgia, "Times New Roman", serif; letter-spacing: -.7px; }
.bezel-degree-number { fill: #0b50a0; font: 700 29px/1 Georgia, "Times New Roman", serif; letter-spacing: -1px; }
.bezel-quarter-number { fill: #292b28; font: 600 11px/1 Georgia, "Times New Roman", serif; }
.central-time-number { fill: #181a17; font: 500 20px/1 Georgia, "Times New Roman", serif; }
.central-angle-number { fill: #a83227; font: 600 13px/1 Georgia, "Times New Roman", serif; }
.eot-seconds-pointer { fill: #151713; pointer-events: none; transition: opacity .18s; }
.eot-seconds-pointer line { stroke: #151713; stroke-width: 3; stroke-linecap: round; }
.eot-seconds-pointer.inactive { opacity: 0; }

.hand, .drag-surface { cursor: grab; }
.hand:active, .drag-surface:active { cursor: grabbing; }
.hand-hit { fill: none; stroke: transparent; stroke-width: 24; pointer-events: none; }
.hand.selected-control .hand-hit { pointer-events: stroke; }
.second-hit { stroke-width: 16; }
.drag-tip { fill: transparent; stroke: transparent; stroke-width: 2; transition: fill .18s, stroke .18s, r .18s; pointer-events: all; cursor: grab; }
.selected-control .drag-tip, .hand:hover .drag-tip { fill: rgba(27, 118, 179, .12); stroke: #268dca; }
.selected-control .drag-tip { animation: tip-pulse 2s ease-out infinite; }
.rotatable-part.selected-control { filter: drop-shadow(0 0 5px rgba(66, 145, 196, .72)); }

@keyframes tip-pulse { 50% { stroke-width: 5; fill: rgba(27, 118, 179, .2); } }

.selected-chip {
  position: absolute;
  left: 1%;
  bottom: 52px;
  display: grid;
  grid-template-columns: 9px auto;
  column-gap: 9px;
  align-items: center;
  padding: 10px 13px;
  border: 1px solid rgba(238, 231, 211, .18);
  border-radius: 4px;
  background: rgba(14, 21, 19, .88);
  box-shadow: 0 10px 25px rgba(0,0,0,.25);
}
.selected-chip span { grid-row: 1 / 3; width: 8px; height: 8px; border-radius: 50%; background: var(--red-bright); box-shadow: 0 0 9px rgba(226,106,78,.5); }
.selected-chip b { font-size: 11px; letter-spacing: .04em; }
.selected-chip small { color: var(--muted); font-size: 8px; letter-spacing: .15em; text-transform: uppercase; }
.drag-hint { position: absolute; bottom: 20px; width: 100%; text-align: center; color: #69736f; font-size: 10px; letter-spacing: .07em; }

.readout-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(30, 41, 39, .96), rgba(14, 21, 20, .96));
  box-shadow: 0 24px 70px rgba(0,0,0,.28);
  overflow: hidden;
}
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; padding: 25px 26px 18px; }
.panel-heading h2 { margin: 0; font: 500 21px/1.1 Georgia, serif; letter-spacing: .02em; }
.precision-badge { padding: 5px 8px; border: 1px solid rgba(119,184,161,.3); border-radius: 3px; color: var(--mint); font-size: 9px; font-weight: 700; letter-spacing: .08em; }

.hero-readout { padding: 23px 26px 25px; border-block: 1px solid var(--line); background: rgba(7, 12, 11, .35); }
.hero-readout span { display: block; margin-bottom: 9px; color: #9aa49f; font-size: 9px; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.hero-readout strong { display: block; color: #fff8e4; font: 400 clamp(33px, 3.2vw, 48px)/1 Georgia, "Times New Roman", serif; letter-spacing: .02em; text-shadow: 0 0 25px rgba(229,218,188,.12); }
.hero-readout small { display: block; margin-top: 9px; color: #66716d; font-size: 9px; letter-spacing: .06em; }

.readout-list { margin: 0; padding: 9px 26px 6px; }
.readout-list > div { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding: 11px 0; border-bottom: 1px solid rgba(238,231,211,.08); }
.readout-list dt { color: #939d98; font-size: 10px; letter-spacing: .05em; }
.readout-list dd { margin: 0; color: #e6dfcd; font: 500 15px/1.2 "SFMono-Regular", Consolas, monospace; }
.readout-list dd em { margin-left: 5px; color: var(--red-bright); font-style: normal; font-size: 10px; }
.readout-list .signed { color: var(--mint); }
.readout-list .accent-row dt { color: #d5c8a8; }
.readout-list .accent-row dd { color: #fff7df; font-size: 19px; }
#eot-pointer-display { color: #d2c5a6; font-size: 11px; }

.equation-card { margin: 13px 26px 19px; padding: 16px; border-left: 2px solid var(--red); background: rgba(0,0,0,.20); }
.equation-kicker { display: block; margin-bottom: 9px; color: #73807a; font-size: 8px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.equation-card div { display: flex; align-items: center; justify-content: space-between; color: #d8d1bf; }
.equation-card b { font-size: 12px; }
.equation-card i { color: var(--red); font-style: normal; font-size: 10px; }
.equation-card p { margin: 9px 0 0; color: #7d8984; font: 10px/1.4 "SFMono-Regular", Consolas, monospace; }

.breakdown { border-top: 1px solid var(--line); }
.breakdown summary { padding: 15px 26px; color: #8e9994; cursor: pointer; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.breakdown dl { margin: 0; padding: 0 26px 18px; }
.breakdown dl div { display: flex; justify-content: space-between; padding: 5px 0; }
.breakdown dt { color: #78837e; font-size: 10px; }
.breakdown dd { margin: 0; font: 10px/1.2 monospace; color: #c7c0ae; }

.control-deck { padding: 26px 0 38px; border-top: 1px solid var(--line); }
.deck-header { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 22px; }
.selection-tabs { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.selection-tabs button { padding: 7px 11px; border: 1px solid rgba(238,231,211,.12); border-radius: 3px; background: #121a18; color: #818c87; font-size: 9px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.selection-tabs button.active { border-color: rgba(198,87,62,.55); color: #f0e5cf; background: rgba(198,87,62,.13); }

.controls-grid { display: grid; grid-template-columns: .82fr 1.15fr 1fr 1.3fr; gap: 12px; }
.control-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 6px; background: rgba(22,31,29,.72); }
.card-title { min-height: 26px; display: flex; align-items: center; gap: 9px; margin-bottom: 17px; }
.card-title > span { width: 21px; height: 21px; display: grid; place-items: center; border: 1px solid rgba(198,87,62,.45); border-radius: 50%; color: var(--red-bright); font: 700 8px/1 sans-serif; }
.card-title h3 { margin: 0; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.card-title small { margin-left: auto; color: #66716c; font-size: 8px; letter-spacing: .07em; text-transform: uppercase; }

.transport-buttons { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 5px; }
.transport-buttons button, .utc-button { min-height: 39px; border: 1px solid rgba(238,231,211,.13); border-radius: 3px; background: #101716; color: #a9b1ad; font-size: 10px; font-weight: 700; }
.transport-buttons button.primary { border-color: #a94935; background: #a94935; color: #fff5e0; }
.transport-buttons button span { margin-right: 3px; }
.utc-button { width: 100%; margin-top: 6px; color: var(--mint); }

.time-fields, .eot-fields { display: flex; align-items: flex-end; gap: 7px; }
.time-fields > b { padding-bottom: 10px; color: #68736e; }
label { color: #76817c; font-size: 8px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
input[type="number"], select {
  display: block;
  width: 100%;
  height: 39px;
  margin-top: 6px;
  padding: 0 9px;
  border: 1px solid rgba(238,231,211,.16);
  border-radius: 3px;
  background: #0d1412;
  color: #eee6d3;
  font: 600 14px/1 monospace;
}
.time-fields label { flex: 1; min-width: 48px; }
.time-fields .period-label { flex: .9; min-width: 58px; }
.eot-fields label { flex: 1; }
.eot-fields label:first-child { max-width: 58px; }
.field-note { margin: 12px 0 0; color: #65706b; font-size: 8px; line-height: 1.4; }

.range-field { display: grid; grid-template-columns: 1fr 67px; gap: 6px 10px; align-items: center; margin-top: 9px; }
.range-field > span { grid-column: 1 / -1; display: flex; justify-content: space-between; }
.range-field output { color: #d6cebb; font: 9px/1 monospace; }
input[type="range"] { width: 100%; height: 3px; margin: 0; appearance: none; border-radius: 5px; background: #38423e; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 14px; height: 14px; border: 3px solid #1b2422; border-radius: 50%; background: var(--red-bright); box-shadow: 0 0 0 1px #ae4934; }
.degree-number { height: 31px !important; margin: 0 !important; padding: 0 5px !important; font-size: 10px !important; }
.setting-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 13px; }
.setting-actions button { min-height: 34px; padding: 5px 8px; border: 1px solid rgba(30, 91, 148, .5); border-radius: 3px; background: rgba(18, 62, 101, .2); color: #a9c9df; font-size: 8px; font-weight: 700; letter-spacing: .04em; }

.method-strip { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 6px; margin-bottom: 45px; background: rgba(19,27,25,.65); }
.method-strip div { padding: 18px 22px; border-right: 1px solid var(--line); }
.method-strip div:last-child { border: 0; }
.method-strip span { display: block; margin-bottom: 7px; color: #68746f; font-size: 8px; letter-spacing: .13em; text-transform: uppercase; }
.method-strip b { color: #c9c1af; font-size: 10px; font-weight: 600; }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 20px clamp(24px, 4vw, 68px); border-top: 1px solid var(--line); color: #5e6964; font-size: 9px; letter-spacing: .07em; }

@media (max-width: 1120px) {
  .topbar { grid-template-columns: 1fr auto; }
  .mode-switch { order: 3; grid-column: 1 / -1; justify-self: center; }
  .instrument-layout { grid-template-columns: minmax(500px, 1.2fr) minmax(330px, .8fr); gap: 25px; }
  .watch-stage { min-height: 540px; }
  .controls-grid { grid-template-columns: 1fr 1.25fr; }
  .method-strip { grid-template-columns: 1fr 1fr; }
  .method-strip div:nth-child(2) { border-right: 0; }
  .method-strip div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 860px) {
  main { width: min(100% - 28px, 720px); }
  .instrument-layout { grid-template-columns: 1fr; }
  .watch-stage { min-height: auto; padding-bottom: 55px; }
  .selected-chip { bottom: 53px; }
  .readout-panel { max-width: 600px; width: 100%; justify-self: center; }
  .deck-header { align-items: flex-start; flex-direction: column; }
  .selection-tabs { justify-content: flex-start; }
}

@media (max-width: 580px) {
  .topbar { min-height: 80px; padding: 14px 18px; gap: 15px; }
  .brand-lockup .eyebrow { display: none; }
  .brand-mark { width: 36px; height: 36px; }
  h1 { font-size: 19px; }
  .run-indicator span { display: none; }
  .mode { padding: 0 9px; font-size: 9px; }
  .mode span { display: none; }
  .instrument-layout { padding-top: 26px; }
  .controls-grid, .method-strip { grid-template-columns: 1fr; }
  .method-strip div { border-right: 0; border-bottom: 1px solid var(--line); }
  .method-strip div:nth-child(3) { border-bottom: 1px solid var(--line); }
  .controls-grid { gap: 9px; }
  .hero-readout strong { font-size: 33px; }
  .selected-chip { transform: scale(.88); transform-origin: left bottom; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
