/* ============================================
   Isaacacious — skin: marker
   Hand-annotated notebook: bright white page,
   faint blue ruled lines, highlighter swashes,
   dashed navy borders, rotated mono stickers.
   ============================================ */

/* ---------- light (default) ---------- */

html[data-theme="marker"] {
  --serif: "Sentient", Georgia, serif;
  --sans: "Inter", -apple-system, sans-serif;
  --mono: "Geist Mono", Menlo, monospace;

  --paper: #FFFFFF;
  --card: #FAF9F5;
  --ink: #14212E;
  --navy: #002E58;
  --blue: #007CFF;
  --faint: #5B6B7B;
  --hl: rgba(125, 196, 255, 0.55);
  --rule: rgba(0, 124, 255, 0.045);
  --dash: rgba(0, 46, 88, 0.4);
  --dash-soft: rgba(0, 46, 88, 0.18);
  --wavy: #007CFF;

  --sticker-blue: #007CFF;
  --sticker-blue-text: #FFFFFF;
  --sticker-amber: #FFC53D;
  --sticker-amber-text: #002E58;
  --sticker-border: #002E58;

  --selection-bg: rgba(125, 196, 255, 0.55);
  --selection-text: #002E58;

  /* deep paper tone showing through the 60% vellum page */
  --paper-base: #D9D3C4;

  background-color: var(--paper-base);
}

html[data-theme="marker"] body {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
}

/* fixed notebook page: 60%-opacity paper + ruled lines, never scrolls with content */
html[data-theme="marker"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--paper); /* fallback: opaque paper without color-mix */
  background-color: color-mix(in srgb, var(--paper) 60%, transparent);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 31px,
    color-mix(in srgb, var(--rule) 60%, transparent) 31px,
    color-mix(in srgb, var(--rule) 60%, transparent) 32px
  );
}

html[data-theme="marker"] ::selection {
  background: var(--selection-bg);
  color: var(--selection-text);
}

/* ---------- shared page measure ---------- */

html[data-theme="marker"] .site-nav,
html[data-theme="marker"] main,
html[data-theme="marker"] .site-footer {
  max-width: 840px;
  margin: 0 auto;
  padding-left: clamp(20px, 5vw, 48px);
  padding-right: clamp(20px, 5vw, 48px);
}

/* ---------- nav ---------- */

html[data-theme="marker"] .site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding-top: 26px;
  padding-bottom: 22px;
  border-bottom: 1.5px dashed var(--dash);
}

html[data-theme="marker"] .wordmark {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 15px;
  color: var(--navy);
  letter-spacing: -0.01em;
}

html[data-theme="marker"] .wordmark sup {
  color: var(--blue);
  font-size: 9px;
}

html[data-theme="marker"] .site-nav nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px clamp(14px, 3vw, 30px);
}

html[data-theme="marker"] .site-nav nav a {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--faint);
  letter-spacing: 0.02em;
  padding-bottom: 3px;
}

html[data-theme="marker"] .site-nav nav a:hover {
  color: var(--navy);
  text-decoration: underline wavy var(--wavy);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 5px;
}

/* ---------- main: single column, full-width stacked cards ---------- */

html[data-theme="marker"] main {
  padding-bottom: clamp(48px, 7vw, 80px);
}

html[data-theme="marker"] .hero,
html[data-theme="marker"] .manifesto,
html[data-theme="marker"] .index-section {
  margin-bottom: clamp(36px, 5vw, 56px);
}

/* ---------- hero ---------- */

html[data-theme="marker"] .hero {
  padding-top: clamp(56px, 9vw, 110px);
}

html[data-theme="marker"] .hero-meta {
  font-family: var(--mono);
  font-size: clamp(11.5px, 1.4vw, 13px);
  color: var(--faint);
  letter-spacing: 0.02em;
  margin-bottom: clamp(24px, 4vw, 44px);
}

html[data-theme="marker"] .status-dot {
  background: var(--blue);
  margin-right: 8px;
}

