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

:root {
  --bg:     #f4f4f5;
  --panel:  #ffffff;
  --panel2: #ebebed;
  --fg:     #232326;
  --mid:    #5c5c63;
  --muted:  #86868c;
  --line:   #dcdce0;
  --line2:  #c9c9cf;
  --alarm:  #9a3412;   /* muted rust — used sparingly, for urgency only */
  --alarmbg:#fdf3ef;
}

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

body {
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.62;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 720px; margin: 0 auto; padding: 0 24px; }

/* ================= loading bar ================= */
.progress {
  position: fixed; top: 0; left: 0; z-index: 60;
  height: 2px; width: 0;
  background: var(--fg);
  transition: width .45s cubic-bezier(.2,.8,.2,1), opacity .3s ease;
  box-shadow: 0 0 8px rgba(0,0,0,.18);
}
.progress.gone { opacity: 0; }

/* ================= header ================= */
header {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  margin-bottom: 52px;
}
header .wrap { display: flex; align-items: center; gap: 10px; }
.brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; letter-spacing: -0.02em;
  text-decoration: none; color: var(--fg);
}
.brand svg { transition: transform .3s ease; }
.brand:hover svg { transform: scale(1.12) rotate(-6deg); }
header nav { margin-left: auto; display: flex; gap: 16px; }
header nav a { color: var(--mid); text-decoration: none; font-size: 14px; }
header nav a:hover { color: var(--fg); }
header nav a.on { color: var(--fg); font-weight: 700; }
@media (max-width: 480px) {
  header nav { gap: 12px; }
  header nav a { font-size: 13px; }
}

/* ================= type ================= */
.hero { margin-bottom: 48px; }
h1 {
  font-size: 38px; line-height: 1.14; letter-spacing: -0.03em;
  font-weight: 700; margin: 0 0 16px;
}
h1.guide-title { display: flex; align-items: center; gap: 12px; font-size: 32px; }
.lede { font-size: 18px; color: var(--mid); margin: 0; max-width: 58ch; }
.hero p { color: var(--mid); }

section { margin-bottom: 48px; }
h2 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--muted); font-weight: 700;
  margin: 0 0 18px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line2);
}
h3 {
  display: flex; align-items: center; gap: 9px;
  font-size: 18px; letter-spacing: -0.02em; font-weight: 700;
  margin: 0 0 6px;
}
p { margin: 0 0 14px; }
a { color: var(--fg); text-decoration: underline; text-underline-offset: 2px; }
.fine { font-size: 13px; color: var(--muted); }

code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.88em; background: var(--panel);
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px;
}
kbd {
  font-family: inherit; font-size: 0.82em; font-weight: 700;
  background: var(--panel); border: 1px solid var(--line2);
  border-bottom-width: 2px; border-radius: 4px; padding: 1px 6px;
}
pre {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 16px 18px; margin: 0 0 18px;
  overflow-x: auto;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px; line-height: 1.55; color: var(--fg);
}

/* ================= cards ================= */
.grid { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } }

