/* Postyli user guide: the same "candidate's post office" identity as the app.
   A static page cannot read frontend/tailwind.config.js, so the palette is repeated
   here: keep both in step. Postal yellow marks the one main action, postmark ink
   marks links and focus, the ink-navy bar carries the brand. */
:root {
  --paper: #edf0f5;
  --sheet: #ffffff;
  --ink: #1c2444;
  --ink-2: #525b7a;
  --ink-3: #646b88;
  --line: #d6dbe5;
  --line-strong: #b9c0cf;
  --post: #f4c21b;
  --post-hover: #ffd23a;
  --post-edge: #d9a90c;
  --stamp: #4a3bc4;
  --ok: #1b7a50;
  --ok-soft: #e3f3ea;
  --warn: #94500a;
  --warn-soft: #fcf0e1;
  --on-ink: rgba(237, 240, 245, 0.78); /* paper at 78 % on the ink bar */
  --radius: 10px;
  --radius-sm: 6px;
  --toc-width: 240px;
  --font: 'Schibsted Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'Cascadia Code', 'JetBrains Mono', Menlo, Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

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

a {
  color: var(--stamp);
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

::selection {
  background: var(--post);
  color: var(--ink);
}

code,
kbd {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  color: var(--ink);
}

pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  overflow-x: auto;
  color: var(--ink);
}

pre code {
  background: none;
  border: 0;
  padding: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  z-index: 100;
  background: var(--post);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}

/* ---------- Top bar: the ink-navy band of the app ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ink);
}

/* Postmark ink would vanish on the ink bar: focus turns postal yellow there. */
.topbar :focus-visible {
  outline-color: var(--post);
}

.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--paper);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  text-decoration: none;
  line-height: 1.2;
}

.brand-mark {
  width: 38px;
  height: 38px;
  color: var(--post);
  flex-shrink: 0;
}

.brand small {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--on-ink);
  letter-spacing: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: var(--post);
  border-color: var(--post-edge);
  color: var(--ink);
}

.btn-primary:hover {
  background: var(--post-hover);
}

.btn-ghost {
  background: var(--sheet);
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--ink-3);
  background: var(--paper);
}

.topbar .btn-ghost {
  background: transparent;
  border-color: rgba(237, 240, 245, 0.35);
  color: var(--paper);
}

.topbar .btn-ghost:hover {
  background: rgba(237, 240, 245, 0.08);
}

/* ---------- Hero ---------- */
.hero {
  max-width: 1240px;
  margin: 0 auto;
  padding: 72px 24px 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 40px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.4rem, 5.2vw, 4rem);
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: -0.035em;
  margin: 0 0 20px;
  max-width: 17ch;
  text-wrap: balance;
}

.hero p.lead {
  max-width: 60ch;
  margin: 0 0 28px;
  color: var(--ink-2);
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* The postmark, large: the guide's one decorative moment. */
.hero-mark {
  width: 220px;
  height: 220px;
  color: var(--ink);
  transform: rotate(-8deg);
}

/* ---------- Step overview (a real sequence: the numbers are earned) ---------- */
.overview {
  grid-column: 1 / -1;
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.overview a {
  display: block;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--sheet);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s;
}

.overview a:hover {
  border-color: var(--ink-3);
}

.overview .num {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 10px;
}

.overview strong {
  display: block;
  font-size: 16px;
}

.overview span {
  font-size: 14px;
  color: var(--ink-2);
}

/* ---------- Layout ---------- */
.layout {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 24px 96px;
  display: grid;
  grid-template-columns: var(--toc-width) minmax(0, 1fr);
  gap: 48px;
}

.toc {
  position: sticky;
  top: 88px;
  align-self: start;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}

.toc p {
  margin: 0 0 8px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-3);
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc a {
  display: block;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.toc a:hover {
  background: rgba(28, 36, 68, 0.05);
  color: var(--ink);
}

.toc a.active {
  color: var(--ink);
  font-weight: 600;
  background: var(--sheet);
  box-shadow: 0 0 0 1px var(--line);
}

/* ---------- Sections ---------- */
main section {
  margin-bottom: 72px;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}

.section-badge {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--sheet);
  border: 1.5px solid var(--ink);
  color: var(--ink);
  font-weight: 800;
}

main h2 {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}

main h3 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 32px 0 10px;
}

