/* ============================================================
   main.css — Page layout · V3 "The Observatory + The Paper"
   ============================================================ */

/* ===== ACT 1 — HERO (single drift + gradient bridge) ===== */
.hero {
  position: relative;
  z-index: 2; /* sits above About so the fog bridge overlays the seam */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px 2rem 6rem;
  overflow: hidden;
}

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

/* Single subtle background — JS drifts it slowly on scroll (capped 60px). */
.hero-bg-drift {
  position: absolute;
  inset: -10%;
  width: 120%;
  height: 120%;
  background:
    radial-gradient(ellipse 60% 50% at 70% 30%, rgba(196,150,58,0.10) 0%, transparent 65%),
    radial-gradient(ellipse 50% 60% at 20% 80%, rgba(61,43,31,0.50) 0%, transparent 60%),
    #0E0B09;
  will-change: transform;
}
.hero-bg-grain {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.035;
  mix-blend-mode: overlay;
}

.hero-content { position: relative; z-index: 1; max-width: 900px; margin: 0 auto; width: 100%; }

/* Eyebrow */
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 0.6rem;
  margin-bottom: 2.5rem;
  opacity: 0; transform: translateX(-20px);
  transition: opacity 600ms ease, transform 600ms ease;
  transition-delay: 200ms;
}
.hero-eyebrow.visible { opacity: 1; transform: translateX(0); }
.eyebrow-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--color-gold);
  animation: dotPulse 2s ease-in-out infinite;
}
@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}
.hero-eyebrow [data-fr], .hero-eyebrow [data-en] {
  font-family: var(--font-body);
  font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(196,150,58,0.9);
}

/* Headline */
.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 9vw, 7rem);
  font-weight: 400; line-height: 1.0;
  letter-spacing: -0.03em; color: #F0EBE3;
  margin-bottom: 2rem;
}
.hero-line {
  display: block;
  opacity: 0; transform: translateY(30px);
  transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}
.hero-line-1 { transition-delay: 300ms; }
.hero-line-2 { transition-delay: 500ms; }
.hero-line.visible { opacity: 1; transform: translateY(0); }

.hero-glass-word {
  display: inline-block; position: relative;
  padding: 0.1em 0.4em; margin-left: 0.15em;
  font-style: italic; color: var(--color-gold);
}
.hero-glass-word > span { position: relative; z-index: 1; }
.hero-glass-word::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(196,150,58,0.08);
  border: 1px solid rgba(196,150,58,0.2);
  border-radius: 6px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}

.hero-sub {
  font-family: var(--font-body);
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  color: rgba(240,235,227,0.5);
  letter-spacing: 0.05em; margin-bottom: 2.5rem;
}
.hero-cta-row { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }

/* Floating stat card */
.hero-scroll-card {
  position: absolute; bottom: 3rem; left: 50%;
  transform: translateX(-50%);
  z-index: 3; /* stays crisp above the fog */
  display: flex; flex-direction: column; align-items: center; gap: 1.5rem;
}
.hero-scroll-card.reveal-up { transform: translate(-50%, 24px); }
.hero-scroll-card.reveal-up.visible { transform: translate(-50%, 0); }
.scroll-card-inner {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.8rem 1.6rem;
  background: rgba(240,235,227,0.05);
  border: 1px solid rgba(240,235,227,0.1);
  border-radius: var(--radius-full);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.scroll-card-label { font-family: var(--font-body); font-size: 0.75rem; color: rgba(240,235,227,0.45); letter-spacing: 0.08em; }
.scroll-card-value { font-family: var(--font-display); font-size: 0.9rem; color: var(--color-gold); font-weight: 500; }
.scroll-card-sep { color: rgba(240,235,227,0.2); font-size: 0.7rem; }

.scroll-indicator { width: 1px; height: 48px; background: rgba(240,235,227,0.1); position: relative; overflow: hidden; border-radius: 1px; }
.scroll-line { position: absolute; top: -100%; left: 0; width: 100%; height: 100%; background: linear-gradient(to bottom, transparent, var(--color-gold), transparent); animation: scrollLine 2s ease-in-out infinite; }
@keyframes scrollLine { 0% { top: -100%; } 100% { top: 100%; } }
@media (prefers-reduced-motion: reduce) { .scroll-line, .eyebrow-dot { animation: none; } }

/* The gradient bridge — hero melts into the cream body.
   z-index 0: above the drift background, BELOW the hero text/card so it
   only fades the backdrop (never covers the sub-headline or CTAs). */
.hero-fade-out {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 280px; z-index: 0; pointer-events: none;
  background: linear-gradient(to bottom,
    transparent 0%,
    rgba(14,11,9,0.6) 40%,
    var(--bg-primary) 100%);
}

@media (max-width: 768px) {
  .hero { padding: 100px 1.5rem 3.5rem; }
  .hero-headline { font-size: clamp(2.8rem, 12vw, 4rem); }
  .hero-scroll-card { position: static; left: auto; transform: none; margin: 3rem auto 0; }
  .hero-scroll-card.reveal-up { transform: translateY(24px); }
  .hero-scroll-card.reveal-up.visible { transform: translateY(0); }
  .scroll-card-inner { gap: 0.6rem; padding: 0.6rem 1rem; flex-wrap: wrap; justify-content: center; }
  .scroll-indicator { display: none; }
  .hero-fade-out { height: 180px; }
}

/* ===== GOLD VERTICAL TIMELINE ===== */
.page-timeline {
  position: absolute;
  left: clamp(1.5rem, 4vw, 4rem);
  top: 0; width: 1px; pointer-events: none; z-index: 10;
}
.timeline-line {
  position: absolute; top: 0; left: 0; width: 1px; height: 0;
  background: linear-gradient(to bottom, rgba(196,150,58,0.6), rgba(196,150,58,0.2));
  transition: height 0.1s linear;
}
.timeline-dot {
  position: absolute; left: -3px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--color-gold);
  border: 1.5px solid var(--bg-primary);
  opacity: 0; transform: scale(0);
  transition: opacity 400ms ease, transform 400ms cubic-bezier(0.34,1.56,0.64,1);
}
.timeline-dot.active { opacity: 1; transform: scale(1); }
@media (max-width: 768px) { .page-timeline { display: none; } }