/* the giant word, on a ragged highlighter swash */
html[data-theme="marker"] .the-word {
  position: relative;
  display: inline-block;
  z-index: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 700;
  font-size: clamp(2.4rem, 9.6vw, 8rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--navy);
  white-space: nowrap;
}

html[data-theme="marker"] .the-word::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -0.08em;
  right: -0.06em;
  top: 0.22em;
  bottom: -0.02em;
  background: var(--hl);
  transform: rotate(-1.2deg) skewX(-5deg);
  /* ragged hand-drawn edges */
  clip-path: polygon(0% 12%, 3% 4%, 96% 0%, 100% 18%, 99% 82%, 97% 100%, 4% 96%, 0% 84%);
}

/* ---------- stickers (CSS-only, three total) ---------- */

html[data-theme="marker"] .the-word::after,
html[data-theme="marker"] .dict-entry::after,
html[data-theme="marker"] #experiments .section-head::after {
  position: absolute;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 12px 6px;
  border: 1.5px solid var(--sticker-border);
  box-shadow: 2px 2px 0 var(--sticker-border);
  white-space: nowrap;
  user-select: none;
}

/* blue "NEW" on the giant word */
html[data-theme="marker"] .the-word::after {
  content: "new";
  top: -14px;
  right: -6px;
  background: var(--sticker-blue);
  color: var(--sticker-blue-text);
  transform: rotate(2deg);
}

/* amber "100% Isaac" on the dictionary entry */
html[data-theme="marker"] .dict-entry::after {
  content: "100% Isaac";
  top: -14px;
  right: clamp(10px, 6vw, 48px);
  background: var(--sticker-amber);
  color: var(--sticker-amber-text);
  transform: rotate(-2.5deg);
}

/* blue "WIP" on the experiments section head */
html[data-theme="marker"] #experiments .section-head::after {
  content: "wip";
  top: -13px;
  right: 0;
  background: var(--sticker-blue);
  color: var(--sticker-blue-text);
  transform: rotate(2deg);
}

/* ---------- dictionary entry ---------- */

html[data-theme="marker"] .dict-entry {
  position: relative;
  max-width: 640px;
  margin-top: clamp(36px, 6vw, 64px);
  padding: clamp(20px, 3.5vw, 30px) clamp(20px, 3.5vw, 32px);
  border: 1.5px dashed var(--dash);
  background: var(--card);
}

html[data-theme="marker"] .phonetic {
  font-family: var(--mono);
  font-size: clamp(11.5px, 1.5vw, 13px);
  color: var(--faint);
  margin-bottom: 14px;
}

html[data-theme="marker"] .phonetic em {
  color: var(--blue);
}

html[data-theme="marker"] .definitions {
  list-style: none;
  counter-reset: def;
}

html[data-theme="marker"] .definitions li {
  counter-increment: def;
  position: relative;
  padding-left: 34px;
  font-family: var(--serif);
  font-size: clamp(15px, 1.9vw, 18px);
  color: var(--ink);
  margin: 10px 0;
}

html[data-theme="marker"] .definitions li::before {
  content: counter(def) ".";
  position: absolute;
  left: 0;
  top: 5px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--blue);
}

html[data-theme="marker"] .caret {
  background: var(--blue);
}

/* ---------- manifesto band ---------- */

html[data-theme="marker"] .manifesto {
  border-top: 1.5px dashed var(--dash);
  border-bottom: 1.5px dashed var(--dash);
  padding-top: clamp(44px, 7vw, 72px);
  padding-bottom: clamp(44px, 7vw, 72px);
}

html[data-theme="marker"] .band-kicker {
  font-family: var(--mono);
  font-size: clamp(11px, 1.4vw, 12.5px);
  color: var(--faint);
  letter-spacing: 0.04em;
  margin-bottom: 18px;
}

html[data-theme="marker"] .band-line {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(24px, 4.2vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--navy);
  max-width: 20ch;
}

/* ---------- index sections ---------- */

