/* ── notebook.css — shared notebook-style system across all pages ──────
   Loaded after page-specific CSS so the notebook system is the lowest
   common denominator. Used by: index.html, about.html, contact.html,
   writing/*.html, and (lightly) case-study pages.

   Visual language: white paper, polaroid-style cards, slight rotation,
   Caveat handwriting for personality, Inter for substance, Lora for
   italics. No border-radius anywhere (square corners, deliberate).
   ──────────────────────────────────────────────────────────────────── */

:root {
  --nb-paper:      #ffffff;
  --nb-paper-2:    #F2EDDE;
  --nb-ink:        #2a2520;
  --nb-ink-soft:   #5c5650;
  --nb-rule:       #e6dfca;
  --nb-tape:       rgba(243, 213, 90, 0.55);    /* yellow tape */
  --nb-tape-2:     rgba(212, 110, 110, 0.35);   /* pink tape */
  --nb-pencil:     #4a6b3a;                      /* sage green pencil */
  --nb-highlight:  #f3d55a;                      /* yellow highlight under words */
  --nb-card:       #ffffff;
}

/* Border-radius reset is scoped to body.nb so case-study pages that
   only link this stylesheet for the nav don't lose their rounded cards. */
body.nb * { box-sizing: border-box; border-radius: 0 !important; }

body.nb {
  margin: 0;
  background: var(--nb-paper);
  color: var(--nb-ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* Prevent horizontal scroll caused by rotated photo polaroid or
     wide grid columns on narrow viewports. */
  overflow-x: hidden;
}
html { overflow-x: hidden; }

/* ── Top nav — sticky, full-width backdrop, content capped to 1180px ── */
nav.nb-nav {
  /* Sticky positioning so the nav stays pinned as the page scrolls. */
  position: sticky;
  top: 0;
  z-index: 100;
  /* Full-width white bar with backdrop blur. Content stays within
     1180px via the asymmetric-padding calc trick: extra side space
     becomes background, internal content stays centered. */
  max-width: none;
  width: 100%;
  margin: 0;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 14px max(32px, calc((100% - 1180px) / 2));
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(230, 223, 202, 0.5);
}
nav.nb-nav .logo {
  font-family: 'Caveat', cursive;
  font-weight: 700;
  font-size: 28px;
  color: var(--nb-ink);
  text-decoration: none;
  transform: rotate(-2deg);
  display: inline-block;
}
nav.nb-nav .nb-links {
  display: flex; gap: 8px;
}
nav.nb-nav .nb-links a {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--nb-ink);
  text-decoration: none;
  padding: 4px 14px 6px;
  border-bottom: 2px solid transparent;
  transition: border-color 200ms, color 200ms;
  letter-spacing: -0.005em;
}
nav.nb-nav .nb-links a:hover,
nav.nb-nav .nb-links a.active {
  border-color: var(--nb-highlight);
}
nav.nb-nav .menu { display: none; }
@media (max-width: 720px) {
  nav.nb-nav { padding: 12px 20px; }
  nav.nb-nav .nb-links a { font-size: 13px; padding: 4px 10px; }
}

/* ── Hero patterns (used on home + about) ──────────────────────────── */
.nb-hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 32px 60px;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 64px;
  align-items: center;
}
.nb-hero h1 {
  font-family: 'Inter', sans-serif;
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 8px 0 20px;
  max-width: 620px;
}
.nb-hero h1 .hi {
  background: linear-gradient(transparent 60%, var(--nb-highlight) 60%);
  padding: 0 4px;
}
.nb-greet {
  font-family: 'Caveat', cursive;
  font-size: clamp(40px, 5.5vw, 64px);
  line-height: 1;
  font-weight: 700;
  margin: 0 0 8px;
  transform: rotate(-1deg);
  display: inline-block;
  color: var(--nb-pencil);
}
.nb-sub {
  font-size: 17px;
  color: var(--nb-ink-soft);
  line-height: 1.6;
  max-width: 540px;
  margin: 0;
}
.nb-sub strong { color: var(--nb-ink); font-weight: 700; }

