/* ============================================
   Of Course — by Erick Sandstad
   Stylesheet: a nervous system exhale
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Inter+Tight:wght@300;400;500&display=swap');

:root {
  /* Palette — amber, cream, ink */
  --cream:        #f6efe2;
  --cream-soft:   #fbf6ec;
  --cream-deep:   #ede2cc;
  --amber:        #c98a3a;
  --amber-soft:   #d9a560;
  --amber-deep:   #8a5a22;
  --ink:          #2a2520;
  --ink-soft:     #4a423a;
  --ink-faint:    #8a7e6f;
  --rule:         rgba(42, 37, 32, 0.12);

  /* Type */
  --serif:  'Cormorant Garamond', 'Cormorant', Garamond, 'EB Garamond', Georgia, serif;
  --sans:   'Inter Tight', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;

  /* Rhythm */
  --measure: 32rem;
  --gutter:  clamp(1.25rem, 4vw, 2.5rem);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body, h1, h2, h3, h4, p, figure, blockquote, ul { margin: 0; padding: 0; }
ul { list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }

/* Page */
html, body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.6;
  font-size: 18px;
}

@media (min-width: 768px) {
  html, body { font-size: 19px; }
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Subtle warm vignette */
  background:
    radial-gradient(ellipse at top, rgba(217, 165, 96, 0.08), transparent 60%),
    radial-gradient(ellipse at bottom, rgba(201, 138, 58, 0.06), transparent 70%),
    var(--cream);
}

/* Optional grain — barely there */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.35;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0.55  0 0 0 0 0.45  0 0 0 0 0.30  0 0 0 0.18 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}

/* Layout shell */
.shell {
  width: 100%;
  max-width: 78rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
  z-index: 2;
}

/* ============================================
   Navigation
   ============================================ */

.site-nav {
  padding: 2.25rem 0 1.25rem;
}

.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 2rem;
}

.brand {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.brand .dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--amber);
  margin: 0 0.55rem 0.18rem;
  vertical-align: middle;
}

.nav-links {
  display: flex;
  gap: clamp(1rem, 3vw, 2.25rem);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.nav-links a {
  position: relative;
  padding-bottom: 2px;
  transition: color 280ms ease;
}

.nav-links a:hover { color: var(--amber-deep); }

.nav-links a.is-current {
  color: var(--ink);
}

.nav-links a.is-current::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -3px;
  height: 1px;
  background: var(--amber);
}

/* ============================================
   Home
   ============================================ */

main {
  flex: 1;
  width: 100%;
}

.hero {
  padding: clamp(3rem, 10vh, 7rem) 0 clamp(4rem, 12vh, 8rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(3rem, 8vw, 6rem);
  align-items: center;
}

@media (min-width: 880px) {
  .hero-grid {
    grid-template-columns: 1.05fr 1fr;
  }
}

.hero-text {
  max-width: 32rem;
}

.hero-eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--amber-deep);
  margin-bottom: 2rem;
  opacity: 0;
  animation: rise 1.4s ease 0.2s forwards;
}

.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.75rem, 7vw, 4.75rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 2.25rem;
  opacity: 0;
  animation: rise 1.6s ease 0.45s forwards;
}

.hero-title em {
  font-style: italic;
  color: var(--amber-deep);
  font-weight: 400;
}

.hero-passage {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.15rem, 1.8vw, 1.4rem);
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 28rem;
  opacity: 0;
  animation: rise 1.8s ease 0.75s forwards;
}

.hero-passage::before {
  content: "";
  display: block;
  width: 36px;
  height: 1px;
  background: var(--amber);
  margin-bottom: 1.75rem;
}

.hero-cover {
  position: relative;
  justify-self: center;
  opacity: 0;
  animation: rise 2s ease 0.6s forwards;
}

.cover-frame {
  position: relative;
  width: clamp(15rem, 28vw, 21rem);
  aspect-ratio: 2 / 3;
  background: var(--cream-soft);
  box-shadow:
    0 1px 1px rgba(42,37,32,0.05),
    0 18px 40px -12px rgba(42,37,32,0.22),
    0 40px 80px -20px rgba(138, 90, 34, 0.18);
  transform: rotate(-1.2deg);
  transition: transform 600ms cubic-bezier(.2,.8,.2,1);
}

.cover-frame:hover { transform: rotate(0deg) translateY(-4px); }

.cover-frame img {
  width: 100%; height: 100%; object-fit: cover;
}

/* Placeholder used until real cover is supplied */
.cover-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: linear-gradient(160deg, #ede2cc 0%, #d9a560 100%);
  color: var(--ink);
  text-align: center;
  padding: 2rem;
  font-family: var(--serif);
}

