/* ChronoDesk — instrument-panel design system
   Palette drawn from clock mechanisms: brass dial accents + a deep teal
   digital-readout color, on a cool paper background. Mono numerals are used
   ONLY for calculated output (a real readout), never as decoration. */

:root {
  --ink: #1E2422;
  --muted: #5B645C;
  --bg: #EEF0EA;
  --panel: #FFFFFF;
  --panel-alt: #E6E9E0;
  --line: #D6DACE;
  --brass: #A9762E;
  --brass-dark: #8A5F23;
  --teal: #2B6F63;
  --teal-dark: #1E5449;
  --danger: #A6392F;
  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-pill: 999px;
  --shadow-panel: 0 1px 0 rgba(30,36,34,0.04), 0 8px 24px -16px rgba(30,36,34,0.25);
  --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px);
  background-size: 100% 42px;
  background-attachment: local;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--brass); outline-offset: 2px;
}

img { max-width: 100%; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.prose { max-width: 700px; }

/* ---------- Header ---------- */
.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.wordmark {
  font-weight: 600; font-size: 19px; color: var(--ink); display: flex; align-items: center; gap: 8px;
}
.wordmark .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brass); display: inline-block; }
.live-clock {
  font-family: var(--font-mono); font-size: 13px; color: var(--teal-dark);
  background: var(--panel-alt); padding: 5px 10px; border-radius: var(--radius-sm);
  letter-spacing: 0.02em;
}
nav.main-nav { display: flex; gap: 22px; align-items: center; }
nav.main-nav a { color: var(--muted); font-size: 14.5px; font-weight: 500; }
nav.main-nav a:hover { color: var(--ink); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 10px; font-family: var(--font-body); }

/* ---------- Hero (home only) ---------- */
.hero { padding: 72px 0 56px; border-bottom: 1px solid var(--line); }
.hero-readout {
  font-family: var(--font-mono);
  font-size: clamp(56px, 11vw, 118px);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1;
  margin: 0 0 8px;
}
.hero-date { color: var(--muted); font-size: 15px; margin-bottom: 28px; font-family: var(--font-mono); }
.hero h1 { font-size: 34px; margin: 0 0 12px; max-width: 620px; letter-spacing: -0.01em; }
.hero p.lede { color: var(--muted); font-size: 17px; max-width: 560px; margin: 0 0 28px; }
.hero-stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 8px; }
.hero-stat b { display: block; font-family: var(--font-mono); font-size: 22px; color: var(--brass-dark); }
.hero-stat span { color: var(--muted); font-size: 13px; }

/* ---------- Category grid ---------- */
.cat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px; margin: 40px 0 64px;
}
.cat-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 22px; display: block; color: var(--ink);
}
.cat-card:hover { border-color: var(--brass); text-decoration: none; }
.cat-card .cat-count { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.cat-card h3 { margin: 6px 0 10px; font-size: 18px; }
.cat-card ul { margin: 0; padding: 0; list-style: none; }
.cat-card li { font-size: 13.5px; color: var(--muted); padding: 3px 0; }
.cat-card li a { color: var(--muted); }
.cat-card li a:hover { color: var(--teal-dark); }
.cat-card .more { font-size: 13px; color: var(--brass-dark); margin-top: 8px; display: inline-block; }

/* ---------- Page header for tool pages ---------- */
.tool-head { padding: 44px 0 8px; }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.breadcrumb a { color: var(--muted); }
.tool-head h1 { font-size: 30px; margin: 0 0 10px; letter-spacing: -0.01em; }
.tool-head .lede { color: var(--muted); font-size: 16px; max-width: 640px; }

/* ---------- Calculator panel ---------- */
.calc-panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-md);
  box-shadow: var(--shadow-panel);
  margin: 28px 0 40px;
  padding: 28px;
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 32px;
}
@media (max-width: 760px) { .calc-panel { grid-template-columns: 1fr; padding: 20px; } }

