/* Clawd Club — shared styles for all three pages.
   Layout: each section is an editor pane. The page sits on top; a code layer sits behind it
   and is shown only by the occasional glitch and the rarer claw tear (see effects.js). */

:root {
  color-scheme: dark;
  --color-bg: #120F0D;
  --color-surface: #1C1815;
  --color-text: #EDE6DF;
  --color-muted: #A69C92;
  --color-line: #3A322C;
  --color-accent: #D2A679;
  --color-on-accent: #120F0D;
  --color-glitch-a: #B5653F;
  --color-glitch-b: #D2A679;
  --color-code-bg: #060504;
  --color-code: #E0B878;
  --color-code-dim: #7A6D5E;
  --color-error: #E08A6A;

  --font-heading-code: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --font-heading-sharp: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 6px;
  --space: 1rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font: 400 1rem/1.65 var(--font-body);
  padding: 1.5rem max(16px, 4vw) 4rem;
  overflow-x: hidden;
}
.wrap { max-width: 64rem; margin: 0 auto; display: grid; gap: 1.5rem; }
.stack { display: grid; gap: 1.5rem; min-width: 0; }

a { color: var(--color-accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--color-accent); outline-offset: 2px;
}
.skip { position: absolute; left: -999rem; }
.skip:focus { left: 1rem; top: 1rem; z-index: 50; background: var(--color-accent); color: var(--color-on-accent); padding: .5rem .75rem; }

/* ---- Editor window ---- */
.window {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  min-width: 0;
}
.tabs {
  display: flex; flex-wrap: wrap;
  border-bottom: 1px solid var(--color-line);
  background: var(--color-bg);
  border-radius: var(--radius) var(--radius) 0 0;
  font: 400 .8125rem/1 var(--font-heading-code);
}
.tabs a, .tabs span {
  padding: .85rem 1rem;
  color: var(--color-muted);
  text-decoration: none;
  border-right: 1px solid var(--color-line);
}
.tabs a:hover { color: var(--color-text); }
.tabs [aria-current="page"], .tabs span { background: var(--color-surface); color: var(--color-text); }

.pane { display: grid; grid-template-columns: auto minmax(0, 1fr); }
.gutter {
  padding: 2.5rem .75rem; text-align: right; user-select: none;
  font: 400 .8125rem/2 var(--font-heading-code);
  color: var(--color-code-dim);
  border-right: 1px solid var(--color-line);
}
.body { padding: 2.5rem clamp(1rem, 4vw, 3rem) 3rem; min-width: 0; }
.window > .body { padding-block: 2rem 2.5rem; }

/* ---- Type ---- */
.eyebrow { font: 400 .8125rem/1.4 var(--font-heading-code); color: var(--color-muted); margin: 0 0 1rem; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font: 700 clamp(2rem, 6.5vw, 4rem)/1.08 var(--font-heading-code); letter-spacing: -.02em; }
h2 { font: 600 clamp(1.375rem, 3vw, 1.875rem)/1.2 var(--font-heading-sharp); margin-bottom: 1rem; }
p { margin: 0 0 1rem; max-width: 40rem; }
.lede { color: var(--color-muted); margin: 1.25rem 0 2rem; font-size: 1.0625rem; }
.muted { color: var(--color-muted); }
.family-note {
  border-left: 2px solid var(--color-accent);
  padding: .25rem 0 .25rem 1rem; margin: 1.5rem 0 0; max-width: 40rem;
  font-size: 1.0625rem;
}

.btn {
  display: inline-block; padding: .85rem 1.25rem; border: 0; cursor: pointer;
  background: var(--color-accent); color: var(--color-on-accent);
  font: 600 .9375rem/1 var(--font-heading-code);
  text-decoration: none; border-radius: var(--radius);
}
.btn:hover { background: var(--color-text); }

/* ---- Tiers ---- */
.tiers {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin: 1.5rem 0; border: 1px solid var(--color-line); border-radius: var(--radius); overflow: hidden;
}
.tier {
  padding: 1.5rem; display: grid; gap: .75rem; align-content: start; min-width: 0;
  border-right: 1px solid var(--color-line); border-bottom: 1px solid var(--color-line);
  margin: 0 -1px -1px 0;
}
.tier h3 { font: 400 .8125rem/1.4 var(--font-heading-code); color: var(--color-muted); }
.tier p { margin: 0; font-size: .9375rem; }
.price { font: 700 2rem/1.1 var(--font-heading-code) !important; font-variant-numeric: tabular-nums; }
.price small { font: 400 .8125rem/1 var(--font-heading-code); color: var(--color-muted); }
.price s { font-weight: 400; font-size: 1.125rem; color: var(--color-muted); margin-right: .5rem; }
.tier ul { margin: 0; padding-left: 1.1rem; display: grid; gap: .35rem; font-size: .9375rem; }

