/* ============================================
   BASE / TOKENS
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;500;600;700&family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400&display=swap');

@font-face {
  font-family: 'Papernotes';
  src: url('../fonts/Papernotes.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Paper & surfaces */
  --paper: #f0e9da;
  --paper-deep: #e4d9c3;
  --paper-shadow: #d8ccae;

  /* Ink */
  --ink: #3a2e22;
  --ink-soft: #6b5d4a;

  /* Accents */
  --rust: #8b4a3c;
  --sage: #5b6e52;
  --kraft: #c9a876;

  /* Type */
  --font-hand: 'Papernotes', 'Fraunces', cursive;
  --font-caveat: 'Caveat', cursive;
  --font-body: 'Fraunces', serif;

  /* Spacing scale */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 7rem;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.75rem;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background-color: #f3f1ec;
  line-height: 1.5;
  font-size: 1.0625rem;
  overflow-x: clip;
  background-image: url('../images/paper-texture.jpg');
  background-size: 100% auto;
  background-repeat: repeat-y;
  background-position: top center;
}

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

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 500;
  color: var(--ink);
}

p {
  margin: 0;
}

a {
  color: inherit;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

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

/* Focus visibility - kept even on custom playful elements */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 3px;
}

/* Shared handwritten label style, used sparingly as section markers */
.hand-label {
  font-family: var(--font-hand);
  font-size: 1.75rem;
  font-weight: 400;
  font-synthesis: none;
  color: var(--rust);
  display: inline-block;
}

.section {
  position: relative;
  padding: var(--space-xl) var(--space-md);
  max-width: 1100px;
  margin: 0 auto;
}

@media (max-width: 640px) {
  .section {
    padding: var(--space-lg) var(--space-sm);
  }
}

.site-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-md);
  text-align: center;
}

.site-footer p {
  font-family: var(--font-hand);
  font-size: 1.4rem;
  font-weight: 400;
  font-synthesis: none;
  color: var(--ink-soft);
  transform: rotate(-1deg);
}
