:root {
  --bg-canvas: #f3f0fa;
  --bg-surface: #ffffff;
  --text-primary: #334155;
  --text-muted: #475569;
  --accent-primary: #2e1065;
  --border-color: #334155;
  
  --font-body: system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, Consolas, "Courier New", monospace;
  
  --ease-kinetic: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  lang: "en";
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-wrap: anywhere;
  hyphens: auto;
}

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

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-body);
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.mono-heading, .label, .number, nav a, .btn, .footer-heading {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mono-heading { font-weight: 700; font-size: 1.25rem; margin-bottom: 0.5rem; }
.label { font-size: 0.85rem; font-weight: 600; color: var(--accent-primary); display: block; margin-bottom: 0.25rem;}
.number { font-size: 1.5rem; font-weight: bold; color: var(--accent-primary); }

p { margin-bottom: 1rem; }

/* Layout & Containers */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.reading-container {
  max-width: 72ch;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Header */
header {
  position: static;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--accent-primary);
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--accent-primary);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-primary);
  cursor: pointer;
  font-family: var(--font-mono);
  padding: 0.5rem;
}

/* Background Patterns */
.bg-grid-pattern {
  background-image: 
    linear-gradient(to right, rgba(51, 65, 85, 0.1) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(51, 65, 85, 0.1) 1px, transparent 1px);
  background-size: 2rem 2rem;
}

/* Hero Section */
.hero {
  position: relative;
  padding: 4rem 0;
  border-bottom: 1px solid var(--border-color);
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

.hero-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border: 1px solid var(--border-color);
}

.hero-image-wrapper img {
  width: 100%;
  height: 100%;
}

.hero-floating-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.fact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.fact-item .number { min-width: 2rem; }

/* Bento Grid */
.section-heading {
  margin-top: 4rem;
  margin-bottom: 2rem;
  font-size: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.bento-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-bottom: 3rem;
}

.bento-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.bento-card img {
  width: 100%;
  aspect-ratio: 4/3;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
}

.bento-card-compact {
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
}

.bento-card-compact img {
  width: 80px;
  height: 80px;
  aspect-ratio: 1/1;
  margin-bottom: 0;
}

/* UI Elements */
.btn {
  display: inline-block;
  background: var(--accent-primary);
  color: var(--bg-surface);
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: 0;
  box-shadow: 4px 4px 0 var(--border-color);
  cursor: pointer;
  transition: all 0.2s var(--ease-kinetic);
  text-align: center;
  font-size: 0.9rem;
}

.btn:hover {
  transform: translate(4px, 4px);
  box-shadow: 0px 0px 0 var(--border-color);
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

input, select, textarea {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 0;
  font-family: var(--font-body);
  color: var(--text-primary);
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent-primary);
}

/* Footer */
footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.footer-heading {
  margin-bottom: 1rem;
  font-size: 1rem;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--accent-primary);
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
}

th, td {
  border: 1px solid var(--border-color);
  padding: 0.75rem;
  text-align: left;
}

th {
  background: var(--bg-canvas);
  font-family: var(--font-mono);
  font-weight: normal;
}

/* Animations */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease-kinetic), transform 0.6s var(--ease-kinetic);
}

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

/* Responsive */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
  }
  
  .nav-links.active {
    display: flex;
  }
  
  .mobile-menu-btn {
    display: block;
  }
}

@media (min-width: 1025px) {
  .bento-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(150px, auto);
  }
  
  .bento-span-2 { grid-column: span 2; }
  .bento-span-3 { grid-column: span 3; }
  .bento-row-2 { grid-row: span 2; }
  
  .hero-content {
    grid-template-columns: 2fr 1fr;
  }
  
  .hero-floating-card {
    position: absolute;
    bottom: -2rem;
    right: 2rem;
    width: 350px;
    box-shadow: 4px 4px 0 var(--border-color);
  }
}

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