/* ==========================================================================
   base.css — Design tokens, reset, typography, animations, utilities
   Hourly Journal peach theme (seed #FEA988)
   ========================================================================== */

:root {
  /* Brand (peach / ink) */
  --color-peach: #fea988;
  --color-rose: #dcc2bd;
  --color-ink: #621e01;
  --color-ink-soft: rgba(98, 30, 1, 0.72);
  --color-ink-faint: rgba(98, 30, 1, 0.12);
  --color-cream: #fff6f1;
  --color-device: #1a1a1a;
  --color-x-black: #000000;

  --color-brand-50: #fff6f1;
  --color-brand-100: #ffe8dc;
  --color-brand-200: #ffd7c4;
  --color-brand-300: #ffb496;
  --color-brand-400: #fea988;
  --color-brand-500: #904a30;
  --color-brand-600: #73351b;
  --color-brand-700: #621e01;
  --color-brand-800: #552008;
  --color-brand-rgb: 144, 74, 48;

  /* Secondary (warm sand) */
  --color-secondary-50: #fff8f5;
  --color-secondary-100: #f5ded4;
  --color-secondary-200: #e8d6cf;
  --color-secondary-400: #d8c2b9;
  --color-secondary-500: #a08d84;
  --color-secondary-600: #86736b;

  /* Accent (tertiary gold) */
  --color-accent-50: #fff9eb;
  --color-accent-100: #f4e2a5;
  --color-accent-400: #d7c68b;
  --color-accent-500: #6b5e2f;
  --color-accent-600: #52461a;

  /* Neutrals */
  --color-white: #ffffff;
  --color-gray-50: #fff8f5;
  --color-gray-100: #f0dfd7;
  --color-gray-200: #e8d6cf;
  --color-gray-300: #d8c2b9;
  --color-gray-400: #a08d84;
  --color-gray-500: #86736b;
  --color-gray-600: #53433c;
  --color-gray-700: #382e2b;
  --color-gray-800: #271e1b;
  --color-gray-900: #221a17;

  /* Semantic */
  --color-success: #2f7a4f;
  --color-error: #ba1a1a;
  --color-warning: #9a6700;
  --color-star: #f4b942;

  /* Surfaces */
  --color-body-bg-start: var(--color-peach);
  --color-body-bg-mid: var(--color-rose);
  --color-body-bg-end: #e8d4cf;
  --color-page-alt: var(--color-cream);
  --color-footer-bg: rgba(255, 255, 255, 0.35);

  /* Typography */
  --font-family: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-mono: 'Fira Code', 'Cascadia Code', Consolas, Monaco, monospace;

  /* Layout */
  --container-max: 73.75rem;
  --container-narrow: 56rem;
  --container-wide: 72rem;
  --container-blog: 64rem;

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

  /* Radii */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-3xl: 2rem;
  --radius-4xl: 2.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(98, 30, 1, 0.06);
  --shadow-md: 0 8px 20px rgba(98, 30, 1, 0.12);
  --shadow-lg: 0 18px 40px rgba(98, 30, 1, 0.18);
  --shadow-soft: 0 10px 40px -10px rgba(98, 30, 1, 0.14);
  --shadow-float: 0 22px 50px rgba(98, 30, 1, 0.22);
  --shadow-xl: 0 35px 60px -12px rgba(98, 30, 1, 0.28);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  /* Header */
  --header-height: 3.5rem;
  --header-height-lg: 5rem;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-family);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-ink);
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(255, 255, 255, 0.45), transparent 55%),
    linear-gradient(180deg, var(--color-body-bg-start) 0%, var(--color-body-bg-mid) 55%, var(--color-body-bg-end) 100%);
  -webkit-font-smoothing: antialiased;
}

img, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  margin: 0;
}

p {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.text-highlight {
  background: linear-gradient(to right, var(--color-brand-500), var(--color-brand-400));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

@media (min-width: 640px) {
  .container { padding-left: var(--space-6); padding-right: var(--space-6); }
}

@media (min-width: 1024px) {
  .container { padding-left: var(--space-8); padding-right: var(--space-8); }
}

.container--narrow { max-width: var(--container-narrow); }
.container--wide { max-width: var(--container-wide); }
.container--blog { max-width: var(--container-blog); }

.content-auto {
  content-visibility: auto;
  contain-intrinsic-size: auto 500px;
}

.is-hidden { display: none !important; }

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

@keyframes fadeInUp {
  from { opacity: 0; transform: translate3d(0, 40px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translate3d(40px, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes bounceIn {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.05); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes bounce {
  0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(0.8, 0, 1, 1); }
  50% { transform: translateY(0); animation-timing-function: cubic-bezier(0, 0, 0.2, 1); }
}

@keyframes ping {
  75%, 100% { transform: scale(2); opacity: 0; }
}

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.animate-fade-in-up { opacity: 0; }
.animate-fade-in-right { opacity: 0; }

@media (prefers-reduced-motion: no-preference) {
  .animate-fade-in-up { animation: fadeInUp 0.8s ease-out forwards; }
  .animate-fade-in-right { animation: fadeInRight 0.8s ease-out forwards; }

  .perf-defer-motion .animate-pulse,
  .perf-defer-motion .animate-bounce,
  .perf-defer-motion .animate-ping {
    animation: none;
  }
  .perf-defer-motion.motion-ready .animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
  .perf-defer-motion.motion-ready .animate-bounce { animation: bounce 1s infinite; }
  .perf-defer-motion.motion-ready .animate-ping { animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite; }
}

@media (prefers-reduced-motion: reduce) {
  .animate-fade-in-up,
  .animate-fade-in-right { opacity: 1; }

  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

.animation-delay-300 { animation-delay: 0.3s; }
.animation-delay-500 { animation-delay: 0.5s; }
.animation-delay-600 { animation-delay: 0.6s; }
.animation-delay-700 { animation-delay: 0.7s; }
.animation-delay-900 { animation-delay: 0.9s; }
.animation-delay-2000 { animation-delay: 2s; }
.animation-delay-4000 { animation-delay: 4s; }

.success-animation { animation: bounceIn 0.6s ease; }
