/* HEDGIES · the burrow */
:root {
  color-scheme: light;
  --ground: #FFF3E2;
  --paper: #FFFAF2;
  --ink: #2B2118;
  --ink-soft: #66533F;
  --peach: #FFD6B8;
  --mint: #CDEBD3;
  --lavender: #E2D6F5;
  --butter: #FFE9A8;
  --sky: #CFE5F5;
  --apple: #E5453C;
  --apple-deep: #C7362E;
  --gold: #F2B233;
  --warn: #A12A20;
  --okay: #2E6A3A;
  --line: 3px solid var(--ink);
  --sans: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--ground); }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 500 16px/1.5 var(--sans);
  -webkit-text-size-adjust: 100%;
}
img { image-rendering: pixelated; image-rendering: crisp-edges; display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }
code { font: 600 0.92em var(--mono); background: var(--ground); border-radius: 6px; padding: 0.05em 0.35em; overflow-wrap: anywhere; }
a { color: var(--ink); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--apple-deep); }
h1, h2 { margin: 0; font-weight: 900; letter-spacing: 0.03em; line-height: 1.1; }
p { margin: 0; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 8px; }
.skip { position: absolute; left: 12px; top: -80px; z-index: 5; background: var(--paper); border: var(--line); border-radius: 14px; padding: 8px 14px; font-weight: 800; }
.skip:focus { top: 12px; }

/* ------------------------------------------------ first screen: the burrow */
.burrow {
  display: grid;
  grid-template-columns: 58fr 42fr;
  grid-template-rows: auto 1fr;
  grid-template-areas: "brand slip" "stage slip";
  gap: 16px 40px;
  max-width: 1440px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: 24px 40px 32px;
}

.brand { grid-area: brand; display: flex; align-items: flex-end; flex-wrap: wrap; gap: 8px 22px; }
.wordmark { display: block; height: 72px; width: auto; }
.brand-sub { font-weight: 800; font-size: 18px; letter-spacing: 0.08em; padding-bottom: 6px; }

.stage {
  grid-area: stage;
  position: relative;
  margin: 0;
  min-height: 560px;
  border: var(--line);
  border-radius: 30px;
  background: var(--sky);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sky { position: absolute; left: 0; top: 0; width: 100%; height: auto; }
.hill { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 44%; }
.perch { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 16px 22px; }
.frame {
  --hog: min(560px, 40vw, calc(100vh - 250px));
  position: relative;
  width: var(--hog);
  height: var(--hog);
  min-width: 260px;
  min-height: 260px;
  border: var(--line);
  border-radius: 24px;
  overflow: hidden;
  background: var(--paper);
}
.frame img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0.9s ease; }
.frame img.on { opacity: 1; }
.perch figcaption {
  display: flex; align-items: center; gap: 6px;
  background: var(--paper); border: var(--line); border-radius: 999px;
  padding: 4px 6px; font-weight: 800; font-size: 15px;
}
.perch figcaption span { padding: 0 8px; }
.nudge {
  width: 32px; height: 32px; border-radius: 50%; border: var(--line); background: var(--butter);
  font-size: 20px; font-weight: 900; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0 0 3px;
}
.nudge:hover { background: var(--peach); }

/* ------------------------------------------------ the adoption slip */
.slip {
  grid-area: slip;
  align-self: center;
  justify-self: center;
  position: relative;
  width: 100%;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 32px 34px 24px;
  background: var(--paper);
  border: 3px dashed var(--ink);
  border-radius: 26px;
}
.slip::before, .slip::after {
  content: ""; position: absolute; top: 52%; width: 34px; height: 34px; border-radius: 50%;
  background: var(--ground); border: var(--line);
}
.slip::before { left: -19px; clip-path: inset(0 0 0 50%); }
.slip::after { right: -19px; clip-path: inset(0 50% 0 0); }
.slip:focus { outline: none; }

