/* Monkey SMP: styled to match lscaturchio.xyz ("The Field Notebook", see that repo's DESIGN.md).
 * Warm paper, one green pen, Fraunces / Instrument Sans / IBM Plex Mono, hairlines, flat surfaces. */
:root {
  --paper: #f9f8f5;
  --card: #fbfaf9;
  --tinted: #eeece7;
  --ink: #1a1f23;
  --muted: #606976;
  --hairline: #e2dbd5;
  --pen: #184e35;
  --pen-ink: #ffffff;
  --nav: rgba(249, 248, 245, 0.9);

  --display: "Fraunces", Georgia, serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --wide: 72rem;
  --mid: 56rem;
  --narrow: 42rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111317;
    --card: #16181d;
    --tinted: #25272d;
    --ink: #fafafa;
    --muted: #abb0ba;
    --hairline: #292c32;
    --pen: #42a979;
    --pen-ink: #111317;
    --nav: rgba(17, 19, 23, 0.9);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
}
/* Paper grain: a fixed, near-invisible noise field, same as the main site. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: var(--pen); text-underline-offset: 3px; text-decoration-thickness: 1px; transition: color 150ms; }
a:hover { text-decoration-thickness: 2px; }
code { font: 500 0.92em/1 var(--mono); }
h1, h2, h3 { font-family: var(--display); line-height: 1.12; margin: 0 0 0.5em; color: var(--ink); }
h1 { font-size: clamp(2.4rem, 6.4vw, 4.2rem); font-weight: 720; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; letter-spacing: -0.02em; }
h3 { font-size: 1.2rem; font-weight: 620; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.2em; }

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

/* Wall label: every piece of metadata is a small mono caption. */
.label, .tag, .alt, .price span, .plan th span, .ladder b,
.top nav a, footer p:first-child, section > h2::before, .steps li::before, .rules li::before,
.gallery figcaption span {
  font: 500 0.72rem/1.4 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-feature-settings: "tnum" 1;
}

.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--pen); color: var(--pen-ink); padding: 8px 12px; z-index: 90; border-radius: 14px; }

/* Nav: fixed, 80px, the one place besides the CTA allowed a shadow. */
.top {
  position: fixed; inset: 0 0 auto; z-index: 50;
  height: 80px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 max(16px, calc((100% - var(--wide)) / 2));
  background: var(--nav);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--hairline) 40%, transparent);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}
.brand { font: 700 1.3rem var(--display); letter-spacing: -0.02em; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.brand img { image-rendering: pixelated; }
.top nav { display: flex; gap: 4px; flex-wrap: wrap; }
.top nav a { text-decoration: none; padding: 6px 10px; border-radius: 999px; min-height: 24px; }
.top nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--pen) 6%, transparent); }

main { padding-top: 80px; }
section { padding: 96px max(16px, calc((100% - var(--wide)) / 2)); border-top: 1px solid var(--hairline); }
section:first-child { border-top: 0; }
main { counter-reset: sec; }
section[id] { counter-increment: sec; }
section > h2::before { content: "0" counter(sec); display: block; margin-bottom: 14px; }

/* Hero: asymmetric, left-weighted, no decoration beyond the type. */
.hero { padding-top: 112px; padding-bottom: 96px; }
.hero h1 { max-width: 16ch; }
.lede { max-width: var(--narrow); font-size: 1.15rem; color: var(--muted); }

.address {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px 14px;
  margin: 16px 0 28px; padding: 10px 10px 10px 16px;
  background: var(--card); border: 1px solid var(--hairline); border-radius: 18px;
  max-width: 100%;
}
.address code { font-size: 1rem; overflow-wrap: anywhere; color: var(--ink); }

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

/* Buttons: 40px, 14px radius. Primary is the forest-ink pen with a 1px ledge. */
.button, button {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 16px; cursor: pointer;
  border-radius: 14px;
  background: var(--pen); color: var(--pen-ink);
  font: 500 0.875rem var(--body); text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--pen) 42%, transparent);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--pen) 25%, transparent);
  transition: background-color 150ms, border-color 150ms, filter 150ms;
}
.button:hover, button:hover { filter: brightness(1.05); color: var(--pen-ink); text-decoration: none; }
.button:active, button:active { transform: translateY(1px); }
.ghost { background: var(--card); color: var(--ink); border-color: var(--hairline); box-shadow: none; }
.ghost:hover {
  filter: none; color: var(--ink);
  background: color-mix(in srgb, var(--pen) 6%, var(--card));
  border-color: color-mix(in srgb, var(--pen) 45%, transparent);
}
button.ghost { height: 32px; padding: 0 12px; border-radius: 12px; }

.note { color: var(--muted); max-width: var(--narrow); font-size: 1.05rem; }
.small { color: var(--muted); font-size: 0.9rem; }

/* The world: hairline-separated rows, title left, text right. Not tiled cards. */
.grid.three { display: block; margin-top: 40px; border-bottom: 1px solid var(--hairline); }
.grid.three article {
  display: grid; grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); gap: 8px 48px;
  padding: 24px 0; border-top: 1px solid var(--hairline);
}
.grid.three article h3 { margin: 0; }
.grid.three article p { margin: 0; color: var(--muted); max-width: var(--narrow); }

