/* style.css — Waking Life 2027 — Earth & Ember Design System */

/* ─── FONTS ─── */
@import url('https://api.fontshare.com/v2/css?f[]=zodiak@400,500,700&f[]=satoshi@300,400,500,700&display=swap');

/* ─── 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);
  --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;

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

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

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

  /* Font Families */
  --font-display: 'Zodiak', 'Georgia', serif;
  --font-body: 'Satoshi', 'Inter', sans-serif;
}

/* ─── DARK MODE (DEFAULT) ─── */
:root, [data-theme="dark"] {
  --color-bg: #0F0E0C;
  --color-surface: #1A1816;
  --color-surface-2: #242220;
  --color-text: #E8E0D4;
  --color-text-muted: #8A8278;
  --color-text-faint: #5A564F;
  --color-accent: #D4883A;
  --color-accent-hover: #E09A4E;
  --color-secondary: #4F9E88;
  --color-border: #333028;
  --color-overlay: rgba(15, 14, 12, 0.7);
  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.2);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.3);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.4);
}

/* ─── LIGHT MODE ─── */
[data-theme="light"] {
  --color-bg: #F5F0E8;
  --color-surface: #EDE7DB;
  --color-surface-2: #E4DDD0;
  --color-text: #2A2520;
  --color-text-muted: #7A7168;
  --color-text-faint: #A09688;
  --color-accent: #C4762C;
  --color-accent-hover: #A8621F;
  --color-secondary: #2D6B5A;
  --color-border: #D4CFC5;
  --color-overlay: rgba(245, 240, 232, 0.7);
  --shadow-sm: 0 1px 2px oklch(0.2 0.01 80 / 0.06);
  --shadow-md: 0 4px 12px oklch(0.2 0.01 80 / 0.08);
  --shadow-lg: 0 12px 32px oklch(0.2 0.01 80 / 0.12);
}

/* ─── GLOBAL TYPOGRAPHY ─── */
h1, h2, h3, .display {
  font-family: var(--font-display);
}

h1 {
  font-size: var(--text-hero);
  font-weight: 500;
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--text-2xl);
  font-weight: 500;
  letter-spacing: -0.015em;
}

h3 {
  font-size: var(--text-xl);
  font-weight: 400;
}

.subtitle {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 300;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

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

a {
  color: var(--color-accent);
  text-decoration: none;
}
a:hover {
  color: var(--color-accent-hover);
}

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

@media (min-width: 768px) {
  .container { padding-inline: var(--space-10); }
}

section {
  position: relative;
  padding-block: clamp(var(--space-16), 10vw, var(--space-32));
}

/* ─── THEME TOGGLE ─── */
.theme-toggle {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 100;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--color-surface) 70%, transparent);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background var(--transition-interactive),
              color var(--transition-interactive),
              border-color var(--transition-interactive);
}
.theme-toggle:hover {
  color: var(--color-text);
  border-color: var(--color-accent);
}

/* ─── HERO SECTION ─── */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding-block: 0;
}

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

.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 14, 12, 0.3) 0%,
    rgba(15, 14, 12, 0.4) 40%,
    rgba(15, 14, 12, 0.75) 80%,
    rgba(15, 14, 12, 0.9) 100%
  );
  z-index: 1;
}

[data-theme="light"] .hero__overlay {
  background: linear-gradient(
    180deg,
    rgba(42, 37, 32, 0.2) 0%,
    rgba(42, 37, 32, 0.3) 40%,
    rgba(42, 37, 32, 0.6) 80%,
    rgba(42, 37, 32, 0.8) 100%
  );
}

.hero__content {
  position: relative;
  z-index: 2;
  padding-inline: var(--space-6);
}

.hero__logo {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-8);
  color: var(--color-text);
  opacity: 0.8;
}

.hero h1 {
  color: #E8E0D4;
  margin-bottom: var(--space-4);
  text-shadow: 0 2px 40px rgba(0,0,0,0.4);
}

