/* V5 "Vlasnik pita": a phone page for an owner between two shifts.
 * Mobile first (360 px), then 40rem, 48rem and 64rem steps up to 1440 px.
 * No words live in this file: every visible string comes from a copy slot.
 * Contrast pairs (WCAG 2.x) are listed next to the tokens; all text is AA or better. */

:root {
  color-scheme: light;

  --paper: #fbf5ec;          /* page */
  --paper-2: #f3e8d7;        /* detail panels, footer */
  --ink: #24160f;            /* text on paper 16.2:1 */
  --ink-2: #5a4436;          /* secondary text: 8.4:1 on paper, 7.5:1 on paper-2 */
  --ink-hover: #3d2a1f;
  --line: #dccbb3;           /* decorative rules only */
  --line-strong: #8a6f5a;    /* control borders: 4.3:1 on paper (needs 3:1) */
  --accent: #a8401f;         /* terracotta: paper text on it 5.7:1, as text on paper 5.7:1 */
  --accent-strong: #8c3216;  /* hover: 7.5:1 */
  --accent-soft: #f1d9c8;    /* the hero question mark; ink on it 13:1 */
  --mustard: #f2b544;        /* calls on the dark surfaces: ink on it 9.6:1 */
  --mustard-strong: #f7cb6e; /* hover: higher contrast still */
  --dark-2: #33221a;         /* raised panel on ink: paper on it 14:1 */
  --on-dark: #fbf5ec;        /* on ink 16.2:1 */
  --on-dark-2: #e3d3bf;      /* on ink 12:1 */
  --focus: #24160f;
  --focus-on-dark: #f2b544;

  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-body: "Atkinson Hyperlegible Next", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius: 0.75rem;
  --gutter: 1rem;
  --bar-space: calc(4.5rem + env(safe-area-inset-bottom));
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(168, 64, 31, 0.18);
  scroll-padding-top: 1rem;
  /* the sticky pilot bar must never cover a focused or jumped-to element */
  scroll-padding-bottom: calc(var(--bar-space) + 0.75rem);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media (pointer: fine) {
  html {
    overscroll-behavior: none;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.55;
  overflow-wrap: break-word;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

p,
ul,
ol,
dl,
dd {
  margin: 0;
}

p,
li,
dd {
  text-wrap: pretty;
}

a,
summary {
  touch-action: manipulation;
}

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.pilot :focus-visible,
.bar :focus-visible {
  outline-color: var(--focus-on-dark);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: 100%;
  max-width: 76rem;
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

/* ---------- Skip link ---------- */

.skip {
  position: absolute;
  top: 0.5rem;
  left: max(var(--gutter), env(safe-area-inset-left));
  z-index: 30;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: var(--ink);
  color: var(--on-dark);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-300%);
}

/* the ring stays ink: it sits on paper, where mustard would fall under 3:1 */
.skip:focus-visible {
  transform: none;
}

.skip:hover {
  text-decoration: underline;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 3rem;
  padding: 0.75rem 1.25rem;
  border: 2px solid transparent; /* stays visible in forced-colors mode */
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn--lg {
  min-height: 3.5rem;
  padding-inline: 1.5rem;
}

.btn--accent {
  background: var(--accent);
  color: var(--paper);
}

.btn--accent:hover {
  background: var(--accent-strong);
}

.btn--ghost {
  border-color: var(--ink);
  background: transparent;
  color: var(--ink);
}

.btn--ghost:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn--mustard {
  background: var(--mustard);
  color: var(--ink);
}

.btn--mustard:hover {
  background: var(--mustard-strong);
}

@media (prefers-reduced-motion: no-preference) {
  .btn:active,
  .bar__cta:active {
    transform: translateY(1px);
  }
}

/* ---------- B0 header ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.75rem;
  padding-top: max(0.75rem, env(safe-area-inset-top));
  padding-bottom: 0.75rem;
}

.brand {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.brand__name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.brand__by {
  color: var(--ink-2);
  font-size: 0.875rem;
}

/* On phones the pilot call lives in the bottom bar instead */
.site-header__cta {
  display: none;
  flex: none;
}

/* ---------- B1 hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero__inner {
  position: relative;
  display: grid;
  gap: 1.125rem;
  padding-top: 2rem;
  padding-bottom: 2.5rem;
}

.hero__inner > * {
  position: relative;
  z-index: 1;
  min-width: 0;
}

/* The page's one typographic mark: an oversized question mark behind the title */
.hero__inner > .hero__mark {
  position: absolute;
  z-index: 0;
  top: -1.75rem;
  right: -0.5rem;
  color: var(--accent-soft);
  font-family: var(--font-display);
  font-size: 13rem;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.hero__eyebrow {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
  padding: 0.375rem 0.875rem;
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  background: var(--paper);
  color: var(--accent-strong);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.3;
}

.hero__eyebrow > span {
  min-width: 0;
}

/* status dot: a plain CSS shape */
.hero__eyebrow::before {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
}

.hero__title {
  font-size: clamp(2.25rem, 1.45rem + 3.6vw, 4.5rem);
  line-height: 1.04;
  max-width: 18ch;
}

.hero__lead {
  max-width: 38rem;
  color: var(--ink-2);
  font-size: 1.1875rem;
}

.hero__actions {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.hero__note {
  max-width: 34rem;
  color: var(--ink-2);
  font-size: 0.9375rem;
}

/* ---------- Questions: index + stack ---------- */

.questions {
  padding-top: 2.5rem;
  padding-bottom: 3rem;
}

.questions__layout {
  display: grid;
  gap: 2rem;
}

.questions__aside {
  min-width: 0;
}

.questions__title {
  font-size: clamp(1.75rem, 1.35rem + 1.8vw, 2.5rem);
}

.questions__lead {
  margin-top: 0.5rem;
  color: var(--ink-2);
}

.index {
  margin-top: 1.25rem;
}

.index__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  padding: 0;
  list-style: none;
}

.index__link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.125rem;
  min-width: 0;
  min-height: 4rem;
  height: 100%;
  padding: 0.625rem 0.75rem;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
}

.index__link:hover {
  border-color: var(--ink);
  background: var(--paper-2);
}

.index__num {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums lining-nums;
}

.index__label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.index__pilot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  margin-top: 0.5rem;
  padding: 0.625rem 1rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--paper);
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}

.index__pilot:hover {
  background: var(--accent-strong);
}

.questions__stack {
  min-width: 0;
  max-width: 46rem;
}

/* One question */

.q {
  padding-top: 1.75rem;
  padding-bottom: 1.75rem;
  border-top: 1px solid var(--line);
  scroll-margin-top: 1.25rem;
}

.q:first-child {
  border-top: 2px solid var(--ink);
}

.q__head {
  display: grid;
  gap: 0.375rem;
}

.q__num {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.q__title {
  min-width: 0;
  font-size: clamp(1.375rem, 1.15rem + 1.1vw, 1.875rem);
  line-height: 1.18;
}

.q:target .q__title {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 0.1em;
  text-underline-offset: 0.16em;
}

.q__answer {
  margin-top: 0.75rem;
}

.q__more {
  margin-top: 1rem;
}

/* The "more" control: native summary, styled as a large pill, text swaps on open */
.q__toggle {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 3rem;
  padding: 0.625rem 1.25rem;
  border: 2px solid var(--line-strong);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  line-height: 1.25;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.q__toggle::-webkit-details-marker {
  display: none;
}

.q__toggle:hover {
  border-color: var(--ink);
  background: var(--paper-2);
}

.q__more[open] > .q__toggle {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.q__more[open] > .q__toggle:hover {
  background: var(--ink-hover);
}

.q__hide,
.q__more[open] .q__show {
  display: none;
}

.q__more[open] .q__hide {
  display: inline;
}

.q__detail {
  display: grid;
  gap: 1.125rem;
  margin-top: 1rem;
  padding: 1.25rem 1rem;
  border-radius: var(--radius);
  background: var(--paper-2);
}

@media (prefers-reduced-motion: no-preference) {
  .q__more[open] > .q__detail {
    animation: detail-in 0.2s ease-out;
  }
}

@keyframes detail-in {
  from {
    opacity: 0;
    transform: translateY(-0.25rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.detail__note {
  padding-top: 0.875rem;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 1rem;
}

.detail__sub {
  font-size: 1.1875rem;
  line-height: 1.25;
}

/* label + sentence pairs (outages, devices, reports, options) */
.pairs {
  display: grid;
  gap: 1rem;
}

.pairs__row {
  display: grid;
  gap: 0.125rem;
  min-width: 0;
  padding-left: 0.875rem;
  border-left: 3px solid var(--accent);
}

.pairs dt {
  font-weight: 700;
}

.pairs dd {
  color: var(--ink-2);
}

/* features with an honest status chip */
.feats {
  display: grid;
  gap: 0.875rem;
  padding: 0;
  list-style: none;
}

.feat {
  display: grid;
  gap: 0.25rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--line);
}

.feat:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.feat__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem 0.625rem;
}

.feat__label {
  min-width: 0;
  font-weight: 700;
}

.feat__body {
  color: var(--ink-2);
}

.chip {
  display: inline-flex;
  max-width: 100%;
  padding: 0.0625rem 0.5rem;
  border: 1.5px solid var(--ink-2);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.45;
}

/* numbered rules and steps: the numbers are layout, hidden from screen readers (the list already counts) */
.numbered {
  display: grid;
  gap: 1rem;
  padding: 0;
  list-style: none;
  counter-reset: item;
}

.numbered > li {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  column-gap: 0.625rem;
  counter-increment: item;
}

.numbered > li::before {
  content: counter(item, decimal-leading-zero);
  content: counter(item, decimal-leading-zero) / "";
  grid-column: 1;
  grid-row: 1 / span 3;
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1.55;
}

.numbered > li > * {
  grid-column: 2;
  min-width: 0;
}

.numbered__title {
  font-weight: 700;
}

.numbered__body {
  color: var(--ink-2);
}

.numbered__source {
  margin-top: 0.25rem;
  color: var(--ink-2);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

/* first version and later */
.split {
  display: grid;
  gap: 1.25rem;
}

.split__col {
  display: grid;
  align-content: start;
  gap: 0.5rem;
  min-width: 0;
}

.split__col--later {
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.ticks {
  display: grid;
  gap: 0.375rem;
  padding-left: 1.25rem;
}

.ticks li::marker {
  color: var(--accent);
}

.split__col--later .ticks li {
  color: var(--ink-2);
}

/* ---------- B10 pilot ---------- */

.pilot {
  padding-top: 3rem;
  padding-bottom: 3rem;
  background: var(--ink);
  color: var(--on-dark);
}

.pilot__inner {
  display: grid;
  gap: 1.25rem;
  grid-template-areas:
    "title"
    "lead"
    "who"
    "action";
}

.pilot__title {
  grid-area: title;
  max-width: 20ch;
  font-size: clamp(1.875rem, 1.3rem + 2.6vw, 3.25rem);
}

.pilot__lead {
  grid-area: lead;
  max-width: 40rem;
  color: var(--on-dark-2);
  font-size: 1.1875rem;
}

.pilot__who {
  grid-area: who;
  display: grid;
  gap: 0.625rem;
  padding: 0;
  list-style: none;
  counter-reset: who;
}

.pilot__who > li {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  column-gap: 0.625rem;
  padding: 0.875rem 1rem;
  border: 1.5px solid rgba(251, 245, 236, 0.3);
  border-radius: var(--radius);
  counter-increment: who;
}

.pilot__who > li::before {
  content: counter(who, decimal-leading-zero);
  content: counter(who, decimal-leading-zero) / "";
  color: var(--mustard);
  font-family: var(--font-display);
  font-weight: 700;
  font-variant-numeric: tabular-nums lining-nums;
}

.pilot__action {
  grid-area: action;
  display: grid;
  gap: 0.875rem;
  padding: 1.25rem 1rem;
  border-radius: var(--radius);
  background: var(--dark-2);
}

.pilot__contact {
  color: var(--on-dark);
  font-size: 1.125rem;
  font-weight: 700;
}

/* ---------- B12 footer ---------- */

.site-footer {
  padding-top: 2rem;
  padding-bottom: calc(2rem + var(--bar-space));
  border-top: 1px solid var(--line);
  background: var(--paper-2);
}

.site-footer__inner {
  display: grid;
  gap: 0.75rem;
  font-size: 0.9375rem;
}

.site-footer__legal {
  color: var(--ink-2);
}

/* ---------- Sticky pilot bar (phones and tablets) ---------- */

.bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  padding: 0.625rem max(var(--gutter), env(safe-area-inset-right)) calc(0.625rem + env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
  border-top: 1px solid #000;
  background: var(--ink);
}

.bar[data-hidden] {
  transform: translateY(100%);
  visibility: hidden;
}

@media (prefers-reduced-motion: no-preference) {
  .bar {
    transition: transform 0.22s ease-out, visibility 0s linear 0s;
  }

  .bar[data-hidden] {
    transition: transform 0.22s ease-in, visibility 0s linear 0.22s;
  }
}

/* first observer pass after load: settle without sliding (script.js removes it) */
.bar[data-instant],
.bar[data-instant][data-hidden] {
  transition: none;
}

.bar__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.25rem;
  padding: 0.5rem 1rem;
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--mustard);
  color: var(--ink);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.bar__cta:hover {
  background: var(--mustard-strong);
}

/* ---------- 40rem: large phones in landscape, small tablets ---------- */

@media (min-width: 40rem) {
  :root {
    --gutter: 1.5rem;
  }

  .hero__actions {
    display: flex;
    flex-wrap: wrap;
  }

  .index__list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .index__pilot {
    justify-content: flex-start;
  }

  .q__detail {
    padding: 1.5rem;
  }

  .split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 2rem;
  }

  .split__col--later {
    padding-top: 0;
    padding-left: 2rem;
    border-top: 0;
    border-left: 1px solid var(--line);
  }
}

/* ---------- 48rem: the number moves into its own column ---------- */

@media (min-width: 48rem) {
  .q__head {
    grid-template-columns: 4.25rem minmax(0, 1fr);
    align-items: start;
    column-gap: 1.25rem;
  }

  .q__num {
    font-size: 2.75rem;
    line-height: 1;
    letter-spacing: 0;
  }

  .q__answer,
  .q__more {
    margin-left: 5.5rem;
  }

  .hero__inner > .hero__mark {
    top: -3rem;
    right: 1rem;
    font-size: 22rem;
  }
}

/* ---------- 64rem: desktop, sticky index beside the stack, no bottom bar ---------- */

@media (min-width: 64rem) {
  :root {
    --gutter: 2rem;
    --bar-space: env(safe-area-inset-bottom, 0px);
  }

  html {
    scroll-padding-bottom: 0;
  }

  .bar {
    display: none;
  }

  .site-header__cta {
    display: inline-flex;
  }

  .hero__inner {
    gap: 1.5rem;
    padding-top: 4.5rem;
    padding-bottom: 4.5rem;
  }

  .hero__inner > .hero__mark {
    top: -4rem;
    right: 2rem;
    font-size: 32rem;
  }

  .hero__lead {
    font-size: 1.375rem;
  }

  .questions {
    padding-top: 4rem;
    padding-bottom: 5rem;
  }

  .questions__layout {
    grid-template-columns: 17.5rem minmax(0, 1fr);
    align-items: start;
    column-gap: 4rem;
  }

  .index__list {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .index__link {
    flex-direction: row;
    align-items: baseline;
    gap: 0.75rem;
    min-height: 2.75rem;
    padding: 0.5rem 0.75rem;
    border-color: transparent;
    background: transparent;
  }

  .index__link:hover {
    border-color: var(--line-strong);
    background: var(--paper-2);
  }

  .index__num {
    flex: none;
  }

  .index__pilot {
    margin-top: 1rem;
  }

  .pilot {
    padding-top: 5rem;
    padding-bottom: 5rem;
  }

  .pilot__inner {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    grid-template-areas:
      "title who"
      "lead who"
      "action who";
    align-content: start;
    align-items: start;
    column-gap: 4rem;
    row-gap: 1.5rem;
  }

  .pilot__action {
    justify-items: start;
    padding: 1.5rem;
  }
}

/* The index only sticks when the screen is tall enough to show all of it */
@media (min-width: 64rem) and (min-height: 44rem) {
  .questions__aside {
    position: sticky;
    top: 1.5rem;
  }
}

@media (min-width: 90rem) {
  body {
    font-size: 1.1875rem;
  }
}