/* ===== ACT 2 — ABOUT (editorial, emerges from the fog) ===== */
.about-section {
  position: relative; z-index: 1;
  margin-top: -120px; padding-top: 180px;
  padding-bottom: var(--space-section);
  background: var(--bg-primary);
}
.about-grid {
  display: grid; grid-template-columns: 5fr 7fr; gap: 5rem;
  align-items: start; max-width: var(--max-width);
  margin: 0 auto; padding: 0 2.5rem;
}
.about-pullquote {
  font-family: var(--font-display); font-style: italic;
  font-size: clamp(1.5rem, 2.8vw, 2.2rem); font-weight: 400;
  color: var(--color-coffee); line-height: 1.35;
  margin: 0; padding: 0; border: none;
  position: sticky; top: 120px;
}
.about-cite {
  display: block; margin-top: 1.5rem;
  font-family: var(--font-body); font-size: 0.78rem;
  letter-spacing: 0.1em; color: var(--color-gold); font-style: normal;
}
.about-body {
  font-family: var(--font-body); font-size: 1.05rem;
  color: var(--text-secondary); line-height: 1.85;
  margin-bottom: 1.5rem; max-width: 58ch;
}
.about-stats {
  display: flex; gap: 2.5rem; margin-top: 3rem;
  padding-top: 2rem; border-top: 1px solid var(--border-light); flex-wrap: wrap;
}
.stat-num {
  display: block; font-family: var(--font-display);
  font-size: 2rem; font-weight: 400; color: var(--color-gold);
  line-height: 1; margin-bottom: 0.4rem;
}
.stat-lbl {
  font-family: var(--font-body); font-size: 0.78rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted);
}
@media (max-width: 768px) {
  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .about-pullquote { position: static; font-size: 1.5rem; }
  .about-section { margin-top: -80px; padding-top: 140px; }
}

/* ===== ACT 3 — SERVICES (typeset register) ===== */
.services-section { padding: var(--space-section) 0; background: var(--bg-primary); }
.services-header { max-width: var(--max-width); margin: 0 auto 4rem; padding: 0 2.5rem; }
.services-table { max-width: var(--max-width); margin: 0 auto; padding: 0 2.5rem; }

.service-entry {
  display: grid; grid-template-columns: 80px 1fr; gap: 2rem;
  padding: 3rem 0; position: relative; align-items: start;
}
.service-rule { position: absolute; bottom: 0; left: 0; right: 0; height: 1px; background: var(--border-light); overflow: hidden; }
.service-rule::after {
  content: ''; position: absolute; top: 0; left: -100%; right: 100%; height: 100%;
  background: var(--color-gold); opacity: 0.6;
  transition: left 500ms cubic-bezier(0.16,1,0.3,1), right 500ms cubic-bezier(0.16,1,0.3,1);
}
.service-entry:hover .service-rule::after { left: 0; right: 0; }