.cover-placeholder .ph-meta {
  font-family: var(--sans);
  font-size: 0.65rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(42,37,32,0.55);
  margin-bottom: 2.5rem;
}

.cover-placeholder .ph-title {
  font-size: 2.6rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1;
  margin-bottom: 0.4rem;
}

.cover-placeholder .ph-author {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  margin-top: auto;
  color: rgba(42,37,32,0.7);
}

/* Quiet footer link area on home */
.hero-foot {
  margin-top: clamp(3rem, 8vh, 5rem);
  text-align: center;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.hero-foot a {
  color: var(--ink-soft);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
  transition: color 300ms ease, border-color 300ms ease;
}

.hero-foot a:hover {
  color: var(--amber-deep);
  border-color: var(--amber);
}

/* ============================================
   Interior pages (About / The Book)
   ============================================ */

.page {
  padding: clamp(2rem, 6vh, 4rem) 0 clamp(5rem, 12vh, 8rem);
}

.page-head {
  text-align: center;
  margin-bottom: clamp(3rem, 8vh, 5rem);
  opacity: 0;
  animation: rise 1.4s ease 0.2s forwards;
}

.page-eyebrow {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--amber-deep);
  margin-bottom: 1.5rem;
}

.page-title {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(2.5rem, 5.5vw, 4rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.page-rule {
  display: block;
  width: 40px;
  height: 1px;
  background: var(--amber);
  margin: 2rem auto 0;
}

/* Two-column page (About) */
.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
  max-width: 64rem;
  margin: 0 auto;
}

@media (min-width: 820px) {
  .two-col { grid-template-columns: 0.85fr 1.15fr; }
}

.portrait {
  width: 100%;
  max-width: 22rem;
  margin: 0 auto;
  aspect-ratio: 4 / 5;
  background: var(--cream-deep);
  box-shadow:
    0 1px 1px rgba(42,37,32,0.05),
    0 22px 44px -16px rgba(42,37,32,0.22);
  opacity: 0;
  animation: rise 1.6s ease 0.45s forwards;
}

.portrait img { width: 100%; height: 100%; object-fit: cover; }

.portrait-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.5), transparent 60%),
    linear-gradient(160deg, #ede2cc, #c98a3a);
  font-family: var(--sans);
  font-size: 0.65rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(42,37,32,0.6);
}

.prose {
  max-width: 34rem;
  font-size: 1.18rem;
  line-height: 1.75;
  color: var(--ink-soft);
  opacity: 0;
  animation: rise 1.8s ease 0.6s forwards;
}

.prose > * + * { margin-top: 1.4rem; }

.prose p:first-child::first-letter {
  font-size: 3.4rem;
  float: left;
  line-height: 0.9;
  padding: 0.35rem 0.55rem 0 0;
  color: var(--amber-deep);
  font-weight: 400;
}

.prose em { color: var(--ink); font-style: italic; }

.section-divider {
  display: block;
  width: 24px;
  height: 1px;
  background: var(--amber);
  margin: 2.5rem 0;
  opacity: 0.7;
}

/* The Book page */
.book-layout {
  max-width: 60rem;
  margin: 0 auto;
}

.book-cover-large {
  width: clamp(15rem, 30vw, 22rem);
  margin: 0 auto clamp(3rem, 6vh, 4.5rem);
  opacity: 0;
  animation: rise 1.6s ease 0.45s forwards;
}

.book-prose {
  max-width: 34rem;
  margin: 0 auto;
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--ink-soft);
  opacity: 0;
  animation: rise 1.8s ease 0.6s forwards;
}

.book-prose > * + * { margin-top: 1.5rem; }

.pull {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 1.5rem;
  line-height: 1.55;
  color: var(--ink);
  text-align: center;
  margin: 3.5rem 0 !important;
  padding: 0 1rem;
  position: relative;
}

.pull::before, .pull::after {
  content: "";
  display: block;
  width: 28px;
  height: 1px;
  background: var(--amber);
  margin: 1.75rem auto;
}

.meta-list {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
  margin-top: 4rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 2.5rem;
}

.meta-list li { position: relative; }

/* ============================================
   Footer
   ============================================ */

.site-footer {
  padding: 3rem 0 2.5rem;
  border-top: 1px solid var(--rule);
  margin-top: auto;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.footer-row .colophon {
  font-style: italic;
  font-family: var(--serif);
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

/* ============================================
   Animation
   ============================================ */

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Selection */
::selection {
  background: var(--amber-soft);
  color: var(--ink);
}
