/* ─── Design Tokens ─── */
:root {
  /* Type Scale */
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;

  /* Fonts */
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body: 'Satoshi', 'Inter', sans-serif;
}

/* ─── Dark Theme (Default) ─── */
:root, [data-theme="dark"] {
  --color-bg:             #0a0f1a;
  --color-surface:        #0f1524;
  --color-surface-2:      #141c2e;
  --color-surface-offset: #111829;
  --color-surface-dynamic: #1a2540;
  --color-divider:        #1e2a45;
  --color-border:         #253352;

  --color-text:           #e2e6ee;
  --color-text-muted:     #8a94a8;
  --color-text-faint:     #4f5b73;
  --color-text-inverse:   #0a0f1a;

  --color-primary:        #4da8b3;
  --color-primary-hover:  #3a8f9a;
  --color-primary-active: #2a7580;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.25);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.45);
}

/* ─── Light Theme ─── */
[data-theme="light"] {
  --color-bg:             #f4f6f9;
  --color-surface:        #ffffff;
  --color-surface-2:      #f8f9fb;
  --color-surface-offset: #edf0f4;
  --color-surface-dynamic: #e4e8ee;
  --color-divider:        #d4d9e2;
  --color-border:         #c0c7d4;

  --color-text:           #0f1729;
  --color-text-muted:     #586580;
  --color-text-faint:     #96a0b4;
  --color-text-inverse:   #f4f6f9;

  --color-primary:        #0e7a86;
  --color-primary-hover:  #096570;
  --color-primary-active: #065058;

  --shadow-sm: 0 1px 2px oklch(0.2 0.01 240 / 0.06);
  --shadow-md: 0 4px 12px oklch(0.2 0.01 240 / 0.08);
  --shadow-lg: 0 12px 32px oklch(0.2 0.01 240 / 0.12);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --color-bg:             #f4f6f9;
    --color-surface:        #ffffff;
    --color-surface-2:      #f8f9fb;
    --color-surface-offset: #edf0f4;
    --color-surface-dynamic: #e4e8ee;
    --color-divider:        #d4d9e2;
    --color-border:         #c0c7d4;
    --color-text:           #0f1729;
    --color-text-muted:     #586580;
    --color-text-faint:     #96a0b4;
    --color-text-inverse:   #f4f6f9;
    --color-primary:        #0e7a86;
    --color-primary-hover:  #096570;
    --color-primary-active: #065058;
    --shadow-sm: 0 1px 2px oklch(0.2 0.01 240 / 0.06);
    --shadow-md: 0 4px 12px oklch(0.2 0.01 240 / 0.08);
    --shadow-lg: 0 12px 32px oklch(0.2 0.01 240 / 0.12);
  }
}

/* ─── Layout ─── */
.container {
  width: 100%;
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.section {
  padding-block: clamp(var(--space-12), 8vw, var(--space-32));
}

/* ─── Header ─── */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: oklch(from var(--color-bg) l c h / 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-divider);
  padding-block: var(--space-4);
}

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

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
}

.header__logo-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.header__logo-text {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.header__nav a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}

.header__nav a:hover {
  color: var(--color-text);
}

.theme-toggle {
  color: var(--color-text-muted);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  color: var(--color-text);
  background: var(--color-surface-dynamic);
}

/* ─── Hero ─── */
.hero {
  min-height: 80vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, oklch(0.35 0.06 210 / 0.3), transparent);
}

.hero__bg::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to top, var(--color-bg), transparent);
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.hero__label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-6);
  display: inline-block;
}

.hero__title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 400;
  color: var(--color-text);
  margin-bottom: var(--space-6);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.hero__subtitle {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.7;
  max-width: 560px;
}

/* ─── Divider line ─── */
.divider {
  border: none;
  height: 1px;
  background: var(--color-divider);
  margin-inline: auto;
  max-width: var(--content-wide);
}

/* ─── About / Philosophy ─── */
.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: start;
}

.about__heading {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  color: var(--color-text);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

.about__body p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-4);
}

.about__body p:last-child {
  margin-bottom: 0;
}

/* ─── Focus Areas ─── */
.focus__heading {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  color: var(--color-text);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-10);
  text-align: center;
}

.focus__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.focus__card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  transition: border-color var(--transition-interactive),
              box-shadow var(--transition-interactive);
}

.focus__card:hover {
  border-color: var(--color-border);
  box-shadow: var(--shadow-md);
}

.focus__card-icon {
  width: 40px;
  height: 40px;
  color: var(--color-primary);
  margin-bottom: var(--space-5);
}

.focus__card-title {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.focus__card-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ─── Stats ─── */
.stats {
  background: var(--color-surface);
  border-top: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
}

.stats__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
  text-align: center;
}

.stats__number {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.stats__label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ─── Contact ─── */
.contact__inner {
  text-align: center;
  max-width: 600px;
  margin-inline: auto;
}

.contact__heading {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  color: var(--color-text);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

.contact__body {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-8);
}

.contact__links {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.contact__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-primary);
  text-decoration: none;
  padding: var(--space-3) var(--space-6);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-full);
  transition: background var(--transition-interactive),
              color var(--transition-interactive);
}

.contact__link:hover {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

.contact__link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ─── Footer ─── */
.footer {
  border-top: 1px solid var(--color-divider);
  padding-block: var(--space-8);
}

.footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer__text {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.footer__right {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

/* ─── Scroll Reveal ─── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ─── Mobile Navigation ─── */
.mobile-nav-toggle {
  display: none;
  color: var(--color-text);
  padding: var(--space-2);
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .container {
    padding-inline: var(--space-4);
  }

  .mobile-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .header__nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-divider);
    flex-direction: column;
    padding: var(--space-6);
    gap: var(--space-4);
  }

  .header__nav.open {
    display: flex;
  }

  .header__nav .theme-toggle {
    margin-top: var(--space-2);
  }

  .hero {
    min-height: 60vh;
  }

  .hero__title {
    font-size: var(--text-2xl);
  }

  .about__grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .focus__grid {
    grid-template-columns: 1fr;
  }

  .stats__grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .footer .container {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }
}
