/* ==========================================================================
   MY YEAR 2026 — base.css
   Design tokens, reset, typography foundations.
   Mobile-first. Premium personal-journal aesthetic.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Design tokens (CSS variables)
   -------------------------------------------------------------------------- */
:root {
  /* Color palette — warm editorial */
  --color-bg: #F8F7F4;          /* warm off-white background */
  --color-surface: #FFFFFF;     /* card / panel surface */
  --color-surface-alt: #FAF9F6; /* subtle surface variation */
  --color-surface-sunken: #F1EFE9; /* wells, inputs */
  --color-primary: #26364A;     /* deep navy */
  --color-primary-700: #1E2A3A;
  --color-primary-300: #6E8298;
  --color-secondary: #647D96;   /* muted blue */
  --color-accent: #C49A5A;      /* warm gold */
  --color-accent-700: #A57E40;
  --color-accent-100: #F1E5CC;
  --color-text: #292D32;        /* charcoal */
  --color-text-muted: #7B8088;
  --color-text-faint: #A8ADB5;
  --color-border: #E8E6E1;
  --color-border-strong: #D4D1CA;

  /* Status colors — soft, journal-friendly */
  --color-success: #4F7A5A;
  --color-success-bg: #E8F0EA;
  --color-warning: #B5803B;
  --color-warning-bg: #F5EBD8;
  --color-danger: #A84B3E;
  --color-danger-bg: #F3E3DF;
  --color-info: #4D6F8C;
  --color-info-bg: #E4EDF3;

  /* Typography */
  --font-serif: 'Playfair Display', 'Source Han Serif SC', 'Noto Serif Thai', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', 'Sarabun', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, 'Tahoma', sans-serif;
  --font-display: 'Playfair Display', 'Source Han Serif SC', 'Noto Serif Thai', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  /* Font sizes — modular scale */
  --fs-xs: 0.75rem;    /* 12px */
  --fs-sm: 0.875rem;   /* 14px */
  --fs-base: 1rem;     /* 16px */
  --fs-md: 1.125rem;   /* 18px */
  --fs-lg: 1.375rem;   /* 22px */
  --fs-xl: 1.75rem;    /* 28px */
  --fs-2xl: 2.25rem;   /* 36px */
  --fs-3xl: 3rem;      /* 48px */
  --fs-4xl: 3.75rem;   /* 60px */

  /* Line heights */
  --lh-tight: 1.15;
  --lh-snug: 1.35;
  --lh-normal: 1.55;
  --lh-relaxed: 1.7;
  --lh-loose: 1.9;

  /* Spacing — 4px base */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;
  --radius-circle: 50%;

  /* Shadows — restrained, editorial */
  --shadow-xs: 0 1px 2px rgba(38, 54, 74, 0.04);
  --shadow-sm: 0 2px 6px rgba(38, 54, 74, 0.06);
  --shadow-md: 0 4px 16px rgba(38, 54, 74, 0.08);
  --shadow-lg: 0 12px 32px rgba(38, 54, 74, 0.10);
  --shadow-inset: inset 0 0 0 1px var(--color-border);

  /* Layout */
  --shell-max: 1200px;
  --content-max: 720px;
  --wide-max: 1080px;
  --nav-height: 60px;
  --sidebar-width: 240px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 120ms;
  --dur: 220ms;
  --dur-slow: 360ms;

  /* Z-index scale */
  --z-base: 1;
  --z-sticky: 100;
  --z-nav: 200;
  --z-overlay: 800;
  --z-modal: 1000;
  --z-toast: 1200;
}

/* --------------------------------------------------------------------------
   Modern reset
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  font-size: 100%;
}
body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
  overflow-x: hidden;
}
img, picture, svg, video, canvas {
  display: block;
  max-width: 100%;
  height: auto;
}
input, button, textarea, select {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}
button { background: none; border: none; cursor: pointer; }
a { color: var(--color-primary); text-decoration: none; transition: color var(--dur-fast) var(--ease); }
a:hover { color: var(--color-accent-700); }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }
hr { border: none; border-top: 1px solid var(--color-border); }

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-tight);
  color: var(--color-primary);
  letter-spacing: -0.01em;
}
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); font-family: var(--font-sans); font-weight: 600; }
h5 { font-size: var(--fs-base); font-family: var(--font-sans); font-weight: 600; }
h6 { font-size: var(--fs-sm); font-family: var(--font-sans); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-text-muted); }

p { line-height: var(--lh-relaxed); }
p + p { margin-top: var(--space-4); }

small { font-size: var(--fs-sm); }
strong, b { font-weight: 600; }
em, i { font-style: italic; }

.lead {
  font-size: var(--fs-md);
  line-height: var(--lh-relaxed);
  color: var(--color-text-muted);
  font-weight: 300;
}
.muted { color: var(--color-text-muted); }
.faint { color: var(--color-text-faint); }
.serif { font-family: var(--font-serif); }
.display { font-family: var(--font-display); }
.italic { font-style: italic; }
.uppercase { text-transform: uppercase; letter-spacing: 0.08em; }
.tnum { font-variant-numeric: tabular-nums; }

/* Editorial drop-cap option */
.dropcap::first-letter {
  font-family: var(--font-display);
  font-size: 3.4em;
  line-height: 0.85;
  float: left;
  padding: 0.08em 0.12em 0 0;
  color: var(--color-accent);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Accessibility helpers
   -------------------------------------------------------------------------- */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
.sr-only-focusable:focus {
  position: static !important;
  width: auto; height: auto;
  overflow: visible; clip: auto;
  white-space: normal;
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: var(--space-3) var(--space-4);
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: var(--z-toast);
}
.skip-link:focus { left: 0; }

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

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

/* --------------------------------------------------------------------------
   Selection
   -------------------------------------------------------------------------- */
::selection {
  background: var(--color-accent);
  color: #fff;
}
