/* Strict palette-only implementation: Forest Green, Morning Glory, Olivetone */
/* Typography system: Space Grotesk (Architect), Sora (Human), Satoshi (Whisper) */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');
@import url('https://api.fontshare.com/v2/css?f[]=satoshi@300,400,500,700&display=swap');

:root {
  --fg: #006400; /* Forest Green - Structure */
  --mg: #7DC5C4; /* Morning Glory - Air */
  --ol: #6B8E23; /* Olivetone - Earth */
  --wb: #F5F1E6; /* Warm Beige - Light */
  --nt: #003D38; /* Navy Teal - Depth */

  /* Font role variables */
  --font-architect: 'Space Grotesk', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --font-human: 'Sora', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --font-whisper: 'Satoshi', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  /* Global body is the Whisperer: Satoshi */
  font-family: var(--font-whisper);
  font-weight: 400;
  line-height: 1.5; /* Whisper default */
  letter-spacing: -0.01em; /* tight readability */
  background: var(--nt); /* Navy Teal for depth */
  color: var(--ol); /* default text color — still within palette */
  position: relative;
}

/* Paper Grain Texture Overlay — The soul of real paper */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200"><defs><filter id="paperGrain"><feTurbulence type="fractalNoise" baseFrequency="0.04" numOctaves="5" result="noise" seed="1"/><feDiffuseLighting in="noise" lighting-color="%23F5F1E6" surfaceScale="1"><feDistantLight azimuth="45" elevation="60"/></feDiffuseLighting></filter></defs><rect width="100%" height="100%" filter="url(%23paperGrain)" opacity="0.01"/></svg>');
  pointer-events: none;
  z-index: -1;
  mix-blend-mode: multiply;
}

/* Role utilities — assign by intent, keep code simple */
.font-architect { /* Space Grotesk — The Architect */
  font-family: var(--font-architect);
  line-height: 1.2;
  letter-spacing: 0.02em; /* for structure/caps */
  font-weight: 600;
}
.font-human { /* Sora — The Human */
  font-family: var(--font-human);
  line-height: 1.2;
  letter-spacing: normal;
  font-weight: 500;
}
.font-whisper { /* Satoshi — The Whisperer */
  font-family: var(--font-whisper);
  line-height: 1.5;
  letter-spacing: -0.01em;
  font-weight: 400;
}

/* Optional size helpers matching roles */
.size-hero { font-size: clamp(3rem, 8vw, 8rem); font-weight: 700; }
.size-headline { font-size: clamp(2rem, 5vw, 4rem); font-weight: 600; }
.size-subline { font-size: clamp(0.9rem, 2vw, 1.3rem); }

/* Accent utility to intentionally mix one word within a line */
.accent-human { font-family: var(--font-human); font-weight: 600; }

/* Base hero stack */
.hero {
  display: block;
}

/* Each reveal section owns full viewport height to stage the reveal */
.reveal-section {
  position: relative;
  height: 100vh;
  overflow: hidden; /* keep content clipped */
}

/* The frame is sticky to create a parallax-like stage without JS */
.reveal-frame {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
}

/* Photo layer fills the frame */
.photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* No filters or extra colors to stay within constraints */
}

/* Overlay: the solid architectural panel that will slide up */
.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 6rem 2rem;
  border: none;
  box-shadow: none; /* explicitly no shadows */
  transform: translateY(0%);
  will-change: transform;
  /* Scroll-driven animation powered by CSS View Timelines when supported */
  animation: none;
}

/* Hero type assignments */
.overlay h1 {
  margin: 0 0 1rem 0;
  font-family: var(--font-architect);
  font-weight: 700; /* 600–700 allowed; 700 for hero */
  font-size: clamp(4rem, 10vw, 8rem);
  line-height: 1.2;
  letter-spacing: 0.02em; /* subtle structure */
}

.overlay p {
  margin: 0;
  font-family: var(--font-whisper);
  font-weight: 500;
  font-size: clamp(0.875rem, 1.2vw, 1.125rem);
  letter-spacing: -0.01em;
  line-height: 1.5;
}

/* Palette assignments */
.overlay--fg { background: var(--fg); color: var(--mg); }
.overlay--fg h1, .overlay--fg p { color: var(--mg); }

.overlay--mg { background: var(--mg); color: var(--fg); }
.overlay--mg h1, .overlay--mg p { color: var(--fg); }

