/* ============================================================
   zacgibson.work — paper.css
   Jotter Down design system foundation (self-hosted, no CDN)
   Tokens · fonts · reset · paper surfaces · components
   ============================================================ */

/* ── FONTS ───────────────────────────────────────────────── */
@font-face { font-family: 'Caveat'; src: url('fonts/Caveat-Regular.woff2') format('woff2');  font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Caveat'; src: url('fonts/Caveat-Medium.woff2') format('woff2');   font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Caveat'; src: url('fonts/Caveat-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Caveat'; src: url('fonts/Caveat-Bold.woff2') format('woff2');     font-weight: 700; font-style: normal; font-display: swap; }

@font-face { font-family: 'Kalam'; src: url('fonts/Kalam-Light.woff2') format('woff2');   font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Kalam'; src: url('fonts/Kalam-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Kalam'; src: url('fonts/Kalam-Bold.woff2') format('woff2');    font-weight: 700; font-style: normal; font-display: swap; }

@font-face { font-family: 'Architects Daughter'; src: url('fonts/ArchitectsDaughter-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Shadows Into Light';   src: url('fonts/ShadowsIntoLight-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }

@font-face { font-family: 'Spectral'; src: url('fonts/Spectral-Regular.woff2') format('woff2');  font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Spectral'; src: url('fonts/Spectral-Italic.woff2') format('woff2');   font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Spectral'; src: url('fonts/Spectral-Medium.woff2') format('woff2');   font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Spectral'; src: url('fonts/Spectral-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }

@font-face { font-family: 'JetBrains Mono'; src: url('fonts/JetBrainsMono-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('fonts/JetBrainsMono-Medium.woff2') format('woff2');  font-weight: 500; font-style: normal; font-display: swap; }

/* Archivo — variable, all weights 100–900 */
@font-face { font-family: 'Archivo'; src: url('fonts/Archivo-Variable.woff2') format('woff2-variations'); font-weight: 100 900; font-style: normal; font-display: swap; }


/* ── TOKENS ──────────────────────────────────────────────── */
:root {
  /* Paper surfaces */
  --paper:        #f7f1e1;
  --paper-warm:   #efe7cf;
  --paper-deep:   #e6dcbf;
  --paper-edge:   #d3c79f;
  --paper-bg:     #e7ddc0;

  /* Ink scale */
  --ink:        #1a1410;
  --ink-soft:   #3d3127;
  --ink-faint:  #7a6c54;
  --ink-ghost:  #b7a987;

  /* Accent — the current pen. Swapped by [data-ink] on <html>. */
  --accent:      #1d4ed8;
  --accent-deep: #1740ab;
  --accent-soft: rgba(29,78,216,.15);

  /* Ruled paper marks */
  --rule-blue:    #b9c9e2;
  --margin-red:   #d8835a;
  --rule-spacing: 30px;

  /* Sticky tints */
  --sticky-yellow: #fff48e;
  --sticky-blue:   #cfe1f7;
  --sticky-pink:   #fbc8d4;
  --sticky-green:  #c9eccb;

  /* Status */
  --sys-live:   #5a8b4a;
  --sys-warn:   #c98a1a;
  --sys-danger: #b34a1a;

  /* Font stacks */
  --hand:   'Caveat', 'Kalam', cursive;
  --hand-2: 'Architects Daughter', 'Comic Sans MS', cursive;
  --pen:    'Kalam', cursive;
  --note:   'Shadows Into Light', cursive;
  --serif:  'Spectral', Georgia, serif;
  --mono:   'JetBrains Mono', ui-monospace, monospace;
  --stamp:  'Archivo', 'Inter', system-ui, sans-serif;

  /* Shadows — hard ink offset, the signature look */
  --shadow:        4px 4px 0 rgba(26,20,16,.92);
  --shadow-sm:     2px 2px 0 rgba(26,20,16,.85);
  --shadow-soft:   3px 4px 14px rgba(26,20,16,.16);
  --shadow-sticky: 1px 2px 0 rgba(0,0,0,.04), 5px 7px 16px rgba(26,20,16,.2);

  --radius: 6px;
  --maxw: 1120px;
  --gut: clamp(18px, 4.5vw, 56px);
  --cursor: none;
  --ease: cubic-bezier(.22,.61,.18,1);
}

/* Pen swatches — change the ink across the whole notebook */
[data-ink="blue"]     { --accent:#1d4ed8; --accent-deep:#1740ab; --accent-soft:rgba(29,78,216,.15); }
[data-ink="red"]      { --accent:#c0392b; --accent-deep:#9c2c20; --accent-soft:rgba(192,57,43,.13); }
[data-ink="green"]    { --accent:#3f7d3a; --accent-deep:#2f6230; --accent-soft:rgba(63,125,58,.13); }
[data-ink="graphite"] { --accent:#2a2a2a; --accent-deep:#161616; --accent-soft:rgba(40,40,40,.12); }

::selection { background: var(--sticky-yellow); color: var(--ink); }

/* ── RESET ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; padding: 0; }
h1,h2,h3,h4 { margin: 0; text-wrap: balance; }
p, li { text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: var(--cursor); }
img, svg, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }

/* ── PAPER SURFACES ──────────────────────────────────────── */
.paper-ruled {
  background-color: var(--paper);
  background-image:
    linear-gradient(to right, transparent 71px, color-mix(in oklab, var(--margin-red) 70%, transparent) 71px, color-mix(in oklab, var(--margin-red) 70%, transparent) 73px, transparent 73px),
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--rule-spacing) - 1px), var(--rule-blue) calc(var(--rule-spacing) - 1px) var(--rule-spacing));
}
.paper-grid {
  background-color: var(--paper);
  background-image:
    linear-gradient(to right, rgba(120,108,82,.13) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(120,108,82,.13) 1px, transparent 1px);
  background-size: 24px 24px;
}
.paper-blank { background: var(--paper); }

/* ── COMPONENTS ──────────────────────────────────────────── */

/* Sketch card — 2px ink border + hard offset shadow */
.box {
  position: relative;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.box-soft {
  position: relative;
  background: var(--paper);
  border: 1.5px solid var(--ink-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.box-dashed {
  position: relative;
  background: var(--paper);
  border: 1.6px dashed var(--ink-soft);
  border-radius: var(--radius);
}

/* Page-corner curl */
.curl::after {
  content: ""; position: absolute; bottom: -2px; right: -2px;
  width: 30px; height: 30px;
  background: linear-gradient(135deg, transparent 50%, var(--paper-warm) 50%, var(--paper-deep) 100%);
  border-top: 1.5px solid var(--ink); border-left: 1.5px solid var(--ink);
  border-radius: 0 0 var(--radius) 0;
  box-shadow: -2px -2px 5px rgba(0,0,0,.07);
  pointer-events: none;
}

/* Rubber-stamp label */
.stamp {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--stamp); font-weight: 700; font-size: 10.5px;
  letter-spacing: .15em; text-transform: uppercase; color: var(--ink);
  background: var(--paper-warm); border: 1.6px solid var(--ink);
  border-radius: 3px; padding: 4px 10px; transform: rotate(-1.4deg); white-space: nowrap;
}
.stamp.accent { color: #fff; background: var(--accent); border-color: var(--accent-deep); }
.stamp.live   { color: var(--sys-live); border-color: var(--sys-live); background: rgba(90,139,74,.08); }
.stamp.danger { color: var(--sys-danger); border-color: var(--sys-danger); background: rgba(179,74,26,.08); }

/* Tag chip */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--stamp); font-weight: 600; font-size: 10px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft);
  background: rgba(255,255,255,.4); border: 1px solid var(--ink-faint);
  border-radius: 9999px; padding: 3px 10px; white-space: nowrap;
}
.tag.accent { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

/* Sticky note */
.sticky {
  position: relative; display: inline-block;
  background: var(--sticky-yellow);
  font-family: var(--hand); font-weight: 500; font-size: 18px; line-height: 1.32;
  color: var(--ink); padding: 16px 18px 15px;
  box-shadow: var(--shadow-sticky);
}
.sticky.blue  { background: var(--sticky-blue); }
.sticky.pink  { background: var(--sticky-pink); }
.sticky.green { background: var(--sticky-green); }

/* Tape strip */
.tape {
  position: absolute; width: 64px; height: 19px;
  background: rgba(255,248,184,.5);
  border-left: 1px solid rgba(0,0,0,.04); border-right: 1px solid rgba(0,0,0,.04);
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

/* Button */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--hand-2); font-size: 15px;
  background: var(--paper); color: var(--ink);
  border: 2px solid var(--ink); border-radius: var(--radius);
  padding: 9px 18px; box-shadow: var(--shadow-sm);
  cursor: var(--cursor);
  transition: transform 120ms var(--ease), box-shadow 120ms var(--ease);
}
.btn:hover  { transform: translate(-1px,-1px); box-shadow: 3px 3px 0 var(--ink); }
.btn:active { transform: translate(1px,1px); box-shadow: 1px 1px 0 var(--ink); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent-deep); }

/* Status dot */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.live { background: var(--sys-live); }
.dot.accent { background: var(--accent); }

/* Hand-drawn underline (auto-sizes) */
.uline {
  display: inline; padding-bottom: 2px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 10'><path d='M2 6 Q 50 2 100 6 T 198 5' fill='none' stroke='%231a1410' stroke-width='2.5' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat; background-size: 100% 8px; background-position: 0 100%;
}

/* Highlighter swipe (accent) */
.hl {
  background-image: linear-gradient(var(--accent-soft), var(--accent-soft));
  background-repeat: no-repeat; background-position: 0 86%; background-size: 100% 44%;
  padding: 0 2px;
}

/* Squiggle divider */
.squiggle {
  height: 13px; border: none; margin: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 14'><path d='M0 7 Q 10 1 20 7 T 40 7 T 60 7 T 80 7' stroke='%231a1410' stroke-width='1.4' fill='none' stroke-linecap='round' opacity='.42'/></svg>");
  background-repeat: repeat-x; background-size: 80px 13px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ink-ghost); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }
