/* ============================================================
   Dreambound — base.css
   Design tokens, reset, typography.
   ============================================================ */

/* --- Design tokens --------------------------------------- */
:root {
  /* Surfaces */
  --cream:      #f5efe1;
  --cream-soft: #ebe3d0;
  --cream-edge: #d9cfb6;

  /* Ink */
  --ink:       #1c1a17;
  --ink-soft:  #3a352e;
  --ink-mute:  #6e665a;
  --ink-faint: #9c9382;

  /* Accents — used sparingly */
  --amber: #b8722a;
  --rust:  #9a4a32;

  /* Lines */
  --line: #d4c9b0;

  /* Avatar tone slots (b|c|d|e) — warm backgrounds */
  --tone-b: #d9a86c; /* honeyed gold */
  --tone-c: #c97f59; /* terracotta   */
  --tone-d: #a7975f; /* dried olive  */
  --tone-e: #cf9d8c; /* faded rose   */

  /* Type */
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans:  "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;

  /* Radius */
  --radius:    10px;
  --radius-sm: 6px;
  --radius-lg: 16px;

  /* Elevation — borders by default; one soft hover shadow */
  --shadow-hover: 0 8px 24px rgba(28, 26, 23, 0.06);

  /* Layout */
  --maxw: 720px;
  --maxw-wide: 1080px;

  /* Motion — minimal, subtle */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 120ms;
  --t-base: 200ms;
}

/* --- Reset ----------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

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

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

a {
  color: var(--rust);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

ul {
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- Typography ------------------------------------------ */
h1,
h2,
h3,
h4 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.18;
  color: var(--ink);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }

/* The signature emotive voice — italic serif */
.voice {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--ink-soft);
}

p { max-width: 64ch; }

small,
.small {
  font-size: 0.8125rem;
  color: var(--ink-mute);
}

/* The Dreambound mark */
.mark {
  color: var(--amber);
  font-style: normal;
}

/* --- Utilities ------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}

.wrap-wide {
  width: 100%;
  max-width: var(--maxw-wide);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}

.stack > * + * {
  margin-top: var(--sp-4);
}

.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;
}

.hidden {
  display: none !important;
}

.muted  { color: var(--ink-mute); }
.faint  { color: var(--ink-faint); }
.center { text-align: center; }

/* --- Page entrance animation ----------------------------- */
@keyframes page-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

main {
  animation: page-in 280ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

/* Staggered feed cards — first 8 items stagger in */
.feed-list > * {
  animation: page-in 280ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.feed-list > *:nth-child(1)  { animation-delay: 0ms; }
.feed-list > *:nth-child(2)  { animation-delay: 40ms; }
.feed-list > *:nth-child(3)  { animation-delay: 80ms; }
.feed-list > *:nth-child(4)  { animation-delay: 120ms; }
.feed-list > *:nth-child(5)  { animation-delay: 160ms; }
.feed-list > *:nth-child(6)  { animation-delay: 200ms; }
.feed-list > *:nth-child(7)  { animation-delay: 240ms; }
.feed-list > *:nth-child(8)  { animation-delay: 280ms; }

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