[data-theme="light"] .hero h1 {
  color: #F5F0E8;
}

.hero .subtitle {
  color: rgba(232, 224, 212, 0.7);
  font-size: var(--text-lg);
  max-width: 36ch;
  margin-inline: auto;
}

[data-theme="light"] .hero .subtitle {
  color: rgba(245, 240, 232, 0.8);
}

.scroll-indicator {
  position: absolute;
  bottom: var(--space-10);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: rgba(232, 224, 212, 0.5);
  animation: scroll-pulse 2s ease-in-out infinite;
}

@keyframes scroll-pulse {
  0%, 100% { opacity: 0.4; transform: translateX(-50%) translateY(0); }
  50% { opacity: 0.8; transform: translateX(-50%) translateY(8px); }
}

/* ─── ORIGIN SECTION ─── */
.origin {
  position: relative;
  overflow: hidden;
}

.origin__texture {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.06;
}

.origin__texture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.origin__content {
  position: relative;
  z-index: 1;
  max-width: var(--content-narrow);
  margin-inline: auto;
}

blockquote {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  font-style: italic;
  color: var(--color-text);
  line-height: 1.4;
  margin-bottom: var(--space-8);
  padding-left: var(--space-6);
  border-left: 2px solid var(--color-accent);
  max-width: 50ch;
}

.transition-phrase {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-accent);
  font-weight: 500;
  margin-top: var(--space-8);
}

/* ─── IMAGE SECTIONS ─── */
.image-section {
  position: relative;
  overflow: hidden;
}

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

.image-section__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-section__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 14, 12, 0.55) 0%,
    rgba(15, 14, 12, 0.7) 50%,
    rgba(15, 14, 12, 0.85) 100%
  );
  z-index: 1;
}

[data-theme="light"] .image-section__overlay {
  background: linear-gradient(
    180deg,
    rgba(42, 37, 32, 0.4) 0%,
    rgba(42, 37, 32, 0.55) 50%,
    rgba(42, 37, 32, 0.75) 100%
  );
}

.image-section__content {
  position: relative;
  z-index: 2;
}

.image-section h2,
.image-section .subtitle {
  color: #E8E0D4;
}

[data-theme="light"] .image-section h2,
[data-theme="light"] .image-section .subtitle {
  color: #F5F0E8;
}

.image-section p {
  color: rgba(232, 224, 212, 0.75);
}

[data-theme="light"] .image-section p {
  color: rgba(245, 240, 232, 0.8);
}

.image-section .closing {
  color: rgba(232, 224, 212, 0.6);
}

[data-theme="light"] .image-section .closing {
  color: rgba(245, 240, 232, 0.7);
}

/* ─── BULLET CARDS ─── */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  margin-block: var(--space-8);
}

@media (min-width: 768px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}

.bullet-card {
  background: rgba(26, 24, 22, 0.5);
  border: 1px solid rgba(51, 48, 40, 0.5);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  backdrop-filter: blur(8px);
  transition: border-color var(--transition-interactive),
              transform var(--transition-interactive);
}

[data-theme="light"] .bullet-card {
  background: rgba(237, 231, 219, 0.5);
  border-color: rgba(212, 207, 197, 0.5);
}

.bullet-card__icon {
  width: 40px;
  height: 40px;
  margin-bottom: var(--space-4);
  color: var(--color-accent);
}

.bullet-card__text {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 400;
  color: #E8E0D4;
  line-height: 1.35;
}

[data-theme="light"] .bullet-card__text {
  color: #F5F0E8;
}

/* ─── RITUAL SPLIT LAYOUT ─── */
.ritual-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .ritual-split {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
}

.ritual-split__image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16/10;
}

.ritual-split__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ─── GUARDIAN CARDS ─── */
.guardian-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  margin-block: var(--space-8);
}

@media (min-width: 640px) {
  .guardian-grid { grid-template-columns: repeat(2, 1fr); }
}

.guardian-card {
  background: rgba(26, 24, 22, 0.45);
  border: 1px solid rgba(79, 158, 136, 0.15);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-6);
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
}