.card {
  display: block; padding: 17px 18px;
  background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px;
  text-decoration: none; color: inherit;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
a.card:hover {
  border-color: var(--line2); transform: translateY(-2px);
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.card h3 { font-size: 16px; margin-bottom: 3px; }
.card p { font-size: 14px; color: var(--mid); margin: 0; }

.card.alarm { background: var(--alarmbg); border-color: #f0d9cd; }
.card.alarm h3 { color: var(--alarm); }
.card.alarm:hover { border-color: var(--alarm); }

/* ================= feature ================= */
.feature {
  display: block; padding: 26px;
  background: var(--panel);
  border: 1px solid var(--line2); border-radius: 10px;
  text-decoration: none; color: inherit;
  transition: transform .15s ease, box-shadow .15s ease;
}
.feature:hover { transform: translateY(-2px); box-shadow: 0 2px 14px rgba(0,0,0,.06); }
.feature.alt { background: var(--panel2); }
.feature h3 { font-size: 23px; letter-spacing: -0.025em; margin-bottom: 8px; }
.feature p { color: var(--mid); margin-bottom: 14px; }
.feature .more {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 700;
}
.feature .more svg { transition: transform .2s ease; }
.feature:hover .more svg { transform: translateX(4px); }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--mid); background: var(--bg);
  border: 1px solid var(--line2); border-radius: 999px;
  padding: 4px 10px; margin-bottom: 14px;
}
.feature.alt .badge { background: var(--panel); }
.badge.red { color: var(--alarm); border-color: #e8c4b4; background: var(--alarmbg); }

/* ================= disclosure ================= */
.disclosure { margin: 14px 0 0; font-size: 14px; }
.disclosure a {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--mid); text-decoration: none;
  border-bottom: 1px dotted var(--line2); padding-bottom: 2px;
}
.disclosure a:hover { color: var(--fg); border-bottom-color: var(--fg); }

/* ================= prose ================= */
.prose ol, .prose ul { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin-bottom: 9px; }
.prose li::marker { color: var(--muted); }
.prose h2 { margin-top: 34px; }
.prose h2:first-child { margin-top: 0; }
.prose ul ul, .prose ol ul { margin-top: 8px; }

/* numbered emergency steps */
ol.big { counter-reset: s; list-style: none; padding-left: 0; }
ol.big > li {
  position: relative; counter-increment: s;
  padding: 15px 18px 15px 52px; margin-bottom: 10px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px;
}
ol.big > li::before {
  content: counter(s);
  position: absolute; left: 16px; top: 15px;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  color: var(--mid); background: var(--panel2);
  border-radius: 50%;
}
ol.big > li > ul { margin: 10px 0 0; }

/* ================= note ================= */
.note {
  display: flex; gap: 13px; align-items: flex-start;
  padding: 17px 18px; margin-bottom: 40px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--mid);
  border-radius: 0 8px 8px 0;
  font-size: 15px;
}
.note p { margin: 0 0 8px; }
.note p:last-child { margin: 0; }

/* ================= products ================= */
.products { display: flex; flex-direction: column; gap: 12px; }
.product {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 18px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px;
  transition: border-color .15s ease;
}
.product:hover { border-color: var(--line2); }
.p-ico {
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; flex: none;
  background: var(--panel2); border-radius: 8px;
  color: var(--mid);
  transition: color .15s ease, background .15s ease;
}
.product:hover .p-ico { color: var(--fg); background: var(--bg); }
.brand-ico { width: 21px; height: 21px; }
.product h3 { font-size: 17px; margin-bottom: 4px; flex-wrap: wrap; }
.product p { font-size: 15px; color: var(--mid); margin: 0 0 10px; }
.product > div:last-child > a {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--mid); text-decoration: none;
  border-bottom: 1px solid var(--line2); padding-bottom: 1px;
}
.product > div:last-child > a:hover { color: var(--fg); border-bottom-color: var(--fg); }
.cat {
  font-size: 11px; font-weight: 400; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--muted);
  border: 1px solid var(--line2); border-radius: 999px; padding: 2px 8px;
}

/* ================= triage ================= */
.triage { display: flex; flex-direction: column; gap: 12px; }
.tri {
  padding: 20px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px;
  border-left: 3px solid var(--line2);
}
.tri h3 { font-size: 17px; margin-bottom: 10px; }
.tri p { font-size: 15px; color: var(--mid); }
.tri p:last-child { margin-bottom: 0; }
.tri strong { color: var(--fg); }
.t1 { border-left-color: var(--muted); }
.t2 { border-left-color: var(--mid); }
.t3 { border-left-color: var(--alarm); background: var(--alarmbg); }
.t3 h3 { color: var(--alarm); }

/* ================= counter callout ================= */
.counter {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 18px; margin: 0 0 18px;
  background: var(--panel2); border: 1px solid var(--line2);
  border-radius: 8px;
}
.counter p { margin: 0; font-size: 15px; color: var(--mid); }
.counter .p-ico { background: var(--panel); }

