/* cron-parser-go — differential playground
 *
 * The two implementations carry their own languages' identities: TypeScript blue
 * against Go cyan, so the diff colour-codes itself without inventing a palette.
 * Verdict green and red stay semantic and never double as accents. The ground is
 * a deep navy rather than black, borrowed from a departure board at night, which
 * is the visual world cron actually lives in.
 */

:root {
  --ground: #080D16;
  --slab:   #0F1725;
  --slab-2: #16203045;
  --line:   #22304A;
  --line-soft: #1A2537;
  --ink:    #E8EEF7;
  --ink-2:  #A7B6CC;
  --ink-3:  #6B7C97;

  --ts:   #5CA0E6;
  --ts-d: #2F6FB5;
  --go:   #2BD9E4;
  --go-d: #12939E;

  --ok:   #46D48A;
  --bad:  #FF6B6B;
  --warn: #F2B25C;

  --shadow: 0 1px 0 #ffffff08 inset, 0 18px 40px -24px #000c;
  --r: 10px;

  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;
  --sans: 'IBM Plex Sans', ui-sans-serif, system-ui, 'Segoe UI', Roboto, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --ground: #EEF2F8;
    --slab:   #FFFFFF;
    --slab-2: #F3F6FB;
    --line:   #D3DCE9;
    --line-soft: #E4EAF3;
    --ink:    #0C1420;
    --ink-2:  #46566E;
    --ink-3:  #74849C;
    --ts:   #2F6FB5;
    --go:   #0E8C97;
    --ok:   #17915C;
    --bad:  #CE3A3A;
    --warn: #A96B10;
    --shadow: 0 1px 0 #fff inset, 0 12px 28px -22px #1a2b4433;
  }
}

:root[data-theme="dark"] {
  --ground: #080D16; --slab: #0F1725; --slab-2: #16203045;
  --line: #22304A; --line-soft: #1A2537;
  --ink: #E8EEF7; --ink-2: #A7B6CC; --ink-3: #6B7C97;
  --ts: #5CA0E6; --go: #2BD9E4; --ok: #46D48A; --bad: #FF6B6B; --warn: #F2B25C;
  --shadow: 0 1px 0 #ffffff08 inset, 0 18px 40px -24px #000c;
}
:root[data-theme="light"] {
  --ground: #EEF2F8; --slab: #FFFFFF; --slab-2: #F3F6FB;
  --line: #D3DCE9; --line-soft: #E4EAF3;
  --ink: #0C1420; --ink-2: #46566E; --ink-3: #74849C;
  --ts: #2F6FB5; --go: #0E8C97; --ok: #17915C; --bad: #CE3A3A; --warn: #A96B10;
  --shadow: 0 1px 0 #fff inset, 0 12px 28px -22px #1a2b4433;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(1180px, calc(100% - 3rem)); margin-inline: auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

h1, h2, h3 { text-wrap: balance; margin: 0; line-height: 1.12; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.1rem, 4.4vw, 3.4rem); font-weight: 600; }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); font-weight: 600; }
p { margin: 0; }
a { color: var(--ts); text-underline-offset: 3px; }
code { font-family: var(--mono); font-size: 0.92em; }

:where(a, button, input, select, summary):focus-visible {
  outline: 2px solid var(--go);
  outline-offset: 2px;
  border-radius: 4px;
}

.eyebrow {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 0.9rem;
}

/* ---------- boot ---------- */

.boot {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: var(--ground);
  transition: opacity .5s ease, visibility .5s;
}
.boot[hidden-soft] { opacity: 0; visibility: hidden; pointer-events: none; }
.boot__inner { text-align: center; }
.boot__dial { display: flex; gap: 7px; justify-content: center; margin-bottom: 1.4rem; }
.boot__dial span {
  width: 9px; height: 26px; border-radius: 2px; background: var(--line);
  animation: tick 1.1s ease-in-out infinite;
}
.boot__dial span:nth-child(2) { animation-delay: .14s; }
.boot__dial span:nth-child(3) { animation-delay: .28s; }
@keyframes tick {
  0%, 100% { background: var(--line); transform: scaleY(.55); }
  50%      { background: var(--go); transform: scaleY(1); }
}
.boot__label { font-weight: 600; }
.boot__hint { color: var(--ink-3); font-size: .86rem; margin-top: .3rem; }

