/* ─────────────────────────────────────────────
   Design system: "The Quiet Scholar"
   Philosophy: typography is the design.
   Restraint, whitespace, a single accent.
───────────────────────────────────────────── */

:root {
  --cream:           #faf9f6;
  --charcoal:        #1c1c1c;
  --rust:            #a84f3e;
  --text-primary:    #1c1c1c;
  --text-secondary:  #4a4a4a;
  --text-tertiary:   #888;
  --border:          #dddbd5;
  --rule:            #e4e2dc;

  --font-serif:  "Fraunces", Georgia, serif;
  --font-sans:   "Inter", -apple-system, sans-serif;

  /* Constrained reading column */
  --col: 68ch;
  --col-wide: 780px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--cream);
  color: var(--text-primary);
  line-height: 1.75;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

/* ── Grain overlay ── */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.022;
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 35px,
      rgba(0,0,0,0.012) 35px,
      rgba(0,0,0,0.012) 70px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 35px,
      rgba(0,0,0,0.006) 35px,
      rgba(0,0,0,0.006) 70px
    );
}

main, .nav, .footer { position: relative; z-index: 1; }

/* ── Links ── */
a {
  color: var(--rust);
  text-decoration-color: rgba(168, 79, 62, 0.3);
  text-underline-offset: 0.16em;
  transition: text-decoration-color 0.2s ease, color 0.2s ease;
}

a:hover {
  text-decoration-color: rgba(168, 79, 62, 0.75);
}

/* ── Navigation ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  background: rgba(250, 249, 246, 0.88);
  border-bottom: 1px solid var(--rule);
}

.nav-inner {
  max-width: var(--col-wide);
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.brand {
  color: var(--text-primary);
  text-decoration: none;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 400;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  letter-spacing: -0.01em;
}

.brand:hover { color: var(--text-primary); }

.brand-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--rust);
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 1.6rem;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-tertiary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 450;
  letter-spacing: 0.005em;
  transition: color 0.2s ease;
  padding-bottom: 1px;
  border-bottom: 1px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  border-color: var(--rust);
}

/* ── Hero ── */
.hero {
  max-width: var(--col-wide);
  margin: 0 auto;
  padding: 7rem 1.5rem 4.5rem;
}

.hero-layout {
  display: flex;
  align-items: flex-start;
  gap: 2.6rem;
}

.hero-photo-wrap {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.hero-name {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin: 0.6rem 0 0.3rem;
  line-height: 1.2;
}

.hero-photo {
  display: block;
  width: 220px;
  height: 275px;
  border-radius: 3px;
  object-fit: cover;
  object-position: center top;
  filter: grayscale(10%);
  border: 1px solid var(--rule);
}

/* placeholder shown when photo.jpg is missing */
.hero-photo[src="photo.jpg"]:not([complete]),
.hero-photo.missing {
  background: var(--rule);
}

.hero-contact {
  margin-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hero-contact a {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.2s;
}

.hero-contact a:hover {
  color: var(--rust);
}

.hero-text {
  flex: 1;
  min-width: 0;
  /* align first line of text with top of photo */
  padding-top: 0.1rem;
}

h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 300;
  letter-spacing: -0.018em;
  line-height: 1.08;
  margin: 0 0 0.5rem;
  color: var(--text-primary);
}

.subtitle {
  font-size: 0.9rem;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
  margin: 0 0 1.8rem;
}

.intro {
  max-width: var(--col);
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.8;
  margin: 0;
}

/* ── Sections ── */
.section {
  max-width: var(--col-wide);
  margin: 0 auto;
  padding: 3.5rem 1.5rem;
  border-top: 1px solid var(--rule);
}

.section-label {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rust);
  font-weight: 600;
  margin: 0 0 0.55rem;
}

h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 2.6vw, 2.3rem);
  font-weight: 320;
  letter-spacing: -0.014em;
  line-height: 1.1;
  margin: 0 0 2.4rem;
  color: var(--text-primary);
}

h3 {
  font-family: var(--font-serif);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin: 0 0 1.2rem;
}

/* ── Paper list ── */
.paper-group {
  margin-bottom: 2.8rem;
}

.paper-group:last-child {
  margin-bottom: 0;
}

.paper-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.paper-list li {
  padding: 1.1rem 0;
  border-top: 1px solid var(--rule);
}

.paper-list li:first-child {
  border-top: none;
  padding-top: 0;
}

.paper-title {
  display: block;
  font-size: 0.975rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.45;
  margin-bottom: 0.2rem;
}

.paper-title a {
  color: inherit;
  text-decoration-color: rgba(28,28,28,0.2);
}

.paper-title a:hover {
  color: var(--rust);
  text-decoration-color: rgba(168,79,62,0.4);
}

.paper-meta {
  font-size: 0.865rem;
  color: var(--text-tertiary);
  line-height: 1.5;
}

.paper-meta a {
  color: var(--text-tertiary);
  text-decoration-color: rgba(136,136,136,0.35);
}

.paper-meta a:hover {
  color: var(--rust);
}

.paper-status {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 550;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--rust);
  margin-top: 0.35rem;
}

/* ── Policy / Resources list ── */
.prose-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.prose-list li {
  padding: 0.9rem 0;
  border-top: 1px solid var(--rule);
  font-size: 0.975rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.prose-list li:first-child {
  border-top: none;
  padding-top: 0;
}

.prose-list .meta {
  display: block;
  font-size: 0.855rem;
  color: var(--text-tertiary);
  margin-top: 0.2rem;
}

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--rule);
  max-width: var(--col-wide);
  margin: 0 auto;
  padding: 2.2rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--text-tertiary);
  font-size: 0.83rem;
}

.footer a {
  color: var(--text-tertiary);
  text-decoration-color: rgba(136,136,136,0.3);
}

.footer a:hover {
  color: var(--rust);
}

/* ── Reveal animation ── */
.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  html { scroll-behavior: auto; }
}

/* ── Responsive ── */
@media (max-width: 700px) {
  .nav-inner {
    padding: 1rem 1.2rem;
  }

  .nav-links {
    gap: 1rem;
  }

  .nav-links a {
    font-size: 0.8rem;
  }

  .hero {
    padding: 5.5rem 1.2rem 3.5rem;
  }

  .hero-layout {
    flex-direction: column;
    gap: 1.6rem;
  }

  .hero-photo {
    width: 140px;
    height: 175px;
  }

  .section {
    padding: 2.8rem 1.2rem;
  }

  .footer {
    padding: 1.8rem 1.2rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
}
