:root {
  --ink: #16324f;
  --ink-soft: #36566f;
  --water: #dceff1;
  --water-deep: #b9dfe3;
  --pencil: #f3c969;
  --leaf: #2f7d56;
  --leaf-soft: #e2f1e8;
  --stop: #b84d3d;
  --paper: #fcfbf7;
  --white: #fff;
  --line: #b9c7ce;
  --display: "Hiragino Maru Gothic ProN", "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  --body: "BIZ UDPGothic", "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.8;
}

a {
  color: #1c6282;
  text-underline-offset: .22em;
}
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 3px solid var(--pencil); outline-offset: 3px; }

img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }

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

.skip {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 50;
  background: var(--ink);
  color: white;
  padding: .7rem 1rem;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
}
.skip:focus { top: 1rem; }

/* Header */
.site-header {
  background: rgb(252 251 247 / 96%);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
}
.nav {
  max-width: 1120px;
  margin: auto;
  min-height: 72px;
  padding: .7rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: .02em;
  font-size: 1.05rem;
}
.brand-mark {
  width: 34px;
  height: 40px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  position: relative;
  background: var(--water);
  transform: rotate(-2deg);
  flex-shrink: 0;
}
.brand-mark::before {
  content: "✓";
  position: absolute;
  inset: 4px 0 0 8px;
  font-size: 1.2rem;
  color: var(--leaf);
}
.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .5rem 1.2rem;
  font-size: .9rem;
}
.nav-links a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  padding: .2rem .1rem;
}
.nav-links a:hover { text-decoration: underline; }
.nav-links a[aria-current="page"] { text-decoration: underline 2px; text-underline-offset: .2em; }

.container { width: min(100% - 2rem, 1080px); margin-inline: auto; }

/* Hero */
.hero {
  padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(3rem, 6vw, 5rem);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.hero h1 { margin-top: .5rem; }

.eyebrow, .updated, .label {
  font: 700 .76rem/1.5 var(--mono);
  letter-spacing: .08em;
}
.eyebrow { color: var(--leaf); }
.updated {
  display: inline-block;
  color: var(--leaf);
  background: var(--leaf-soft);
  padding: .35rem .55rem;
  border-radius: 2px;
}
.label {
  display: inline-block;
  padding: .35rem .55rem;
  border-radius: 2px;
  color: var(--ink);
  background: var(--water);
  margin-bottom: .6rem;
}
.label-stop { color: white; background: var(--stop); }
.label-caution { background: var(--pencil); color: var(--ink); }

h1, h2, h3 { font-family: var(--display); line-height: 1.25; letter-spacing: .01em; }
h1 { font-size: clamp(2.4rem, 6.5vw, 5rem); margin: .5rem 0 1.2rem; max-width: 14ch; }
h2 { font-size: clamp(1.65rem, 3.8vw, 2.6rem); margin: 0 0 1.2rem; }
h3 { font-size: 1.25rem; margin: 1.5rem 0 .7rem; }

.lede {
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  max-width: 38rem;
  line-height: 1.7;
}

.actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }

.button {
  appearance: none;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: white;
  padding: .78rem 1.15rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
}
.button.secondary {
  background: transparent;
  color: var(--ink);
}
.button:hover { transform: translateY(-1px); box-shadow: 4px 4px 0 var(--pencil); }
.button:focus-visible { outline: 3px solid var(--pencil); outline-offset: 3px; }

/* Hero card */
.promise-card {
  background: var(--white);
  border: 2px solid var(--ink);
  box-shadow: 10px 12px 0 var(--water-deep);
  padding: 1.35rem 1.5rem 1.5rem;
  position: relative;
  transform: rotate(1.5deg);
  margin-top: 1rem;
}
.promise-card::before {
  content: "";
  position: absolute;
  width: 56px;
  height: 18px;
  top: -10px;
  left: 45%;
  background: rgb(243 201 105 / 80%);
  transform: rotate(-4deg);
}
.promise-card::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  top: 6px;
  right: 24px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
}
.promise-card h2 {
  font-size: 1.15rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: .7rem;
  margin-bottom: .5rem;
}
.promise-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.promise-card li {
  border-bottom: 1px dashed var(--line);
  padding: .7rem 0;
  display: flex;
  gap: .7rem;
  align-items: baseline;
}
.promise-card li::before { content: "□"; font-size: 1.2rem; flex-shrink: 0; }
.promise-card a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}
.promise-card a:hover { text-decoration: underline; }

/* Sections */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section.tinted {
  background: var(--water);
  border-block: 1px solid var(--water-deep);
}
.section-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: end;
  margin-bottom: 2.5rem;
}
.section-head p { margin: 0; color: var(--ink-soft); }

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 5px solid var(--ink);
  padding: 1.4rem;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
.card.safe { border-top-color: var(--leaf); }
.card.caution { border-top-color: var(--pencil); }
.card.stop { border-top-color: var(--stop); }
.card h3 { margin-top: 0; }
.card p { color: var(--ink-soft); margin: 0 0 1rem; }
.card a { font-weight: 800; margin-top: auto; }
.card ul { margin-top: .5rem; padding-left: 1.2rem; }
.card li { margin-bottom: .35rem; }

