/* ============================================
   GLOBAL RESET & BOX MODEL
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ============================================
   DESIGN TOKENS
   ============================================ */
:root {
  /* Typography */
  --font-sans: "Inter", system-ui, sans-serif;
  --font-serif: "Lora", Georgia, serif;
  --font-mono: "Fira Code", "Courier New", monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;

  /* Colors */
  --color-bg: #fdf0dc;
  --color-surface: #f5f5f4;
  --color-border: #e7e5e4;
  --color-text: #4a2518;
  --color-muted: #78716c;
  --color-accent: #2563eb;
  --color-accent-h: #1d4ed8; /* hover */

  /* Layout */
  --content-width: 72ch;
  --page-width: 1200px;
  --radius: 0.375rem;

  /* Line heights */
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-prose: 1.75;
}

/* ============================================
   BASE HTML
   ============================================ */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100dvh;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: var(--leading-tight);
  font-weight: 600;
  color: var(--color-text);
}

h1 {
  font-size: var(--text-4xl);
}
h2 {
  font-size: var(--text-3xl);
}
h3 {
  font-size: var(--text-2xl);
}
h4 {
  font-size: var(--text-xl);
}
h5 {
  font-size: var(--text-lg);
}
h6 {
  font-size: var(--text-base);
}

p {
  line-height: var(--leading-prose);
  max-width: var(--content-width);
}

a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--color-accent-h);
}

strong {
  font-weight: 700;
}
em {
  font-style: italic;
}

small {
  font-size: var(--text-sm);
  color: var(--color-muted);
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-surface);
  padding: 0.1em 0.35em;
  border-radius: var(--radius);
}

pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--color-surface);
  padding: var(--space-4);
  border-radius: var(--radius);
  overflow-x: auto;
  line-height: var(--leading-relaxed);
}

pre code {
  background: none;
  padding: 0;
}

blockquote {
  border-left: 3px solid var(--color-border);
  padding-left: var(--space-4);
  color: var(--color-muted);
  font-style: italic;
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-8) 0;
}

/* ============================================
   LISTS
   ============================================ */
ul,
ol {
  padding-left: var(--space-6);
  line-height: var(--leading-relaxed);
}

li + li {
  margin-top: var(--space-1);
}

/* ============================================
   IMAGES & MEDIA
   ============================================ */
img,
video,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

figure {
  margin: 0;
}

figcaption {
  font-size: var(--text-sm);
  color: var(--color-muted);
  margin-top: var(--space-2);
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */

/* Centered content wrapper */
.container {
  width: 100%;
  max-width: var(--page-width);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

/* Narrower prose column */
.prose {
  max-width: var(--content-width);
  margin-inline: auto;
}

/* Flow spacing — add vertical rhythm between children */
.flow > * + * {
  margin-top: var(--space-6);
}

.flow-sm > * + * {
  margin-top: var(--space-3);
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================
   DARK MODE
   ============================================ */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #2a1508;
    --color-surface: #1c1917;
    --color-border: #292524;
    --color-text: #fdf0dc;
    --color-muted: #a8a29e;
    --color-accent: #60a5fa;
    --color-accent-h: #93c5fd;
  }
}

/* ============================================
   PRINT
   ============================================ */
@media print {
  body {
    background: white;
    color: black;
  }
  a::after {
    content: " (" attr(href) ")";
  }
  nav,
  aside,
  footer {
    display: none;
  }
}
body {
  padding-top: var(--space-16);
  text-align: center;
}

p {
  width: 80%;
  margin-inline: auto;
  padding-bottom: var(--space-24);
  font-family: "Cormorant Garamond", serif;
  font-optical-sizing: auto;
  font-weight: 600;
  font-style: normal;
  font-size: 2rem;
}

p.quote {
  padding-top: var(--space-12);
  font-style: italic;
}
p.quote a {
  text-decoration: none;
  font-style: normal;
  font-weight: 400;
  font-size: 1.2rem;
  color: #555;
}

h1 {
  width: 90%;
  margin-inline: auto;
  font-family: "Pinyon Script", cursive;
  font-weight: 400;
  font-size: 9rem;
  font-style: normal;
  padding-bottom: var(--space-12);
}

h1 {
  text-shadow: 1px 2px 6px rgba(74, 37, 24, 0.18);
}

p {
  text-shadow: 1px 1px 4px rgba(74, 37, 24, 0.05);
}

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

.headline {
  animation: fadeUp 0.8s ease forwards;
}

.body-first {
  animation: fadeUp 0.8s ease 0.3s both;
}

.body-second {
  animation: fadeUp 0.8s ease 0.6s both;
}
