/* ============================================
   charles-hornick.be — Design System
   Light (default) + Dark (data-theme="dark")
   ============================================ */

/* --- Design Tokens: Light (default) --- */
:root {
  --color-primary: #1E3A5F;
  --color-secondary: #D47853;
  --color-secondary-hover: #B86645;
  --bg-main: #FAF8F5;
  --bg-elevated: #FFFFFF;
  --bg-dark: #1E3A5F;
  --bg-dark-alt: #152940;
  --text-heading: #1E3A5F;
  --text-body: #64748B;
  --text-tertiary: #94A3B8;
  --border: #E5E7EB;
  --accent-urgent: #8B4049;
  --accent-success: #7D9D8F;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .1);
  --shadow-md: 0 4px 15px rgba(0, 0, 0, .1);
  --shadow-lg: 0 8px 25px rgba(0, 0, 0, .15);
  --shadow-header: 0 2px 10px rgba(0, 0, 0, .1);
  --shadow-card: 0 2px 10px rgba(0, 0, 0, .08);
  --shadow-focus: 0 0 0 3px rgba(212, 120, 83, .1);

  --hero-bg: linear-gradient(135deg, #1E3A5F 0%, #152940 100%);

  --sp-xs: .5rem;
  --sp-sm: .75rem;
  --sp-md: 1rem;
  --sp-lg: 1.5rem;
  --sp-xl: 2rem;
  --sp-2xl: 2.5rem;
  --sp-3xl: 3.75rem;

  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;

  --tr-fast: .2s ease;
  --tr-base: .3s ease;

  --font-display: 'Archivo Black', Impact, sans-serif;
  --font-body: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* --- Dark: explicit toggle --- */
[data-theme="dark"] {
  --color-primary: #FFFFFF;
  --color-secondary: #E8744F;
  --color-secondary-hover: #F09573;
  --bg-main: #1A1D23;
  --bg-elevated: #24282F;
  --bg-dark: #2D3340;
  --bg-dark-alt: #1E2128;
  --text-heading: #FFFFFF;
  --text-body: #E8EAED;
  --text-tertiary: #9CA3AF;
  --border: #3A3F4D;
  --accent-urgent: #C85A4A;
  --accent-success: #8CB3A3;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .3);
  --shadow-md: 0 4px 15px rgba(0, 0, 0, .4);
  --shadow-lg: 0 8px 25px rgba(0, 0, 0, .5);
  --shadow-header: 0 2px 10px rgba(0, 0, 0, .5);
  --shadow-card: 0 2px 10px rgba(0, 0, 0, .3);
  --shadow-focus: 0 0 0 3px rgba(232, 116, 79, .2);

  --hero-bg: linear-gradient(135deg, #2D3340 0%, #1E2128 100%);
}

/* --- Dark: system preference (no explicit choice) --- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-primary: #FFFFFF;
    --color-secondary: #E8744F;
    --color-secondary-hover: #F09573;
    --bg-main: #1A1D23;
    --bg-elevated: #24282F;
    --bg-dark: #2D3340;
    --bg-dark-alt: #1E2128;
    --text-heading: #FFFFFF;
    --text-body: #E8EAED;
    --text-tertiary: #9CA3AF;
    --border: #3A3F4D;
    --accent-urgent: #C85A4A;
    --accent-success: #8CB3A3;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, .3);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, .4);
    --shadow-lg: 0 8px 25px rgba(0, 0, 0, .5);
    --shadow-header: 0 2px 10px rgba(0, 0, 0, .5);
    --shadow-card: 0 2px 10px rgba(0, 0, 0, .3);
    --shadow-focus: 0 0 0 3px rgba(232, 116, 79, .2);

    --hero-bg: linear-gradient(135deg, #2D3340 0%, #1E2128 100%);
  }
}

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

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

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-body);
  background: var(--bg-main);
  transition: background var(--tr-base), color var(--tr-base);
}

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

/* --- Typography --- */
h1, h2 {
  font-family: var(--font-display);
  color: var(--text-heading);
  line-height: 1.2;
}

h3 {
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--text-heading);
  font-size: 1.25rem;
  line-height: 1.4;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); line-height: 1.3; }

p { margin-bottom: var(--sp-md); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--color-secondary);
  text-decoration: none;
  transition: color var(--tr-fast);
}

a:hover { color: var(--color-secondary-hover); }

/* --- Layout --- */
.container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 var(--sp-lg);
}

.section { padding: var(--sp-3xl) 0; }

