/* ============================================
   Dagg Landing Page — Design Tokens & Styles
   Derived from Brand Guidelines v2.0
   ============================================ */

/* === Design Tokens === */
:root {
  /* Dark palette */
  --color-night: #1A1A2E;
  --color-predawn: #2C2C3A;
  --color-text-on-dark: #FFFFFF;
  --color-text-muted-dark: #C8C2B4;

  /* Light palette */
  --color-fog: #F5F2EC;
  --color-text-primary: #1A1A1A;
  --color-text-secondary: #8B8680;
  --color-border: #C8C2B4;

  /* Accent — used with extreme restraint */
  --color-forest: #4A7C59;
  --color-dew: #A8C5B8;
  --color-dawn: #D4A574;
  --color-signal: #E07A2F;

  /* Typography */
  --font-marketing: 'Inter', 'Source Sans 3', sans-serif;
  --font-product: 'Space Mono', monospace;

  --font-weight-light: 400;
  --font-weight-regular: 400;
  --font-weight-medium: 400;
  --font-weight-semibold: 700;

  /* Type scale */
  --text-hero: clamp(3rem, 6vw, 5.5rem);
  --text-section: clamp(2rem, 3.5vw, 3rem);
  --text-subsection: clamp(1.25rem, 2vw, 1.75rem);
  --text-body: 1.125rem;
  --text-body-small: 0.9375rem;
  --text-label: 0.8125rem;
  --text-stat: clamp(2.5rem, 4vw, 4rem);

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 3rem;
  --space-xl: 6rem;
  --space-2xl: 10rem;
  --space-3xl: 14rem;

  /* Borders */
  --border-subtle: 1px solid rgba(200, 194, 180, 0.25);
  --border-card: 1px solid #C8C2B4;

  /* Shadows */
  --shadow-subtle: 0 1px 3px rgba(26, 26, 46, 0.04);
  --shadow-image: 0 8px 32px rgba(26, 26, 46, 0.12);

  /* Motion */
  --duration-fade: 800ms;
  --duration-reveal: 1200ms;
  --duration-hover: 300ms;
  --duration-dot-pulse: 2000ms;
  --easing-default: cubic-bezier(0.25, 0.1, 0.25, 1);
  --easing-reveal: cubic-bezier(0.0, 0.0, 0.2, 1);
}


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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-product);
  font-weight: var(--font-weight-regular);
  font-size: var(--text-body);
  line-height: 1.7;
  color: var(--color-text-primary);
  background-color: var(--color-night);
}

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

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

button {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
}


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

.grain::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  opacity: 0.035;
  pointer-events: none;
  z-index: 1;
}


/* === Navigation === */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  z-index: 100;
  transition: background-color var(--duration-hover) var(--easing-default),
              border-color var(--duration-hover) var(--easing-default);
}

.nav--scrolled {
  background-color: var(--color-fog);
  border-bottom: var(--border-subtle);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  color: var(--color-text-on-dark);
  transition: color var(--duration-hover) var(--easing-default);
  display: flex;
  align-items: center;
}

.nav--scrolled .logo {
  color: var(--color-text-primary);
}

.logo-mark {
  height: 24px;
  width: auto;
}

.logo-dot {
}

.nav-links {
  display: flex;
  gap: var(--space-lg);
}

.nav-links a {
  font-family: var(--font-product);
  font-weight: var(--font-weight-medium);
  font-size: var(--text-label);
  color: var(--color-text-muted-dark);
  transition: color var(--duration-hover) var(--easing-default);
}

.nav-links a:hover {
  color: var(--color-text-on-dark);
}

.nav--scrolled .nav-links a {
  color: var(--color-text-secondary);
}

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

/* Focus states */
.nav-links a:focus-visible,
.logo:focus-visible,
.btn-primary:focus-visible {
  outline: 2px solid var(--color-forest);
  outline-offset: 2px;
}

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.nav-hamburger span {
  display: block;
  width: 20px;
  height: 1px;
  background-color: var(--color-text-on-dark);
  transition: background-color var(--duration-hover) var(--easing-default),
              transform var(--duration-hover) var(--easing-default),
              opacity var(--duration-hover) var(--easing-default);
}

.nav--scrolled .nav-hamburger span {
  background-color: var(--color-text-primary);
}

.nav-hamburger.active span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-hamburger.active span:nth-child(2) {
  opacity: 0;
}
.nav-hamburger.active span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Mobile menu overlay */
.mobile-menu {
  position: fixed;
  inset: 0;
  background-color: var(--color-night);
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-fade) var(--easing-default);
}

.mobile-menu.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}

.mobile-menu a {
  font-family: var(--font-product);
  font-weight: var(--font-weight-medium);
  font-size: var(--text-section);
  color: var(--color-text-on-dark);
}

.mobile-menu a:hover {
  color: var(--color-text-muted-dark);
}


/* === Hero === */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--color-night) url('assets/mood%20images/frame3_mod.jpg') center center / cover no-repeat;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(26, 26, 46, 0.55), rgba(26, 26, 46, 0.8));
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: var(--space-md);
  max-width: 960px;
  font-family: var(--font-product);
}

