/* =====================================================================
   thecartine.me — design tokens & base styles
   Warm paper + ink + clay. Editorial but playful.
   ===================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700;9..144,800;9..144,900&display=swap");

:root {
  /* PALETTE — paper */
  --paper-50:  oklch(0.985 0.006 80);
  --paper-100: oklch(0.965 0.012 78);
  --paper-200: oklch(0.935 0.018 76);
  --paper-300: oklch(0.890 0.022 74);
  --paper-400: oklch(0.820 0.020 72);

  /* INK */
  --ink-900:   oklch(0.185 0.012 60);
  --ink-800:   oklch(0.260 0.014 62);
  --ink-700:   oklch(0.385 0.014 64);
  --ink-600:   oklch(0.505 0.016 66);
  --ink-500:   oklch(0.615 0.014 68);

  /* CLAY (default accent) */
  --clay-100:  oklch(0.928 0.042 46);
  --clay-300:  oklch(0.790 0.105 42);
  --clay-500:  oklch(0.635 0.148 36);
  --clay-700:  oklch(0.452 0.115 32);

  /* MOSS, OCHRE, LAKE for variety */
  --moss-500:  oklch(0.585 0.082 132);
  --ochre-500: oklch(0.678 0.128 78);
  --lake-500:  oklch(0.555 0.082 216);

  /* Semantic — can be overridden by palette tweak */
  --bg:        var(--paper-100);
  --bg-raised: var(--paper-50);
  --bg-sunken: var(--paper-200);
  --bg-grain:  var(--paper-300);

  --fg1:       var(--ink-900);
  --fg2:       var(--ink-700);
  --fg3:       var(--ink-600);
  --fg-muted:  var(--ink-500);

  --border:    oklch(0.872 0.018 72);
  --border-strong: oklch(0.795 0.022 70);
  --border-subtle: oklch(0.922 0.014 74);

  --accent:    var(--clay-500);
  --accent-hover: var(--clay-700);
  --accent-tint: var(--clay-100);

  --focus-ring: oklch(0.635 0.148 36 / 0.45);

  /* TYPE */
  --font-sans:    "Manrope", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Fraunces", "Space Grotesk", serif;
  --font-grotesk: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* SPACE */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px;  --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px;  --s-8: 64px;
  --s-9: 96px; --s-10: 128px;

  --r-sm: 6px;  --r-md: 10px;  --r-lg: 16px;  --r-xl: 24px;  --r-pill: 999px;

  --shadow-sm: 0 1px 2px 0 oklch(0.3 0.02 60 / 0.06), 0 1px 1px 0 oklch(0.3 0.02 60 / 0.04);
  --shadow-md: 0 4px 12px -3px oklch(0.3 0.02 60 / 0.10), 0 2px 4px -2px oklch(0.3 0.02 60 / 0.06);
  --shadow-lg: 0 12px 32px -8px oklch(0.3 0.02 60 / 0.14), 0 4px 12px -4px oklch(0.3 0.02 60 / 0.08);
  --shadow-pop: 0 24px 64px -16px oklch(0.3 0.02 60 / 0.22);

  --ease-out:  cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-soft: cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ---- PALETTE VARIANTS (driven by Tweaks) ---- */
[data-palette="clay"]  { --accent: var(--clay-500);  --accent-hover: var(--clay-700);  --accent-tint: var(--clay-100); --focus-ring: oklch(0.635 0.148 36 / 0.45); }
[data-palette="moss"]  { --accent: var(--moss-500);  --accent-hover: oklch(0.45 0.075 134); --accent-tint: oklch(0.938 0.028 128); --focus-ring: oklch(0.585 0.082 132 / 0.45); }
[data-palette="ochre"] { --accent: var(--ochre-500); --accent-hover: oklch(0.45 0.108 76); --accent-tint: oklch(0.945 0.038 88); --focus-ring: oklch(0.678 0.128 78 / 0.45); }
[data-palette="lake"]  { --accent: var(--lake-500);  --accent-hover: oklch(0.4 0.062 214); --accent-tint: oklch(0.928 0.028 220); --focus-ring: oklch(0.555 0.082 216 / 0.45); }
[data-palette="ink"]   { --accent: var(--ink-900);   --accent-hover: oklch(0.05 0.012 60); --accent-tint: var(--paper-200); --focus-ring: oklch(0.185 0.012 60 / 0.35); }