/* ── Portrait polaroid (the ONLY card with tape + rotation kept —
       per user request: 'tape sticker style only for the Portrait image
       with some rotation to make it look taped'.) ───────────────────── */
.nb-photo-wrap {
  position: relative;
  transform: rotate(2deg);
}
.nb-photo {
  background: #fff;
  padding: 14px 14px 50px;
  box-shadow: 0 12px 30px -8px rgba(0,0,0,0.18);
}
.nb-photo img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #e5e2d8;
  filter: grayscale(0.15) contrast(1.05);
  display: block;
}
.nb-photo-caption {
  text-align: center;
  margin-top: 12px;
  font-family: 'Caveat', cursive;
  font-size: 18px;
  color: var(--nb-ink-soft);
}
.nb-tape {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  width: 80px; height: 22px;
  background: var(--nb-tape);
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

/* ── Section title (Caveat heading + yellow underline + subtitle) ─── */
.nb-sec-title {
  max-width: 1180px;
  margin: 96px auto 32px;
  padding: 0 32px;
}
.nb-sec-title h2 {
  font-family: 'Caveat', cursive;
  font-weight: 700;
  font-size: 52px;
  margin: 0;
  color: var(--nb-ink);
  display: inline-block;
  transform: rotate(-1deg);
}
.nb-sec-title .underline {
  height: 3px;
  width: 180px;
  background: var(--nb-highlight);
  margin-top: -6px;
  transform: rotate(-1deg);
  transform-origin: left;
}
.nb-sec-title .nb-sec-sub {
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
  font-size: 16px;
  color: var(--nb-ink-soft);
  margin: 12px 0 0;
  line-height: 1.5;
  white-space: nowrap;
}
@media (max-width: 720px) {
  .nb-sec-title .nb-sec-sub { white-space: normal; max-width: 540px; }
  .nb-sec-title h2 { font-size: 40px; }
}

/* ── Currently building (Chiblu + DWB cards, 2-col) ─────────────────── */
.nb-currently {
  max-width: 1180px;
  margin: 48px auto 0;
  padding: 0 32px;
}
.nb-currently-label {
  font-family: 'Caveat', cursive;
  font-size: 26px;
  color: var(--nb-pencil);
  margin: 0 0 14px;
  transform: rotate(-1deg);
  display: inline-block;
}
.nb-currently-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.nb-cur-card {
  background: #fff;
  padding: 18px 20px;
  display: flex; align-items: center; gap: 16px;
  text-decoration: none; color: inherit;
  box-shadow: 0 6px 16px -8px rgba(0,0,0,0.12);
  transition: transform 220ms ease, box-shadow 220ms ease;
  border: 1px solid var(--nb-rule);
}
.nb-cur-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px -10px rgba(0,0,0,0.18);
}
.nb-cur-card img { width: 48px; height: 48px; object-fit: contain; flex-shrink: 0; }
.nb-cur-card .nb-cur-text { flex: 1; min-width: 0; }
.nb-cur-card .nb-cur-name { font-weight: 800; font-size: 18px; letter-spacing: -0.01em; margin: 0 0 2px; }
.nb-cur-card .nb-cur-tag { font-size: 13px; color: var(--nb-ink-soft); line-height: 1.4; margin: 0; }
.nb-cur-card .nb-cur-arrow { font-family: 'Caveat', cursive; font-size: 24px; color: var(--nb-ink-soft); }

/* ── Stats strip (Inter 800, elegant, pencil-green) ─────────────────── */
.nb-stats {
  max-width: 1180px;
  margin: 80px auto 0;
  padding: 32px;
  border-top: 2px dashed var(--nb-rule);
  border-bottom: 2px dashed var(--nb-rule);
  display: flex; flex-wrap: wrap;
  gap: 32px;
  justify-content: space-around;
  align-items: baseline;
}
.nb-stat { text-align: center; }
.nb-stat-num {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 32px;
  color: var(--nb-pencil);
  line-height: 1;
  letter-spacing: -0.03em;
  display: block;
}
.nb-stat-label {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: var(--nb-ink-soft);
  margin-top: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
}
@media (max-width: 720px) {
  .nb-stats { gap: 20px; padding: 24px 16px; }
  .nb-stat-num { font-size: 26px; }
}