/* Article */
.article {
  width: min(100% - 2rem, 780px);
  margin: auto;
  padding: 3rem 0 6rem;
}
.article h1 { max-width: none; font-size: clamp(2.1rem, 5.5vw, 4rem); }
.article h2 {
  margin-top: 3rem;
  border-bottom: 2px solid var(--water-deep);
  padding-bottom: .45rem;
}
.article h3 { margin-top: 2.2rem; }
.article p { margin: .8rem 0; }
.article ul, .article ol { padding-left: 1.4rem; }
.article li { margin-bottom: .55rem; }

.breadcrumbs { font-size: .85rem; margin-bottom: 2rem; color: var(--ink-soft); }
.breadcrumbs a { color: var(--ink-soft); }

.checklist { list-style: none; padding: 0; }
.checklist li {
  padding: .8rem 0 .8rem 2.4rem;
  border-bottom: 1px dashed var(--line);
  position: relative;
}
.checklist li::before {
  content: "□";
  position: absolute;
  left: .3rem;
  font-size: 1.25rem;
}

.steps {
  counter-reset: safe-step;
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}
.steps li {
  counter-increment: safe-step;
  border-left: 3px solid var(--water-deep);
  padding: 0 0 2.5rem 2rem;
  position: relative;
}
.steps li::before {
  content: counter(safe-step);
  position: absolute;
  left: -1rem;
  top: 0;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: white;
  border-radius: 50%;
  font: 700 .85rem var(--mono);
}
.steps li:last-child { padding-bottom: 0; border-left-color: transparent; }
.steps h2, .steps h3 { margin-top: 0; }

/* Notices */
.notice {
  border-left: 6px solid var(--pencil);
  background: #fff7db;
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
  border-radius: 0 4px 4px 0;
}
.notice.stop { border-color: var(--stop); background: #fcedea; }
.notice.safe { border-color: var(--leaf); background: var(--leaf-soft); }
.notice p:first-child { margin-top: 0; }
.notice p:last-child { margin-bottom: 0; }

.source-list { list-style: none; padding: 0; }
.source-list li { margin-bottom: 1.4rem; }
.source-list a { font-weight: 700; }
.source-list small { display: block; color: var(--ink-soft); margin-top: .2rem; }

/* Table */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 2px; }
table { width: 100%; border-collapse: collapse; background: white; min-width: 720px; }
th, td { text-align: left; vertical-align: top; padding: .9rem; border-bottom: 1px solid var(--line); }
th { background: var(--water); font-weight: 800; }
tbody tr:last-child td { border-bottom: none; }

/* Tooltips / glossary */
.glossary { margin: 1.5rem 0; border: 1px solid var(--line); border-radius: 4px; }
.glossary summary {
  padding: .9rem 1.1rem;
  cursor: pointer;
  font-weight: 800;
  color: var(--ink);
  list-style: none;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.glossary summary::-webkit-details-marker { display: none; }
.glossary summary::before {
  content: "？";
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--water);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-size: .8rem;
  flex-shrink: 0;
}
.glossary[open] summary::before { content: "×"; background: var(--pencil); }
.glossary .body { padding: 0 1.1rem 1.1rem; color: var(--ink-soft); }
.glossary .body p { margin: .5rem 0; }
.glossary .body p:last-child { margin-bottom: 0; }

/* Rule tool */
.rule-tool {
  background: white;
  border: 2px solid var(--ink);
  padding: clamp(1.2rem, 4vw, 2rem);
  box-shadow: 8px 8px 0 var(--water-deep);
  border-radius: 2px;
}
.field { margin-bottom: 1.4rem; }
.field label, .field legend { display: block; font-weight: 800; margin-bottom: .4rem; }
.field input[type="text"], .field input[type="email"], .field select, .field textarea {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 3px;
  padding: .75rem;
  background: white;
  min-height: 44px;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); outline: none; }
.choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem 1rem; }
.choices label { font-weight: 500; display: flex; align-items: baseline; gap: .5rem; cursor: pointer; }
.choices input { margin-top: .25rem; flex-shrink: 0; }
.output {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--paper);
  border: 1px dashed var(--ink);
  border-radius: 2px;
}
.output[hidden] { display: none; }
.fineprint { color: var(--ink-soft); font-size: .82rem; line-height: 1.6; }

/* Footer */
.site-footer {
  background: var(--ink);
  color: white;
  padding: 3rem 0;
  margin-top: 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 2rem;
  align-items: start;
}
.site-footer a { color: white; }
.site-footer .fineprint { color: #cbd9e2; }
.footer-links { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
  .button:hover { transform: none; box-shadow: none; }
}

/* Mobile */
@media (max-width: 760px) {
  .nav { align-items: flex-start; flex-wrap: wrap; gap: .8rem; }
  .nav-links { justify-content: flex-start; max-width: none; width: 100%; }
  .hero-grid, .section-head, .footer-grid { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .promise-card { transform: none; margin-top: 2rem; }
  .choices { grid-template-columns: 1fr; }
  .article h1 { font-size: clamp(1.8rem, 8vw, 2.4rem); }
  h1 { max-width: none; font-size: clamp(2rem, 10vw, 3rem); }
}

/* Print */
@media print {
  .site-header, .site-footer, .no-print, .breadcrumbs, .glossary { display: none !important; }
  body { background: white; color: black; font-size: 11pt; }
  .article { width: 100%; padding: 0; }
  .rule-tool, .output, .card, .promise-card { box-shadow: none; border-color: black; }
  a { color: black; text-decoration: none; }
  .notice { border-color: black; background: transparent; }
  h1 { font-size: 20pt; }
  h2 { font-size: 14pt; }
  .promise-card { transform: none; }
}
