/* ==========================================================================
   Minutes to Decimal — Shared Design System
   Modern-minimal · "clock steel" blues + warm amber "clock hand" accent
   System-font stack (zero web-font cost) · tabular numerals for figures
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  color-scheme: light;

  /* Palette */
  --ink:        #0b2239;   /* deep navy text */
  --ink-soft:   #3d5573;   /* secondary text */
  --muted:      #6b7d94;   /* captions / meta */
  --line:       #e2e8f0;   /* hairlines */
  --line-soft:  #eef2f7;
  --paper:      #f7f9fc;   /* page background */
  --surface:    #ffffff;   /* cards */
  --surface-2:  #f2f6fc;   /* subtle fill */

  --brand:      #1466c7;   /* primary blue */
  --brand-ink:  #0f4f9e;   /* darker blue (hover) */
  --brand-tint: #e8f1fc;   /* light blue wash */
  --amber:      #f59e0b;   /* warm accent = clock hand */
  --amber-deep: #d97a06;

  /* Type */
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;

  /* Scale */
  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.9rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  --step-1:  clamp(1.2rem, 1.12rem + 0.4vw, 1.4rem);
  --step-2:  clamp(1.45rem, 1.3rem + 0.7vw, 1.85rem);
  --step-3:  clamp(1.8rem, 1.55rem + 1.2vw, 2.55rem);
  --step-4:  clamp(2.2rem, 1.8rem + 2vw, 3.4rem);

  /* Space + shape */
  --radius:   14px;
  --radius-sm: 9px;
  --radius-lg: 22px;
  --shadow:   0 1px 2px rgba(11,34,57,.06), 0 10px 30px -12px rgba(11,34,57,.18);
  --shadow-sm: 0 1px 2px rgba(11,34,57,.06), 0 4px 12px -8px rgba(11,34,57,.16);
  --ring:     0 0 0 3px rgba(20,102,199,.25);
  --wrap: 1120px;
  --wrap-narrow: 780px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
body {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-ink); text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; color: var(--ink); font-weight: 700; letter-spacing: -.01em; margin: 0 0 .5em; }
p { margin: 0 0 1.1em; }
strong { font-weight: 700; color: var(--ink); }
:where(h1,h2,h3,h4,a,button):focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }

/* tabular figures everywhere numbers matter */
.num, td, th, .tool, table { font-variant-numeric: tabular-nums; }

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2rem); }
.narrow { max-width: var(--wrap-narrow); }
.section { padding-block: clamp(2.6rem, 6vw, 4.6rem); }
.section--tint { background: linear-gradient(180deg, #fff, var(--surface-2)); border-block: 1px solid var(--line-soft); }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5em;
  font-size: var(--step--1); font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--brand); margin: 0 0 .8rem;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--amber); border-radius: 2px; }
.lead { font-size: var(--step-1); color: var(--ink-soft); line-height: 1.6; }

