/* ============================================================
   ALL IN 04 · "The Help Card"
   A front-desk service interface. Every path ends in something
   you can hold: a card with the right free numbers.
   Red = wayfinding only. Ink on near-white. Atkinson Hyperlegible.
   ============================================================ */

:root {
  --bg: #FBFBF8;
  --panel: #FFFFFF;
  --ink: #21252A;         /* 14.7:1 */
  --ink-soft: #4C555F;    /* 7.3:1 */
  --red: #B9242A;         /* brand campaign red, 6.4:1 on bg */
  --red-deep: #921B20;
  --green: #1E6E4E;       /* confirmations, 5.9:1 */
  --line: #DDDBD2;
  --card-bg: #FFF6E8;
  --radius: 10px;
  --font: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 1.0625rem; line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: 0.75rem 1.25rem; font-weight: 700;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 2px; }
.utility-bar :focus-visible, .site-footer :focus-visible { outline-color: #fff; }

.num { font-family: var(--mono); font-weight: 600; letter-spacing: 0.01em; }

/* ---------- Utility bar ---------- */
.utility-bar { background: var(--red); color: #fff; font-size: 0.92rem; }
.utility-inner {
  max-width: 1240px; margin: 0 auto; padding: 0 1.5rem;
  display: flex; align-items: center; gap: 1.75rem; min-height: 46px;
}
.utility-link { color: #fff; text-decoration: none; font-weight: 600; padding: 0.6rem 0; }
.utility-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.utility-call { margin-left: auto; }

.lang { position: relative; }
.lang-btn {
  background: none; border: none; color: #fff; font: inherit; font-weight: 600;
  padding: 0.6rem 0; cursor: pointer; min-height: 44px;
  text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px;
}
.lang-menu {
  position: absolute; left: 0; top: calc(100% + 6px);
  background: #fff; color: var(--ink);
  border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0,0,0,0.25);
  list-style: none; margin: 0; padding: 0.5rem;
  min-width: 210px; max-height: 60vh; overflow: auto; z-index: 60;
}
.lang-menu [role="option"] { padding: 0.55rem 0.9rem; border-radius: 6px; cursor: pointer; }
.lang-menu [role="option"]:hover { background: #F6F1E7; }
.lang-menu [role="option"][aria-selected="true"] { background: var(--red); color: #fff; font-weight: 700; }
.lang-menu [role="option"]:focus-visible { outline: 3px solid var(--red); outline-offset: -3px; }

/* ---------- Header ---------- */
.site-header {
  background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  max-width: 1240px; margin: 0 auto; padding: 0.6rem 1.5rem;
  display: flex; align-items: center; gap: 1.5rem;
}
.brand img { width: 130px; height: auto; }
.primary-nav { margin-left: auto; }
.primary-nav ul { display: flex; gap: 0.1rem; list-style: none; margin: 0; padding: 0; }
.primary-nav a {
  display: block; padding: 0.65rem 0.7rem; color: var(--ink);
  text-decoration: none; font-weight: 600; font-size: 0.95rem; border-radius: 6px;
  border-bottom: 3px solid transparent;
}
.primary-nav a:hover { border-bottom-color: var(--red); }
.menu-btn {
  display: none; align-items: center; gap: 0.5rem;
  background: none; border: 2px solid var(--ink); border-radius: 8px;
  color: var(--ink); font: inherit; font-weight: 700;
  padding: 0.5rem 1rem; min-height: 44px; cursor: pointer;
}
.menu-bars, .menu-bars::before, .menu-bars::after {
  content: ""; display: block; width: 16px; height: 2px; background: currentColor; position: relative;
}
.menu-bars::before { position: absolute; top: -5px; }
.menu-bars::after { position: absolute; top: 5px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 0.8rem 1.4rem;
  border-radius: 8px; font: inherit; font-weight: 700; font-size: 1rem;
  text-decoration: none; cursor: pointer; min-height: 44px;
  border: 2px solid transparent;
}
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-deep); }
.btn-line { background: none; border-color: var(--ink); color: var(--ink); }
.btn-line:hover { background: var(--ink); color: #fff; }
.btn-line.is-added { border-color: var(--green); color: var(--green); }
.btn-line.is-added:hover { background: var(--green); color: #fff; }

.section-title { font-size: clamp(1.5rem, 2.8vw, 2.1rem); font-weight: 800; line-height: 1.15; margin: 0 0 1rem; letter-spacing: -0.01em; }
.proto { font-size: 0.8rem; }

/* ---------- Notice ---------- */
.notice {
  max-width: 1240px; margin: 1.25rem auto 0; padding: 0 1.5rem;
}
.notice p {
  margin: 0; background: #FFF3D6; border: 1.5px solid #E3C77E;
  border-left: 6px solid #B98900;
  border-radius: var(--radius); padding: 0.9rem 1.25rem;
  font-size: 0.98rem;
}
.notice-meta { display: block; margin-top: 0.3rem; font-size: 0.82rem; color: #6B5B23; }

/* ---------- Builder ---------- */
.builder { max-width: 1240px; margin: 0 auto; padding: 2.5rem 1.5rem 3.5rem; }
.builder-intro { max-width: 62ch; margin-bottom: 2rem; }
.builder-intro h1 { font-size: clamp(1.9rem, 4.2vw, 3rem); font-weight: 800; letter-spacing: -0.015em; line-height: 1.1; margin: 0 0 0.9rem; }
.builder-intro p { margin: 0; color: var(--ink-soft); font-size: 1.12rem; }

.builder-grid {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 2.5rem; align-items: start;
}
.builder-form { display: grid; gap: 1.75rem; }
.chips { border: none; margin: 0; padding: 0; }
.chips legend { font-weight: 800; font-size: 1.05rem; margin-bottom: 0.8rem; display: flex; align-items: center; gap: 0.6rem; }
.step-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--red); color: #fff; font-size: 0.9rem;
}
.chips label { display: inline-block; margin: 0 0.5rem 0.6rem 0; cursor: pointer; }
.chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chips span {
  display: inline-block; padding: 0.6rem 1.1rem; border-radius: 999px;
  border: 2px solid var(--line); background: var(--panel);
  font-weight: 600; min-height: 44px; line-height: 1.9;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.chips label:hover span { border-color: var(--ink-soft); }
.chips input:checked + span { border-color: var(--red); background: #FBEBEC; }
.chips input:focus-visible + span { outline: 3px solid var(--red); outline-offset: 2px; }
.builder-note { margin: 0; font-size: 0.9rem; color: var(--ink-soft); max-width: 56ch; }

/* The card */
.card-panel { position: sticky; top: 84px; }
.help-card {
  background: var(--card-bg);
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 1.5rem 1.6rem;
  box-shadow: 4px 4px 0 var(--ink);
}
.card-brand { margin: 0 0 0.75rem; font-weight: 800; color: var(--red); font-size: 0.9rem; letter-spacing: 0.02em; }
.card-brand span { color: var(--ink); }
.help-card h2 { margin: 0 0 0.2rem; font-size: 1.45rem; font-weight: 800; letter-spacing: -0.01em; }
.card-lang { margin: 0 0 1.1rem; color: var(--green); font-weight: 700; font-size: 0.95rem; }
.card-items { list-style: none; margin: 0 0 1.1rem; padding: 0; display: grid; gap: 0.85rem; }
.card-items li {
  border-top: 1.5px dashed #D8C9A8; padding-top: 0.8rem;
  display: grid; gap: 0.1rem;
}
.card-items li:first-child { border-top: none; padding-top: 0; }
.card-items strong { font-size: 1rem; }
.card-items .num { font-size: 1.15rem; color: var(--red-deep); text-decoration: none; }
.card-items a.num:hover { text-decoration: underline; text-underline-offset: 3px; }
.card-items span:not(.num) { font-size: 0.9rem; color: var(--ink-soft); }
.card-items li.card-item-enter { animation: card-in 0.4s ease both; }
@keyframes card-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.card-footer { margin: 0 0 0.4rem; font-size: 0.85rem; font-weight: 700; color: var(--red-deep); }
.card-reviewed { margin: 0; font-size: 0.78rem; color: var(--ink-soft); }
.card-actions { margin-top: 1rem; display: grid; gap: 0.5rem; }
.card-hint { margin: 0; font-size: 0.88rem; color: var(--ink-soft); }

/* ---------- Routes ---------- */
.routes { background: var(--panel); border-block: 1px solid var(--line); padding: 3.5rem 1.5rem; }
.routes .section-title, .route-grid { max-width: 1240px; margin-inline: auto; }
.routes .section-title { margin-bottom: 2rem; }
.route-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.route {
  border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem; display: flex; flex-direction: column; gap: 1.1rem;
  background: var(--bg);
}
.route h3 {
  display: flex; align-items: center; gap: 0.7rem;
  font-size: 1.35rem; font-weight: 800; margin: 0;
}
.route-marker {
  width: 14px; height: 26px; border-radius: 4px; background: var(--red);
  display: inline-block;
}
#care .route-marker { background: var(--green); }
#renew .route-marker { background: #B98900; }
.route-steps { margin: 0; padding-left: 1.3rem; display: grid; gap: 0.7rem; font-size: 0.98rem; }
.route-steps li::marker { font-weight: 800; color: var(--ink-soft); }
.route .btn { align-self: flex-start; margin-top: auto; font-size: 0.92rem; }

/* ---------- Roles ---------- */
.roles { max-width: 1240px; margin: 0 auto; padding: 3.5rem 1.5rem; }
.roles .section-title { margin-bottom: 2rem; }
.role-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.role-card {
  display: flex; flex-direction: column;
  border: 1.5px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--panel);
  text-decoration: none; color: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.role-card:hover { border-color: var(--red); box-shadow: 0 6px 18px rgba(30,30,30,0.1); }
.role-card img { aspect-ratio: 16/9; object-fit: cover; }
.role-body { padding: 1.25rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.role-body h3 { margin: 0; font-size: 1.3rem; font-weight: 800; }
.role-body p { margin: 0; color: var(--ink-soft); font-size: 0.97rem; }
.role-cta { margin-top: auto; padding-top: 0.6rem; font-weight: 700; color: var(--red); }
.role-card:hover .role-cta { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Seasonal ---------- */
.seasonal { background: var(--panel); border-block: 1px solid var(--line); padding: 3.5rem 1.5rem; }
.seasonal .section-title, .seasonal-list { max-width: 1240px; margin-inline: auto; }
.seasonal .section-title { margin-bottom: 1.75rem; }
.seasonal-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.seasonal-list li {
  border-left: 5px solid var(--red); background: var(--bg);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.2rem 1.4rem; display: flex; flex-direction: column; gap: 0.5rem;
}
.seasonal-list h3 { margin: 0; font-size: 1.12rem; font-weight: 800; }
.seasonal-list p { margin: 0; font-size: 0.95rem; color: var(--ink-soft); }
.pill {
  align-self: flex-start; margin-top: auto;
  font-size: 0.78rem; font-weight: 700;
  background: #EDEBE2; border-radius: 999px; padding: 0.25rem 0.7rem;
}

/* ---------- Library / topics ---------- */
.library { max-width: 1240px; margin: 0 auto; padding: 3.5rem 1.5rem; }
.library-sub { margin: 0 0 1.75rem; color: var(--ink-soft); max-width: 60ch; }
.topic-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.topic-grid a {
  display: flex; flex-direction: column; gap: 0.3rem;
  border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--panel);
  padding: 1.1rem 1.3rem; text-decoration: none; color: inherit; height: 100%;
  transition: border-color 0.2s ease;
}
.topic-grid a:hover { border-color: var(--red); }
.topic-name { font-weight: 800; font-size: 1.08rem; }
.topic-langs { font-size: 0.88rem; color: var(--green); font-weight: 700; }

/* ---------- Partners / contact ---------- */
.partners { background: var(--panel); border-block: 1px solid var(--line); padding: 3rem 1.5rem; }
.partners .section-title, .partners p { max-width: 900px; margin-inline: auto; }
.partners p { margin-block: 0; color: var(--ink-soft); }
.partners a { color: var(--red-deep); font-weight: 700; }
.contact { max-width: 1240px; margin: 0 auto; padding: 3.5rem 1.5rem 4.5rem; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.contact p { color: var(--ink-soft); max-width: 52ch; }
.contact a:not(.btn) { color: var(--red-deep); font-weight: 700; }

/* ---------- Footer ---------- */
.site-footer { background: #2A2E33; color: #fff; padding: 3rem 1.5rem; }
.footer-inner { max-width: 1240px; margin: 0 auto; display: grid; gap: 0.75rem; }
.footer-inner img { width: 130px; margin-bottom: 0.5rem; }
.footer-inner p { margin: 0; opacity: 0.85; }
.site-footer .proto { opacity: 0.6; }

.lang-toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; border-radius: 999px;
  padding: 0.8rem 1.5rem; font-weight: 600; font-size: 0.95rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3); z-index: 90;
  max-width: min(90vw, 560px); text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .builder-grid { grid-template-columns: 1fr; }
  .card-panel { position: static; }
  .route-grid, .role-grid, .seasonal-list { grid-template-columns: 1fr 1fr; }
  .topic-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .menu-btn { display: flex; }
  .primary-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--panel); border-bottom: 1px solid var(--line);
    padding: 0.5rem 1rem 1rem;
  }
  .primary-nav.is-open { display: block; }
  .primary-nav ul { flex-direction: column; }
  .primary-nav a { padding: 0.85rem 0.75rem; font-size: 1.05rem; }
  .utility-inner { gap: 1rem; }
}
@media (max-width: 768px) {
  .route-grid, .role-grid, .seasonal-list, .topic-grid, .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  body { font-size: 1rem; }
  .utility-inner { flex-wrap: wrap; padding: 0.4rem 1rem; row-gap: 0; }
  .utility-call { margin-left: 0; }
  .header-inner { padding: 0.6rem 1rem; }
  .brand img { width: 110px; }
  .builder { padding-top: 1.75rem; }
  .chips label { display: block; margin-right: 0; }
  .chips span { display: block; text-align: center; }
  .card-actions .btn { width: 100%; }
}

/* ---------- Print: pocket help card ---------- */
@media print {
  body * { visibility: hidden; }
  .help-card, .help-card * { visibility: visible; }
  .help-card {
    position: absolute; left: 0; top: 0; width: 90mm;
    box-shadow: none; border-width: 1px;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
  .card-items li.card-item-enter { animation: none !important; }
}
