/* Fonts are stored in the site itself, so they always load */
@font-face { font-family: "Mrs Saint Delafield"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/mrs-saint-delafield-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/eb-garamond-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/eb-garamond-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/eb-garamond-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Josefin Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/josefin-sans-latin-400-normal.woff2") format("woff2"); }

/* Rev. Rachael Dilling website
   Palette and feel drawn from a scrapbook style: deep red, linen cream, script headings, polaroids. */

:root {
  --red: #730f0f;
  --red-deep: #5c0b0b;
  --cream: #e7d7c0;
  --cream-light: #f3e9da;
  --paper: #fbf6ee;
  --ink: #3a1a14;
  --gold: #c9a46a;
  --script: "Mrs Saint Delafield", "Allura", cursive;
  --serif: "EB Garamond", Georgia, serif;
  --label: "Josefin Sans", "Helvetica Neue", Arial, sans-serif;
  --max: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
}

img { max-width: 100%; display: block; }

a { color: inherit; }

/* Linen texture on every section */
.linen {
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0,0,0,0.035) 0 1px, transparent 1px 4px);
}

.section { padding: 5.5rem 1.5rem; }
.section.red { background-color: var(--red); color: var(--cream); }
.section.cream { background-color: var(--cream); color: var(--red); }
.section.cream p, .section.cream li { color: var(--ink); }

.wrap { max-width: var(--max); margin: 0 auto; }
.narrow { max-width: 720px; margin: 0 auto; }
.center { text-align: center; }

/* Type */
.script {
  font-family: var(--script);
  font-weight: 400;
  line-height: 1;
  margin: 0 0 1.5rem;
  transform: rotate(-3deg);
}
h1.script { font-size: clamp(4.5rem, 12vw, 9.5rem); }
h2.script { font-size: clamp(3.6rem, 8vw, 6.5rem); }
h3.script { font-size: clamp(2.6rem, 5vw, 3.6rem); transform: rotate(-2deg); margin-bottom: 0.75rem; }

.label {
  font-family: var(--label);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.85rem;
  margin: 0 0 0.75rem;
}

.lead { font-size: 1.35rem; }

/* Header and nav */
.site-header {
  background-color: var(--red);
  color: var(--cream);
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(231,215,192,0.25);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  gap: 1rem;
}
.brand {
  font-family: var(--script);
  font-size: 2.4rem;
  text-decoration: none;
  line-height: 1;
}
.nav { display: flex; gap: 1.6rem; flex-wrap: wrap; }
.nav a {
  font-family: var(--label);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.82rem;
  text-decoration: none;
  padding: 0.35rem 0;
  border-bottom: 1px solid transparent;
}
.nav a:hover, .nav a:focus-visible, .nav a[aria-current="page"] { border-bottom-color: var(--cream); }

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--cream);
  color: var(--cream);
  font-family: var(--label);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.8rem;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
}

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 1rem; top: 1rem; z-index: 50;
  background: var(--cream); color: var(--red); padding: 0.5rem 1rem;
}

/* Buttons */
.buttons { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; margin-top: 2rem; }
.btn {
  display: inline-block;
  font-family: var(--label);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.85rem;
  text-decoration: none;
  padding: 0.95rem 1.6rem;
  border: 1px solid currentColor;
  transition: background 0.2s, color 0.2s;
}
.red .btn:hover, .red .btn:focus-visible { background: var(--cream); color: var(--red); }
.cream .btn { color: var(--red); }
.cream .btn:hover, .cream .btn:focus-visible { background: var(--red); color: var(--cream); }
.btn.solid { background: var(--cream); color: var(--red); }
.cream .btn.solid { background: var(--red); color: var(--cream); }