.slip-top { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 800; letter-spacing: 0.12em; color: var(--ink-soft); }
.tally { font-size: 26px; letter-spacing: 0.06em; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 10px; }
.tally b { font-size: 56px; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.tally .of { font-size: 24px; color: var(--ink-soft); }

.pill { height: 24px; border: var(--line); border-radius: 999px; background: var(--ground); overflow: hidden; }
.pill-fill { display: block; height: 100%; width: var(--p, 0%); min-width: 12px; background: var(--mint); border-right: var(--line); border-radius: 999px; transition: width 0.6s ease; }

.price { font-size: 17px; }
.price strong { font-weight: 900; letter-spacing: 0.04em; }
#usd { color: var(--ink-soft); }

.stepper { display: grid; grid-template-columns: 58px 1fr 58px auto; gap: 8px; }
.stepper button, .stepper output {
  height: 58px; border: var(--line); border-radius: 18px; display: grid; place-items: center;
}
.stepper button { background: var(--peach); font-size: 28px; font-weight: 900; cursor: pointer; padding: 0; }
.stepper button:hover:not(:disabled) { background: var(--butter); }
.stepper .max { background: var(--lavender); font-size: 16px; letter-spacing: 0.08em; padding: 0 20px; }
.stepper output { background: var(--ground); font: 800 28px var(--mono); font-variant-numeric: tabular-nums; }
.stepper button:disabled { opacity: 0.45; cursor: not-allowed; }

.due { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.due-k { font-size: 13px; font-weight: 900; letter-spacing: 0.14em; background: var(--butter); border: 2px solid var(--ink); border-radius: 8px; padding: 0 8px; }
.due b { font: 800 26px var(--mono); }
.split { color: var(--ink-soft); font-size: 14px; }

.act {
  min-height: 72px; width: 100%;
  border: var(--line); border-radius: 22px;
  background: var(--apple); color: var(--paper);
  font-size: 22px; font-weight: 900; letter-spacing: 0.05em;
  cursor: pointer; padding: 10px 18px;
}
.act:hover:not(:disabled) { background: var(--apple-deep); }
.act:active:not(:disabled) { transform: translateY(1px); }
.act:disabled { background: #EDE1CF; color: var(--ink-soft); cursor: not-allowed; }

.note { min-height: 1.4em; font-size: 14px; font-weight: 600; }
.note:empty { min-height: 0; margin-top: -18px; }
.note[data-tone="warn"] { color: var(--warn); }
.note[data-tone="ok"] { color: var(--okay); }
.retry-row { margin-top: -4px; }
.retry { border: var(--line); border-radius: 16px; background: var(--gold); padding: 10px 16px; font-weight: 900; cursor: pointer; width: 100%; }

.netbox { background: var(--butter); border: var(--line); border-radius: 18px; padding: 14px 16px; font-size: 14px; display: grid; gap: 10px; }
.netbox dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; }
.netbox dt { font-weight: 800; }
.netbox dd { margin: 0; font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.addnet { justify-self: start; border: var(--line); border-radius: 14px; background: var(--paper); padding: 8px 14px; font-weight: 800; cursor: pointer; }

.welcome { background: var(--mint); border: var(--line); border-radius: 18px; padding: 14px 16px; display: grid; gap: 10px; }
.welcome-h { font-weight: 900; font-size: 18px; }
.welcome-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.welcome-list a { display: grid; justify-items: center; gap: 2px; text-decoration: none; font-weight: 800; font-size: 12px; }
.welcome-list img { width: 64px; height: 64px; border: var(--line); border-radius: 12px; background: var(--paper); }
.welcome-list .noart a::before { content: ""; width: 64px; height: 64px; border: 3px dashed var(--ink); border-radius: 12px; background: var(--paper); }
.welcome-list .more { align-self: center; font-weight: 900; }

.onecall { font-size: 13px; color: var(--ink-soft); }
.slip-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; border-top: 3px dashed var(--ink); padding-top: 12px; font-size: 13px; font-weight: 700; }
.fresh { display: inline-flex; align-items: center; gap: 6px; }
.fresh::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ink); background: var(--ground); }
.fresh[data-state="live"]::before { background: var(--mint); }
.fresh[data-state="stale"] { color: var(--warn); }
.fresh[data-state="stale"]::before { background: var(--apple); }

/* ------------------------------------------------ lower sections */
.legend, .how, .hedgerow { max-width: 1200px; margin: 72px auto 0; padding: 0 40px; }
.legend h2, .how h2, .hedgerow h2 { font-size: clamp(26px, 3vw, 36px); }