.grid.two { display: grid; gap: 20px; margin-top: 32px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid.two article p:last-child { margin-bottom: 0; }

/* Steps and rules: numbered with mono catalogue numbers instead of circles. */
.steps, .rules { list-style: none; padding: 0; counter-reset: n; margin: 40px 0 0; }
.steps { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.steps li { counter-increment: n; border-top: 1px solid var(--ink); padding-top: 18px; }
.steps li::before { content: "Step 0" counter(n); display: block; margin-bottom: 10px; }
.steps p { color: var(--muted); margin: 0; }

.rules { max-width: var(--mid); border-bottom: 1px solid var(--hairline); }
.rules li {
  counter-increment: n;
  display: grid; grid-template-columns: 3.5rem minmax(0, 1fr);
  padding: 22px 0; border-top: 1px solid var(--hairline);
}
.rules li::before { content: counter(n, decimal-leading-zero); grid-row: span 2; padding-top: 5px; }
.rules h3 { margin-bottom: 6px; }
.rules p { color: var(--muted); margin: 0; }
#rules > .small { max-width: var(--mid); margin-top: 24px; }

/* Pricing: flat cards on paper-card, 18px radius, no shadows. */
.plan {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--hairline); border-radius: 18px;
  padding: 28px;
}
.plan.main { border-color: color-mix(in srgb, var(--pen) 45%, transparent); }
.plan ul { padding-left: 1.1em; color: var(--muted); }
.plan li { margin-bottom: 4px; }
.plan .button { margin-top: auto; align-self: flex-start; }
.price { font: 700 3rem/1 var(--display); letter-spacing: -0.03em; margin: 12px 0 6px; }
.price span { letter-spacing: 0.16em; }
.alt { margin-bottom: 20px; }
.tag { border: 1px solid var(--hairline); border-radius: 999px; padding: 3px 10px; vertical-align: middle; margin-left: 6px; }
.plan table { border-collapse: collapse; margin: 8px 0 24px; width: 100%; }
.plan th, .plan td { text-align: left; vertical-align: top; padding: 14px 0; border-top: 1px solid var(--hairline); }
.plan th { padding-right: 20px; white-space: nowrap; font: 620 1.05rem var(--display); }
.plan th span { display: block; margin-top: 4px; }
.plan td { color: var(--muted); }

/* Bare cards below the plans: hairline top, no fill. */
#pricing .grid.two + .grid.two { margin-top: 48px; }
#pricing .grid.two + .grid.two article { border-top: 1px solid var(--hairline); padding-top: 22px; }
#pricing .grid.two + .grid.two p { color: var(--muted); }
.ladder { list-style: none; padding: 0; margin: 0 0 16px; }
.ladder li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); align-items: baseline; padding: 10px 0; border-top: 1px solid var(--hairline); }
.ladder li:last-child { border-bottom: 1px solid var(--hairline); }

/* FAQ: hairline rows. */
#faq .grid.two { gap: 0 48px; }
details { border-top: 1px solid var(--hairline); padding: 18px 0; }
details summary { cursor: pointer; font: 620 1.1rem/1.3 var(--display); letter-spacing: -0.01em; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; font: 400 1.1rem var(--mono); color: var(--muted); transition: transform 200ms; }
details[open] summary::after { transform: rotate(45deg); }
details[open] summary { margin-bottom: 10px; }
details p { color: var(--muted); margin: 0; }

/* Gallery: one large plate with two stacked beside it, then a row of three. */
.gallery { display: grid; gap: 32px 20px; margin-top: 40px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.gallery figure { margin: 0; grid-column: span 2; }
.gallery figure:first-child { grid-column: span 4; grid-row: span 2; }
.gallery img {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: 18px; border: 1px solid var(--hairline); background: var(--tinted);
}
.gallery figcaption { margin-top: 12px; color: var(--muted); font-size: 0.95rem; max-width: var(--narrow); }
.gallery figcaption span { display: block; margin-bottom: 4px; }

/* Trailer under the hero; pixel art scales by whole numbers, so no smoothing. */
.trailer { margin: 64px 0 0; }
.trailer video {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9;
  border-radius: 18px; border: 1px solid var(--hairline); background: #111317;
}
.trailer figcaption, .kit figcaption { margin-top: 12px; color: var(--muted); font-size: 0.95rem; }

/* Press kit: images at their own size, capped to the column. */
.kit { display: grid; gap: 40px; margin-top: 40px; }
.kit figure { margin: 0; }
.kit img { display: block; max-width: 100%; height: auto; image-rendering: pixelated; border-radius: 8px; }
.kit-logo img { box-sizing: border-box; width: 412px; padding: 28px 32px; background: #111317; border-radius: 18px; }
.kit figure:last-child img { max-width: min(100%, 640px); image-rendering: auto; }

footer {
  padding: 48px max(16px, calc((100% - var(--wide)) / 2)) 64px;
  border-top: 1px solid var(--hairline);
}
footer a { color: inherit; }
footer a:hover { color: var(--pen); }

@media (max-width: 760px) {
  .top { height: auto; min-height: 80px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; padding-top: 12px; padding-bottom: 10px; }
  .top nav { margin-left: -10px; max-width: calc(100% + 10px); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .top nav a { flex: none; }
  main { padding-top: 96px; }
  html { scroll-padding-top: 112px; }
  section { padding-top: 64px; padding-bottom: 64px; }
  .hero { padding-top: 56px; }
  .grid.three article { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; gap: 28px; }
  .gallery figure, .gallery figure:first-child { grid-column: auto; grid-row: auto; }
  .plan { padding: 22px; }
  .plan th { white-space: normal; }
}

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