/* ── Polaroid build cards (rotated, with tape) ──────────────────────── */
.nb-builds {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px 24px;
}
.nb-build {
  background: #fff;
  padding: 14px 14px 22px;
  box-shadow: 0 10px 24px -8px rgba(0,0,0,0.15);
  text-decoration: none; color: inherit;
  transition: transform 240ms ease, box-shadow 240ms ease;
  display: block;
  position: relative;
}
.nb-build:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -12px rgba(0,0,0,0.22);
  z-index: 2;
}
.nb-build-cover {
  aspect-ratio: 16/10;
  background: var(--nb-paper-2);
  overflow: hidden;
  display: block;
}
.nb-build-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nb-build-meta { padding-top: 14px; }
.nb-build-title {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 0;
}
.nb-build-desc { font-family: 'Inter', sans-serif; font-size: 13px; color: var(--nb-ink-soft); margin: 6px 0 0; line-height: 1.45; }
@media (max-width: 820px) { .nb-builds { grid-template-columns: 1fr; } }

/* ── Recently writing — 1-col cover-tile + title rows ──────────────── */
.nb-writing-list {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex; flex-direction: column;
  gap: 18px;
}
.nb-w-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 24px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  transition: transform 220ms ease;
}
.nb-w-row:hover { transform: translateX(6px); }
.nb-w-row:hover .nb-w-arrow { color: var(--nb-pencil); }
.nb-w-tile {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  position: relative;
}
.nb-w-tile-shape { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.nb-w-tile-shape path { fill: currentColor; opacity: 0.18; }
.nb-w-tile-kw {
  position: relative; z-index: 1;
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: 26px;
  letter-spacing: -0.03em;
  line-height: 1;
  text-align: center;
}
.nb-w-tile-kw small {
  display: block;
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0;
  opacity: 0.55;
  margin-top: 4px;
}
.nb-card-navy  { background: #4F5C72; color: #E8E1CF; }
.nb-card-sage  { background: #B7D4D2; color: #1E2532; }
.nb-card-brown { background: #4A3B2E; color: #FFFFFF; }
.nb-card-plum  { background: #D2B8DB; color: #2A1F33; }
.nb-w-body { display: flex; flex-direction: column; gap: 6px; }
.nb-w-eyebrow { font-family: 'Lora', Georgia, serif; font-style: italic; font-size: 13px; color: var(--nb-ink-soft); }
.nb-w-title { font-size: 19px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.3; color: var(--nb-ink); }
.nb-w-arrow { font-size: 18px; color: var(--nb-ink-soft); transition: color 200ms; }
.nb-writing-link {
  max-width: 1180px;
  margin: 28px auto 0;
  padding: 0 32px;
}
.nb-writing-link a {
  font-family: 'Caveat', cursive;
  font-size: 22px;
  color: var(--nb-pencil);
  text-decoration: none;
  transform: rotate(-1deg);
  display: inline-block;
}
@media (max-width: 720px) {
  .nb-w-row { grid-template-columns: 96px 1fr auto; gap: 16px; }
  .nb-w-title { font-size: 17px; }
}

/* ── Earlier work polaroid thumbs ──────────────────────────────────── */
.nb-earlier {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.nb-e-card {
  background: #fff;
  padding: 12px 12px 16px;
  box-shadow: 0 8px 20px -8px rgba(0,0,0,0.14);
  text-decoration: none; color: inherit;
  transition: transform 220ms ease;
  display: block;
}
.nb-e-card:hover { transform: translateY(-3px); }
.nb-e-thumb {
  aspect-ratio: 4/3;
  background: var(--nb-paper-2);
  overflow: hidden;
}
.nb-e-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nb-e-meta { text-align: center; margin-top: 10px; }
.nb-e-title { font-family: 'Inter', sans-serif; font-size: 15px; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.nb-e-sub {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--nb-ink-soft);
  margin: 4px 0 0;
  letter-spacing: 0.02em;
}
@media (max-width: 820px) { .nb-earlier { grid-template-columns: 1fr; } }

/* ── Contact / "let's make something" ──────────────────────────────── */
.nb-contact {
  max-width: 1180px;
  margin: 96px auto 0;
  padding: 64px 32px;
  text-align: center;
}
.nb-contact h2 {
  font-family: 'Caveat', cursive;
  font-weight: 700;
  font-size: clamp(44px, 5.5vw, 68px);
  margin: 0;
  transform: rotate(-1deg);
  display: inline-block;
}
.nb-contact p {
  font-size: 17px;
  color: var(--nb-ink-soft);
  max-width: 560px;
  margin: 16px auto 32px;
  line-height: 1.55;
}
.nb-btn {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--nb-ink);
  text-decoration: none;
  background: var(--nb-highlight);
  padding: 14px 22px;
  margin: 0 8px;
  display: inline-block;
  box-shadow: 0 6px 12px -4px rgba(0,0,0,0.15);
  transition: transform 200ms;
  border: 0;
  cursor: pointer;
}
.nb-btn:hover { transform: translateY(-2px) rotate(-1deg); }
.nb-btn.secondary {
  background: #fff;
  border: 1.5px solid var(--nb-rule);
}

/* ── Footer ─────────────────────────────────────────────────────────── */
footer.nb {
  text-align: center;
  padding: 32px;
  font-family: 'Caveat', cursive;
  font-size: 18px;
  color: var(--nb-ink-soft);
}

/* ────────────────────────────────────────────────────────────────────
   MOBILE RESPONSIVE FIXES — single block at the end so it always wins
   over the desktop-sized grids defined above. Stack everything to one
   column under 720px and shrink horizontal padding from 32px to 20px.
   ──────────────────────────────────────────────────────────────────── */
@media (max-width: 720px) {

  /* Hero - stack vertically, photo below content, capped width */
  .nb-hero {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 24px 20px 40px;
  }
  .nb-hero h1 { font-size: clamp(28px, 8vw, 36px); }
  .nb-sub { font-size: 16px; max-width: 100%; }
  .nb-photo-wrap {
    max-width: 280px;
    margin: 0 auto;
  }

  /* Currently building cards stack vertically */
  .nb-currently { padding: 0 20px; }
  .nb-currently-row { grid-template-columns: 1fr; gap: 14px; }
  .nb-cur-card { padding: 14px 16px; }
  .nb-cur-card .nb-cur-name { font-size: 16px; }
  .nb-cur-card .nb-cur-tag { font-size: 12px; }
  .nb-currently-label { font-size: 22px; }

  /* Stats - tighter padding, 2 per row */
  .nb-stats {
    padding: 24px 20px;
    gap: 16px 24px;
  }
  .nb-stat { flex: 0 1 calc(50% - 12px); }

  /* Section titles + sub */
  .nb-sec-title {
    padding: 0 20px;
    margin: 64px auto 24px;
  }
  .nb-sec-title h2 { font-size: 38px; }
  .nb-sec-title .nb-sec-sub { white-space: normal; font-size: 14px; }

  /* Build polaroid grid -> 1 col, tighter padding */
  .nb-builds { padding: 0 20px; gap: 24px; }

  /* Recently writing tiles - already responsive but tighten padding */
  .nb-writing-list { padding: 0 20px; }
  .nb-writing-link { padding: 0 20px; }
  .nb-w-row { grid-template-columns: 88px 1fr auto; gap: 14px; }
  .nb-w-tile-kw { font-size: 20px; }
  .nb-w-title { font-size: 16px; }

  /* Earlier work + contact */
  .nb-earlier { padding: 0 20px; }
  .nb-contact { padding: 48px 20px; }
  .nb-contact h2 { font-size: 40px; }
  .nb-btn { font-size: 14px; padding: 12px 18px; }

  /* Footer */
  footer.nb { padding: 24px 16px; font-size: 16px; }
}
