/* Beni — "Software should be beautiful" mural aesthetic */

:root {
  /* Paper */
  --paper: oklch(0.955 0.022 82);
  --paper-2: oklch(0.935 0.030 82);
  --paper-3: oklch(0.905 0.034 80);

  /* Ink */
  --ink: oklch(0.18 0.012 60);
  --ink-2: oklch(0.32 0.012 60);
  --ink-3: oklch(0.50 0.012 60);
  --ink-4: oklch(0.68 0.012 60);

  /* Accent — restrained */
  --accent: oklch(0.60 0.170 32);   /* terracotta */
  --accent-2: oklch(0.55 0.130 200);/* dusty teal */
  --accent-3: oklch(0.70 0.130 90); /* mustard */

  /* Signals (muted) */
  --ok: oklch(0.55 0.110 145);
  --warn: oklch(0.66 0.140 75);
  --danger: oklch(0.55 0.180 30);

  /* Type */
  --display: "DM Serif Display", "Caprasimo", Georgia, serif;
  --hand: "Caveat", "Reenie Beanie", cursive;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Newsreader", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  /* Radii — almost none */
  --r-xs: 2px;
  --r-sm: 4px;
  --r-md: 6px;

  --line-w: 1.5px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
}

body {
  /* Paper texture: subtle noise + tone */
  background-color: var(--paper);
  background-image:
    radial-gradient(2px 2px at 20% 30%, oklch(0.18 0.012 60 / 0.04), transparent 50%),
    radial-gradient(1.5px 1.5px at 80% 70%, oklch(0.18 0.012 60 / 0.03), transparent 50%),
    radial-gradient(1px 1px at 50% 50%, oklch(0.18 0.012 60 / 0.025), transparent 50%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='2' stitchTiles='stitch' seed='4'/><feColorMatrix values='0 0 0 0 0.10  0 0 0 0 0.07  0 0 0 0 0.04  0 0 0 0.09 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 100% 100%, 100% 100%, 100% 100%, 240px 240px;
  min-height: 100vh;
}

::selection { background: oklch(0.60 0.170 32 / 0.25); color: var(--ink); }

/* Typography */
.display {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 0.94;
}
.hand {
  font-family: var(--hand);
  font-weight: 400;
}
.serif { font-family: var(--serif); }
.mono { font-family: var(--mono); letter-spacing: 0.02em; }
.smallcaps {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 11px;
}

p { line-height: 1.55; }
a { color: inherit; }

/* Hand-drawn wobble filter (applied via SVG) defined inline in SVG */
.wobble { filter: url(#wobble); }

/* Ink button */
.ink-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 22px;
  background: var(--ink);
  color: var(--paper);
  border: var(--line-w) solid var(--ink);
  border-radius: 999px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s ease;
  box-shadow: 3px 3px 0 0 var(--ink);
  position: relative;
}
.ink-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 0 var(--ink); }
.ink-btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 0 var(--ink); }

.ink-btn.ghost {
  background: transparent;
  color: var(--ink);
}

.ink-btn.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
  box-shadow: 3px 3px 0 0 var(--ink);
}

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.wide { max-width: 1320px; margin: 0 auto; padding: 0 32px; }

/* Hand-drawn underline (uses SVG path overlay; this is the wrapper) */
.scribble-under {
  position: relative;
  display: inline-block;
}
.scribble-under > .ink-under {
  position: absolute;
  left: -4px; right: -4px; bottom: -10px;
  height: 14px;
  pointer-events: none;
}

/* Pinned note / sticker */
.tape {
  position: relative;
  background: var(--paper-2);
  border: var(--line-w) solid var(--ink);
  box-shadow: 4px 4px 0 0 var(--ink);
}

.tape::before {
  content: "";
  position: absolute;
  top: -10px; left: 24px;
  width: 48px; height: 18px;
  background: oklch(0.85 0.06 80 / 0.7);
  border: var(--line-w) solid oklch(0.45 0.04 60);
  transform: rotate(-4deg);
}