/* ---- DARK MODE ---- */
[data-theme="dark"] {
  --bg:        oklch(0.165 0.010 60);
  --bg-raised: oklch(0.215 0.012 62);
  --bg-sunken: oklch(0.135 0.008 58);
  --bg-grain:  oklch(0.245 0.014 62);

  --fg1:       oklch(0.962 0.008 78);
  --fg2:       oklch(0.835 0.012 76);
  --fg3:       oklch(0.695 0.014 72);
  --fg-muted:  oklch(0.562 0.014 70);

  --border:        oklch(1 0.01 70 / 0.10);
  --border-strong: oklch(1 0.01 70 / 0.20);
  --border-subtle: oklch(1 0.01 70 / 0.06);

  --shadow-sm: 0 1px 2px 0 oklch(0 0 0 / 0.32);
  --shadow-md: 0 6px 18px -4px oklch(0 0 0 / 0.42);
  --shadow-lg: 0 18px 40px -10px oklch(0 0 0 / 0.55);
  --shadow-pop: 0 32px 72px -20px oklch(0 0 0 / 0.70);
}
[data-theme="dark"][data-palette="clay"]  { --accent: oklch(0.745 0.135 38); --accent-hover: oklch(0.82 0.13 40); --accent-tint: oklch(0.32 0.06 36); }
[data-theme="dark"][data-palette="moss"]  { --accent: oklch(0.72 0.085 132); --accent-hover: oklch(0.82 0.08 132); --accent-tint: oklch(0.30 0.04 132); }
[data-theme="dark"][data-palette="ochre"] { --accent: oklch(0.79 0.13 80);   --accent-hover: oklch(0.86 0.12 82); --accent-tint: oklch(0.32 0.05 80); }
[data-theme="dark"][data-palette="lake"]  { --accent: oklch(0.72 0.08 218);  --accent-hover: oklch(0.82 0.075 218); --accent-tint: oklch(0.30 0.04 218); }
[data-theme="dark"][data-palette="ink"]   { --accent: var(--paper-50);       --accent-hover: var(--paper-100); --accent-tint: var(--bg-sunken); }

/* ---- REDUCED MOTION (driven by Tweaks) ---- */
[data-motion="off"] *, [data-motion="off"] *::before, [data-motion="off"] *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}

/* =====================================================================
   RESET & BASE
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--fg1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent-tint); color: var(--fg1); }

/* Paper grain overlay */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.45;
  mix-blend-mode: multiply;
  background-image: radial-gradient(circle at 25% 30%, var(--bg-grain) 0.5px, transparent 1px),
                    radial-gradient(circle at 75% 70%, var(--bg-grain) 0.4px, transparent 0.8px);
  background-size: 3px 3px, 5px 5px;
}
[data-theme="dark"] body::before { mix-blend-mode: screen; opacity: 0.25; }

/* =====================================================================
   LAYOUT
   ===================================================================== */
.app {
  position: relative;
  z-index: 2;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--s-6);
}
@media (min-width: 900px) {
  .app { padding: 0 var(--s-7); }
}

/* =====================================================================
   NAV
   ===================================================================== */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-5) 0;
  position: sticky;
  top: 0;
  background: color-mix(in oklch, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-fast, 140ms) var(--ease-out);
}
.nav.scrolled { border-bottom-color: var(--border-subtle); }
.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 144;
}
.nav-brand .mark {
  width: 36px; height: 36px;
}
.nav-brand .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  margin-left: -2px;
  animation: pulse 3s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(1.25); }
}
.nav-links {
  display: flex;
  gap: var(--s-5);
  align-items: center;
}
.nav-link {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--fg3);
  position: relative;
  padding: 6px 2px;
  transition: color 180ms var(--ease-out);
}
.nav-link::before {
  content: "→";
  position: absolute;
  left: -14px; top: 50%;
  transform: translateY(-50%) translateX(-4px);
  opacity: 0;
  color: var(--accent);
  transition: all 220ms var(--ease-out);
}
.nav-link:hover { color: var(--fg1); }
.nav-link:hover::before { opacity: 1; transform: translateY(-50%) translateX(0); }
@media (max-width: 700px) {
  .nav-links { gap: var(--s-3); }
  .nav-link[data-secondary] { display: none; }
}