/* ---- Form ---- */
form { display: grid; gap: 1rem; max-width: 34rem; margin-top: 1.5rem; }
.field { display: grid; gap: .35rem; }
label, legend { font: 400 .8125rem/1.4 var(--font-heading-code); color: var(--color-muted); }
input[type="text"], input[type="email"], input[type="number"], select, textarea {
  width: 100%; padding: .7rem .8rem;
  background: var(--color-bg); color: var(--color-text);
  border: 1px solid var(--color-line); border-radius: var(--radius);
  font: 400 1rem/1.4 var(--font-body);
}
textarea { min-height: 6rem; resize: vertical; }
.check { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .6rem; align-items: start; }
.check input { margin-top: .3rem; width: 1.1rem; height: 1.1rem; accent-color: var(--color-accent); }
.check label { font: 400 .9375rem/1.5 var(--font-body); color: var(--color-text); }
.form-status { font: 400 .875rem/1.5 var(--font-heading-code); color: var(--color-accent); margin: 0; }
.form-status.error { color: var(--color-error); }

footer.site { font: 400 .8125rem/1.6 var(--font-heading-code); color: var(--color-muted); padding: 1rem 0 0; }

/* ---- Glitch (Glitchcore, text-effects.colorion.co; neon removed; runs once per trigger) ---- */
.fx-glitch { position: relative; display: inline-block; }
.fx-glitch::before, .fx-glitch::after {
  content: attr(data-text);
  position: absolute; inset: 0; opacity: 0; pointer-events: none;
}
.fx-glitch::before { color: var(--color-glitch-a); clip-path: inset(0 0 55% 0); }
.fx-glitch::after  { color: var(--color-glitch-b); clip-path: inset(45% 0 0 0); }
.is-glitching .fx-glitch::before { animation: fx-glitch-a .7s steps(1) 1; }
.is-glitching .fx-glitch::after  { animation: fx-glitch-b .7s steps(1) 1; }
@keyframes fx-glitch-a {
  0%, 100% { transform: translate(0); opacity: 0; }
  10% { transform: translate(-5px, -2px); opacity: .9; }
  30% { transform: translate(4px, 1px); opacity: .9; }
  50% { transform: translate(0); opacity: 0; }
  70% { transform: translate(-3px, 2px); opacity: .9; }
  85% { transform: translate(0); opacity: 0; }
}
@keyframes fx-glitch-b {
  0%, 100% { transform: translate(0); opacity: 0; }
  20% { transform: translate(5px, 2px); opacity: .9; }
  40% { transform: translate(-4px, -1px); opacity: .9; }
  55% { transform: translate(0); opacity: 0; }
  75% { transform: translate(3px, -2px); opacity: .9; }
  90% { transform: translate(0); opacity: 0; }
}

/* ---- Code layer behind the page (filled by effects.js) ---- */
.code-layer {
  position: fixed; inset: 0; z-index: 40; overflow: hidden; pointer-events: none;
  background: var(--color-code-bg); color: var(--color-code);
  font: 400 .8125rem/1.7 var(--font-heading-code);
  visibility: hidden;
}
.code-layer pre { margin: 0; padding: 1rem 1.25rem; white-space: pre; font: inherit; }
.code-layer .dim { color: var(--color-code-dim); }

/* Glitch: thin bands of code flash */
.is-glitching .code-layer { visibility: visible; animation: peek .7s steps(1) 1 both; }
@keyframes peek {
  0%, 100% { clip-path: inset(0 0 100% 0); }
  10% { clip-path: inset(34% 0 60% 0); }
  30% { clip-path: inset(63% 0 31% 0); }
  50% { clip-path: inset(0 0 100% 0); }
  70% { clip-path: inset(18% 0 78% 0); }
  85% { clip-path: inset(0 0 100% 0); }
}

/* Claw tear: drawn on a canvas by effects.js (three slashes with torn-paper edges) */
.tear-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 41; pointer-events: none; }

@media (max-width: 30rem) {
  .gutter { display: none; }
  .pane { grid-template-columns: minmax(0, 1fr); }
}

/* Reduced motion: no glitch, no tear, no smooth scroll */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fx-glitch::before, .fx-glitch::after, .code-layer, .code-layer pre { animation: none !important; }
  .code-layer { visibility: hidden !important; }
}