/* ---------- Skip link ---------- */
.skip {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: 0 0 10px 0;
}
.skip:focus { left: 0; color: #fff; }

/* ==========================================================================
   Header / Nav
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(150%) blur(10px);
  -webkit-backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 66px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink); font-size: 1.12rem; }
.brand:hover { text-decoration: none; color: var(--ink); }
.brand__mark { width: 30px; height: 30px; flex: 0 0 auto; }
.brand__mark circle, .brand__mark line { transition: none; }
.brand b { color: var(--brand); }

.nav__links { display: flex; align-items: center; gap: .35rem; list-style: none; margin: 0; padding: 0; }
.nav__links a {
  display: inline-block; padding: .5rem .8rem; border-radius: 9px;
  color: var(--ink-soft); font-weight: 600; font-size: .96rem;
}
.nav__links a:hover { background: var(--brand-tint); color: var(--brand-ink); text-decoration: none; }
.nav__links a[aria-current="page"] { color: var(--brand); background: var(--brand-tint); }

.nav__toggle {
  display: none; width: 44px; height: 44px; border: 1px solid var(--line); background: #fff;
  border-radius: 10px; cursor: pointer; align-items: center; justify-content: center;
}
.nav__toggle span, .nav__toggle span::before, .nav__toggle span::after {
  content: ""; display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; position: relative;
}
.nav__toggle span::before { position: absolute; top: -6px; }
.nav__toggle span::after  { position: absolute; top: 6px; }

@media (max-width: 780px) {
  .nav__toggle { display: inline-flex; }
  .nav__links {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: .15rem;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: .6rem clamp(1.1rem, 4vw, 2rem) 1rem;
    box-shadow: var(--shadow-sm);
    display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: .75rem .7rem; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { position: relative; overflow: hidden; padding-block: clamp(2.2rem, 5vw, 3.4rem) clamp(2rem, 4vw, 3rem); background: radial-gradient(1200px 500px at 80% -10%, var(--brand-tint), transparent 60%); }
.hero__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.hero h1 { font-size: var(--step-4); margin-bottom: .35em; }
.hero h1 .accent { color: var(--brand); }
.hero .lead { max-width: 46ch; }
.hero__chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.3rem; }
.chip {
  font-size: var(--step--1); font-weight: 600; color: var(--ink-soft);
  background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .35rem .8rem;
}
.chip b { color: var(--brand); font-variant-numeric: tabular-nums; }
@media (max-width: 880px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__copy { order: 1; }
  .hero__tool { order: 2; }
}

/* ==========================================================================
   Tool / Converter
   ========================================================================== */
.tool {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: clamp(1.1rem, 2.5vw, 1.6rem);
}
.tool__tabs { display: flex; gap: .3rem; background: var(--surface-2); padding: .3rem; border-radius: 12px; margin-bottom: 1.2rem; }
.tool__tab {
  flex: 1; border: 0; background: transparent; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: .92rem; color: var(--ink-soft);
  padding: .6rem .5rem; border-radius: 9px; transition: background .15s, color .15s, box-shadow .15s;
}
.tool__tab:hover { color: var(--ink); }
.tool__tab[aria-selected="true"] { background: #fff; color: var(--brand); box-shadow: var(--shadow-sm); }

.tool__panel { display: none; }
.tool__panel.is-active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.field-row { display: flex; gap: .8rem; flex-wrap: wrap; }
.field { flex: 1 1 140px; }
.field label { display: block; font-weight: 700; font-size: .9rem; color: var(--ink-soft); margin-bottom: .35rem; }
.field input {
  width: 100%; font-family: var(--mono); font-size: 1.35rem; font-weight: 600; color: var(--ink);
  padding: .7rem .85rem; border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
  -moz-appearance: textfield;
}
.field input::-webkit-outer-spin-button, .field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }

.tool__result {
  margin-top: 1.2rem; background: linear-gradient(180deg, var(--brand-tint), #fff);
  border: 1px solid #cfe1f7; border-radius: 14px; padding: 1.1rem 1.2rem;
  display: flex; align-items: center; justify-content: flex-start; gap: 1.3rem; flex-wrap: wrap;
}
.tool__result .dial-wrap { flex: 0 0 auto; }
.tool__result .dial { width: 148px; }
.tool__result .result-text { flex: 1 1 190px; }
.tool__result .r-label { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--brand-ink); margin: 0 0 .15rem; }
.tool__result .r-value { font-family: var(--mono); font-size: clamp(1.9rem, 5vw, 2.6rem); font-weight: 700; color: var(--ink); line-height: 1.05; margin: 0 0 .5rem; }
.tool__result .r-value small { font-size: .45em; font-weight: 700; color: var(--muted); margin-left: .3em; }
.tool__result .r-sub { font-size: .9rem; color: var(--ink-soft); margin: 0 0 .8rem; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: .95rem;
  padding: .7rem 1.1rem; border-radius: 11px; border: 1.5px solid transparent; transition: transform .12s, background .15s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-ink); color: #fff; text-decoration: none; }
.btn--ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.btn--copy.copied { background: #12855a; border-color: #12855a; color: #fff; }

.tool__opts { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; font-size: .9rem; color: var(--ink-soft); }
.tool__opts label { font-weight: 600; display: inline-flex; align-items: center; gap: .5rem; }
.tool__opts select {
  font-family: inherit; font-size: .9rem; padding: .4rem .6rem; border: 1.5px solid var(--line);
  border-radius: 9px; background: #fff; color: var(--ink); cursor: pointer;
}
.tool__opts select:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.tool__hint { margin: .9rem 0 0; font-size: .86rem; color: var(--muted); }
.tool__hint code { font-family: var(--mono); background: var(--surface-2); padding: .1rem .4rem; border-radius: 6px; color: var(--brand-ink); }

/* Clock dial signature element */
.dial-wrap { display: grid; place-items: center; }
.dial { width: min(240px, 72%); height: auto; }
.dial .face { fill: #fff; stroke: var(--line); stroke-width: 2; }
.dial .tick { stroke: #c4d2e3; stroke-width: 2; }
.dial .tick--q { stroke: var(--brand); stroke-width: 3; }
.dial .wedge { fill: rgba(20,102,199,.14); stroke: none; }
.dial .hand { stroke: var(--amber); stroke-width: 3.5; stroke-linecap: round; }
.dial .hub { fill: var(--amber-deep); }
.dial .center-num { font-family: var(--mono); font-weight: 700; fill: var(--ink); }
.dial .center-lbl { font-family: var(--sans); font-weight: 600; fill: var(--muted); }

/* ==========================================================================
   Content typography (article body)
   ========================================================================== */
.prose { max-width: 72ch; }
.prose.full { max-width: none; }
.prose h2 { font-size: var(--step-2); margin-top: 2.2em; scroll-margin-top: 84px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: var(--step-1); margin-top: 1.8em; color: var(--ink); scroll-margin-top: 84px; }
.prose h4 { font-size: var(--step-0); margin-top: 1.4em; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.prose li { margin-bottom: .5em; }
.prose li::marker { color: var(--brand); }
.prose > p:first-of-type { color: var(--ink-soft); }

.callout {
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--amber);
  border-radius: 12px; padding: 1rem 1.2rem; margin: 1.6em 0; box-shadow: var(--shadow-sm);
}
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: var(--ink); }

/* Formula display */
.formula {
  font-family: var(--mono); font-size: clamp(1.05rem, 2.5vw, 1.3rem); font-weight: 600;
  background: var(--ink); color: #eaf2fd; border-radius: 12px;
  padding: 1rem 1.2rem; margin: 1.4em 0; text-align: center; letter-spacing: .01em;
}
.formula .op { color: var(--amber); }

/* ==========================================================================
   Tables
   ========================================================================== */
.table-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; margin: 1.6em 0; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .98rem; }
caption { text-align: left; font-weight: 700; padding: 1rem 1.1rem .2rem; color: var(--ink); }
thead th {
  background: var(--surface-2); color: var(--ink); text-align: left; font-weight: 700; font-size: .82rem;
  text-transform: uppercase; letter-spacing: .05em; padding: .7rem 1.1rem; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td { padding: .65rem 1.1rem; border-bottom: 1px solid var(--line-soft); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: #fbfdff; }
tbody tr:hover { background: var(--brand-tint); }
th.right, td.right { text-align: right; }
.cell-strong { font-weight: 700; color: var(--brand-ink); }

/* Two-column grids for cards */
.grid { display: grid; gap: 1rem; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--auto { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
@media (max-width: 720px) { .grid--2, .grid--3 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.2rem 1.3rem; box-shadow: var(--shadow-sm); height: 100%;
}
.card h3, .card h4 { margin-top: 0; }
.card .big { font-family: var(--mono); font-weight: 700; font-size: 1.5rem; color: var(--brand); display: block; margin-bottom: .2rem; }
.card p:last-child { margin-bottom: 0; }
.card--mini { display: flex; flex-direction: column; gap: .1rem; }

/* Quick-value pills */
.pills { display: flex; flex-wrap: wrap; gap: .55rem; margin: 1.4em 0; padding: 0; list-style: none; }
.pills li { margin: 0; }
.pill-val {
  display: inline-flex; align-items: baseline; gap: .45rem; background: #fff; border: 1px solid var(--line);
  border-radius: 999px; padding: .4rem .85rem; font-size: .92rem; box-shadow: var(--shadow-sm);
}
.pill-val b { font-family: var(--mono); color: var(--brand-ink); }

/* ==========================================================================
   FAQ (details/summary)
   ========================================================================== */
.faq { display: grid; gap: .7rem; margin: 1.5em 0; }
.faq details {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  transition: box-shadow .15s;
}
.faq details[open] { box-shadow: var(--shadow-sm); border-color: #cfe1f7; }
.faq summary {
  cursor: pointer; list-style: none; padding: 1rem 1.2rem; font-weight: 700; color: var(--ink);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; font-family: var(--mono); font-size: 1.4rem; color: var(--brand); line-height: 1; transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .faq__body { padding: 0 1.2rem 1.1rem; color: var(--ink-soft); }
.faq .faq__body p:last-child { margin-bottom: 0; }

/* ==========================================================================
   On-page TOC
   ========================================================================== */
.toc {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.3rem; box-shadow: var(--shadow-sm);
}
.toc h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 .7rem; }
.toc ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 2rem; }
.toc li { margin-bottom: .45rem; break-inside: avoid; }
.toc a { color: var(--ink-soft); font-weight: 600; font-size: .94rem; }
.toc a:hover { color: var(--brand); }
@media (max-width: 620px) { .toc ul { columns: 1; } }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--ink); color: #b9c6d6; margin-top: 3rem; }
.site-footer a { color: #d7e3f2; }
.site-footer a:hover { color: #fff; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; padding-block: clamp(2.2rem, 5vw, 3.2rem); }
.footer__brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; color: #fff; font-size: 1.1rem; margin-bottom: .7rem; }
.footer__brand b { color: #fff; }
.site-footer p { color: #93a4b8; font-size: .94rem; max-width: 42ch; }
.footer h3 { color: #fff; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 .9rem; }
.footer__links { list-style: none; margin: 0; padding: 0; }
.footer__links li { margin-bottom: .55rem; }
.footer__links a { font-size: .95rem; color: #b9c6d6; }
.footer__bottom { border-top: 1px solid rgba(255,255,255,.1); padding-block: 1.2rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .88rem; color: #8496ab; }
@media (max-width: 720px) { .footer__grid { grid-template-columns: 1fr; gap: 1.6rem; } }

/* ==========================================================================
   Page hero (interior pages)
   ========================================================================== */
.page-hero { background: linear-gradient(180deg, var(--brand-tint), #fff); border-bottom: 1px solid var(--line); padding-block: clamp(2rem, 5vw, 3.2rem); }
.breadcrumbs { font-size: .86rem; color: var(--muted); margin-bottom: .8rem; }
.breadcrumbs a { color: var(--ink-soft); font-weight: 600; }
.breadcrumbs span { margin-inline: .4rem; color: var(--line); }
.page-hero h1 { font-size: var(--step-3); margin-bottom: .25em; }
.page-hero p { color: var(--ink-soft); max-width: 62ch; margin-bottom: 0; }
.updated { font-size: .82rem; color: var(--muted); margin-top: .8rem; }

/* ==========================================================================
   Step flow (numbered how-it-works)
   ========================================================================== */
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 1.6em 0; padding: 0; list-style: none; counter-reset: flow; }
.flow li {
  position: relative; margin: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.3rem 1.2rem 1.2rem; box-shadow: var(--shadow-sm);
}
.flow li::before {
  counter-increment: flow; content: counter(flow);
  display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: .7rem;
  font-family: var(--mono); font-weight: 700; font-size: 1.05rem; color: #fff;
  background: var(--brand); border-radius: 10px; box-shadow: 0 4px 10px -4px rgba(20,102,199,.6);
}
.flow li h3 { font-size: 1.02rem; margin: 0 0 .3rem; }
.flow li p { font-size: .92rem; color: var(--ink-soft); margin: 0; }
.flow li:not(:last-child)::after {
  content: "›"; position: absolute; top: 50%; right: -.72rem; transform: translateY(-50%);
  font-size: 1.5rem; line-height: 1; color: var(--brand); font-weight: 700;
}
@media (max-width: 860px) {
  .flow { grid-template-columns: repeat(2, 1fr); }
  .flow li:nth-child(2)::after { content: none; }
}
@media (max-width: 460px) {
  .flow { grid-template-columns: 1fr; }
  .flow li::after { content: none !important; }
}

/* Icon card (who-can-use grid) */
.card__ico {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px;
  background: var(--brand-tint); color: var(--brand-ink); margin-bottom: .8rem;
}
.card__ico svg { width: 22px; height: 22px; }

/* utilities */
.mt-0 { margin-top: 0; }
.center { text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