/* ---------- masthead ---------- */

.masthead { padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(2rem, 4vw, 3rem); }
.masthead__grid {
  display: grid; gap: clamp(2rem, 5vw, 4rem);
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  align-items: end;
}
.lede {
  margin-top: 1.2rem; max-width: 56ch;
  font-size: 1.06rem; color: var(--ink-2);
}
.lede em { color: var(--ink); font-style: normal; font-weight: 600; }

.vitals {
  margin: 0; display: grid; gap: 1px;
  grid-template-columns: 1fr 1fr;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--r); overflow: hidden;
}
.vitals > div { background: var(--slab); padding: .95rem 1.05rem; }
.vitals dt {
  font-size: .68rem; letter-spacing: .11em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600;
}
.vitals dd {
  margin: .25rem 0 0; font-family: var(--mono); font-size: 1.5rem;
  font-weight: 600; font-variant-numeric: tabular-nums; color: var(--go);
}
.vitals dd span { color: var(--ink-3); font-size: .95rem; font-weight: 400; }

/* ---------- console ---------- */

.console {
  background: var(--slab); border: 1px solid var(--line-soft);
  border-radius: 14px; padding: clamp(1.1rem, 2.4vw, 1.7rem);
  box-shadow: var(--shadow);
}

.controls {
  display: grid; gap: .8rem;
  grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.3fr) minmax(0, 1.5fr) 5.5rem 8rem;
}
.field { display: flex; flex-direction: column; gap: .38rem; min-width: 0; }
.field label {
  font-size: .68rem; letter-spacing: .11em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600;
}
.field input, .field select {
  font-family: var(--mono); font-size: .95rem;
  background: var(--ground); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
  padding: .62rem .7rem; width: 100%;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.field input:hover, .field select:hover { border-color: var(--ink-3); }
.field input:focus { border-color: var(--go); box-shadow: 0 0 0 3px #2bd9e422; outline: none; }
.field--expr input { font-size: 1.06rem; font-weight: 500; letter-spacing: .01em; }
.field input[aria-invalid="true"] { border-color: var(--bad); }

.presets { margin-top: 1.1rem; display: flex; gap: .75rem; align-items: baseline; flex-wrap: wrap; }
.presets__label {
  font-size: .68rem; letter-spacing: .11em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600; flex: none;
}
.presets__row { display: flex; gap: .45rem; flex-wrap: wrap; }
.chip {
  font: 500 .82rem/1 var(--sans);
  background: var(--slab-2); color: var(--ink-2);
  border: 1px solid var(--line-soft); border-radius: 99px;
  padding: .45rem .8rem; cursor: pointer;
  transition: color .16s, border-color .16s, background .16s, transform .12s;
}
.chip:hover { color: var(--ink); border-color: var(--go-d); transform: translateY(-1px); }
.chip[aria-pressed="true"] { color: var(--ground); background: var(--go); border-color: var(--go); }

/* ---------- verdict ---------- */

.verdict {
  margin-top: 1.3rem; display: flex; align-items: center; gap: .7rem;
  padding: .8rem 1rem; border-radius: 9px;
  border: 1px solid var(--line-soft); background: var(--slab-2);
  transition: border-color .3s ease, background .3s ease;
}
.verdict__dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); flex: none;
  transition: background .3s ease, box-shadow .3s ease;
}
.verdict__text { font-weight: 600; letter-spacing: -.01em; }
.verdict__meta {
  margin-left: auto; font-family: var(--mono); font-size: .8rem; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.verdict[data-state="match"] { border-color: #46d48a44; background: #46d48a0e; }
.verdict[data-state="match"] .verdict__dot { background: var(--ok); box-shadow: 0 0 0 4px #46d48a22; }
.verdict[data-state="match"] .verdict__text { color: var(--ok); }
.verdict[data-state="diverge"] { border-color: #ff6b6b55; background: #ff6b6b12; }
.verdict[data-state="diverge"] .verdict__dot { background: var(--bad); box-shadow: 0 0 0 4px #ff6b6b22; }
.verdict[data-state="diverge"] .verdict__text { color: var(--bad); }
.verdict[data-state="rejected"] { border-color: #f2b25c44; background: #f2b25c0e; }
.verdict[data-state="rejected"] .verdict__dot { background: var(--warn); }
.verdict[data-state="rejected"] .verdict__text { color: var(--warn); }

/* ---------- diff ---------- */

.diff {
  margin-top: 1rem;
  display: grid; grid-template-columns: 1fr 1px 1fr;
  border: 1px solid var(--line-soft); border-radius: 10px; overflow: hidden;
}
.diff__spine { background: var(--line-soft); }
.diff__col { min-width: 0; background: var(--slab); }
.diff__head {
  display: flex; align-items: center; gap: .6rem;
  padding: .7rem .9rem; border-bottom: 1px solid var(--line-soft);
  background: var(--slab-2);
}
.diff__impl { font-size: .76rem; color: var(--ink-3); }
.tag {
  font: 600 .68rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase;
  padding: .3rem .5rem; border-radius: 5px;
}
.tag--ts { color: var(--ts); background: color-mix(in srgb, var(--ts) 14%, transparent); }
.tag--go { color: var(--go); background: color-mix(in srgb, var(--go) 14%, transparent); }

.rows { list-style: none; margin: 0; padding: .3rem 0; min-height: 12rem; }
.rows li {
  display: flex; gap: .8rem; align-items: baseline;
  padding: .32rem .9rem;
  font-family: var(--mono); font-size: .88rem;
  font-variant-numeric: tabular-nums;
  border-left: 2px solid transparent;
}
.rows li .idx { color: var(--ink-3); font-size: .76rem; min-width: 1.5rem; }
.rows li .local { color: var(--ink); }
.rows li .off { color: var(--ink-3); font-size: .78rem; margin-left: auto; }
.rows li.is-diff { border-left-color: var(--bad); background: #ff6b6b12; }
.rows li.is-diff .local { color: var(--bad); }
.rows li.is-err { color: var(--warn); font-style: normal; }
.rows li.is-note { color: var(--ink-3); }

@media (prefers-reduced-motion: no-preference) {
  .rows li.enter { animation: slot .28s cubic-bezier(.2,.7,.3,1) both; }
  @keyframes slot {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: none; }
  }
}

/* ---------- fields ---------- */

.fields { margin-top: 1rem; border-top: 1px solid var(--line-soft); padding-top: .9rem; }
.fields summary {
  cursor: pointer; font-size: .82rem; color: var(--ink-2); font-weight: 500;
  list-style-position: inside;
}
.fields summary:hover { color: var(--ink); }
.fields__grid {
  margin-top: .9rem; display: grid; gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: 8px;
  overflow: hidden;
}
.fcell { background: var(--slab); padding: .6rem .7rem; min-width: 0; }
.fcell__k {
  font-size: .64rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600;
}
.fcell__v {
  font-family: var(--mono); font-size: .8rem; color: var(--ink-2);
  margin-top: .25rem; word-break: break-word;
}
.fcell--wild .fcell__v { color: var(--go); }
.fields__note { margin-top: .7rem; font-family: var(--mono); font-size: .8rem; color: var(--ink-3); }

/* ---------- stress ---------- */

.stress {
  margin-top: clamp(3rem, 6vw, 4.5rem);
  display: grid; gap: clamp(1.5rem, 3vw, 2.5rem);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  align-items: start;
}
.stress__intro > p { margin-top: .9rem; color: var(--ink-2); max-width: 48ch; }
.stress__intro h2 { margin-bottom: 0; }
.checklist {
  list-style: none; margin: 1.3rem 0 0; padding: 0;
  display: grid; gap: 1px; background: var(--line-soft);
  border: 1px solid var(--line-soft); border-radius: 9px; overflow: hidden;
}
.checklist li {
  background: var(--slab); padding: .6rem .85rem;
  font-size: .84rem; color: var(--ink-2);
  display: flex; gap: .7rem; align-items: baseline;
}
.checklist li span {
  font: 600 .64rem/1.6 var(--sans); letter-spacing: .1em; text-transform: uppercase;
  color: var(--go); flex: none; min-width: 5.4rem;
}
.stress__foot { font-size: .82rem; color: var(--ink-3) !important; }
.stress__panel {
  background: var(--slab); border: 1px solid var(--line-soft);
  border-radius: 14px; padding: 1.3rem; box-shadow: var(--shadow);
}
.gauge { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.gauge__item { display: flex; flex-direction: column; gap: .2rem; }
.gauge__n {
  font-family: var(--mono); font-size: clamp(1.5rem, 3.4vw, 2.1rem); font-weight: 600;
  font-variant-numeric: tabular-nums; letter-spacing: -.02em; color: var(--ink);
}
.gauge__l {
  font-size: .66rem; letter-spacing: .11em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600;
}
.gauge__item--verdict .gauge__n { color: var(--ok); }
.gauge__item--verdict[data-bad="true"] .gauge__n { color: var(--bad); }

.stress__bar {
  margin-top: 1.1rem; height: 4px; border-radius: 99px;
  background: var(--line-soft); overflow: hidden;
}
.stress__fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--ts), var(--go));
  transition: width .2s linear;
}
.stress__actions { margin-top: 1.1rem; display: flex; gap: .6rem; }
.btn {
  font: 600 .88rem/1 var(--sans);
  background: var(--slab-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
  padding: .65rem 1.1rem; cursor: pointer;
  transition: background .16s, border-color .16s, transform .12s, opacity .16s;
}
.btn:hover:not(:disabled) { border-color: var(--ink-3); transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--primary {
  background: var(--go); border-color: var(--go); color: #04121a;
}
.btn--primary:hover:not(:disabled) { background: color-mix(in srgb, var(--go) 88%, #fff); }

.ticker {
  list-style: none; margin: 1.1rem 0 0; padding: 0;
  max-height: 11rem; overflow-y: auto;
  font-family: var(--mono); font-size: .76rem;
  border-top: 1px solid var(--line-soft);
}
.ticker li {
  display: flex; gap: .6rem; padding: .3rem 0;
  border-bottom: 1px solid var(--line-soft); color: var(--ink-3);
}
.ticker li b { color: var(--ink-2); font-weight: 500; }
.ticker li .ok { color: var(--ok); flex: none; }
.ticker li .no { color: var(--bad); flex: none; }
.ticker__expr { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- footer ---------- */

.foot {
  margin-top: clamp(3.5rem, 8vw, 6rem); padding: 2rem 0 3rem;
  border-top: 1px solid var(--line-soft); color: var(--ink-3); font-size: .86rem;
}
.foot__grid { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.foot strong { color: var(--ink-2); }
.foot__links { display: flex; gap: 1.1rem; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .masthead__grid, .stress, .foot__grid { grid-template-columns: minmax(0, 1fr); }
  .controls { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .field--expr { grid-column: 1 / -1; }
  .foot__links { justify-content: flex-start; }
}
@media (max-width: 640px) {
  .wrap { width: calc(100% - 2rem); }
  .diff { grid-template-columns: minmax(0, 1fr); }
  .diff__spine { display: none; }
  .diff__col + .diff__col { border-top: 1px solid var(--line-soft); }
  .controls { grid-template-columns: minmax(0, 1fr); }
  .vitals { grid-template-columns: 1fr 1fr; }
}

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