/* Little Beetle: shared styles */

@font-face {
  font-family: "Bricolage";
  src: url("fonts/bricolage.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face { font-family: "Instrument"; src: url("fonts/instrument-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument"; src: url("fonts/instrument-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Instrument"; src: url("fonts/instrument-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --dandelion: #FFE45C;   /* page */
  --shell: #10251C;       /* ink: beetle-shell green-black */
  --leaf: #2F8A4C;
  --paper: #FFFFFF;
  --petal: #FF8FA3;
  --bg: var(--dandelion);
  --ink: var(--shell);
  --soft: rgba(16, 37, 28, .72);
  --line: rgba(16, 37, 28, .9);
  --card: var(--paper);
  --sticker: var(--paper);
  --focus: #1F5FFF;
  --bug: #10251C;
  --bug2: #0A1912;
  --display: "Bricolage", "Arial Narrow", system-ui, sans-serif;
  --text: "Instrument", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1180px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F2219;
    --ink: #FFF1A6;
    --soft: rgba(255, 241, 166, .74);
    --line: rgba(255, 241, 166, .85);
    --card: #173226;
    --sticker: #FFE45C;
    --focus: #8AB4FF;
    --bug: #E9F7CF;
    --bug2: #B9CDA2;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F2219;
  --ink: #FFF1A6;
  --soft: rgba(255, 241, 166, .74);
  --line: rgba(255, 241, 166, .85);
  --card: #173226;
  --sticker: #FFE45C;
  --focus: #8AB4FF;
  --bug: #E9F7CF;
  --bug2: #B9CDA2;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--text);
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); color: var(--shell); padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

/* Header */
.top { padding: 20px 0; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 750 1.2rem/1 var(--display); font-stretch: 88%; letter-spacing: -.01em; }
.brand svg { width: 40px; height: 40px; }
.nav { display: flex; gap: clamp(12px, 2.6vw, 28px); font-weight: 500; }
.nav a { text-decoration: none; }
.nav a:hover { text-decoration: underline; }

/* Type */
h1, h2, h3 { font-family: var(--display); line-height: 1; margin: 0; letter-spacing: 0; }
h2 { font-size: clamp(2.2rem, 5.4vw, 3.8rem); font-weight: 800; font-stretch: 86%; }
h3 { font-size: 1.6rem; font-weight: 750; font-stretch: 90%; }
p { margin: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 22px; border-radius: 999px;
  border: 2.5px solid var(--line);
  font: 600 1rem/1 var(--text); text-decoration: none;
  background: var(--card); color: var(--ink);
  box-shadow: 4px 4px 0 var(--line);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--line); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--line); }
.btn.solid { background: var(--ink); color: var(--bg); }

/* Footer */
.foot { padding: 56px 0 40px; font-size: .95rem; }
.foot .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; border-top: 2.5px solid var(--line); padding-top: 24px; }
.foot nav { display: flex; gap: 20px; }
.foot p { color: var(--soft); }

/* Plain text pages (privacy, 404) */
.page { padding: 32px 0 24px; }
.page .wrap { max-width: 760px; }
.page h1 { font-size: clamp(2.6rem, 7vw, 4.4rem); font-weight: 800; font-stretch: 86%; margin-bottom: 20px; }
.page h2 { font-size: 1.7rem; font-stretch: 90%; margin: 40px 0 10px; }
.page p, .page li { color: var(--ink); max-width: 66ch; }
.page p + p { margin-top: 12px; }
.page ul { padding-left: 1.2em; }
.page li + li { margin-top: 6px; }
.page .lede { font-size: 1.2rem; color: var(--soft); }
