/* Recursive Engineering — Wireframe styles
   Low-fi, sketchy vibe. B&W base + one accent. Handwritten-but-readable. */

@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;500;600;700&family=Kalam:wght@300;400;700&family=Architects+Daughter&family=JetBrains+Mono:wght@300;400;500;600&family=Inter:wght@300;400;500;600&family=Fraunces:opsz,wght@9..144,300;9..144,400;9..144,500;9..144,600&display=swap');

:root {
  --paper: #fafaf7;
  --ink: #15140f;
  --ink-soft: #4a4842;
  --ink-faint: #b8b5ac;
  --rule: #1a1814;
  --accent: oklch(0.55 0.14 35);
  --grid: #e8e6df;

  --font-hand: 'Kalam', 'Architects Daughter', cursive;
  --font-script: 'Caveat', cursive;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-serif: 'Fraunces', Georgia, serif;
}

* { box-sizing: border-box; }

.wf {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-hand);
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

/* Subtle paper grain via repeating gradient */
.wf::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(0,0,0,0.015) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(0,0,0,0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.wf > * { position: relative; z-index: 1; }

/* Hand-drawn-ish borders */
.sketch-box {
  border: 1.5px solid var(--rule);
  border-radius: 2px;
  position: relative;
}
.sketch-box.dashed { border-style: dashed; border-width: 1.2px; }

/* Wobbly underline */
.wobble {
  text-decoration: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 6'><path d='M0,3 Q25,0 50,3 T100,3' stroke='%2315140f' stroke-width='1.2' fill='none'/></svg>");
  background-repeat: repeat-x;
  background-position: 0 100%;
  background-size: 60px 4px;
  padding-bottom: 4px;
}

/* Image/3D placeholder */
.placeholder {
  background:
    repeating-linear-gradient(45deg, transparent 0 8px, rgba(0,0,0,0.05) 8px 9px);
  border: 1.2px dashed var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  text-align: center;
  padding: 12px;
  line-height: 1.4;
}

.placeholder .label {
  background: var(--paper);
  padding: 2px 6px;
  border: 1px solid var(--rule);
  border-radius: 2px;
}

/* SVG sketch arrow / annotation */
.annot {
  font-family: var(--font-script);
  color: var(--accent);
  font-size: 18px;
  position: absolute;
  pointer-events: none;
}

/* Hand-drawn rule */
.hr-sketch {
  height: 4px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 4'><path d='M0,2 Q50,0 100,2 T200,2' stroke='%2315140f' stroke-width='1' fill='none'/></svg>");
  background-repeat: repeat-x;
  background-size: 200px 4px;
  border: none;
}

/* Common wireframe meta corner */
.wf-meta {
  position: absolute;
  top: 14px;
  right: 18px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  z-index: 5;
}

.wf-num {
  position: absolute;
  top: 14px;
  left: 18px;
  font-family: var(--font-script);
  font-size: 26px;
  color: var(--accent);
  z-index: 5;
}

/* Dark variant */
.wf.dark {
  --paper: #14130f;
  --ink: #f0ede5;
  --ink-soft: #b8b5ac;
  --ink-faint: #5a5852;
  --rule: #d8d5cc;
  --grid: #2a2824;
}

/* Buttons / chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1.2px solid var(--rule);
  border-radius: 99px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: transparent;
}

.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

.cursor-blink {
  display: inline-block;
  width: 0.5em;
  height: 1em;
  background: currentColor;
  vertical-align: text-bottom;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Tiny rotating mark used as 'recursion' indicator */
.spin-slow { animation: spin 24s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