.service-numeral {
  font-family: var(--font-display); font-size: 0.78rem; font-weight: 400;
  letter-spacing: 0.15em; color: var(--color-gold); padding-top: 0.6rem; opacity: 0.7;
}
.service-name {
  font-family: var(--font-display); font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 400; font-style: italic; color: var(--text-primary);
  margin-bottom: 0.8rem; line-height: 1.2; transition: color 250ms ease;
}
.service-entry:hover .service-name { color: var(--color-coffee); }
.service-desc {
  font-family: var(--font-body); font-size: 0.92rem;
  color: var(--text-muted); line-height: 1.75; max-width: 52ch; margin: 0;
}
.service-entry--large .service-name { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
.service-entry--large .service-desc { font-size: 1rem; max-width: 60ch; }
.service-row-double { display: grid; grid-template-columns: 1fr 1fr; gap: 0 4rem; }
.service-entry--closing { opacity: 0.85; }
.service-entry--closing .service-name { font-size: clamp(1.2rem, 2vw, 1.5rem); }

@media (max-width: 768px) {
  .service-row-double { grid-template-columns: 1fr; }
  .service-entry { grid-template-columns: 48px 1fr; gap: 1rem; padding: 2rem 0; }
  .service-entry--large .service-name { font-size: 1.8rem; }
}

/* ===== ACT 4 — VALUES (premium dark) ===== */
.values-section { background: var(--bg-dark); padding-block: var(--space-section); position: relative; overflow: hidden; }
.values-section::before {
  content: ''; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%); width: 60%; height: 60%;
  background: radial-gradient(ellipse, rgba(196,150,58,0.05) 0%, transparent 70%);
  pointer-events: none;
}
.values__head { text-align: center; margin-bottom: 3rem; position: relative; }
.values__head .section-label { color: var(--color-gold); }
.values__head h2 { color: var(--text-inverse); margin-top: 0.25rem; }
.values-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; max-width: var(--max-width); margin: 0 auto; position: relative; }
.value-item { position: relative; padding: 3rem 2.5rem; text-align: center; }
.value-item:not(:last-child)::after {
  content: ''; position: absolute; right: 0; top: 20%; bottom: 20%; width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(196,150,58,0.2), transparent);
}
.value-number { font-family: var(--font-mono); font-size: 0.7rem; color: rgba(196,150,58,0.4); letter-spacing: 0.15em; margin-bottom: 1.5rem; display: block; }
.value-title { font-family: var(--font-display); font-size: 1.6rem; font-weight: 400; color: var(--text-inverse); margin-bottom: 1.2rem; }
.value-desc { font-family: var(--font-body); font-size: 0.92rem; color: rgba(240,235,227,0.5); line-height: 1.75; max-width: 30ch; margin: 0 auto; }
.value-desc .accent { color: var(--color-gold); font-weight: 500; }
@media (max-width: 768px) {
  .values-grid { grid-template-columns: 1fr; }
  .value-item:not(:last-child)::after { right: 20%; left: 20%; top: auto; bottom: 0; height: 1px; width: auto; background: linear-gradient(to right, transparent, rgba(196,150,58,0.2), transparent); }
}

/* ===== ACT 5 — CONTACT (colophon) ===== */
.contact-section { padding: clamp(6rem, 12vw, 10rem) 2rem clamp(4rem, 8vw, 7rem); background: var(--bg-primary); text-align: center; }
.contact-inner { max-width: 800px; margin: 0 auto; }
.contact-diamond { font-size: 0.9rem; color: var(--color-gold); opacity: 0.5; display: block; margin-bottom: 3rem; letter-spacing: 0.3em; }
.contact-intro { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.2rem, 2.5vw, 1.7rem); color: var(--text-secondary); margin-bottom: 2rem; }
.contact-email {
  display: inline-block; font-family: var(--font-display); font-style: italic; font-weight: 400;
  font-size: clamp(1.4rem, 4vw, 2.6rem); color: var(--color-gold); text-decoration: none;
  margin: 0 auto 3rem; position: relative;
}
.contact-email::after {
  content: ''; position: absolute; bottom: -4px; left: 0; right: 0; height: 1px;
  background: var(--color-gold); transform: scaleX(0.25); transform-origin: left; opacity: 0.4;
  transition: transform 500ms cubic-bezier(0.16,1,0.3,1), opacity 500ms ease;
}
.contact-email:hover::after { transform: scaleX(1); opacity: 0.7; }
.contact-colophon { display: block; font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted); line-height: 2; font-style: normal; letter-spacing: 0.05em; }

/* ===== Dark-mode adjustments for new components ===== */
[data-theme="dark"] .about-pullquote { color: var(--text-inverse); }
[data-theme="dark"] .service-entry:hover .service-name { color: var(--color-gold-lt); }
[data-theme="dark"] .contact-section { background: var(--bg-secondary); }
[data-theme="dark"] .hero-fade-out { background: linear-gradient(to bottom, transparent 0%, rgba(14,11,9,0.6) 40%, var(--bg-primary) 100%); }
[data-theme="dark"] .timeline-dot { border-color: var(--bg-primary); }

/* ===== Legal page ===== */
.legal { background: var(--bg-primary); padding-top: calc(var(--nav-height) + 3rem); }
.legal__inner { max-width: 760px; margin-inline: auto; }
.legal__inner > h1 { color: var(--text-primary); margin-top: 0.5rem; }
.legal__rule { width: 48px; height: 1px; background: var(--color-gold); margin: 1.75rem 0 0; }
.legal section { margin-top: 3rem; }
.legal h2 { font-size: 1.5rem; color: var(--text-primary); margin-bottom: 1rem; }
.legal p { color: var(--text-secondary); max-width: var(--text-max); }
.legal p + p { margin-top: 1rem; }
.legal .legal__meta { font-size: 0.9rem; line-height: 1.9; }
.legal a.legal__email { color: var(--color-gold); text-decoration: underline; text-underline-offset: 4px; }
.back-home { display: inline-block; margin-bottom: 2rem; font-size: 0.875rem; color: var(--text-secondary); transition: color var(--transition-fast); }
.back-home:hover { color: var(--color-gold); }