html[data-theme="marker"] .index-section {
  position: relative;
  border: 1.5px dashed var(--dash);
  background: var(--paper);
  padding: clamp(24px, 3vw, 32px);
}

/* kept minimal: ±0.4deg max, nothing more */
html[data-theme="marker"] .index-section:nth-of-type(odd) { transform: rotate(-0.4deg); }
html[data-theme="marker"] .index-section:nth-of-type(even) { transform: rotate(0.4deg); }

html[data-theme="marker"] .section-head {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin-bottom: clamp(16px, 2.5vw, 22px);
}

html[data-theme="marker"] .section-no {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--blue);
}

/* highlighter behind each section h2 — the only section decoration */
html[data-theme="marker"] .section-head h2 {
  position: relative;
  z-index: 0;
  display: inline-block;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.45rem, 1.05rem + 1.3vw, 1.8rem);
  letter-spacing: -0.01em;
  color: var(--navy);
}

html[data-theme="marker"] .section-head h2::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -0.08em;
  right: -0.06em;
  top: 0.18em;
  bottom: 0.02em;
  background: var(--hl);
  transform: rotate(-0.8deg) skewX(-4deg);
  clip-path: polygon(0% 12%, 3% 4%, 96% 0%, 100% 18%, 99% 82%, 97% 100%, 4% 96%, 0% 84%);
}

html[data-theme="marker"] .section-note {
  flex-basis: 100%;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}

/* entry rows — generous padding, scannable titles */
html[data-theme="marker"] .entry-list a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 15px 0;
  border-top: 1px dashed var(--dash-soft);
}

html[data-theme="marker"] .entry-id {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--blue);
  flex-shrink: 0;
  width: 34px;
}

html[data-theme="marker"] .entry-title {
  flex: 1;
  font-size: 1.05rem;
  line-height: 1.35;
  color: var(--ink);
}

html[data-theme="marker"] .entry-list a:hover .entry-title {
  text-decoration: underline wavy var(--wavy);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}

html[data-theme="marker"] .entry-date,
html[data-theme="marker"] .entry-tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  flex-shrink: 0;
}

/* ---------- footer ---------- */

html[data-theme="marker"] .site-footer {
  border-top: 1.5px dashed var(--dash);
  padding-top: 30px;
  padding-bottom: 44px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
}

html[data-theme="marker"] .site-footer p {
  font-size: 13.5px;
  color: var(--ink);
}

html[data-theme="marker"] .site-footer p em {
  font-family: var(--serif);
  color: var(--navy);
}

html[data-theme="marker"] .site-footer .colophon {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}

html[data-theme="marker"] #theme-controls {
  color: var(--faint);
  flex-basis: 100%;
}

html[data-theme="marker"] #theme-controls .tc-current {
  color: var(--blue);
}

/* ---------- responsive ---------- */

@media (max-width: 560px) {
  html[data-theme="marker"] .the-word::after {
    top: auto;
    bottom: -16px;
    right: 8px;
  }
  html[data-theme="marker"] .entry-list a {
    flex-wrap: wrap;
    row-gap: 4px;
  }
}

/* ============================================
   dark mode — warm paper, not pure black
   ============================================ */

html[data-theme="marker"][data-mode="dark"] {
  --paper: #1C1B19;
  --card: #232220;
  --ink: #EDEAE3;
  --navy: #EDEAE3;
  --blue: #6FB2FF;
  --faint: #A8A49B;
  --hl: rgba(0, 124, 255, 0.35);
  --rule: rgba(237, 234, 227, 0.045);
  --dash: #4A463F;
  --dash-soft: rgba(74, 70, 63, 0.55);
  --wavy: #6FB2FF;

  /* stickers keep blue/amber, slightly muted */
  --sticker-blue: #2F66C4;
  --sticker-blue-text: #EDEAE3;
  --sticker-amber: #D9A93E;
  --sticker-amber-text: #1C1B19;
  --sticker-border: #4A463F;

  --selection-bg: rgba(0, 124, 255, 0.35);
  --selection-text: #EDEAE3;

  --paper-base: #111010;
}