.hero-tagline {
  font-family: var(--font-product);
  font-size: clamp(0.875rem, 1.5vw, 1.25rem);
  font-weight: var(--font-weight-regular);
  color: var(--color-text-muted-dark);
  margin-top: var(--space-lg);
  letter-spacing: 0.02em;
  opacity: 0;
  animation: hero-reveal var(--duration-reveal) var(--easing-reveal) 400ms forwards;
}

.hero-divider {
  border: none;
  border-top: 1px solid rgba(200, 194, 180, 0.25);
  width: 100%;
  max-width: 480px;
  margin: var(--space-lg) auto;
  opacity: 0;
  animation: hero-reveal var(--duration-reveal) var(--easing-reveal) 600ms forwards;
}

.hero-cta-label {
  font-family: var(--font-product);
  font-size: var(--text-body-small);
  font-weight: var(--font-weight-regular);
  color: var(--color-text-secondary);
  text-decoration: none;
  opacity: 0;
  animation: hero-reveal var(--duration-reveal) var(--easing-reveal) 800ms forwards;
  transition: color var(--duration-hover) var(--easing-default);
}

.hero-cta-label:hover {
  color: var(--color-text-primary);
}

@keyframes hero-reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 1px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.3);
  animation: scroll-fade 2.5s var(--easing-default) infinite;
}

@keyframes scroll-fade {
  0%, 100% { opacity: 0; }
  40%, 60% { opacity: 1; }
}


/* === Sections === */
.section {
  position: relative;
}

.section-light {
  background-color: var(--color-fog);
  padding: var(--space-2xl) 0;
}

.section-dark {
  background-color: var(--color-night);
  padding: var(--space-2xl) 0;
}

.section-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}


/* === Scroll Reveal === */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--duration-fade) var(--easing-reveal),
              transform var(--duration-fade) var(--easing-reveal);
}

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

.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 200ms; }
.reveal-delay-3 { transition-delay: 300ms; }
.reveal-delay-4 { transition-delay: 400ms; }


/* === Philosophy Section === */
.section-philosophy h2 {
  font-family: var(--font-product);
  font-size: var(--text-section);
  font-weight: var(--font-weight-light);
  font-style: italic;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
  max-width: 38em;
  margin-bottom: var(--space-lg);
}

.section-philosophy p {
  max-width: 38em;
  color: var(--color-text-primary);
  margin-bottom: var(--space-md);
}

.section-philosophy p:last-of-type {
  margin-bottom: 0;
}

.etymology {
  font-size: var(--text-body);
  color: var(--color-text-secondary);
  font-style: italic;
  font-variant: small-caps;
  letter-spacing: 0.03em;
  text-align: center;
  margin-top: var(--space-xl);
  margin-bottom: 0;
  margin-left: auto;
  margin-right: auto;
  padding-top: var(--space-md);
  padding-bottom: var(--space-md);
  border-top: var(--border-subtle);
  border-bottom: var(--border-subtle);
  max-width: 24em;
}


/* === Product Section === */
.section-product {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: center;
}

.product-label {
  font-family: var(--font-product);
  font-size: var(--text-label);
  color: var(--color-text-secondary);
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: var(--space-sm);
}

.product-text h2 {
  font-family: var(--font-product);
  font-size: var(--text-section);
  font-weight: var(--font-weight-semibold);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
  margin-bottom: var(--space-md);
}

.product-text p {
  max-width: 38em;
  color: var(--color-text-primary);
}


/* === App Mockup === */
.app-mockup {
  max-width: 320px;
  margin: 0 auto;
  border-radius: 32px;
  overflow: hidden;
  border: 2px solid var(--color-text-primary);
  box-shadow: 0 12px 48px rgba(26, 26, 46, 0.18);
}

.app-mockup img {
  width: 100%;
  height: auto;
  display: block;
  filter: saturate(0.85) contrast(1.05);
}


/* === Atmospheric Break === */
.section-atmospheric {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--color-predawn) url('assets/mood%20images/frame5_mod.png') center center / cover no-repeat;
}

.section-atmospheric-2 {
  min-height: 100vh;
  background-image: url('assets/mood%20images/frame6_mod.png');
}

.atmospheric-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(26, 26, 46, 0.4), rgba(26, 26, 46, 0.6));
  z-index: 1;
}

.pull-quote {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 32em;
  padding: var(--space-2xl) var(--space-md);
}

.pull-quote p {
  font-family: var(--font-product);
  font-size: var(--text-section);
  font-weight: var(--font-weight-light);
  font-style: italic;
  line-height: 1.15;
  color: var(--color-text-muted-dark);
}