/* Polaroids */
.polaroid {
  background: var(--paper);
  padding: 0.9rem 0.9rem 3.2rem;
  box-shadow: 0 14px 30px rgba(0,0,0,0.28);
  position: relative;
  transform: rotate(var(--tilt, -2deg));
  max-width: 100%;
}
.polaroid img { width: 100%; height: 100%; object-fit: cover; }
.polaroid figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0.7rem;
  text-align: center;
  font-family: var(--script);
  font-size: 1.9rem;
  color: var(--red);
}
.polaroid::before {
  content: "";
  position: absolute;
  top: -14px; left: 50%;
  width: 110px; height: 28px;
  transform: translateX(-50%) rotate(-4deg);
  background: rgba(231,215,192,0.82);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* Hero */
.hero { text-align: center; padding-top: 3.5rem; }
.hero .welcome { margin-bottom: 0; }
.hero h1 { margin: 0.2rem 0 1.5rem; }
.hero .polaroid { width: min(430px, 88%); margin: 0 auto; --tilt: -1.8deg; }
.hero .polaroid img { aspect-ratio: 4 / 5; }
.hero .tagline { margin-top: 2.6rem; }

/* Two column layouts */
.split {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.split.flip { grid-template-columns: 1fr 1.1fr; }

.photo-stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.6rem 1.4rem;
  padding: 0.5rem;
}
.photo-stack .polaroid { padding: 0.7rem 0.7rem 2.2rem; margin: 0; width: 100%; }
.photo-stack .polaroid::before { width: 70px; height: 20px; top: -10px; }
.photo-stack img { aspect-ratio: 1 / 1; }
.photo-stack .p1 { --tilt: -4deg; }
.photo-stack .p2 { --tilt: 3deg; margin-top: 1.5rem; }
.photo-stack .p3 { --tilt: 2.5deg; margin-top: -0.5rem; }
.photo-stack .p4 { --tilt: -3deg; margin-top: 1rem; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-top: 2.5rem; }
.card {
  background: var(--red);
  color: var(--cream);
  padding: 2rem 1.8rem 2.2rem;
  outline: 1px solid rgba(231,215,192,0.6);
  outline-offset: -10px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
}
.card:nth-child(2) { transform: rotate(1deg); }
.card:nth-child(odd) { transform: rotate(-0.8deg); }
.card h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.25;
  margin: 0 0 0.8rem;
}
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.card p { color: var(--cream) !important; font-size: 1.08rem; margin: 0 0 1.2rem; }
.card .more {
  font-family: var(--label);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.78rem;
}

.cream-card { background: var(--cream-light); color: var(--ink); outline-color: rgba(115,15,15,0.4); }
.cream-card h3 { color: var(--red); }
.cream-card p { color: var(--ink) !important; }
.cream-card .more { color: var(--red); }

/* Serve columns */
.serve { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; text-align: center; margin-top: 2rem; }
.serve h3 { font-family: var(--script); font-weight: 400; font-size: 3rem; color: var(--red); margin: 0 0 0.4rem; }
.serve p { margin: 0; }

/* Essay collections */
.collection { margin-top: 4.5rem; }
.collection:first-of-type { margin-top: 2rem; }
.collection .question { font-family: var(--script); font-size: clamp(2.6rem, 5vw, 3.8rem); margin: 0 0 1.4rem; transform: rotate(-2deg); color: var(--red); font-weight: 400; line-height: 1.1; }
.essay {
  background: var(--cream-light);
  padding: 2rem 2.2rem;
  border-left: 6px solid var(--red);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
.essay + .essay { margin-top: 1.5rem; }
.essay h3 { font-family: var(--serif); font-size: 1.6rem; line-height: 1.25; margin: 0 0 0.6rem; color: var(--red); }
.essay h3 a { text-decoration: none; }
.essay h3 a:hover { text-decoration: underline; }
.essay p { margin: 0 0 1rem; }
.essay .links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.essay .links a {
  font-family: var(--label);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--red);
}

/* Talks */
.talks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3rem 2.5rem; margin-top: 2.5rem; }
.talk h3 { font-family: var(--serif); font-size: 1.35rem; margin: 1.6rem 0 0.3rem; line-height: 1.3; }
.talk p { margin: 0 0 0.6rem; font-size: 1.05rem; }
.talk .links a {
  font-family: var(--label);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
}
.video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #1c0606 center / cover no-repeat;
  border: 0.7rem solid var(--paper);
  box-shadow: 0 12px 26px rgba(0,0,0,0.3);
  cursor: pointer;
  width: 100%;
  padding: 0;
  display: block;
}
.video::after {
  content: "";
  position: absolute; inset: 0;
  background: rgba(60, 8, 8, 0.25);
  transition: background 0.2s;
}
.video:hover::after, .video:focus-visible::after { background: rgba(60, 8, 8, 0.05); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 3; }
.video.playing { cursor: default; }
.video.playing .play { display: none; }
.video .play {
  position: absolute; z-index: 2;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 76px; height: 76px;
  border-radius: 50%;
  background: rgba(231,215,192,0.92);
  display: grid; place-items: center;
}
.video .play::before {
  content: "";
  margin-left: 6px;
  border-style: solid;
  border-width: 14px 0 14px 22px;
  border-color: transparent transparent transparent var(--red);
}

.section.red .talk a { color: var(--cream); }
.section.cream .talk a { color: var(--red); }
.section.cream .talk h3 { color: var(--red); }

