:root {
  --ink: #0e1a3a;
  --ink-soft: #4a5673;
  --paper: #f4f6fa;
  --sheet: #ffffff;
  --signal: #2440d8;
  --signal-deep: #1a2fa6;
  --standby: #ffb703;
  --line: #d5dbe8;
  --fault: #b3122b;

  --display: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif;
  --body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.55;
}

a { color: var(--signal); text-underline-offset: 0.18em; }
a:hover { color: var(--signal-deep); }

:focus-visible {
  outline: 3px solid var(--standby);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Masthead */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  background: var(--signal);
  color: #fff;
}

.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  color: #fff;
  text-decoration: none;
}

.masthead nav { display: flex; gap: 1.25rem; font-size: 0.9375rem; }
.masthead nav a { color: #fff; }
.masthead a:hover { color: #fff; text-decoration-thickness: 2px; }

/* Home: pitch beside the upload desk */

.stage {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}

.pitch {
  background: var(--signal);
  color: #fff;
  padding: clamp(1.5rem, 5vw, 4rem) clamp(1rem, 4vw, 3rem) 3rem;
}

.pitch h1 {
  margin: 0 0 1.5rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.5rem, 5.2vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.lede { margin: 0 0 2rem; font-size: 1.1875rem; line-height: 1.45; max-width: 32ch; }

.steps {
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
  counter-reset: step;
  max-width: 38ch;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 0.875rem 0 0.875rem 2.75rem;
  border-top: 1px solid rgb(255 255 255 / 0.3);
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.75rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.2;
  color: var(--standby);
}

.fineprint { margin: 0; max-width: 42ch; font-size: 0.875rem; color: rgb(255 255 255 / 0.85); }
.fineprint a { color: #fff; }

.desk {
  background: var(--sheet);
  padding: clamp(1.5rem, 4vw, 3.5rem) clamp(1rem, 4vw, 3.5rem) 4rem;
}

.desk > * { max-width: 40rem; }

/* Channel connection */

.channel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 2rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--line);
  border-left: 6px solid var(--ink-soft);
  border-radius: 4px;
  background: var(--paper);
}

.channel[data-state="connected"] { border-left-color: var(--signal); }
.channel[data-state="error"] { border-left-color: var(--fault); }

.channel-status { margin: 0; font-weight: 500; }

/* Form */

fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
fieldset:disabled { opacity: 0.5; }

.field { margin-bottom: 1.375rem; }
.field-row { display: grid; grid-template-columns: 3fr 2fr; gap: 1rem; }

.label { display: block; margin-bottom: 0.375rem; font-weight: 600; font-size: 0.9375rem; }
.hint { font-weight: 400; color: var(--ink-soft); margin-left: 0.375rem; }

input[type="text"],
input[type="datetime-local"],
textarea,
select {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid #9aa5bd;
  border-radius: 4px;
  background: var(--sheet);
  color: var(--ink);
  font: inherit;
}

textarea { resize: vertical; min-height: 6rem; }

.filepick {
  display: block;
  padding: 1.25rem 1rem;
  border: 2px dashed #9aa5bd;
  border-radius: 4px;
  background: var(--paper);
  cursor: pointer;
}

.filepick:hover, .filepick.is-over { border-color: var(--signal); background: #eaeefc; }
.filepick:focus-within { outline: 3px solid var(--standby); outline-offset: 2px; }
.filepick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.filepick-name { display: block; font-weight: 500; overflow-wrap: anywhere; }
.filepick-meta { display: block; font-size: 0.875rem; color: var(--ink-soft); }

fieldset:disabled .filepick { cursor: default; }

.segmented { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid #9aa5bd; border-radius: 4px; overflow: hidden; }
.segmented label { position: relative; text-align: center; }
.segmented label + label { border-left: 1px solid #9aa5bd; }
.segmented input { position: absolute; opacity: 0; inset: 0; }
.segmented span { display: block; padding: 0.625rem 0.25rem; font-size: 0.9375rem; font-weight: 500; cursor: pointer; }
.segmented input:checked + span { background: var(--ink); color: #fff; }
.segmented input:focus-visible + span { outline: 3px solid var(--standby); outline-offset: -3px; }

.choices { display: grid; gap: 0.375rem; }
.choices input { accent-color: var(--signal); margin-right: 0.375rem; }

/* Schedule: the publish time read back in large type over a 24-hour strip */

.schedule {
  margin-bottom: 1.5rem;
  padding: 1.25rem 1rem 1rem;
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
}

.schedule[hidden] { display: none; }
.schedule .field { margin-bottom: 1rem; }
.schedule .hint { color: rgb(255 255 255 / 0.7); }
.schedule input { border-color: transparent; color-scheme: light; }

.readout {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2.125rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.readout small {
  display: block;
  margin-top: 0.375rem;
  font-family: var(--body);
  font-weight: 400;
  font-size: 0.9375rem;
  letter-spacing: 0;
  color: rgb(255 255 255 / 0.75);
}

.readout.is-invalid { color: #ffb4bf; }

.daystrip-track {
  position: relative;
  height: 1.75rem;
  border-bottom: 2px solid rgb(255 255 255 / 0.6);
  background: repeating-linear-gradient(to right, rgb(255 255 255 / 0.45) 0 1px, transparent 1px calc(100% / 24));
  background-size: 100% 40%;
  background-repeat: no-repeat;
  background-position: bottom;
}

.daystrip-mark,
.daystrip-now {
  position: absolute;
  bottom: -2px;
  width: 4px;
  margin-left: -2px;
  height: 100%;
  background: var(--standby);
  transition: left 180ms ease-out;
}

.daystrip-now { width: 2px; margin-left: -1px; height: 60%; background: #fff; }
.daystrip-now[hidden] { display: none; }

.daystrip-hours {
  display: flex;
  justify-content: space-between;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: rgb(255 255 255 / 0.7);
  font-variant-numeric: tabular-nums;
}

/* Buttons */

.btn {
  padding: 0.6875rem 1.125rem;
  border: 1px solid transparent;
  border-radius: 4px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn[hidden] { display: none; }
.btn-primary { background: var(--signal); color: #fff; font-size: 1.0625rem; padding: 0.875rem 1.5rem; }
.btn-primary:hover { background: var(--signal-deep); }
.btn-quiet { background: var(--sheet); border-color: var(--ink); color: var(--ink); }
.btn-quiet:hover { background: var(--ink); color: #fff; }
.btn:disabled { cursor: default; }

.actions { margin-top: 2rem; }
.form-error { margin: 0.875rem 0 0; color: var(--fault); font-weight: 500; }

/* Upload progress and result */

.progress { margin-top: 1.5rem; }
.progress-text { margin: 0 0 0.5rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.progress-bar { height: 0.5rem; background: var(--line); border-radius: 4px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; background: var(--signal); transition: width 150ms linear; }

.result { margin-top: 1.5rem; padding: 1.25rem 1rem; border-left: 6px solid var(--standby); background: var(--paper); border-radius: 4px; }
.result h2 { margin: 0 0 0.5rem; font-family: var(--display); font-weight: 700; font-size: 1.625rem; line-height: 1.15; letter-spacing: -0.02em; }
.result p { margin: 0 0 0.75rem; }
.result-note { padding: 0.75rem; background: #fff3cd; border-radius: 4px; }
.result-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }

/* Privacy policy and terms */

.document {
  flex: 1;
  width: 100%;
  max-width: 44rem;
  padding: clamp(2rem, 6vw, 4rem) clamp(1rem, 4vw, 3rem) 4rem;
}

.document h1 {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.document .dated { margin: 0 0 2.5rem; color: var(--ink-soft); }
.document h2 { margin: 2.25rem 0 0.5rem; font-family: var(--display); font-weight: 700; font-size: 1.375rem; letter-spacing: -0.01em; line-height: 1.2; }
.document p, .document ul { margin: 0 0 1rem; }
.document ul { padding-left: 1.25rem; }
.document li { margin-bottom: 0.375rem; }

@media (max-width: 860px) {
  .stage { grid-template-columns: 1fr; }
  .pitch { padding-bottom: 2rem; }
  .lede, .steps, .fineprint { max-width: none; }
}

@media (max-width: 520px) {
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .segmented { grid-template-columns: repeat(2, 1fr); }
  .segmented label:nth-child(3) { border-left: 0; }
  .segmented label:nth-child(n + 3) { border-top: 1px solid #9aa5bd; }
}

@media (prefers-reduced-motion: reduce) {
  .daystrip-mark, .daystrip-now, .progress-bar span { transition: none; }
}