.section-intro {
  color: var(--ink-2);
  margin: 6px 0 24px;
  font-size: 17px;
  max-width: 68ch;
}

main p,
main li {
  max-width: 72ch;
}

main ul,
main ol {
  padding-left: 22px;
}

main li {
  margin-bottom: 6px;
}

main li::marker {
  color: var(--ink-3);
}

/* Names of buttons and screens, set like the label of a control. */
.ui {
  display: inline-block;
  padding: 0 0.45em;
  border-radius: 4px;
  background: var(--sheet);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 0.88em;
  font-weight: 600;
  white-space: nowrap;
}

/* Small print at the end of a section (credits of the job sources). */
.fine-print {
  margin-top: 28px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-3);
}

.fine-print a {
  color: inherit;
}

/* ---------- Cards ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.feature {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.feature h4 {
  margin: 0 0 6px;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.feature h4 .icon {
  color: var(--ink-2);
}

.feature p {
  margin: 0;
  font-size: 15px;
  color: var(--ink-2);
}

.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Steps list ---------- */
.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 16px 0;
}

.steps > li {
  position: relative;
  counter-increment: step;
  padding: 3px 0 20px 48px;
  margin: 0;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--sheet);
  border: 1.5px solid var(--ink);
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
}

.steps > li::after {
  content: '';
  position: absolute;
  left: 14px;
  top: 36px;
  bottom: 4px;
  width: 2px;
  background: var(--line);
}

.steps > li:last-child::after {
  display: none;
}

/* ---------- Callouts ---------- */
.callout {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid;
  margin: 20px 0;
  font-size: 15px;
  max-width: 76ch;
}

.callout p {
  margin: 0;
  color: inherit;
}

.callout .icon {
  margin-top: 3px;
}

.callout-tip {
  background: var(--ok-soft);
  border-color: rgba(27, 122, 80, 0.25);
  color: var(--ok);
}

.callout-info {
  background: var(--sheet);
  border-color: var(--line);
  color: var(--ink);
}

.callout-warn {
  background: var(--warn-soft);
  border-color: rgba(148, 80, 10, 0.25);
  color: var(--warn);
}

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 16px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

th,
td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  background: var(--paper);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
}

tr:last-child td {
  border-bottom: 0;
}

/* ---------- FAQ ---------- */
details {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 10px;
  max-width: 80ch;
}

details[open] {
  border-color: var(--line-strong);
}

summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 18px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: '+';
  font-size: 20px;
  font-weight: 400;
  color: var(--ink-3);
  transition: transform 0.2s ease;
}

details[open] summary::after {
  transform: rotate(45deg);
}

details > div {
  padding: 0 18px 16px;
  color: var(--ink-2);
  font-size: 15px;
}

details > div p {
  margin: 0 0 8px;
}

/* ---------- Closing call to action: the brand band again ---------- */
.cta-final {
  padding: 40px 32px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
}

.cta-final h2 {
  color: var(--paper);
  margin-bottom: 8px;
}

.cta-final p {
  color: var(--on-ink);
  margin: 0 0 22px;
}

.cta-final :focus-visible {
  outline-color: var(--post);
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 32px 24px;
  text-align: center;
  color: var(--ink-3);
  font-size: 14px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  summary::after {
    transition: none;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  /* minmax(0, …): a plain 1fr column grows to its widest child (the CSV <pre>),
     which pushed the whole page sideways on phones. */
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .toc {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-mark {
    display: none;
  }

  .overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .overview,
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .topbar .btn-ghost {
    display: none;
  }

  .topbar-inner {
    padding: 0 16px;
  }

  .hero {
    padding: 48px 16px 40px;
  }

  .layout {
    padding: 16px 16px 72px;
  }

  main h2 {
    font-size: 24px;
  }
}