.calc-inputs { display: flex; flex-direction: column; gap: 14px; }
.field-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.field { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 90px; }
.field label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.field input, .field select {
  font-family: var(--font-body); font-size: 15px; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg);
  color: var(--ink);
}
.field input:focus, .field select:focus { background: var(--panel); }
.op-toggle { display: flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; width: fit-content; }
.op-toggle label { margin: 0; }
.op-toggle input { display: none; }
.op-toggle span {
  display: block; padding: 8px 16px; font-size: 14px; cursor: pointer; color: var(--muted);
}
.op-toggle input:checked + span { background: var(--brass); color: #fff; }

.readout {
  background: var(--panel-alt); border-radius: var(--radius-md);
  padding: 26px 22px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  border: 1px solid var(--line);
}
.readout .value {
  font-family: var(--font-mono); font-size: clamp(28px, 4vw, 40px); color: var(--teal-dark);
  font-weight: 500; line-height: 1.1; word-break: break-word;
}
.readout .sub { margin-top: 10px; color: var(--muted); font-size: 13.5px; font-family: var(--font-mono); }

.btn {
  font-family: var(--font-body); font-weight: 600; font-size: 14.5px;
  padding: 10px 20px; border-radius: var(--radius-pill); border: none; cursor: pointer;
  background: var(--ink); color: #fff;
}
.btn:hover { background: var(--teal-dark); }
.btn-outline { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn-row { display: flex; gap: 10px; margin-top: 4px; }
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; }
.preset-btn {
  font-family: var(--font-mono); font-size: 13px; padding: 7px 13px; border-radius: var(--radius-pill);
  border: 1px solid var(--line); background: var(--bg); cursor: pointer; color: var(--ink);
}
.preset-btn:hover { border-color: var(--brass); }

.row-block { border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 12px; }
.row-block + .row-block { margin-top: 8px; }
.add-row-btn { align-self: flex-start; font-size: 13px; color: var(--brass-dark); background: none; border: none; cursor: pointer; padding: 0; font-weight: 600; }

.wc-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 14px; }
.wc-row:last-child { border-bottom: none; }
.wc-city { color: var(--muted); font-family: var(--font-body); }
.lap-row { font-family: var(--font-mono); font-size: 13px; padding: 4px 0; color: var(--muted); }

/* ---------- Content sections ---------- */
.section { padding: 36px 0; border-top: 1px solid var(--line); }
.section h2 { font-size: 21px; margin: 0 0 14px; }
.section p { color: var(--ink); }
.section.muted-bg { background: rgba(255,255,255,0.4); }

.faq-item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.faq-item:last-child { border-bottom: none; }
.faq-item h3 { font-size: 16px; margin: 0 0 6px; }
.faq-item p { margin: 0; color: var(--muted); font-size: 14.5px; }

.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.related-grid a {
  display: block; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-sm); color: var(--ink); font-size: 14px; font-weight: 500;
}
.related-grid a:hover { border-color: var(--teal); text-decoration: none; }

/* ---------- Affiliate card ---------- */
.affiliate-card {
  display: flex; gap: 16px; align-items: center; background: var(--panel);
  border: 1px solid var(--line); border-left: 3px solid var(--brass);
  border-radius: var(--radius-sm); padding: 16px 18px; margin: 28px 0;
}
.affiliate-card .aff-icon {
  width: 40px; height: 40px; border-radius: 50%; background: var(--panel-alt);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-family: var(--font-mono); color: var(--brass-dark); font-size: 18px;
}
.affiliate-card .aff-copy { flex: 1; }
.affiliate-card .aff-copy strong { font-size: 14.5px; }
.affiliate-card .aff-copy p { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.affiliate-card .aff-cta {
  font-size: 13.5px; font-weight: 600; color: #fff; background: var(--brass);
  padding: 8px 16px; border-radius: var(--radius-pill); white-space: nowrap;
}
.affiliate-card .aff-cta:hover { background: var(--brass-dark); text-decoration: none; }
.aff-disclosure { font-size: 11.5px; color: var(--muted); margin-top: 6px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--panel); margin-top: 40px; padding: 40px 0; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 20px; margin-bottom: 24px; }
.footer-grid h4 { font-size: 13px; text-transform: none; color: var(--muted); margin: 0 0 10px; font-weight: 600; }
.footer-grid a { display: block; font-size: 13.5px; color: var(--ink); padding: 3px 0; }
.footer-bottom { font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 20px; }

@media (max-width: 760px) {
  nav.main-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--panel);
    flex-direction: column; padding: 12px 24px; border-bottom: 1px solid var(--line); gap: 4px; }
  nav.main-nav.is-open { display: flex; }
  .nav-toggle { display: block; }
}
