/* ============================================================
   MeatPuppet — shared area shell
   Chrome + background aesthetic shared by the homepage and every
   area page. Page-specific content styles stay inline on the page.
   Usage: notes/area-shell.md
   ============================================================ */

/* ---------- BigBio / Claude-esque palette ---------- */
:root {
  --bg-dark: #191919;
  --bg-med: #262625;
  --slate-light: #40403E;
  --cloud-dark: #666663;
  --cloud-med: #91918D;
  --cloud-light: #BFBFBA;
  --ivory-dark: #E5E4DF;
  --ivory-med: #F0F0EB;
  --ivory-light: #FAFAF7;
  --book-cloth: #CC785C;
  --kraft: #D4A27F;
  --manilla: #EBDBBC;
  --focus: #61AAF2;

  --ink: var(--ivory-med);
  --dim: var(--cloud-med);
  --rule: rgba(64, 64, 62, 0.55);
  --accent: var(--book-cloth);
  --accent-soft: var(--kraft);

  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --serif: 'Instrument Serif', 'Times New Roman', serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg-dark);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* film grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 30;
  opacity: 0.04;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* shared focus ring — keyboard only */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

/* ---------- background layers (prompt rain + glow + theme wash) ---------- */
#rainCanvas {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 1;
  display: block;
}
.theme-wash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  transition: opacity 3s ease;
}
.glow {
  position: fixed;
  pointer-events: none;
  z-index: 2;
  width: 900px; height: 700px;
  background:
    radial-gradient(ellipse 60% 45% at 45% 50%, rgba(204, 120, 92, 0.05) 0%, transparent 100%),
    radial-gradient(ellipse 40% 55% at 55% 45%, rgba(180, 83, 9, 0.03) 0%, transparent 100%),
    radial-gradient(ellipse 70% 35% at 50% 55%, rgba(212, 162, 127, 0.02) 0%, transparent 100%);
  animation: glow-breathe 7s ease-in-out infinite;
  filter: blur(20px);
  transform: translate(-50%, -50%);
}
@keyframes glow-breathe {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* emoji vortex layer */
.vortex-layer {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
.emoji-particle {
  position: absolute;
  top: 0; left: 0;
  will-change: transform, opacity;
  pointer-events: none;
  user-select: none;
  line-height: 1;
  transition: opacity 0.8s ease;
}

/* founder character — anchored bottom center */
.founder {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  text-decoration: none;
  pointer-events: auto;
}
.founder img {
  width: 320px;
  height: 320px;
  display: block;
  animation: founder-float 5s ease-in-out infinite;
  filter:
    drop-shadow(0 0 30px rgba(204, 120, 92, 0.22))
    drop-shadow(0 0 80px rgba(204, 120, 92, 0.06));
  transition: filter 0.5s ease;
}
.founder:hover img {
  filter:
    drop-shadow(0 0 30px rgba(204, 120, 92, 0.45))
    drop-shadow(0 0 90px rgba(204, 120, 92, 0.12));
}
@keyframes founder-float {
  0%, 100% { transform: translateY(0px); }
  33% { transform: translateY(-5px); }
  66% { transform: translateY(3px); }
}

/* fade content into the founder zone */
.bottom-fade {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 320px;
  pointer-events: none;
  z-index: 8;
  background: linear-gradient(to bottom,
    rgba(25,25,25,0) 0%,
    rgba(25,25,25,0.55) 50%,
    rgba(25,25,25,0.92) 100%);
}

/* ---------- content column ---------- */
main {
  position: relative;
  z-index: 12;
  max-width: 720px;
  margin: 0 auto;
  padding: 36px 32px 80px;
}

/* header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 88px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
header .mark {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--ivory-light);
}
header .mark .steak { margin-right: 8px; }
header .status { color: var(--cloud-med); }
header .status .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  animation: pulse 2.4s ease-in-out infinite;
  box-shadow: 0 0 12px var(--accent);
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ---------- area header (area pages only) ----------
   Left: back-to-home. Right: per-area nav slot — leave the <nav>
   empty when an area has no sub-nav; it collapses cleanly. */
.area-header .back-home {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--ivory-light);
  text-decoration: none;
  transition: color 0.2s;
}
.area-header .back-home:hover { color: var(--accent); }
.area-header .back-home .chev {
  color: var(--accent);
  transition: transform 0.2s;
  display: inline-block;
}
.area-header .back-home:hover .chev { transform: translateX(-3px); }

.area-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}
.area-nav a {
  color: var(--cloud-med);
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 0.14em;
  transition: color 0.2s;
}
.area-nav a:hover,
.area-nav a[aria-current="page"] { color: var(--accent); }

/* area title — the area's own H1, below the area header */
.area-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 3.4vw + 0.5rem, 42px);
  line-height: 1.16;
  letter-spacing: -0.015em;
  color: var(--ivory-light);
  margin-bottom: 14px;
}
.area-intro {
  color: var(--cloud-med);
  max-width: 560px;
  margin-bottom: 64px;
  line-height: 1.7;
}

/* section labels */
.section-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cloud-med);
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}

section { margin-bottom: 72px; }

/* shared card surface */
.surface {
  background: rgba(25, 25, 25, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--rule);
}

/* responsive */
@media (max-width: 720px) {
  main { padding: 28px 22px 64px; }
  header { margin-bottom: 64px; }
  section { margin-bottom: 56px; }
  .area-intro { margin-bottom: 48px; }
  .founder img { width: 240px; height: 240px; }
  .bottom-fade { height: 240px; }
}

/* motion opt-out — kill the ambient loops for anyone who asked */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
