/* ============================================================
   C. Wayne France — handcraft southern gothic
   Paper, ink, restraint.
   ============================================================ */

:root {
  /* Paper */
  --paper:       oklch(0.945 0.018 82);
  --paper-deep:  oklch(0.915 0.022 78);
  --paper-edge:  oklch(0.88  0.026 76);

  /* Ink */
  --ink:         oklch(0.20 0.018 62);
  --ink-soft:    oklch(0.36 0.014 60);
  --ink-faint:   oklch(0.55 0.012 60);
  --ink-hair:    oklch(0.78 0.012 60);

  /* Accent — oxblood, used sparingly */
  --oxblood:     oklch(0.42 0.090 30);

  /* Fonts */
  --serif:  "EB Garamond", "Cormorant Garamond", "Adobe Caslon Pro", Garamond, "Times New Roman", serif;
  --script: "Mrs Saint Delafield", "Pinyon Script", "Homemade Apple", cursive;
  --mono:   "Courier Prime", "Courier New", ui-monospace, monospace;

  /* Rhythm */
  --measure: 38ch;
  --rule:    1px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(16px, 1.05vw + 12px, 19px);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

::selection { background: var(--ink); color: var(--paper); }

/* ------------------------------------------------------------
   PAPER — turbulence noise + soft vignette layered on the body
   ------------------------------------------------------------ */
body {
  position: relative;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% 0%, transparent 55%, rgba(60,40,20,0.06) 100%),
    radial-gradient(ellipse at 50% 100%, transparent 55%, rgba(60,40,20,0.08) 100%),
    var(--paper);
}

body::before {
  /* Paper grain — fine turbulence */
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.55;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='320'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='7'/><feColorMatrix values='0 0 0 0 0.22  0 0 0 0 0.15  0 0 0 0 0.08  0 0 0 0.12 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

body::after {
  /* Slow paper mottling — large-scale fiber tone */
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='900' height='900'><filter id='m'><feTurbulence type='fractalNoise' baseFrequency='0.012' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0.32  0 0 0 0 0.22  0 0 0 0 0.10  0 0 0 0.20 0'/></filter><rect width='100%25' height='100%25' filter='url(%23m)'/></svg>");
}

body > * { position: relative; z-index: 2; }

/* ------------------------------------------------------------
   TYPOGRAPHY
   ------------------------------------------------------------ */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.005em;
}

.script {
  font-family: var(--script);
  font-weight: 400;
}

/* Tracked-out small-caps — the WRITER / DIRECTOR label */
.smallcaps {
  font-family: var(--serif);
  font-weight: 500;
  font-feature-settings: "smcp" 1;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 0.78em;
  color: var(--ink);
}

.italic { font-style: italic; }
.muted  { color: var(--ink-soft); }

/* Diamond + rule ornament */
.rule {
  display: inline-block;
  width: 2.2rem;
  height: 1px;
  background: var(--ink);
  vertical-align: middle;
}
.rule-pair {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
}
.rule-pair::before,
.rule-pair::after {
  content: "";
  display: inline-block;
  width: 2.2rem; height: 1px;
  background: currentColor;
}
.diamond {
  display: inline-block;
  width: 4px; height: 4px;
  background: currentColor;
  transform: rotate(45deg);
}

/* ------------------------------------------------------------
   FRAME — the deckle / page-edge feel for sections
   ------------------------------------------------------------ */
.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 5rem) clamp(1.25rem, 4vw, 3rem);
}

.center { text-align: center; }

/* Hairline rule — slight ink imperfection */
hr.hair {
  border: 0;
  height: 1px;
  background: var(--ink-soft);
  margin: 0 auto;
  width: 36px;
  opacity: 0.85;
}

/* ------------------------------------------------------------
   LINKS
   ------------------------------------------------------------ */
a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink-hair);
  padding-bottom: 1px;
  transition: border-color 220ms ease, color 220ms ease;
}
a:hover { border-color: var(--ink); color: var(--oxblood); }

/* ------------------------------------------------------------
   FADE-IN on intersection
   ------------------------------------------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 1200ms ease, transform 1200ms ease;
}
.reveal.in {
  opacity: 1;
  transform: none;
}

/* ------------------------------------------------------------
   SIGNATURE — ink-draw reveal
   The script text is masked by a wipe that animates from L→R
   ------------------------------------------------------------ */
.signature {
  position: relative;
  display: inline-block;
  font-family: var(--script);
  color: var(--ink);
  /* Script fonts have tall ascenders / flourishes that extend above
     the cap height. Give them breathing room so nothing is clipped. */
  line-height: 1.25;
  padding-top: 0.18em;
  /* a touch of ink bleed */
  filter: drop-shadow(0 0.5px 0 rgba(30,18,8,0.12));
}
.signature .underline {
  display: block;
  height: 2px;
  background: var(--ink);
  margin: 0.15em auto 0;
  border-radius: 2px;
  width: 0;
  transition: width 1400ms cubic-bezier(.5,.1,.2,1) 1100ms;
  /* slight tilt and rough edge */
  box-shadow: 1px 0 0 var(--ink), -1px 0 0 var(--ink);
}
.signature.drawn .underline { width: 28%; }

.signature .ink {
  display: inline-block;
  background: linear-gradient(90deg, var(--ink) 0 50%, transparent 50% 100%);
  background-size: 200% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  /* Avoid the background-clip box clipping ascenders */
  padding-top: 0.12em;
  padding-bottom: 0.05em;
  transition: background-position 1800ms cubic-bezier(.45,.05,.25,1);
}
.signature.drawn .ink { background-position: 0% 0; }

/* ------------------------------------------------------------
   IMAGE SLOT — sparse 35mm still placeholder
   ------------------------------------------------------------ */
.still {
  position: relative;
  background: var(--ink);
  overflow: hidden;
  isolation: isolate;
}
.still::before {
  /* film grain over the still */
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='2' seed='5'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.35 0'/></filter><rect width='100%25' height='100%25' filter='url(%23g)'/></svg>");
  mix-blend-mode: screen;
  opacity: 0.45;
  pointer-events: none;
  z-index: 2;
}
.still .caption {
  position: absolute;
  left: 12px; bottom: 10px;
  z-index: 3;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(245,235,220,0.75);
  text-transform: uppercase;
}

/* ------------------------------------------------------------
   BUTTON / link as button
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 0.78em;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 220ms ease, color 220ms ease;
}
.btn:hover { background: var(--ink); color: var(--paper); }