.legend { display: grid; gap: 18px; }
.legend > * { max-width: 100%; }
.legend-lede { font-size: 18px; max-width: 58ch; }
.legend-cast {
  list-style: none; margin: 0; padding: 22px;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px;
  background: var(--gold); border: var(--line); border-radius: 28px;
}
.legend-cast li { background: var(--paper); border: var(--line); border-radius: 20px; padding: 10px 10px 8px; display: grid; gap: 6px; text-align: center; font-weight: 900; letter-spacing: 0.04em; }
.legend-cast img { width: 100%; border-radius: 12px; border: var(--line); }

.how ol { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.how li { border: var(--line); border-radius: 22px; padding: 20px; display: grid; gap: 12px; align-content: start; }
.how li:nth-child(1) { background: var(--peach); }
.how li:nth-child(2) { background: var(--mint); }
.how li:nth-child(3) { background: var(--lavender); }
.how .num { width: 44px; height: 44px; border-radius: 50%; border: var(--line); background: var(--paper); display: grid; place-items: center; font-weight: 900; font-size: 20px; }
.how code { background: var(--paper); }

.row-lede { margin-top: 8px; color: var(--ink-soft); font-weight: 600; }
.row { list-style: none; margin: 26px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 22px 18px; }
.card {
  --tilt: 0deg; --lift: 0px;
  width: 140px; border: var(--line); border-radius: 20px; padding: 9px 9px 8px;
  display: grid; gap: 6px; text-align: center; font-size: 13px; font-weight: 800; line-height: 1.25;
  transform: translateY(var(--lift)) rotate(var(--tilt));
  transition: transform 0.25s ease;
}
.card img { width: 100%; border: var(--line); border-radius: 12px; }
.card:nth-child(4n + 1) { --tilt: -2deg; --lift: 6px; }
.card:nth-child(4n + 2) { --tilt: 1.5deg; --lift: -4px; }
.card:nth-child(4n + 3) { --tilt: -1deg; --lift: 10px; }
.card:nth-child(4n + 4) { --tilt: 2deg; --lift: 0px; }
.card:hover { transform: translateY(-6px) rotate(0deg); }
.card-cream { background: var(--paper); }
.card-peach { background: var(--peach); }
.card-mint { background: var(--mint); }
.card-lavender { background: var(--lavender); }
.card-butter { background: var(--butter); }
.card-sky { background: var(--sky); }

.foot {
  max-width: 1200px; margin: 80px auto 0; padding: 26px 40px 44px;
  border-top: 3px dashed var(--ink);
  display: grid; gap: 8px; font-size: 14px;
}
.foot-k { display: inline-block; min-width: 76px; font-size: 12px; font-weight: 900; letter-spacing: 0.1em; background: var(--butter); border: 2px solid var(--ink); border-radius: 8px; padding: 0 8px; margin-right: 8px; text-align: center; }
#foot-contract a { font-family: var(--mono); overflow-wrap: anywhere; }
.foot-small { color: var(--ink-soft); }

/* ------------------------------------------------ narrow screens */
@media (max-width: 1080px) {
  .burrow { gap: 16px 24px; padding: 20px 24px 28px; }
  .frame { --hog: min(460px, 44vw); }
  .legend-cast { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}
@media (max-width: 880px) {
  .burrow {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas: "brand" "slip" "stage";
    min-height: 0;
    padding: 16px 16px 8px;
  }
  .wordmark { height: 50px; }
  .brand-sub { font-size: 15px; padding-bottom: 2px; }
  .slip { max-width: none; padding: 20px 18px 16px; }
  .stage { min-height: 0; border-radius: 24px; }
  .perch { padding-top: 32px; }
  .frame { --hog: 280px; min-width: 0; min-height: 0; }
  .perch figcaption { font-size: 13px; }
  .tally { font-size: 20px; }
  .tally b { font-size: 38px; }
  .stepper { grid-template-columns: 50px 1fr 50px auto; }
  .stepper .max { padding: 0 14px; }
  .act { font-size: 19px; min-height: 64px; }
  .legend, .how, .hedgerow { margin-top: 56px; padding: 0 16px; }
  .legend-cast { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); padding: 14px; gap: 10px; }
  .how ol { grid-template-columns: 1fr; }
  .card { width: calc(50% - 12px); max-width: 170px; }
  .foot { padding: 22px 16px 36px; margin-top: 56px; }
}
@media (max-width: 360px) {
  .frame { --hog: 240px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .card, .card:hover { transform: none; }
}