/* =====================================================================
   HERO
   ===================================================================== */
.hero {
  padding: var(--s-9) 0 var(--s-8);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-7);
  align-items: center;
}
@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1.4fr 1fr;
    gap: var(--s-8);
    padding: var(--s-10) 0 var(--s-9);
  }
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: var(--s-5);
}
.eyebrow .live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: ring 2.4s ease-out infinite;
}
@keyframes ring {
  0% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--accent) 60%, transparent); }
  100% { box-shadow: 0 0 0 12px color-mix(in oklch, var(--accent) 0%, transparent); }
}
.hero-title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144;
  font-size: clamp(48px, 8vw, 104px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  font-weight: 500;
  margin: 0 0 var(--s-5);
  color: var(--fg1);
  text-wrap: balance;
}
.hero-title .ital {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}
.hero-title .strike {
  text-decoration: line-through;
  text-decoration-color: var(--fg-muted);
  text-decoration-thickness: 2px;
  color: var(--fg-muted);
  margin-right: 0.18em;
}
.hero-sub {
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.5;
  color: var(--fg2);
  max-width: 56ch;
  text-wrap: pretty;
  margin: 0 0 var(--s-6);
}
.hero-actions {
  display: flex; flex-wrap: wrap; gap: var(--s-3);
  align-items: center;
}
.hero-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 360px;
}
.hero-stage svg.tine { width: 100%; max-width: 380px; height: auto; }

/* tickets / chip */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  color: var(--fg3);
}
.chip.accent { background: var(--accent-tint); color: var(--accent-hover); border-color: color-mix(in oklch, var(--accent) 30%, var(--border)); }
.chip .led { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* =====================================================================
   BUTTONS
   ===================================================================== */
.btn {
  display: inline-flex; align-items: center; gap: var(--s-2);
  height: 44px;
  padding: 0 var(--s-5);
  border-radius: var(--r-pill);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  transition: transform 140ms var(--ease-out),
              background 200ms var(--ease-out),
              color 200ms var(--ease-out),
              box-shadow 200ms var(--ease-out),
              border-color 200ms var(--ease-out);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }

.btn-primary {
  background: var(--accent);
  color: var(--paper-50);
}
.btn-primary:hover { background: var(--accent-hover); }
[data-theme="dark"] .btn-primary { color: var(--ink-900); }

.btn-ghost {
  color: var(--fg1);
  border-color: var(--border);
  background: transparent;
}
.btn-ghost:hover { background: var(--bg-sunken); border-color: var(--border-strong); }

.btn .arrow {
  display: inline-block;
  transition: transform 200ms var(--ease-out);
}
.btn:hover .arrow { transform: translateX(3px); }

/* =====================================================================
   SECTION CHROME
   ===================================================================== */
.section {
  padding: var(--s-9) 0;
  position: relative;
}
.section-hd {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-5);
  margin-bottom: var(--s-7);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: var(--s-4);
}
.section-hd-left { display: flex; flex-direction: column; gap: 4px; }
.section-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.section-title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 80;
  font-size: clamp(32px, 4.5vw, 52px);
  line-height: 1;
  letter-spacing: -0.025em;
  font-weight: 500;
  margin: 0;
}
.section-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-muted);
  letter-spacing: 0.04em;
}

/* TINE BUBBLE — between sections */
.tine-bubble {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  margin: var(--s-7) 0 0;
  padding: var(--s-4) var(--s-5);
  background: var(--bg-raised);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-lg);
  max-width: 560px;
}
.tine-bubble .pose { width: 56px; height: 56px; flex-shrink: 0; }
.tine-bubble .quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  line-height: 1.35;
  color: var(--fg2);
  font-variation-settings: "opsz" 18;
}
.tine-bubble .quote::before { content: "“"; margin-right: 2px; color: var(--accent); font-size: 24px; line-height: 0; vertical-align: -4px; }
.tine-bubble .quote::after  { content: "”"; margin-left: 2px;  color: var(--accent); font-size: 24px; line-height: 0; vertical-align: -4px; }

