/* ==========================================================================
   Global — resets, design tokens, typography, layout primitives
   ========================================================================== */

:root {
  /* Color palette — README §9 */
  --color-cream: #f3ebdd; /* main background */
  --color-paper: #e8ddc8; /* cards / paper */
  --color-olive: #535b4a; /* primary */
  --color-olive-deep: #3f4938; /* main text */
  --color-brown: #8a6f3c; /* accent */
  --color-green-muted: #6f7a3a; /* secondary accent */
  --color-beige-soft: #d8c6a5; /* borders / tape */

  --color-error: #a13f2b;
  --color-focus: #8a6f3c;

  /* Typography — README §10 */
  --font-heading: "Cormorant Garamond", "DM Serif Display", serif;
  --font-body: "Inter", "Manrope", sans-serif;
  --font-hand: "Caveat", "Patrick Hand", cursive;

  /* Spacing scale */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;

  /* Layout */
  --content-max: 1200px;
  --radius-paper: 2px;

  /* Motion (overridden to 0 under prefers-reduced-motion, see animations.css) */
  --duration-fast: 0.2s;
  --duration-base: 0.6s;
  --duration-slow: 1.1s;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-cream);
  color: var(--color-olive-deep);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 var(--space-2);
  color: var(--color-olive-deep);
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
}

h2 {
  font-size: clamp(1.9rem, 3.5vw, 2.8rem);
}

h3 {
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
}

p {
  margin: 0 0 var(--space-2);
}

a {
  color: inherit;
}

.hand {
  font-family: var(--font-hand);
}

.eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-brown);
}

.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

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

/* Skip link */
.skip-link {
  position: absolute;
  left: var(--space-2);
  top: -3rem;
  background: var(--color-olive-deep);
  color: var(--color-cream);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-paper);
  z-index: 100;
  transition: top var(--duration-fast) ease;
}

.skip-link:focus {
  top: var(--space-2);
}

/* Focus visibility — README §19 */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: var(--radius-paper);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.02em;
  background: var(--color-olive);
  color: var(--color-cream);
  border: none;
  padding: 0.85em 1.8em;
  border-radius: var(--radius-paper);
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--duration-fast) ease, background var(--duration-fast) ease;
}

.btn:hover {
  background: var(--color-olive-deep);
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-ghost {
  background: transparent;
  color: var(--color-olive-deep);
  border: 1.5px solid var(--color-beige-soft);
}

.btn-ghost:hover {
  background: var(--color-paper);
}

/* Site header (used on message + memories pages) */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-3);
}

.site-header .logo {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-olive-deep);
}

.site-header .back-link {
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--color-brown);
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration-fast) ease;
}

.site-header .back-link:hover {
  border-color: var(--color-brown);
}

/* Section rhythm */
.section {
  padding-block: var(--space-5);
}

@media (max-width: 1199px) {
  .section {
    padding-block: var(--space-4);
  }
}

@media (max-width: 767px) {
  body {
    font-size: 15px;
  }

  .section {
    padding-block: var(--space-4);
  }
}