/* Credentials */
.credentials { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.credentials li {
  padding: 0.9rem 0;
  border-bottom: 1px solid rgba(231,215,192,0.35);
}
.credentials li strong { font-weight: 500; display: block; }
.credentials li span { font-family: var(--label); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.75rem; opacity: 0.85; }

/* Contact card */
.contact-card {
  background: var(--red);
  color: var(--cream);
  padding: 3rem 2.5rem;
  outline: 1px solid rgba(231,215,192,0.6);
  outline-offset: -12px;
  text-align: center;
  transform: rotate(-1deg);
  box-shadow: 0 16px 34px rgba(0,0,0,0.25);
}
.contact-card p { color: var(--cream) !important; }
.contact-card .email {
  font-size: clamp(1.15rem, 3.6vw, 1.6rem);
  word-break: break-word;
}
.checklist { text-align: left; display: inline-block; margin: 0.5rem auto 1.5rem; padding-left: 1.2rem; }
.checklist li { margin: 0.25rem 0; }

.divider {
  width: 70px; height: 1px;
  background: currentColor;
  margin: 1.6rem auto;
  opacity: 0.7;
}

/* Quote */
.quote {
  font-family: var(--script);
  font-size: clamp(3rem, 7vw, 5.5rem);
  line-height: 1.05;
  transform: rotate(-2deg);
  margin: 0 0 2rem;
}

/* Footer */
.site-footer {
  background-color: var(--red-deep);
  color: var(--cream);
  padding: 3.5rem 1.5rem 2.5rem;
  text-align: center;
}
.site-footer .brand { font-size: 3rem; display: inline-block; margin-bottom: 1rem; }
.site-footer .nav { justify-content: center; margin-bottom: 1.5rem; }
.site-footer small { font-family: var(--label); letter-spacing: 0.1em; font-size: 0.75rem; opacity: 0.8; }

/* Mobile */
@media (max-width: 860px) {
  .split, .split.flip { grid-template-columns: 1fr; gap: 3rem; }
  .cards, .serve { grid-template-columns: 1fr; }
  .talks { grid-template-columns: 1fr; }
  .card, .card:nth-child(odd), .card:nth-child(2) { transform: none; }
  .section { padding: 4rem 1.25rem; }
  .menu-toggle { display: block; }
  .site-header .nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--red);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1.5rem 1.2rem;
    border-bottom: 1px solid rgba(231,215,192,0.25);
  }
  .site-header .nav.open { display: flex; }
  .site-header .nav a { padding: 0.8rem 0; }
  .essay { padding: 1.6rem 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* Contact card list stays cream on red */
.contact-card li, .section.cream .contact-card li { color: var(--cream); }

/* Essay pages */
.essay-page .label a { text-decoration: none; }
.essay-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: 1.15;
  color: var(--red);
  margin: 0.5rem 0 2rem;
}
.prose { font-size: 1.25rem; line-height: 1.75; }
.prose p { margin: 0 0 1.3rem; color: var(--ink); }
.prose h2, .prose h3, .prose h4 { font-family: var(--serif); color: var(--red); line-height: 1.3; margin: 2.2rem 0 1rem; }
.prose blockquote { margin: 1.8rem 0; padding: 0.4rem 0 0.4rem 1.4rem; border-left: 4px solid var(--red); font-style: italic; }
.prose figure { margin: 2rem 0; }
.prose img { height: auto; margin: 0 auto; box-shadow: 0 10px 24px rgba(0,0,0,0.18); }
.prose figcaption { font-size: 0.95rem; text-align: center; margin-top: 0.6rem; opacity: 0.8; }
.prose a { color: var(--red); }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 1.3rem; }
.prose .continue { text-align: center; margin-top: 2rem; }
.essay-end { text-align: center; margin-top: 3rem; }
.recent { margin-top: 4.5rem; }
.recent-list { list-style: none; padding: 0; margin: 0; }
.recent-list li { padding: 1.3rem 0; border-bottom: 1px solid rgba(115,15,15,0.25); }
.recent-list a { font-size: 1.35rem; color: var(--red); text-decoration: none; font-weight: 500; }
.recent-list a:hover { text-decoration: underline; }
.recent-list .label { margin: 0.3rem 0 0.4rem; color: var(--ink); }
.recent-list p { margin: 0; font-size: 1.05rem; }

/* Serve columns on a red section */
.serve.on-red h3 { color: var(--cream); }
.serve.on-red p { color: var(--cream); }
.section.cream .lead a, .section.cream p a { color: var(--red); }