/* ================= panic button ================= */
.panic {
  position: fixed; bottom: 18px; right: 18px; z-index: 50;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 16px;
  font-size: 14px; font-weight: 700;
  color: #fff; background: var(--alarm);
  border-radius: 999px; text-decoration: none;
  box-shadow: 0 3px 14px rgba(0,0,0,.2);
  transition: transform .18s ease, box-shadow .18s ease;
}
.panic:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 5px 20px rgba(0,0,0,.26); }
.panic svg { animation: blip 2.6s ease-in-out infinite; }
@keyframes blip {
  0%, 88%, 100% { opacity: 1; }
  92% { opacity: .35; }
  96% { opacity: 1; }
}
.emergency-page .panic { display: none; }
@media (max-width: 480px) {
  .panic span { display: none; }
  .panic { padding: 13px; }
}

.exit {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: inherit; font-size: 15px; font-weight: 700;
  color: #fff; background: var(--alarm);
  border: 0; border-radius: 8px; padding: 12px 18px;
  cursor: pointer;
  transition: transform .15s ease, filter .15s ease;
}
.exit:hover { transform: translateY(-1px); filter: brightness(1.08); }

.esc-hint {
  position: fixed; bottom: 74px; right: 18px; z-index: 50;
  padding: 8px 13px; font-size: 13px;
  background: var(--fg); color: var(--bg);
  border-radius: 6px;
  opacity: 0; transform: translateY(6px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.esc-hint kbd { background: transparent; border-color: var(--mid); color: var(--bg); }
.esc-hint.show { opacity: 1; transform: translateY(0); }

/* ================= back link ================= */
.back { font-size: 14px; margin-bottom: 22px; }
.back a { display: inline-flex; align-items: center; gap: 6px; color: var(--mid); text-decoration: none; }
.back a:hover { color: var(--fg); }
.back svg { transition: transform .2s ease; }
.back a:hover svg { transform: translateX(-3px); }

/* ================= icons ================= */
svg { flex: none; }
.icon { width: 20px; height: 20px; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 27px; height: 27px; color: var(--mid); }

/* ================= footer ================= */
footer {
  background: var(--panel); border-top: 1px solid var(--line);
  margin-top: 12px; padding: 26px 0 80px;
  font-size: 13px; color: var(--muted);
}
footer p { margin: 0 0 6px; }
footer a { color: var(--mid); }

/* ================= entrance motion =================
   Content is visible without JS; .animate only adds the movement. */
main.reveal.animate > * {
  animation: rise .5s cubic-bezier(.2,.7,.3,1) backwards;
}
main.reveal.animate > *:nth-child(1) { animation-delay: .02s; }
main.reveal.animate > *:nth-child(2) { animation-delay: .07s; }
main.reveal.animate > *:nth-child(3) { animation-delay: .12s; }
main.reveal.animate > *:nth-child(4) { animation-delay: .17s; }
main.reveal.animate > *:nth-child(5) { animation-delay: .22s; }
main.reveal.animate > *:nth-child(n+6) { animation-delay: .27s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  main.reveal.animate > * { opacity: 1; transform: none; }
}

/* brand glyph used in place of a Lucide icon (guide titles, cards) */
.si { fill: currentColor; }
h1.guide-title .si { color: var(--mid); }

/* ================= time / difficulty chips (feature 15) ================= */
.chips { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted); background: var(--panel2);
  border-radius: 999px; padding: 3px 9px;
}
.chip.lv-important { color: var(--alarm); background: var(--alarmbg); }
.chip.lv-moderate  { color: var(--mid); }
.icon-xs { width: 12px; height: 12px; }
.hero .chips { margin: 0 0 18px; }
.card .chips { margin-top: 12px; }

/* ================= search ================= */
.search-box {
  width: 100%; font-family: inherit; font-size: 17px;
  color: var(--fg); background: var(--panel);
  border: 1px solid var(--line2); border-radius: 8px;
  padding: 14px 16px; margin-bottom: 10px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-box:focus {
  outline: none; border-color: var(--fg);
  box-shadow: 0 0 0 3px rgba(35,35,38,.07);
}
.search-box::placeholder { color: var(--muted); }
#count { min-height: 20px; margin-bottom: 14px; }
#results:empty { display: none; }
#results .card { animation: rise .3s ease backwards; }

/* ================= changelog ================= */
.changelog { display: flex; flex-direction: column; gap: 14px; }
.entry {
  display: flex; gap: 18px; align-items: flex-start;
  padding: 20px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px;
}
.entry .date {
  display: inline-flex; align-items: center; gap: 6px;
  flex: none; width: 116px;
  font-size: 12px; font-weight: 700; color: var(--muted);
  letter-spacing: 0.03em; padding-top: 3px;
}
.entry h3 { font-size: 16px; margin-bottom: 8px; }
.entry ul { margin: 0; padding-left: 20px; font-size: 15px; color: var(--mid); }
.entry li { margin-bottom: 5px; }
@media (max-width: 560px) {
  .entry { flex-direction: column; gap: 10px; }
  .entry .date { width: auto; }
}

/* ================= who's running this ================= */
:root { --duck: #e3b23c; --duckbeak: #e07a34; }

.whois { display: flex; gap: 22px; align-items: flex-start; }
.pfp {
  width: 120px; height: 120px; flex: none;
  border-radius: 12px; background: var(--panel);
  border: 1px solid var(--line); object-fit: cover;
}
.pfp.sm { width: 72px; height: 72px; border-radius: 10px; }
h2.nolines {
  font-size: 26px; text-transform: none; letter-spacing: -0.025em;
  color: var(--fg); border: 0; padding: 0; margin: 0 0 6px;
}
.place { font-size: 17px; color: var(--mid); margin-bottom: 10px; }
.city {
  display: inline-block; min-width: 8.5ch;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.94em; font-weight: 700; color: var(--fg);
  background: var(--panel2); border-radius: 5px;
  padding: 1px 7px; cursor: pointer;
  transition: background .2s ease;
}
.city:hover { background: var(--line); }
.ghlink {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 14px; color: var(--mid); text-decoration: none;
  border: 1px solid var(--line2); border-radius: 999px; padding: 6px 13px;
  transition: border-color .15s ease, color .15s ease;
}
.ghlink:hover { color: var(--fg); border-color: var(--fg); }
@media (max-width: 560px) {
  .whois { flex-direction: column; gap: 16px; }
  .pfp { width: 88px; height: 88px; }
}

.whois-card { display: flex; gap: 20px; align-items: center; }
.whois-card h3 { font-size: 20px; margin-bottom: 4px; }
.whois-card p { margin-bottom: 10px; }

/* ================= gallery ================= */
.gallery {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.gallery figure { margin: 0; }
.gallery img {
  width: 100%; height: 180px; object-fit: cover; display: block;
  border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel2);
  transition: transform .25s ease, box-shadow .25s ease;
}
.gallery figure:hover img {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
}
.gallery figcaption {
  font-size: 12px; color: var(--muted); margin-top: 6px;
  letter-spacing: 0.01em;
}

/* ================= duck ================= */
.duck-wrap { text-align: center; padding: 8px 0 0; }
.duck {
  background: none; border: 0; padding: 10px; cursor: pointer;
  line-height: 0;
}
.duck-svg { width: 180px; height: 150px; max-width: 70%; }
.d-body { fill: var(--duck); }
.d-beak { fill: var(--duckbeak); }
.d-eye  { fill: #2a2118; }
.d-wing { fill: rgba(0,0,0,.11); }
.d-water { stroke: var(--line2); stroke-width: 3; fill: none; }
.duck-svg { transition: transform .2s ease; transform-origin: 30% 70%; }
.duck:hover .duck-svg { transform: rotate(-3deg) scale(1.03); }
.duck.quacking .duck-svg { animation: quack .42s ease; }
@keyframes quack {
  0%   { transform: rotate(0) scale(1); }
  22%  { transform: rotate(-9deg) scale(1.09); }
  50%  { transform: rotate(4deg) scale(.98); }
  75%  { transform: rotate(-3deg) scale(1.03); }
  100% { transform: rotate(0) scale(1); }
}
.duck-hint {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  flex-wrap: wrap; max-width: 52ch; margin: 4px auto 0;
}

/* album label */
.album { margin-bottom: 6px; }
.album-name {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px; color: var(--mid);
  background: var(--panel2); border-radius: 5px; padding: 3px 9px;
}
.gallery img { height: 190px; }
