/*
 * NSC1501 Bioscience - BASE STYLES
 * "Living Taxonomy" Design System
 * Scientific editorial meets botanical warmth
 */

/* ============================================
   GOOGLE FONTS IMPORT
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500;1,700&family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;0,8..60,500;0,8..60,600;0,8..60,700;1,8..60,400;1,8..60,500&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ============================================
   CSS CUSTOM PROPERTIES
   ============================================ */
:root {
  /* Core Palette */
  --forest: #1a3a2a;
  --forest-deep: #0f2219;
  --forest-light: #2a5a3e;
  --ivory: #f5f0e8;
  --ivory-warm: #ede6d8;
  --ivory-cool: #f8f5f0;
  --parchment: #e8dfd0;
  --terracotta: #c45d3e;
  --terracotta-light: #d4785e;
  --terracotta-dark: #a04a2e;
  --gold: #d4a853;
  --gold-light: #e8c97a;
  --gold-muted: #b89a5a;
  --ink: #2a4858;
  --ink-light: #3a6878;
  --ink-dark: #1a3040;
  --moss: #5a7a5e;
  --moss-light: #7a9a7e;
  --sage: #8aaa8e;

  /* Semantic Colors */
  --text-primary: #2c2416;
  --text-secondary: #5a4e3a;
  --text-muted: #8a7e6a;
  --text-inverse: #f5f0e8;
  --bg-primary: var(--ivory);
  --bg-secondary: var(--ivory-warm);
  --bg-surface: var(--ivory-cool);
  --bg-dark: var(--forest);
  --bg-darker: var(--forest-deep);
  --accent-primary: var(--terracotta);
  --accent-secondary: var(--gold);
  --accent-tertiary: var(--ink);
  --success: #3a7a4a;
  --success-bg: #e8f2ea;
  --error: #a83232;
  --error-bg: #f5e8e8;
  --warning: var(--gold);
  --warning-bg: #f5f0e0;

  /* Borders & Shadows */
  --border-color: #c8bfa8;
  --border-color-strong: #9a8e78;
  --border-width: 1px;
  --border-accent: 2px;
  --shadow-sm: 0 1px 3px rgba(42, 36, 22, 0.06), 0 1px 2px rgba(42, 36, 22, 0.04);
  --shadow-md: 0 4px 12px rgba(42, 36, 22, 0.08), 0 2px 4px rgba(42, 36, 22, 0.04);
  --shadow-lg: 0 8px 24px rgba(42, 36, 22, 0.1), 0 4px 8px rgba(42, 36, 22, 0.06);
  --shadow-xl: 0 16px 48px rgba(42, 36, 22, 0.12), 0 8px 16px rgba(42, 36, 22, 0.06);

  /* Typography */
  --font-heading: 'Playfair Display', 'Georgia', 'Times New Roman', serif;
  --font-body: 'Source Serif 4', 'Georgia', serif;
  --font-mono: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;
  --line-height: 1.7;
  --line-height-tight: 1.3;
  --line-height-heading: 1.15;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  /* Layout */
  --max-width-content: 72ch;
  --container-max: 1280px;
  --container-narrow: 860px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);
  --duration-fast: 150ms;
  --duration-normal: 300ms;
  --duration-slow: 500ms;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: var(--line-height);
  color: var(--text-primary);
  background: var(--bg-primary);
  min-height: 100vh;
  margin: 0;
  /* Subtle paper texture via gradient */
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(212, 168, 83, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(196, 93, 62, 0.02) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(26, 58, 42, 0.02) 0%, transparent 50%);
}

::selection {
  background: var(--gold-light);
  color: var(--text-primary);
}

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

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--line-height-heading);
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-md);
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  font-weight: 700;
}

h3 {
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
  font-weight: 600;
}

h4 {
  font-size: 1.0625rem;
  font-weight: 600;
}

p {
  margin-bottom: var(--space-md);
  max-width: var(--max-width-content);
  line-height: var(--line-height);
}

a {
  color: var(--accent-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: color var(--duration-fast) var(--ease-out),
              text-decoration-color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--terracotta-dark);
  text-decoration-color: var(--terracotta-dark);
}

a:focus {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

strong {
  font-weight: 700;
  color: var(--text-primary);
}

em {
  font-style: italic;
}

code {
  font-family: var(--font-mono);
  background: var(--forest-deep);
  color: var(--gold-light);
  padding: 2px 8px;
  font-size: 0.875em;
  border-radius: var(--radius-sm);
}

pre {
  background: var(--forest-deep);
  color: var(--gold-light);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  border: var(--border-width) solid var(--border-color);
  overflow-x: auto;
  margin-bottom: var(--space-md);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* ============================================
   LAYOUT CONTAINERS
   ============================================ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

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

.section {
  padding: var(--space-3xl) 0;
  position: relative;
}

.section + .section {
  border-top: var(--border-width) solid var(--border-color);
}

.section-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-sm);
  border-bottom: var(--border-accent) solid var(--terracotta);
  display: inline-block;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden {
  display: none !important;
}

.sr-only,
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.text-center {
  text-align: center;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.animate-in {
  animation: fadeInUp var(--duration-slow) var(--ease-out) both;
}

.animate-in-delay-1 {
  animation-delay: 100ms;
}

.animate-in-delay-2 {
  animation-delay: 200ms;
}

.animate-in-delay-3 {
  animation-delay: 300ms;
}

/* Ornamental divider */
.ornament {
  display: block;
  text-align: center;
  margin: var(--space-xl) 0;
  font-size: 1.5rem;
  color: var(--border-color);
  letter-spacing: 0.5em;
}

.ornament::before {
  content: '· · ·';
}