.overlay--ol { background: var(--ol); color: var(--mg); }
.overlay--ol h1, .overlay--ol p { color: var(--mg); }

/* CSS-only scroll reveal
   Use scroll-timeline where supported (Chrome/Edge/Opera).
   Fallback: overlays remain static if unsupported.
*/
@supports (animation-timeline: view()) or (-webkit-animation-timeline: view()) {
  .reveal-section {
    view-timeline-name: --reveal;
    view-timeline-axis: block;
  }

  .overlay {
    animation-name: curtain-up;
    animation-duration: 1ms; /* duration is ignored; timeline drives progress */
    animation-timing-function: linear;
    animation-timeline: --reveal;
    animation-range: entry 0% cover 100%;
  }

  @keyframes curtain-up {
    from { transform: translateY(0%); }
    to   { transform: translateY(-100%); }
  }
}

/* Desktop layout option: 1x3 panel grid preview (no hover, no interaction). 
   We retain vertical scroll staging as primary experience. */
@media (min-width: 1024px) {
  .overlay h1 {
    font-size: clamp(6rem, 8vw, 10rem);
  }
}

/* Philosophy Section — architectural continuation, pure typography */
.philosophy {
  /* Use palette-only background; choose Morning Glory to soften from hero */
  background: var(--mg);
  padding: 15vh 2rem; /* generous vertical spacing */
}

.philosophy__inner {
  max-width: 60ch; /* museum-plaque readable width */
  margin: 0 auto;
  text-align: center;
}

.philosophy__title {
  margin: 0 0 1rem 0;
  font-family: var(--font-human);
  font-weight: 600;
  font-size: clamp(2.5rem, 6vw, 4rem); /* target: 4rem on large */
  color: var(--ol); /* Olivetone */
  letter-spacing: normal;
  line-height: 1.2;
}

.philosophy__subtitle {
  margin: 0 0 3rem 0;
  font-family: var(--font-whisper);
  font-weight: 500;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  color: var(--mg); /* Request: Morning Glory; same as background not allowed → adjust */
}

/* To keep only three colors and provide contrast, use Forest Green for subtitle text
   while keeping Morning Glory as the background (both within palette). */
.philosophy { color: var(--fg); }
.philosophy__subtitle { color: var(--fg); }

.philosophy__manifesto {
  display: grid;
  gap: 1.25rem; /* vertical spacing between lines */
}

.philosophy__line {
  margin: 0;
  font-family: var(--font-architect); /* Space Grotesk Medium */
  font-weight: 500;
  font-size: clamp(1.5rem, 2.8vw, 2rem); /* target: 2rem */
  color: var(--fg); /* Forest Green */
}

/* ARCHITECTURAL ELEMENTS — Building a world with soul */

/* Rhythm Line — The gentle pulse at top of sections */
.rhythm-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--mg);
  transform-origin: left;
  animation: gentle-pulse 3s ease-in-out infinite;
  z-index: 10;
}

/* Architectural Lines — Structural beams in corners */
.architectural-lines::before,
.architectural-lines::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 1px;
  background: var(--mg);
  z-index: 5;
}

.architectural-lines::before {
  top: 20px;
  left: 20px;
  transform: rotate(45deg);
}

.architectural-lines::after {
  bottom: 20px;
  right: 20px;
  transform: rotate(45deg);
}

/* Handwritten Notes — Human touches in corners */
.handwritten-note {
  position: absolute;
  font-family: var(--font-whisper);
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--ol);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.6s ease-out;
  font-style: italic;
  line-height: 1.3;
  max-width: 180px;
}

.handwritten-note.show {
  opacity: 0.7;
  transform: translateY(0);
}

.handwritten-note--bottom-right {
  bottom: 20px;
  right: 20px;
  text-align: right;
}

.handwritten-note--bottom-left {
  bottom: 20px;
  left: 20px;
  text-align: left;
}

.handwritten-note--top-right {
  top: 20px;
  right: 20px;
  text-align: right;
}

/* Soft Fog Effect — Atmosphere for cards */
.soft-fog {
  backdrop-filter: blur(2px);
  background: rgba(245, 241, 230, 0.95);
  border: 1px solid var(--mg);
}

/* Skyline Gradient — Dawn feeling in heroes */
.skyline-gradient {
  background: linear-gradient(135deg, var(--nt) 0%, var(--mg) 100%);
  position: relative;
}