.section-alt {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-header { margin-bottom: var(--sp-xl); }
.section-header p { color: var(--text-tertiary); margin-top: var(--sp-xs); }

/* --- Header --- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-header);
  transition: background var(--tr-base);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.header-brand {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--text-heading);
  text-decoration: none;
}

.header-brand:hover { color: var(--color-secondary); }

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-lg);
}

.header-nav a {
  color: var(--text-body);
  font-weight: 600;
  font-size: .875rem;
}

.header-nav a:hover { color: var(--color-secondary); }

/* Nav Toggle (Burger) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-heading);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Navigation */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .header-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 300px;
    height: 100vh;
    flex-direction: column;
    align-items: flex-start;
    padding: 5rem 2rem 2rem;
    background: var(--bg-main);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
  }

  .header-nav.is-open {
    transform: translateX(0);
  }

  .header-nav a {
    width: 100%;
    padding: 0.75rem 0;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border);
  }

  .header-nav .theme-switch {
    margin-top: 1rem;
  }
}

/* --- Theme Toggle --- */
.theme-switch {
  cursor: pointer;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  border-radius: var(--r-md);
  transition: background var(--tr-fast);
  font-size: 1.15rem;
  line-height: 1;
  color: var(--text-body);
}

.theme-switch:hover { background: var(--border); }

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: .75rem 1.75rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  border: 2px solid transparent;
  border-radius: var(--r-md);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--tr-fast), transform var(--tr-fast), box-shadow var(--tr-fast);
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--color-secondary);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: var(--color-secondary-hover);
  color: #FFFFFF;
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  color: var(--color-secondary);
  border-color: var(--color-secondary);
}

.btn-outline:hover {
  background: var(--color-secondary);
  color: #FFFFFF;
}

/* --- Hero --- */
.hero {
  background: var(--hero-bg);
  color: #FFFFFF;
  padding: 5rem var(--sp-lg);
}

.hero .container { max-width: 760px; }
.hero h1 { color: #FFFFFF; margin-bottom: var(--sp-lg); }
.hero p { color: rgba(255, 255, 255, .85); font-size: 1.1rem; max-width: 600px; }
.hero .btn { margin-top: var(--sp-xl); }

/* --- Cards --- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--sp-xl);
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--tr-base), transform var(--tr-base);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card h3 { margin-bottom: var(--sp-sm); }

/* --- Stats --- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-xl);
}

.stat { text-align: center; padding: var(--sp-xl) var(--sp-md); }

.stat-value {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.5rem);
  color: var(--color-secondary);
  display: block;
}

.stat-label {
  color: var(--text-body);
  font-size: .9rem;
  margin-top: var(--sp-xs);
  display: block;
}

/* --- Convictions --- */
.convictions { display: grid; gap: var(--sp-lg); }

.conviction {
  padding: var(--sp-lg) var(--sp-xl);
  border-left: 3px solid var(--color-secondary);
  background: var(--bg-elevated);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}

/* --- Bio --- */
.bio-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: var(--sp-2xl);
  align-items: start;
}

.bio-photo {
  width: 180px;
  height: 180px;
  object-fit: cover;
  mix-blend-mode: multiply;
}

[data-theme="dark"] .bio-photo {
  mix-blend-mode: lighten;
}

.bio-text h2 { margin-bottom: var(--sp-md); }

/* --- Contact --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2xl);
  align-items: start;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}

.contact-info a { font-weight: 600; }

.contact-item a {
  display: flex;
  align-content: center;
  align-items: center;
  gap: 5px;
}

/* --- Footer --- */
.footer {
  background: var(--bg-dark);
  color: rgba(255, 255, 255, .7);
  padding: var(--sp-xl) 0;
  font-size: .85rem;
  text-align: center;
}

.footer a { color: rgba(255, 255, 255, .85); }
.footer a:hover { color: #FFFFFF; }

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--sp-lg);
  margin-bottom: var(--sp-sm);
}

.footer-social {
  display: flex;
  gap: var(--sp-md);
  justify-content: center;
  margin: var(--sp-md) 0;
}

.footer-social a {
  color: var(--text-tertiary);
  transition: color var(--tr-base);
}

.footer-social a:hover {
  color: var(--color-secondary);
}

/* --- Accessibility --- */
:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 2px;
}

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

/* --- Responsive --- */
@media (max-width: 640px) {
  html { font-size: 15px; }
  .hero { padding: 3rem var(--sp-md); }
  .header-nav { gap: var(--sp-sm); }
  .header-nav a { font-size: .8rem; }
  .contact-grid { grid-template-columns: 1fr; }
  .bio-grid {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
}

@media (min-width: 1280px) {
  html { font-size: 17px; }
}
