/* ============================================================
   EPSILON DIARY — MAIN.CSS
   Design Tokens · Reset · Typography · Layout Utilities
   ============================================================ */

/* ── Google Fonts Import ─────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&family=Inter:wght@300;400;500;600&display=swap');

/* ── Design Tokens ───────────────────────────────────────── */
:root {
  /* Colors */
  --color-primary:    #CBDDE9;
  --color-secondary:  #2872A1;
  --color-background: #F6FAFD;
  --color-text:       #183B56;
  --color-accent:     #4A9BC7;
  --color-muted:      #6B8DAD;
  --color-light:      #EAF3FA;
  --color-border:     rgba(40, 114, 161, 0.12);
  --color-white:      #FFFFFF;

  /* Shadows — Neumorphic System */
  --shadow-raised:
    6px 6px 14px rgba(163, 177, 198, 0.6),
    -6px -6px 14px rgba(255, 255, 255, 0.8);
  --shadow-floating:
    10px 10px 20px rgba(163, 177, 198, 0.7),
    -10px -10px 20px rgba(255, 255, 255, 0.9);
  --shadow-pressed:
    inset 4px 4px 10px rgba(163, 177, 198, 0.6),
    inset -4px -4px 10px rgba(255, 255, 255, 0.8);
  --shadow-deep:
    12px 12px 24px rgba(163, 177, 198, 0.65),
    -12px -12px 24px rgba(255, 255, 255, 0.85);
  --shadow-icon:
    inset 3px 3px 7px rgba(163, 177, 198, 0.5),
    inset -3px -3px 7px rgba(255, 255, 255, 0.8);

  /* Typography */
  --font-heading: 'Poppins', sans-serif;
  --font-body:    'Inter', sans-serif;

  /* Font Sizes — Desktop */
  --text-h1:      3.5rem;   /* 56px */
  --text-h2:      2.5rem;   /* 40px */
  --text-h3:      1.75rem;  /* 28px */
  --text-h4:      1.25rem;  /* 20px */
  --text-body-lg: 1.125rem; /* 18px */
  --text-body:    1rem;     /* 16px */
  --text-sm:      0.875rem; /* 14px */
  --text-caption: 0.813rem; /* 13px */

  /* Spacing Scale */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --space-6: 64px;
  --space-7: 96px;

  /* Layout */
  --container-max: 1200px;
  --container-pad: clamp(16px, 5vw, 64px);

  /* Border Radius */
  --radius-xl:  20px;
  --radius-lg:  16px;
  --radius-md:  12px;
  --radius-sm:  10px;
  --radius-xs:  8px;
  --radius-pill: 999px;

  /* Transitions */
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out:      cubic-bezier(0.0, 0, 0.2, 1);
  --transition-shadow: box-shadow 0.3s var(--ease-standard);
  --transition-transform: transform 0.2s var(--ease-standard);
}

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

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

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--color-text);
  background-color: var(--color-background);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

input, textarea, select {
  font-family: var(--font-body);
  font-size: var(--text-body);
}

/* ── Page Loader ─────────────────────────────────────────── */
#page-loader {
  position: fixed;
  inset: 0;
  background: var(--color-background);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.4s ease;
}

#page-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ── Typography ──────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

h1 { font-size: var(--text-h1); font-weight: 800; }
h2 { font-size: var(--text-h2); font-weight: 700; }
h3 { font-size: var(--text-h3); font-weight: 600; }
h4 { font-size: var(--text-h4); font-weight: 600; }

p { line-height: 1.7; }

.text-sm     { font-size: var(--text-sm); }
.text-caption{ font-size: var(--text-caption); }
.text-lg     { font-size: var(--text-body-lg); }
.text-muted  { color: var(--color-muted); }
.text-accent { color: var(--color-accent); }
.text-secondary { color: var(--color-secondary); }
.font-heading   { font-family: var(--font-heading); }
.font-medium    { font-weight: 500; }
.font-semibold  { font-weight: 600; }
.font-bold      { font-weight: 700; }
.text-center    { text-align: center; }

/* ── Layout Utilities ────────────────────────────────────── */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  width: 100%;
}

.section {
  padding: var(--space-7) 0;
}

.section-sm {
  padding: var(--space-5) 0;
}

/* ── Grid System ─────────────────────────────────────────── */
.grid {
  display: grid;
  gap: var(--space-3);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

/* ── Scroll-Entry Animation Base States ──────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* ── Section Headings ────────────────────────────────────── */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-caption);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-2);
}

.section-label::before {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-accent);
  border-radius: 2px;
}

.section-title {
  font-size: var(--text-h2);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.section-subtitle {
  font-size: var(--text-body-lg);
  color: var(--color-muted);
  max-width: 600px;
  line-height: 1.7;
}

.section-header {
  margin-bottom: var(--space-5);
}

.section-header.centered {
  text-align: center;
}

.section-header.centered .section-label {
  margin-left: auto;
  margin-right: auto;
}

.section-header.centered .section-subtitle {
  margin-left: auto;
  margin-right: auto;
}

/* ── Accessibility ───────────────────────────────────────── */
.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;
}

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

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

  .reveal, .reveal-left, .reveal-right, .reveal-scale {
    opacity: 1;
    transform: none;
  }
}

/* ── Responsive Typography ───────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --text-h1:      2rem;    /* 32px */
    --text-h2:      1.5rem;  /* 24px */
    --text-h3:      1.25rem; /* 20px */
    --text-body:    0.938rem;
    --text-body-lg: 1rem;
  }

  .section { padding: var(--space-5) 0; }
  .section-sm { padding: var(--space-4) 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  :root {
    --text-h1:    2.5rem;
    --text-h2:    2rem;
  }

  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ── Main Content Padding (below fixed nav) ──────────────── */
main {
  padding-top: 80px;
}
