:root {
  --paper:        #fbf9ef;
  --grid:         #9bc3de;       /* visible quad-rule blue */
  --grid-strong:  #4f8fbb;       /* heavier every-5th line */
  --ink:          #1a2236;
  --ink-soft:     #3a4360;
  --ink-faint:    #6c7591;
  --accent:       #b34735;

  --hand-display: "Caveat", "Bradley Hand", "Comic Sans MS", cursive;
  --hand-body:    "Patrick Hand", "Bradley Hand", system-ui, sans-serif;
  --sans:         "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #1f1d1a;
  color: var(--ink);
  font-family: var(--hand-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

body { padding: 32px 16px 64px; }

/* ── the notebook ──────────────────────────────── */
.notebook {
  max-width: 880px;
  margin: 0 auto;
  background: var(--paper);
  border-radius: 6px;
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.55),
    0 10px 24px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  position: relative;
}

/* ── COVER ─────────────────────────────────────── */

/* Real marble texture via SVG fractal noise.
   Dark base, white speckle noise on top via feTurbulence + contrast crank. */
.cover {
  position: relative;
}

.marble {
  height: 140px;
  background-color: #0d0d0d;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='600' height='400'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='7'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 0.94  0 0 0 28 -14'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.85'/></svg>");
  background-size: 600px 400px;
  background-repeat: repeat;
  position: relative;
}

.marble::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), transparent 30%),
    linear-gradient(180deg, transparent 75%, rgba(0,0,0,0.4));
  pointer-events: none;
}

.marble-bottom {
  height: 90px;
}

/* The white "COMPOSITION" sticker */
.label {
  position: relative;
  z-index: 2;
  width: min(420px, 78%);
  margin: -40px auto -28px;
  background: #fcfaf3;
  padding: 18px 22px 14px;
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px #1a1a1a;
  font-family: var(--sans);
}

.label-banner {
  text-align: center;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 0.28em;
  color: var(--ink);
  padding-bottom: 8px;
  border-bottom: 3px double #b5a376;
  margin-bottom: 12px;
}

.label-rows { display: flex; flex-direction: column; }

.label-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  border-bottom: 1px solid #cbb892;
  padding: 8px 2px 4px;
}

.label-key {
  flex-shrink: 0;
  width: 76px;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.label-val {
  font-family: var(--hand-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
}

.label-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

/* Black binding strip below cover */
.binding {
  height: 18px;
  background:
    linear-gradient(180deg, #1a1a1a 0%, #2b2b2b 30%, #1a1a1a 60%, #050505 100%);
  position: relative;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 -1px 0 rgba(0,0,0,0.5);
}

.binding::before {
  content: "";
  position: absolute;
  inset: 5px 0;
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent 14px,
    rgba(255,255,255,0.1) 14px,
    rgba(255,255,255,0.1) 16px
  );
}

/* ── PAGE ──────────────────────────────────────── */
.page {
  position: relative;
  background-color: var(--paper);
  /* Quad-rule grid: 24px squares, heavier line every 5th (120px) */
  background-image:
    linear-gradient(to right, var(--grid-strong) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-strong) 1px, transparent 1px),
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size:
    120px 120px,
    120px 120px,
    24px 24px,
    24px 24px;
  background-position: 0 0;
  padding: 64px 72px 80px 120px;
  font-family: var(--hand-body);
  font-size: 19px;
  line-height: 24px;
  color: var(--ink);
  min-height: 600px;
}

/* Red margin rule line */
.margin-rule {
  position: absolute;
  left: 96px;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 1px solid rgba(180, 60, 50, 0.7);
  pointer-events: none;
  z-index: 1;
}

/* ── content typography ────────────────────────── */
.block {
  margin-bottom: 36px;
  position: relative;
  z-index: 2;
}

.intro h1 {
  font-family: var(--hand-display);
  font-weight: 700;
  font-size: 64px;
  line-height: 0.95;
  margin: 0 0 4px;
  color: var(--ink);
  letter-spacing: -0.01em;
  transform: rotate(-0.5deg);
  transform-origin: left center;
}

.lede {
  font-family: var(--hand-body);
  font-size: 19px;
  line-height: 24px;
  color: var(--ink-soft);
  margin: 12px 0 0;
  max-width: 56ch;
}

h2 {
  font-family: var(--hand-display);
  font-weight: 700;
  font-size: 36px;
  line-height: 1;
  margin: 0 0 16px;
  color: var(--ink);
  display: inline-block;
  position: relative;
  padding: 0 4px 2px;
  transform: rotate(-0.3deg);
}

h2::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: -6px;
  height: 6px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 6' preserveAspectRatio='none'><path d='M0 3 Q 5 0 10 3 T 20 3 T 30 3 T 40 3 T 50 3 T 60 3 T 70 3 T 80 3 T 90 3 T 100 3' fill='none' stroke='%23b34735' stroke-width='1.6' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.job { margin-bottom: 28px; }

.job-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 4px;
}

h3 {
  font-family: var(--hand-display);
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
  margin: 0;
  color: var(--ink);
}

.job-dates {
  font-family: var(--hand-body);
  font-size: 18px;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

h4 {
  font-family: var(--hand-body);
  font-size: 20px;
  font-weight: 400;
  color: var(--ink);
  margin: 14px 0 4px;
  text-decoration: underline;
  text-decoration-color: rgba(26, 34, 54, 0.35);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

p, ul, li {
  font-family: var(--hand-body);
  font-size: 19px;
  line-height: 24px;
  color: var(--ink-soft);
}

ul {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
}

li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 6px;
}

li::before {
  content: "—";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 700;
}

strong {
  color: var(--ink);
  font-weight: 400;
  background: linear-gradient(180deg, transparent 78%, rgba(255, 220, 90, 0.45) 78%, rgba(255, 220, 90, 0.45) 96%, transparent 96%);
  padding: 0 2px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

ul.plain li { padding-left: 0; margin-bottom: 14px; line-height: 22px; }
ul.plain li::before { content: none; }
ul.plain li strong { background: none; padding: 0; }

.page-foot {
  text-align: center;
  margin-top: 48px;
  font-family: var(--hand-display);
  font-size: 22px;
  color: var(--ink-faint);
  letter-spacing: 0.1em;
  position: relative;
  z-index: 2;
}

/* ── responsive ────────────────────────────────── */
@media (max-width: 720px) {
  body { padding: 12px 8px 32px; }
  .page {
    padding: 40px 28px 56px 56px;
    font-size: 17px;
    line-height: 22px;
    background-size:
      100px 100px,
      100px 100px,
      20px 20px,
      20px 20px;
  }
  .margin-rule { left: 40px; }
  .intro h1 { font-size: 48px; }
  h2 { font-size: 30px; }
  h3 { font-size: 26px; }
  .job-head { flex-direction: column; align-items: flex-start; gap: 2px; }
  .two-col { grid-template-columns: 1fr; gap: 24px; }
  .label { width: min(360px, 92%); }
  .label-banner { font-size: 18px; }
  .label-val { font-size: 24px; }
}

/* ── print ─────────────────────────────────────── */
@media print {
  body { background: white; padding: 0; }
  .notebook { box-shadow: none; max-width: none; border-radius: 0; }
  .cover { display: none; }
  .page {
    background-color: white;
    background-image: none;
    padding: 32px 48px;
  }
  .margin-rule { display: none; }
  h2::after { opacity: 0.4; }
  .job, .block { page-break-inside: avoid; }
}
