/* ============================================
   HARDWON FOUNDATION — STYLE
   Dark-first. Bold. Unapologetic.
   ============================================ */

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

html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  hanging-punctuation: first last;
}

/* --- 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);
  --text-hero: clamp(3rem,     0.5rem  + 7vw,    8rem);

  /* Spacing (4px system) */
  --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;

  /* Fonts */
  --font-display: 'Clash Display', 'Arial Black', sans-serif;
  --font-body: 'Satoshi', 'Helvetica Neue', sans-serif;

  /* Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-full: 9999px;

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

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

/* --- DARK THEME (DEFAULT) --- */
[data-theme="dark"] {
  --color-bg: #0a0a0a;
  --color-surface: #111111;
  --color-surface-2: #181818;
  --color-border: #252525;
  --color-text: #e8e6e1;
  --color-text-muted: #8a8880;
  --color-text-faint: #4a4940;
  --color-accent: #e0e0e0;
  --color-accent-hover: #ffffff;
  --color-accent-muted: rgba(255, 255, 255, 0.08);
}

/* --- LIGHT THEME --- */
[data-theme="light"] {
  --color-bg: #f2f1ed;
  --color-surface: #e8e7e2;
  --color-surface-2: #dddcd7;
  --color-border: #c4c3be;
  --color-text: #0a0a0a;
  --color-text-muted: #5a5950;
  --color-text-faint: #9a998f;
  --color-accent: #1a1a1a;
  --color-accent-hover: #000000;
  --color-accent-muted: rgba(0, 0, 0, 0.06);
}

/* System preference fallback */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0a0a0a;
    --color-surface: #111111;
    --color-surface-2: #181818;
    --color-border: #252525;
    --color-text: #e8e6e1;
    --color-text-muted: #8a8880;
    --color-text-faint: #4a4940;
    --color-accent: #e0e0e0;
    --color-accent-hover: #ffffff;
    --color-accent-muted: rgba(255, 255, 255, 0.08);
  }
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --color-bg: #f2f1ed;
    --color-surface: #e8e7e2;
    --color-surface-2: #dddcd7;
    --color-border: #c4c3be;
    --color-text: #0a0a0a;
    --color-text-muted: #5a5950;
    --color-text-faint: #9a998f;
    --color-accent: #1a1a1a;
    --color-accent-hover: #000000;
    --color-accent-muted: rgba(0, 0, 0, 0.06);
  }
}

/* --- BODY --- */
body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

/* Subtle noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4, h5, h6 { text-wrap: balance; line-height: 1.1; }
p, li, figcaption { text-wrap: pretty; max-width: 72ch; }

::selection {
  background: var(--color-accent);
  color: var(--color-bg);
}

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

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

button { cursor: pointer; background: none; border: none; }

a, button, [role="button"], input, textarea, select {
  transition: color var(--transition-fast),
              background var(--transition-fast),
              border-color var(--transition-fast),
              box-shadow var(--transition-fast),
              opacity var(--transition-fast);
}

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

/* --- TOP BAR --- */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: var(--space-5) var(--space-6);
  background: transparent;
}

.top-bar__inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.logo__icon {
  width: 28px;
  height: 28px;
  color: var(--color-accent);
  flex-shrink: 0;
}

.logo__text {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--color-text);
}

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

.theme-toggle:hover {
  color: var(--color-text);
  background: var(--color-accent-muted);
}

/* --- HERO --- */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: var(--space-32) var(--space-6) var(--space-16);
}

.hero__content {
  max-width: var(--content-wide);
  margin: 0 auto;
  width: 100%;
}

.hero__rule {
  width: 48px;
  height: 3px;
  background: var(--color-accent);
  margin-bottom: var(--space-6);
  opacity: 0;
  animation: fadeUp 600ms cubic-bezier(0.16, 1, 0.3, 1) 100ms forwards;
}

.hero__label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
  opacity: 0;
  animation: fadeUp 800ms cubic-bezier(0.16, 1, 0.3, 1) 200ms forwards;
}

.hero__heading {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: 700;
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.hero__line {
  display: block;
  opacity: 0;
  animation: fadeUp 800ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero__line:nth-child(1) { animation-delay: 400ms; }
.hero__line:nth-child(2) { animation-delay: 600ms; }
.hero__line:nth-child(3) { animation-delay: 900ms; }

.hero__line--accent {
  color: var(--color-accent);
}

/* --- ABOUT --- */
.about {
  padding: clamp(var(--space-16), 10vw, var(--space-32)) var(--space-6);
}

.about__inner {
  max-width: var(--content-default);
  margin: 0 auto;
}

.section-label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-8);
}

.about__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.about__lead {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  line-height: 1.3;
  color: var(--color-text);
}

.about__text p:not(.about__lead) {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* --- DIVIDER --- */
.divider {
  max-width: var(--content-default);
  margin: 0 auto;
  height: 1px;
  background: var(--color-border);
  margin-left: var(--space-6);
  margin-right: var(--space-6);
}

@media (min-width: 768px) {
  .divider {
    margin-left: auto;
    margin-right: auto;
  }
}

/* --- CTA SECTION --- */
.cta-section {
  padding: clamp(var(--space-16), 10vw, var(--space-32)) var(--space-6);
  text-align: center;
}

.cta__inner {
  max-width: var(--content-narrow);
  margin: 0 auto;
}

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

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

.cta__button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-bg);
  background: var(--color-accent);
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-sm);
}

.cta__button:hover {
  background: var(--color-accent-hover);
}

.cta__button svg {
  display: inline-block;
  transition: transform var(--transition-fast);
}

.cta__button:hover svg {
  transform: translateX(4px);
}

.cta__buttons {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
}

.cta__button--outline {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-accent);
  background: transparent;
  border: 1.5px solid var(--color-border);
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-sm);
}

.cta__button--outline:hover {
  border-color: var(--color-accent);
  background: var(--color-accent-muted);
}

.cta__button--outline svg {
  display: inline-block;
}

.cta__email {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  letter-spacing: 0.05em;
}

/* --- FOOTER --- */
.footer {
  padding: var(--space-16) var(--space-6) var(--space-8);
  border-top: 1px solid var(--color-border);
}

.footer__inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  text-align: center;
}

.footer__tagline {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

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

/* --- SCROLL HINT --- */
.hero__scroll-hint {
  position: absolute;
  bottom: var(--space-8);
  left: var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-faint);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0;
  animation: fadeUp 800ms cubic-bezier(0.16, 1, 0.3, 1) 1400ms forwards;
}

.hero__scroll-hint svg {
  animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* --- ANIMATIONS --- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll-triggered reveal elements */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Stagger children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0ms; opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 120ms; opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 240ms; opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 360ms; opacity: 1; transform: translateY(0); }

/* --- RESPONSIVE --- */
@media (max-width: 640px) {
  .hero {
    padding-top: var(--space-24);
    padding-bottom: var(--space-12);
    min-height: 90dvh;
  }

  .hero__scroll-hint {
    display: none;
  }

  .hero__heading {
    font-size: clamp(2.4rem, 0.5rem + 8vw, 4rem);
  }

  .logo__icon {
    width: 24px;
    height: 24px;
  }

  .logo__text {
    font-size: var(--text-xs);
  }

  .cta__button,
  .cta__button--outline {
    width: 100%;
    justify-content: center;
    padding: var(--space-4) var(--space-6);
  }

  .cta__buttons {
    flex-direction: column;
  }
}

@media (min-width: 1400px) {
  .hero__content {
    padding-left: var(--space-8);
  }
}