/* =====================================================================
   REPO GRID
   ===================================================================== */
.repos {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-5);
}
@media (min-width: 720px)  { .repos { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .repos { grid-template-columns: repeat(2, 1fr); } }

.repo {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform 260ms var(--ease-out),
              box-shadow 260ms var(--ease-out),
              border-color 260ms var(--ease-out);
  box-shadow: var(--shadow-sm);
}
.repo:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}
.repo-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background:
    repeating-linear-gradient(
      135deg,
      var(--bg-sunken) 0 12px,
      var(--bg-grain) 12px 24px
    );
  display: grid; place-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border-subtle);
}
.repo-media .placeholder {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  background: var(--bg-raised);
  padding: 6px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-subtle);
}
.repo-media iframe {
  width: 100%; height: 100%;
  border: 0;
  object-fit: cover;
}
.repo-media img,
.repo-media video {
  width: 100%; height: 100%;
  border: 0;
  object-fit: contain;
  background: oklch(0.22 0.012 60);
}
.repo-media .play {
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  background: linear-gradient(180deg, transparent 40%, oklch(0.2 0.012 60 / 0.55));
  color: var(--paper-50);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: backdrop-filter 200ms;
}
.repo-media .play-disk {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--paper-50);
  color: var(--ink-900);
  display: grid; place-items: center;
  margin-bottom: 10px;
  box-shadow: var(--shadow-lg);
  transition: transform 200ms var(--ease-out);
}
.repo:hover .play-disk { transform: scale(1.07); }
.repo-pose {
  position: absolute;
  top: 12px; right: 12px;
  width: 64px; height: 64px;
  z-index: 2;
  filter: drop-shadow(0 4px 8px oklch(0.2 0.02 60 / 0.18));
}

.repo-body { padding: var(--s-5) var(--s-5) var(--s-5); display: flex; flex-direction: column; gap: var(--s-3); flex: 1; }
.repo-row1 { display: flex; align-items: baseline; gap: var(--s-3); flex-wrap: wrap; }
.repo-name {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0;
  color: var(--fg-muted);
}
.repo-name strong {
  color: var(--fg1);
  font-weight: 600;
}
.repo-title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 24;
  font-size: 26px;
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 500;
  color: var(--fg1);
  margin: 0;
  text-wrap: balance;
}
.repo-tag { color: var(--fg2); font-size: 15px; line-height: 1.5; margin: 0; }
.repo-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--s-4);
  border-top: 1px solid var(--border-subtle);
  gap: var(--s-3);
}
.repo-meta { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; }
.status {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg3);
}
.status .led { width: 8px; height: 8px; border-radius: 50%; }
.status.shipped .led  { background: var(--moss-500); box-shadow: 0 0 0 3px color-mix(in oklch, var(--moss-500) 25%, transparent); }
.status.building .led { background: var(--ochre-500); box-shadow: 0 0 0 3px color-mix(in oklch, var(--ochre-500) 25%, transparent); animation: blink 1.6s ease-in-out infinite; }
.status.drafting .led { background: var(--lake-500); box-shadow: 0 0 0 3px color-mix(in oklch, var(--lake-500) 25%, transparent); }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

.repo-go {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg2);
  letter-spacing: 0.04em;
  transition: color 200ms var(--ease-out), gap 200ms var(--ease-out);
}
.repo-go:hover { color: var(--accent); gap: 10px; }

/* =====================================================================
   SOCIAL ROW
   ===================================================================== */