[data-theme="light"] .guardian-card {
  background: rgba(237, 231, 219, 0.5);
  border-color: rgba(45, 107, 90, 0.2);
}

.guardian-card::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, rgba(79, 158, 136, 0.12) 0%, transparent 70%);
  border-radius: var(--radius-full);
  pointer-events: none;
}

.guardian-card__text {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 400;
  color: #E8E0D4;
  line-height: 1.35;
}

[data-theme="light"] .guardian-card__text {
  color: #F5F0E8;
}

/* ─── MANIFESTO / WHAT AWAKENS ─── */
.manifesto {
  text-align: center;
  padding-block: clamp(var(--space-16), 12vw, var(--space-32));
}

.manifesto h2 {
  margin-bottom: var(--space-12);
}

.manifesto__line {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.25;
  margin-bottom: var(--space-8);
  max-width: 20ch;
  margin-inline: auto;
}

.manifesto__closing {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-top: var(--space-12);
  font-style: italic;
  max-width: 40ch;
  margin-inline: auto;
}

.manifesto__final {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-accent);
  font-weight: 500;
  margin-top: var(--space-10);
  max-width: 36ch;
  margin-inline: auto;
  line-height: 1.3;
}

/* ─── FOOTER ─── */
.footer {
  text-align: center;
  padding-block: var(--space-12);
  border-top: 1px solid var(--color-border);
}

.footer__logo {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-6);
  color: var(--color-text-faint);
  opacity: 0.6;
}

.footer__info {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  margin-inline: auto;
}

.footer__link {
  font-size: var(--text-sm);
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer__link:hover {
  color: var(--color-accent-hover);
}

/* ─── SCROLL ANIMATIONS ─── */
.fade-in {
  opacity: 1;
}

@supports (animation-timeline: scroll()) {
  .fade-in {
    opacity: 0;
    animation: reveal-fade linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 100%;
  }
}

@keyframes reveal-fade {
  to { opacity: 1; }
}

.reveal-up {
  opacity: 1;
}

@supports (animation-timeline: scroll()) {
  .reveal-up {
    clip-path: inset(100% 0 0 0);
    opacity: 0;
    animation: reveal-clip linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 90%;
  }
}

@keyframes reveal-clip {
  to {
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }
}

/* Staggered manifesto lines */
.manifesto__line:nth-child(1) { --stagger: 0; }
.manifesto__line:nth-child(2) { --stagger: 1; }
.manifesto__line:nth-child(3) { --stagger: 2; }

@supports (animation-timeline: scroll()) {
  .manifesto__line {
    opacity: 0;
    clip-path: inset(100% 0 0 0);
    animation: reveal-clip linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 100%;
  }
}

/* Section title reveals */
.section-header {
  margin-bottom: var(--space-4);
}

.closing {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-faint);
  font-style: italic;
  margin-top: var(--space-8);
  letter-spacing: 0.01em;
}

/* ─── SEPARATOR LINE ─── */
.section-sep {
  width: 48px;
  height: 1px;
  background: var(--color-accent);
  opacity: 0.4;
  margin-block: var(--space-8);
  border: none;
}

.section-sep--center {
  margin-inline: auto;
}

/* ─── RESPONSIVE REFINEMENTS ─── */
@media (max-width: 639px) {
  .hero h1 {
    font-size: clamp(2.5rem, 0.5rem + 8vw, 4rem);
  }
  .manifesto__line {
    font-size: var(--text-xl);
    max-width: 16ch;
  }
  blockquote {
    font-size: var(--text-lg);
  }
}

@media (min-width: 1440px) {
  .container {
    max-width: 1320px;
  }
}

/* ─── FLOW LINK ─── */
.flow-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: rgba(212, 136, 58, 0.6);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color var(--transition-interactive),
              gap var(--transition-interactive);
}

.flow-link:hover {
  color: var(--color-accent);
  gap: var(--space-3);
}