.skyline-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--nt) 0%, var(--mg) 100%);
  opacity: 0.1;
  pointer-events: none;
}

/* Enhanced Cards with Architectural Feel */
.architectural-card {
  background: var(--wb);
  border: 1px solid var(--mg);
  padding: 2rem;
  position: relative;
  transition: all 0.3s ease-out;
}

.architectural-card:hover {
  transform: scale(1.02);
}

.architectural-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--mg);
  animation: gentle-pulse 3s ease-in-out infinite;
}

/* Breathing Animation — Like a gentle sigh */
@keyframes gentle-pulse {
  0%, 100% {
    transform: scaleX(0.3);
    opacity: 0.5;
  }
  50% {
    transform: scaleX(1);
    opacity: 1;
  }
}

/* Fade In on Scroll — Human timing */
.fade-in-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.8s ease-out;
}

.fade-in-scroll.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Section Spacing — Museum-like breathing room */
.section-spacing {
  padding: 15vh 0;
  position: relative;
}

/* Warm Beige Sections */
.warm-section {
  background: var(--wb);
  color: var(--ol);
}

/* Navy Teal Sections */
.depth-section {
  background: var(--nt);
  color: var(--mg);
}

/* Morning Glory Sections */
.air-section {
  background: var(--mg);
  color: var(--fg);
}

/* SMALL HUMAN DETAILS — Making it feel lived-in */

/* Warm Light on Text — Like candlelight */
.depth-section h1,
.depth-section h2,
.depth-section h3 {
  text-shadow: 0 0 1px rgba(245, 241, 230, 0.1);
}

.depth-section p {
  text-shadow: 0 0 0.5px rgba(245, 241, 230, 0.05);
}

/* Poetic Quotes — Random notes left by cleaners */
.poetic-quote {
  position: absolute;
  bottom: 20px;
  right: 20px;
  font-family: var(--font-whisper);
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--ol);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.6s ease-out;
  font-style: italic;
  line-height: 1.3;
  max-width: 200px;
  text-align: right;
}

.poetic-quote.show {
  opacity: 0.6;
  transform: translateY(0);
}

.poetic-quote:hover {
  opacity: 1;
}

/* Natural Elements — Tiny SVG icons */
.natural-element {
  position: absolute;
  width: 12px;
  height: 12px;
  opacity: 0.3;
  transition: all 0.3s ease;
}

.natural-element:hover {
  transform: scale(1.05);
  opacity: 0.6;
}

.natural-element--top-right {
  top: 20px;
  right: 20px;
}

.natural-element--top-left {
  top: 20px;
  left: 20px;
}

.natural-element--bottom-left {
  bottom: 20px;
  left: 20px;
}

/* Cleaning Tool Icons — Tiny tools in corners */
.cleaning-tool {
  position: absolute;
  width: 12px;
  height: 12px;
  opacity: 0.2;
  transition: all 0.3s ease;
}

.cleaning-tool:hover {
  transform: scale(1.05);
  opacity: 0.5;
}

.cleaning-tool--bottom-left {
  bottom: 20px;
  left: 20px;
}

/* Enhanced Paper Texture — More realistic */
.paper-texture {
  position: relative;
}

.paper-texture::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300" viewBox="0 0 300 300"><defs><filter id="paperTexture"><feTurbulence type="fractalNoise" baseFrequency="0.02" numOctaves="4" result="noise" seed="2"/><feDiffuseLighting in="noise" lighting-color="%23F5F1E6" surfaceScale="0.5"><feDistantLight azimuth="45" elevation="60"/></feDiffuseLighting></filter></defs><rect width="100%" height="100%" filter="url(%23paperTexture)" opacity="0.015"/></svg>');
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: multiply;
}

/* Subtle Section Dividers — Like paper seams */
.section-divider {
  position: relative;
}

.section-divider::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 1px;
  background: var(--mg);
  opacity: 0.3;
}

/* Human Touch Animations — Gentle and organic */
.human-touch {
  animation: gentle-breathe 4s ease-in-out infinite;
}

@keyframes gentle-breathe {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.01);
    opacity: 1;
  }
}

/* Micro Interactions — Tiny delights */
.micro-interaction {
  transition: all 0.2s ease;
}

.micro-interaction:hover {
  transform: translateY(-1px);
}

/* Living Space Feel — Random small movements */
.living-space {
  animation: subtle-float 8s ease-in-out infinite;
}

@keyframes subtle-float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-2px);
  }
}