.socials {
  --social-card-width: 224px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--social-card-width)), var(--social-card-width)));
  justify-content: center;
  gap: var(--s-3);
}
.social {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: all 220ms var(--ease-out);
  position: relative;
  overflow: hidden;
  inline-size: var(--social-card-width);
  max-inline-size: 100%;
}
.social::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, color-mix(in oklch, var(--accent) 18%, transparent) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 600ms var(--ease-out);
  pointer-events: none;
}
.social:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.social:hover::after { transform: translateX(100%); }
.social-left { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.social-name { font-weight: 600; font-size: 15px; color: var(--fg1); }
.social-handle {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
  white-space: nowrap;
}
.social-icon {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: var(--bg-sunken);
  border-radius: var(--r-sm);
  color: var(--fg2);
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
}
.social:hover .social-icon { color: var(--accent); background: var(--accent-tint); border-color: color-mix(in oklch, var(--accent) 30%, var(--border-subtle)); }
.social-arr { font-family: var(--font-mono); color: var(--fg-muted); transition: transform 200ms; flex-shrink: 0; }
.social:hover .social-arr { transform: translate(3px, -3px); color: var(--accent); }

/* =====================================================================
   NEWSLETTER
   ===================================================================== */
.newsletter {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-6);
  background:
    radial-gradient(ellipse at top right, color-mix(in oklch, var(--accent) 14%, transparent), transparent 60%),
    var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--s-7);
  position: relative;
  overflow: hidden;
}
@media (min-width: 800px) {
  .newsletter { grid-template-columns: 1.2fr 1fr; padding: var(--s-8); }
}
.newsletter-pose {
  position: absolute;
  bottom: -16px; right: var(--s-6);
  width: 140px; height: 140px;
  opacity: 0.95;
}
@media (max-width: 800px) { .newsletter-pose { display: none; } }

.newsletter h2 {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 80;
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  font-weight: 500;
  margin: 0 0 var(--s-3);
  text-wrap: balance;
}
.newsletter p { color: var(--fg2); margin: 0; max-width: 48ch; }

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  align-self: start;
}
.field {
  display: flex;
  align-items: stretch;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 4px;
  transition: border-color 180ms, box-shadow 180ms;
}
.field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
.field input {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 0 var(--s-4);
  font: inherit;
  font-size: 15px;
  color: var(--fg1);
  outline: none;
  min-width: 0;
}
.field input::placeholder { color: var(--fg-muted); }
.field button {
  background: var(--accent);
  color: var(--paper-50);
  border-radius: var(--r-pill);
  padding: 0 var(--s-5);
  font-weight: 600;
  font-size: 14px;
  height: 40px;
  white-space: nowrap;
  transition: background 200ms;
}
.field button:hover { background: var(--accent-hover); }
[data-theme="dark"] .field button { color: var(--ink-900); }

.newsletter .fine {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
  letter-spacing: 0.04em;
}

/* =====================================================================
   CONTACT / FOOTER
   ===================================================================== */
.contact {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-6);
  padding-top: var(--s-8);
  border-top: 1px solid var(--border-subtle);
}
@media (min-width: 900px) {
  .contact { grid-template-columns: 1.4fr 1fr; }
}
.contact h2 {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-weight: 500;
  margin: 0 0 var(--s-4);
  text-wrap: balance;
}
.contact h2 .ital { font-style: italic; color: var(--accent); font-weight: 400; }
.contact-side {
  display: flex; flex-direction: column; gap: var(--s-3);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg2);
}
.contact-side .label {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-top: var(--s-3);
}
.contact-side a { color: var(--fg1); border-bottom: 1px solid var(--border-strong); padding-bottom: 1px; transition: color 200ms, border-color 200ms; }
.contact-side a:hover { color: var(--accent); border-color: var(--accent); }

.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--s-7) 0 var(--s-6);
  border-top: 1px solid var(--border-subtle);
  margin-top: var(--s-8);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.foot .sig { display: flex; gap: var(--s-3); align-items: center; }
.foot .sig svg { width: 22px; height: 22px; }

/* =====================================================================
   REVEAL on scroll
   ===================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* =====================================================================
   TINE the stickman — global animations
   ===================================================================== */
.tine-idle { animation: tine-bob 4s ease-in-out infinite; transform-origin: center bottom; }
@keyframes tine-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.tine-wave-arm { animation: tine-wave 2.6s ease-in-out infinite; transform-origin: 50% 38%; transform-box: fill-box; }
@keyframes tine-wave {
  0%, 100% { transform: rotate(-8deg); }
  50%      { transform: rotate(28deg); }
}
.tine-eye { animation: tine-blink 5.2s infinite; transform-origin: center; transform-box: fill-box; }
.tine-eye-2 { animation-delay: 0.05s; }
@keyframes tine-blink {
  0%, 92%, 100% { transform: scaleY(1); }
  94%, 98%      { transform: scaleY(0.08); }
}
