/* JSF Timegrapher: bench instrument look. Brushed steel, ruby jewels, sapphire. */
/* JSF Watch Co brand: black and white, navy enamel and gold from the logo,
   Georgia bold capitals for headings, Syne Mono for text and numbers. */
:root {
  --steel: #ffffff;
  --plate: #f8f9fa;
  --paper: #ffffff;
  --graphite: #000000;
  --muted: #636a73;
  --rule: #e2e5e9;
  --ruby: #102f5e;      /* primary accent: navy (tick dots, active states) */
  --sapphire: #a8864f;  /* second accent: logo gold, darkened for contrast on white (tock dots) */
  --gold: #e8c894;
  --ok: #2e7d4f;
  --warn: #9a6a12;
  --radius-s: 4px;
  --radius-m: 10px;
  --leaf: 45px 0;       /* the site's button shape */
  --font: "Syne Mono", "Courier New", monospace;
  --display: Georgia, "Times New Roman", serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--graphite);
  background: var(--steel);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 1.5rem 1.25rem 2rem; }

h1, h2, .mark-name { font-family: var(--display); font-weight: 700; text-transform: uppercase; }
h1 { font-size: clamp(2.25rem, 6vw, 4.25rem); line-height: 1; margin: 0 0 1.25rem; letter-spacing: -0.03em; max-width: 14ch; }
h2 { font-size: 1.75rem; line-height: 1.1; margin: 0 0 .75rem; letter-spacing: 0.02em; color: var(--ruby); }
.lede { font-size: 1.125rem; color: var(--muted); max-width: 58ch; margin: 0 0 1.5rem; }
.fine { font-size: .875rem; color: var(--muted); max-width: 62ch; }
.error { color: #b3261e; font-weight: 700; }

/* Header */
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .875rem 1.25rem; border-bottom: 1px solid var(--rule); background: var(--plate);
}
.mark { display: flex; align-items: center; gap: .75rem; color: var(--graphite); text-decoration: none; }
.mark img { height: 40px; width: auto; display: block; }
.mark-name { font-size: 1.125rem; letter-spacing: 0.04em; line-height: 1; }
.mark-name small { display: block; font-family: var(--font); text-transform: none; font-weight: 400; font-size: .75rem; letter-spacing: 0; color: var(--muted); margin-top: .25rem; }
.status { display: flex; align-items: center; gap: .5rem; font-size: .875rem; color: var(--muted); text-align: right; }
.dot { width: .625rem; height: .625rem; border-radius: 50%; background: var(--rule); flex: none; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.bad { background: #b3261e; }

.banner { padding: .625rem 1.25rem; font-size: .9375rem; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.banner.warn { background: #f6ead4; color: #5a3a06; border-bottom: 1px solid #e2c992; }
.banner.sim { background: #eef2f8; color: var(--ruby); border-bottom: 1px solid #c9d3e3; }

/* Controls */
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; border-radius: var(--leaf); padding: .8rem 1.75rem; font-weight: 400; border: 1px solid transparent; }
button.primary { background: #000; color: #fafafa; }
button.primary:hover { background: var(--ruby); }
button.primary:disabled { background: #b9bdc2; cursor: not-allowed; }
button.secondary { background: #fff; border-color: #000; }
button.secondary:hover { background: var(--plate); }
button.link { background: none; border: none; padding: 0; text-decoration: underline; font-weight: 600; color: inherit; }
:focus-visible { outline: 3px solid var(--sapphire); outline-offset: 2px; }

label { display: block; font-size: .875rem; font-weight: 700; margin: 1rem 0 .3rem; }
select, input[type="number"], input[type="file"] {
  width: 100%; padding: .55rem .65rem; border: 1px solid var(--rule); border-radius: var(--radius-s); background: #fff;
}
.actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* Start */
.start { max-width: 720px; padding: 3rem 0 2rem; }

/* Wizard */
.wizard { max-width: 640px; background: var(--plate); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 2rem; }
.steps { display: flex; gap: .25rem; list-style: none; counter-reset: s; padding: 0; margin: 0 0 1.5rem; font-size: .8125rem; color: var(--muted); }
.steps li { flex: 1; counter-increment: s; padding-top: .5rem; border-top: 3px solid var(--rule); }
.steps li::before { content: counter(s) " "; font-weight: 700; }
.steps li.done { border-color: var(--graphite); color: var(--graphite); }
.steps li.current { border-color: var(--gold); color: var(--graphite); font-weight: 600; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: .875rem; font-weight: 600; margin-bottom: .5rem; }
.choice { display: flex; gap: .75rem; align-items: flex-start; font-weight: 400; padding: .875rem 1rem; margin: 0 0 .5rem; border: 1px solid var(--rule); border-radius: var(--radius-s); background: #fff; cursor: pointer; }
.choice strong { display: block; }
.choice input { margin-top: .3rem; accent-color: var(--ruby); }
.choice strong { font-weight: 700; }
.choice.disabled { opacity: .55; cursor: not-allowed; }
.advanced { margin-top: 1.25rem; font-size: .9375rem; }
.advanced summary { cursor: pointer; color: var(--muted); }

.meter { height: 14px; background: #fff; border: 1px solid var(--rule); border-radius: 7px; overflow: hidden; margin: 1rem 0 .5rem; }
.meter.small { height: 8px; margin: .25rem 0; }
.meter-fill { height: 100%; width: 0; background: var(--sapphire); transition: width .12s linear; }
.progress { height: 6px; background: var(--rule); border-radius: 3px; overflow: hidden; margin-bottom: 1.25rem; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--ruby), #1d4a8c); }
.readline { font-variant-numeric: tabular-nums; }
.calgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 0; }
.calgrid dt { font-size: .8125rem; color: var(--muted); }
.calgrid dd { margin: 0; font-size: 1.25rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.big { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; margin: 0 0 .5rem; }

/* Measure */
.readouts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 3px solid var(--ruby); border-bottom: 1px solid var(--rule); box-shadow: inset 0 1px 0 var(--gold); }
.readout { padding: 1rem 1.25rem 1.25rem 0; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .5rem; align-items: baseline; }
.readout + .readout { padding-left: 1.25rem; border-left: 1px solid var(--rule); }
.readout .label { grid-column: 1 / -1; font-size: .875rem; color: var(--muted); }
.readout .value { font-size: clamp(2.5rem, 7vw, 4.75rem); font-weight: 400; line-height: 1; letter-spacing: -0.09em; }
.readout .unit { font-size: 1rem; color: var(--muted); }
.meta { color: var(--muted); font-size: .9375rem; margin: .75rem 0 1.25rem; font-variant-numeric: tabular-nums; }

.workbench { display: grid; grid-template-columns: 1fr 240px; gap: 1.5rem; align-items: start; }
.display { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius-m); overflow: hidden; }
.tabs { display: flex; border-bottom: 1px solid var(--rule); background: var(--plate); }
.tabs button { border-radius: 0; background: none; border: 0; border-bottom: 3px solid transparent; padding: .7rem 1.1rem; color: var(--muted); }
.tabs button[aria-selected="true"] { color: var(--graphite); border-bottom-color: var(--gold); }
#view { display: block; width: 100%; height: 380px; }
.legend { margin: 0; padding: .5rem 1rem .75rem; font-size: .8125rem; color: var(--muted); display: flex; gap: 1.25rem; align-items: center; }
.legend .item { display: inline-flex; align-items: center; gap: .4rem; padding-right: .25rem; overflow: visible; }
.key { width: .75rem; height: .75rem; border-radius: 50%; display: inline-block; flex: none; }
.key.tick { background: var(--ruby); }
.key.tock { background: var(--sapphire); }
.controls .field:first-child label { margin-top: 0; }
.stack { display: grid; gap: .5rem; margin-top: 1.5rem; }
.quality { margin-top: 1.5rem; font-size: .875rem; }
.quality .label { color: var(--muted); }

.filebox { margin-top: 2rem; border-top: 1px solid var(--rule); padding-top: 1rem; }
.filebox summary { cursor: pointer; font-weight: 600; }
.filegrid { display: grid; grid-template-columns: 2fr 1.5fr 1fr; gap: 1rem; }

.foot { padding: 1rem 1.25rem; font-size: .8125rem; color: var(--muted); border-top: 1px solid var(--rule); background: var(--plate); }
.foot a { color: inherit; }
.foot p { max-width: 1120px; margin: 0 auto; padding: 0 1.25rem; }

@media (max-width: 820px) {
  .workbench { grid-template-columns: 1fr; }
  .controls { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1rem; }
  .controls .field:first-child label { margin-top: 1rem; }
  .stack, .quality { grid-column: 1 / -1; }
  .filegrid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .steps li { font-size: 0; }
  .steps li::before { font-size: .8125rem; }
  .steps li.current { font-size: .8125rem; }
  .bar { flex-wrap: wrap; }
  .status { text-align: left; }
  .readouts { grid-template-columns: 1fr; }
  .readout + .readout { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); }
  .wizard { padding: 1.25rem; }
  .calgrid { grid-template-columns: 1fr; }
  #view { height: 300px; }
}
@media (prefers-reduced-motion: reduce) { .meter-fill { transition: none; } }

/* Embedded in jsfwatch.com: the site already shows the logo, menu and footer. */
.embedded .mark, .embedded .foot { display: none; }
.embedded .bar { justify-content: flex-end; background: transparent; border-bottom: 0; padding-top: .5rem; padding-bottom: 0; }
.embedded .bar .status:not([hidden]) ~ * { display: none; }
.embedded .start { padding-top: 1rem; }
.embedded main { padding-top: .75rem; }

/* Embedded: use the full width of the block on the page. */
.embedded main { max-width: none; padding-left: clamp(1rem, 3vw, 3rem); padding-right: clamp(1rem, 3vw, 3rem); }
.embedded .start { max-width: none; }
.embedded h1 { max-width: 22ch; font-size: clamp(2.5rem, 6.5vw, 6.5rem); }
.embedded .lede { max-width: 70ch; font-size: clamp(1.05rem, 1.4vw, 1.35rem); }
.embedded .start .fine { max-width: 80ch; font-size: clamp(.875rem, 1.05vw, 1rem); }
.embedded .wizard { max-width: 760px; }
.embedded .workbench { grid-template-columns: 1fr 280px; }
.embedded #view { height: clamp(380px, 32vw, 520px); }
