/* ============================================================
   Juwan Dippenaar — personal site prototype, rev 02
   Soft paper-white world · pen-ink type · arcing blueprints
   with polaroid field-photos riding along
   ============================================================ */

@font-face {
  font-family: "Caveat";
  src: url("fonts/caveat.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Architects Daughter";
  src: url("fonts/architects-daughter.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Homemade Apple";
  src: url("fonts/Homemade_Apple/HomemadeApple-Regular.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "Nothing You Could Do";
  src: url("fonts/Nothing_You_Could_Do/NothingYouCouldDo-Regular.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "Rock Salt";
  src: url("fonts/Rock_Salt/RockSalt-Regular.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "Reenie Beanie";
  src: url("fonts/Reenie_Beanie/ReenieBeanie-Regular.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "Cedarville Cursive";
  src: url("fonts/Cedarville_Cursive/CedarvilleCursive-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #faf8f2;            /* white first, a whisper of beige */
  --bg-deep: #f0ece1;
  --ink: #2b3147;           /* blue-black pen ink */
  --ink-soft: #5c6178;
  --accent: #3b6fd4;        /* fountain-pen blue */
  --paper: #f6f2e9;         /* sheet matches the page — flush */
  --paper-back: #ede6d5;
  --hand: "Caveat", cursive;
  --scrawl: "Architects Daughter", "Segoe Print", cursive;
  --signature: "Homemade Apple", cursive;   /* slow, inky, personal */
  --script: "Nothing You Could Do", cursive; /* confident heading hand */
  --marker: "Rock Salt", cursive;            /* scratchy marker caps */
  --pen-thin: "Reenie Beanie", cursive;      /* quick ballpoint notes */
  --cursive-lite: "Cedarville Cursive", cursive;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scrollbar-width: thin; scrollbar-color: rgba(59,111,212,.35) transparent; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  font-family: var(--scrawl);
  color: var(--ink);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255,255,252,.85), transparent 60%),
    var(--bg);
  overflow-x: hidden;
}

/* faint paper grain over the whole page */
.page-grain {
  position: fixed; inset: 0; z-index: 40;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='260' height='260' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  opacity: .12;
}

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex; align-items: center; gap: 2.4rem;
  padding: .95rem 2.2rem;
  background: linear-gradient(180deg, rgba(246,242,233,.92), rgba(246,242,233,.72));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1.5px dashed rgba(43,49,71,.22);
}
.nav-logo { display: flex; align-items: center; gap: .85rem; text-decoration: none; color: var(--ink); }
.logo-mark {
  font-family: var(--hand); font-weight: 700; font-size: 1.15rem;
  color: #fdfcf8; background: var(--accent);
  padding: .18rem .55rem .28rem;
  border-radius: 6px 12px 7px 10px / 10px 7px 12px 6px;
  transform: rotate(-2deg);
  box-shadow: 1.5px 2px 0 rgba(43,49,71,.35);
}
.logo-word { font-family: var(--scrawl); font-size: .98rem; letter-spacing: .03em; }
.nav-links { display: flex; gap: 2rem; margin-left: auto; }
.nav-links a {
  font-family: var(--scrawl);
  color: var(--ink-soft); text-decoration: none; font-size: 1rem;
  transition: color .2s ease;
}
.nav-links a:hover { color: var(--accent); }
.nav-cta {
  font-family: var(--hand); font-weight: 600; font-size: 1.12rem;
  color: var(--accent); text-decoration: none;
  border: 1.5px solid var(--accent);
  border-radius: 8px 14px 9px 13px / 13px 9px 14px 8px;
  padding: .28rem .85rem .38rem;
  transform: rotate(-1deg);
  transition: background .2s ease, color .2s ease;
}
.nav-cta:hover { background: var(--accent); color: #fdfcf8; }

/* ---------- hero ---------- */
.hero {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  position: relative;
  padding: 0 6vw;
  overflow: hidden;
}
/* faded Hubble blueprint drifting behind the hero */
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background: url("assets/hubble.png") center 42% / 150% auto no-repeat;
  mix-blend-mode: multiply;
  opacity: .16;
  -webkit-mask-image: radial-gradient(85% 70% at 50% 45%, #000 35%, transparent 78%);
  mask-image: radial-gradient(85% 70% at 50% 45%, #000 35%, transparent 78%);
  pointer-events: none;
}
.hero-inner { position: relative; }
.hero-kicker {
  font-family: var(--marker); font-size: .72rem; letter-spacing: .22em;
  color: var(--accent); margin-bottom: 1.4rem;
  transform: rotate(-1.2deg);
}
.hero-title {
  font-family: var(--script);
  font-size: clamp(2.4rem, 5.2vw, 4.4rem);
  line-height: 1.18; letter-spacing: .01em;
  color: var(--ink);
  transform: rotate(-1.5deg);
}
.hero-sub {
  margin-top: .3rem;
  font-family: var(--script);
  font-size: clamp(2.4rem, 5.2vw, 4.4rem);
  line-height: 1.18; letter-spacing: .01em;
  color: var(--accent);
  transform: rotate(-1deg);
}
.scroll-cue {
  position: absolute; bottom: 3.2rem; left: 50%; transform: translateX(-50%) rotate(-2deg);
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  font-family: var(--pen-thin); font-size: 1.35rem;
  color: var(--ink-soft);
}
.cue-line {
  width: 2px; height: 48px; border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), transparent);
  animation: cue 2.2s ease-in-out infinite;
  transform-origin: top;
}
@keyframes cue {
  0% { transform: scaleY(0); opacity: 0; }
  35% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1) translateY(16px); opacity: 0; }
}

/* ---------- blueprint sections ---------- */
.bp-section { position: relative; height: 200vh; }
.bp-stage {
  position: sticky; top: 0;
  height: 100vh;
  display: flex; align-items: center;
  z-index: 2;   /* papers ride above the blueprint flight deck (z 1) */
}

/* one fixed layer carries every drawing so flights overlap
   across section boundaries — a continuous conveyor of ink */
.flight-deck {
  position: fixed; inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* the floating drawing — flies the semicircle route */
.art-wrap {
  position: absolute; top: 50%;
  will-change: transform;
}
.art-wrap.side-left  { left: 1vw; }
.art-wrap.side-right { right: 1vw; }
/* reduced-motion fallback keeps art inside its own section */
.bp-section .art-wrap { z-index: 1; }

/* blueprint as faded ink soaked into the page */
.bp-ink {
  position: absolute; inset: 0;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  opacity: .58;
  -webkit-mask-image: radial-gradient(95% 95% at 50% 50%, #000 55%, transparent 98%);
  mask-image: radial-gradient(95% 95% at 50% 50%, #000 55%, transparent 98%);
}

/* scrawled title block */
.bp-titleblock {
  position: absolute; right: 3.2%; bottom: 3.4%; z-index: 6;
  font-family: var(--pen-thin);
  color: rgba(43,49,71,.85);
  padding: 1em 1.6em 1.1em;
  font-size: clamp(.78rem, 1.2vw, 1.02rem);
  letter-spacing: .02em;
  background: url("assets/title-strip.png") center / 100% 100% no-repeat;
  filter: drop-shadow(0 1px 1.5px rgba(60,48,26,.16));
  transform: rotate(-1.6deg);
  pointer-events: none;
  text-align: center;
}
.bp-titleblock .tb-no { display: block; font-size: .85em; opacity: .75; margin-top: .2em; }

/* ---------- polaroid field-photo ---------- */
.polaroid {
  position: absolute;
  top: -7%; left: -6%;
  width: 26%;
  background: #fdfcf8;
  padding: 4% 4% 12.5%;
  box-shadow: 0 1px 3px rgba(60,52,36,.2);
  border-radius: 2px;
  transform: rotate(5deg);
}
.art-wrap.side-right .polaroid { left: auto; right: -6%; transform: rotate(-5deg); }
.polaroid .photo {
  width: 100%; aspect-ratio: 1 / 0.96;
  background-size: cover; background-position: center;
  filter: saturate(.92) contrast(.98);
  box-shadow: inset 0 0 14px rgba(20,24,38,.35);
}
.polaroid .photo-caption {
  position: absolute; left: 0; right: 0; bottom: 1.5%;
  text-align: center;
  font-family: var(--cursive-lite);
  font-size: clamp(.72rem, 1.15vw, 1rem);
  color: rgba(43,49,71,.78);
  transform: rotate(-1.4deg);
}
/* bit of old tape holding the photo on */
.polaroid::before {
  content: "";
  position: absolute; top: -5.5%; left: 50%;
  width: 42%; height: 9%;
  transform: translateX(-50%) rotate(-2.5deg);
  background: rgba(240,232,205,.75);
  box-shadow: 0 1px 3px rgba(60,52,36,.18);
}

/* ---------- copy side ---------- */
/* ---------- the folded field-note carrying the copy ---------- */
.note-wrap {
  position: absolute; top: 50%;
  z-index: 2;
  will-change: transform;
}
.bp-section[data-side="left"]  .note-wrap { right: 5vw; }
.bp-section[data-side="right"] .note-wrap { left: 5vw; }

.note {
  position: relative; width: 100%; height: 100%;
  background: center / 100% 100% no-repeat;
  transform: rotate(-1.4deg);
}
.bp-section[data-side="right"] .note { transform: rotate(1.2deg); }

.note-content {
  position: absolute; inset: 0;
  padding: 11% 9% 9% 16%;
  overflow: hidden;
}

/* a real paperclip hooked over the top edge */
.paperclip {
  position: absolute;
  z-index: 6;
  transform: rotate(3.5deg);
  filter: drop-shadow(1px 2.5px 2.5px rgba(60,48,26,.35));
  pointer-events: none;
}

/* copy is now ink on the note, locked to the paper's printed rules:
   every line box is a whole number of rules so baselines stay true */
.bp-copy { position: static; width: auto; }

.note-content { --E: calc(var(--line, 22px) * var(--step, 1)); }
.note-content .copy-label {
  font-size: calc(var(--E) * .48); line-height: var(--E); margin-bottom: 0;
}
.note-content h2 {
  font-size: calc(var(--line, 22px) * var(--h2step, 2) * .60);
  line-height: calc(var(--line, 22px) * var(--h2step, 2));
  margin-bottom: 0; padding-bottom: 0;
  background-position: 0% 92%;
}
.note-content p {
  font-size: calc(var(--E) * .56); line-height: var(--E);
  margin-bottom: var(--E);
}
.note-content p:last-child { margin-bottom: 0; }
.note-content .copy-list { margin-top: 0; }
.note-content .copy-list li {
  font-size: calc(var(--E) * .60); line-height: var(--E);
  padding: 0 0 0 1.4em; border-bottom: none;
}
.note-content .copy-cta {
  font-size: calc(var(--E) * .68); line-height: calc(var(--E) * 1.5);
  margin-top: 0;
}

/* the landscape scrap: single-line heading, no blank rules */
.note-wrap.scrap h2 br { display: none; }
.note-wrap.scrap .note-content p { margin-bottom: 0; }
.footer { position: relative; z-index: 2; }

.copy-label {
  font-family: var(--marker); font-size: clamp(.55rem, .8vw, .68rem); letter-spacing: .18em;
  color: var(--accent); text-transform: uppercase;
  margin-bottom: 1rem;
}
.bp-copy h2 {
  font-family: var(--script); font-weight: 400;
  font-size: clamp(1.5rem, 2.5vw, 2.3rem);
  line-height: 1.16;
  margin-bottom: 1.1rem;
  color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 18' preserveAspectRatio='none'%3E%3Cpath d='M4 12 C 60 4, 120 15, 180 9 S 270 7, 296 11' fill='none' stroke='%233b6fd4' stroke-width='3.5' stroke-linecap='round' opacity='.55'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0% 100%;
  background-size: 72% .32em;
  padding-bottom: .12em;
}
.bp-copy p { color: var(--ink-soft); line-height: 1.65; font-size: clamp(.82rem, 1.15vw, .98rem); margin-bottom: .8rem; }
.copy-fine { font-size: .95rem; opacity: .85; }
.copy-list { list-style: none; margin-top: .3rem; }
.copy-list li {
  font-family: var(--pen-thin); font-size: clamp(1rem, 1.5vw, 1.2rem); color: var(--ink);
  padding: .4rem 0 .4rem 1.5rem; position: relative;
  border-bottom: 1.5px dashed rgba(43,49,71,.2);
}
.copy-list li::before {
  content: "→"; position: absolute; left: 0;
  font-family: var(--hand); font-weight: 700; color: var(--accent);
}
.copy-cta {
  display: inline-block; margin-top: .5rem;
  font-family: var(--hand); font-weight: 600; font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  color: var(--accent); text-decoration: none;
  border-bottom: 2px solid rgba(59,111,212,.45);
  padding-bottom: .1rem;
  transform: rotate(-.8deg);
  transition: border-color .2s ease;
}
.copy-cta:hover { border-color: var(--accent); }

/* ---------- footer ---------- */
.footer {
  position: relative;
  background: var(--bg-deep);
  border-top: 1.5px dashed rgba(43,49,71,.25);
}
.footer-inner {
  max-width: 72rem; margin: 0 auto;
  padding: 3.6rem 2.2rem 2.4rem;
  display: flex; flex-wrap: wrap; gap: 2.4rem; align-items: flex-start;
}
.footer-left { display: flex; gap: 1.1rem; align-items: flex-start; }
.footer-left p { color: var(--ink-soft); font-size: .95rem; line-height: 1.7; }
.footer-links { margin-left: auto; display: flex; gap: 1.7rem; }
.footer-links a {
  font-family: var(--scrawl);
  color: var(--ink-soft); text-decoration: none; font-size: .95rem;
}
.footer-links a:hover { color: var(--accent); }
.footer-copy { width: 100%; font-family: var(--hand); font-weight: 600; font-size: 1rem; color: rgba(92,97,120,.7); }

/* ---------- small screens ---------- */
@media (max-width: 920px) {
  .nav-links, .logo-word { display: none; }
  .art-wrap.side-left, .art-wrap.side-right { left: 50%; right: auto; }
  .bp-section[data-side="left"] .note-wrap,
  .bp-section[data-side="right"] .note-wrap { left: 50%; right: auto; margin-left: -35vw; }
  .bp-copy h2 { font-size: 2.2rem; }
  .bp-copy p { font-size: .95rem; }
}

@media (prefers-reduced-motion: reduce) {
  .cue-line { animation: none; }
}