/* Rubber stamp chip */
.stamp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: var(--line-w) solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
}
.stamp.accent { color: var(--accent); border-color: var(--accent); }
.stamp.ok { color: var(--ok); border-color: var(--ok); }
.stamp.warn { color: var(--warn); border-color: var(--warn); }
.stamp.danger { color: var(--danger); border-color: var(--danger); }

/* Solid filled stamp */
.stamp-filled {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  transform: rotate(-1.5deg);
}

/* Card with hand-drawn border (uses SVG overlay) */
.paper-card {
  background: var(--paper);
  border: var(--line-w) solid var(--ink);
  position: relative;
}

.ink-card {
  background: var(--ink);
  color: var(--paper);
  border: var(--line-w) solid var(--ink);
  position: relative;
}

/* Inputs */
.ink-input {
  height: 40px;
  padding: 0 14px;
  border: var(--line-w) solid var(--ink);
  background: var(--paper);
  font: 16px var(--serif);
  color: var(--ink);
  border-radius: 0;
  outline: 0;
}

/* Decorative thick rule */
.thick-rule {
  height: 6px;
  background: var(--ink);
  width: 100%;
}

.thin-rule { height: 1.5px; background: var(--ink); }

/* Stamp like rotated chip */
.askew-1 { transform: rotate(-1deg); }
.askew-2 { transform: rotate(1.5deg); }
.askew-3 { transform: rotate(-2.2deg); }

/* Marquee */
@keyframes scroll-x { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Page fade */
.fade-in { animation: fadeIn .35s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Scribble draw */
@keyframes draw { from { stroke-dashoffset: 1000; } to { stroke-dashoffset: 0; } }
.draw-on path, .draw-on line, .draw-on polyline, .draw-on circle, .draw-on rect {
  stroke-dasharray: 1000;
  animation: draw 2.5s ease forwards;
}

/* Scrollbar */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: var(--ink-4); border: 3px solid var(--paper); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

/* Sticky paper backdrop for sections */
section { position: relative; }

/* Polaroid frame */
.polaroid {
  background: var(--paper);
  border: var(--line-w) solid var(--ink);
  padding: 14px 14px 56px;
  box-shadow: 6px 6px 0 0 var(--ink);
}

/* Specific layout helpers */
.poster-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}

/* Big number readout */
.readout {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 0.95;
}

/* Hand-drawn arrow utility class - applied to SVGs */
.ink-stroke { stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.ink-fill { fill: var(--ink); }

/* ── Responsive layout ───────────────────────────────────────────────── */

/* 2-column grid → stacks on mobile */
.rg-2 {
  display: grid;
  grid-template-columns: var(--rg-cols, 1fr 1fr);
  gap: var(--rg-gap, 60px);
  align-items: var(--rg-align, start);
}

/* 4-column grid → 2-col tablet → 1-col mobile */
.rg-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

/* Allow grid children to shrink below their content's intrinsic width
   (prevents long code lines / wide media from blowing out the layout). */
.rg-2 > *, .rg-4 > *, .rg-5 > * { min-width: 0; }

/* 5-column hero diagram → horizontally scrollable on mobile */
.rg-5 {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 24px;
  align-items: center;
}

/* Footer column grid → collapses on smaller screens */
.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 56px;
  max-width: 560px;
}

@media (max-width: 900px) {
  .wide { padding: 0 20px; }
  .rg-2 { grid-template-columns: 1fr; gap: 36px; }
  .rg-4 { grid-template-columns: repeat(2, 1fr); }
  .rg-hide-mobile { display: none !important; }
  .rg-sticky-off { position: static !important; }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; gap: 36px 28px; max-width: none; }
  .nav-hide-mobile { display: none !important; }
}

@media (max-width: 560px) {
  .wide { padding: 0 16px; }
  .rg-4 { grid-template-columns: 1fr; }
  .rg-5 { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .ink-btn { font-size: 15px; padding: 0 18px; height: 42px; }
  section { padding-top: 60px !important; padding-bottom: 60px !important; }
}