/* === Feature Cards === */
.section-features .section-inner {
  max-width: 960px;
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.feature-card {
  border: var(--border-card);
  padding: var(--space-lg);
  background: transparent;
}

.feature-label {
  font-family: var(--font-product);
  font-size: var(--text-label);
  color: var(--color-text-secondary);
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: var(--space-sm);
}

.feature-card h3 {
  font-family: var(--font-product);
  font-size: var(--text-subsection);
  font-weight: var(--font-weight-semibold);
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
  margin-bottom: var(--space-xs);
}

.feature-card p {
  font-size: var(--text-body-small);
  color: var(--color-text-primary);
  max-width: 38em;
}


/* === Anti-features Section === */
.section-anti {
  text-align: left;
}

.section-anti h2 {
  font-family: var(--font-product);
  font-size: var(--text-section);
  font-weight: var(--font-weight-light);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--color-text-on-dark);
  margin-bottom: var(--space-lg);
}

.anti-features {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.anti-item {
  display: block;
  font-size: var(--text-body);
  line-height: 2;
  color: var(--color-text-muted-dark);
  text-decoration: line-through;
}

.anti-closing {
  color: var(--color-text-on-dark);
  margin-top: var(--space-lg);
}


/* === CTA Section === */
.section-cta {
  background-color: var(--color-night);
  padding: var(--space-3xl) 0;
  text-align: center;
  border-top: var(--border-subtle);
}

.cta-content h2 {
  font-family: var(--font-product);
  font-size: var(--text-section);
  font-weight: var(--font-weight-light);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--color-text-on-dark);
  margin-bottom: var(--space-sm);
}

.cta-content > p {
  font-size: var(--text-body);
  color: var(--color-text-muted-dark);
  margin-bottom: var(--space-lg);
}

.btn-primary {
  display: inline-block;
  font-family: var(--font-product);
  font-weight: var(--font-weight-medium);
  font-size: var(--text-body-small);
  color: var(--color-text-primary);
  background-color: #FFFFFF;
  padding: 1rem 2.5rem;
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: background-color var(--duration-hover) var(--easing-default);
}

.btn-primary:hover {
  background-color: var(--color-fog);
}

.platform-note {
  display: block;
  font-size: var(--text-label);
  color: var(--color-text-muted-dark);
  margin-top: var(--space-md);
}


/* === Waitlist Form === */
.waitlist-form {
  max-width: 480px;
  margin: 0 auto;
}

.waitlist-input-group {
  display: flex;
  gap: 0;
}

#waitlist-email {
  flex: 1;
  font-family: var(--font-product);
  font-size: var(--text-body-small);
  color: var(--color-text-on-dark);
  background-color: var(--color-predawn);
  border: 1px solid var(--color-border);
  border-right: none;
  padding: 1rem 1.25rem;
  outline: none;
  transition: border-color var(--duration-hover) var(--easing-default);
}

#waitlist-email::placeholder {
  color: var(--color-text-secondary);
}

#waitlist-email:focus {
  border-color: var(--color-text-on-dark);
}

.waitlist-input-group .btn-primary {
  flex-shrink: 0;
  border: 1px solid #FFFFFF;
}

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

.waitlist-status {
  font-size: var(--text-label);
  color: var(--color-signal);
  margin-top: var(--space-sm);
  min-height: 1.5em;
}

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

.waitlist-success-message {
  font-family: var(--font-product);
  font-size: var(--text-subsection);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-on-dark);
  margin-bottom: var(--space-xs);
}


/* === Footer === */
.footer {
  background-color: var(--color-night);
  padding: var(--space-xl) 0;
  border-top: var(--border-subtle);
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-logo {
  color: var(--color-text-muted-dark);
  display: flex;
  align-items: center;
}

.footer-logo .logo-mark {
  height: 16px;
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
}

.footer-links a {
  font-size: var(--text-label);
  color: var(--color-text-muted-dark);
  transition: color var(--duration-hover) var(--easing-default);
}

.footer-links a:hover {
  color: var(--color-text-on-dark);
}

.footer-copyright {
  font-size: var(--text-label);
  color: var(--color-text-muted-dark);
}


/* === Responsive === */

/* Tablet */
@media (max-width: 960px) {
  .section-light,
  .section-dark {
    padding: var(--space-xl) 0;
  }

  .section-product {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .app-mockup {
    max-width: 260px;
  }

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

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

/* Mobile */
@media (max-width: 600px) {
  .nav-links {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }

  .section-cta {
    padding: var(--space-xl) 0;
  }

  .btn-primary {
    display: block;
    width: calc(100% - var(--space-md) * 2);
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
  }

  .waitlist-input-group {
    flex-direction: column;
  }

  #waitlist-email {
    border-right: 1px solid var(--color-border);
    border-bottom: none;
  }

  .waitlist-form {
    max-width: 400px;
    width: calc(100% - var(--space-md) * 2);
  }

  .waitlist-input-group .btn-primary {
    width: 100%;
  }

  .pull-quote {
    padding: var(--space-xl) var(--space-md);
  }

  .section-atmospheric {
    min-height: 40vh;
  }

  .footer-links {
    gap: var(--space-md);
  }
}


/* === Accessibility: Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .hero-tagline,
  .hero-divider,
  .hero-cta-label {
    opacity: 1;
    animation: none;
  }

  .scroll-indicator {
    animation: none;
    opacity: 0.3;
  }

  html {
    scroll-behavior: auto;
  }
}
