/* ====================================
   Defog — defog.cc
   Aesthetic: warm editorial, marius.lol-inspired
   ==================================== */

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

/* --- Design Tokens --- */
:root {
  --bg: #FDFBEE;
  --bg-outer: #EEEADB;
  --text: #0E0D0C;
  --text-secondary: #6B6159;
  --text-tertiary: #9E9689;
  --border: #E8E5D7;
  --accent: #FCCB08;
  --card-bg: rgba(0, 0, 0, 0.025);
  --selection-bg: rgba(252, 203, 8, 0.18);

  --font-display: 'Instrument Serif', serif;
  --font-body: 'Outfit', sans-serif;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;

  --ease-out-expo: cubic-bezier(.16, 1, .3, 1);
  --ease-out-quart: cubic-bezier(.25, 1, .5, 1);
}

/* --- Base --- */
::selection {
  background: var(--selection-bg);
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-outer);
  padding: 1.25vw;
}

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

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

/* --- Frame --- */
.frame {
  background: var(--bg);
  border-radius: 20px;
  min-height: calc(100vh - 2.5vw);
  position: relative;
  overflow: hidden;
}

/* --- Grain Overlay --- */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.028;
  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");
  background-size: 256px 256px;
}

/* ====================================
   Hero
   ==================================== */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 2.5vw);
  min-height: calc(100dvh - 2.5vw);
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  position: relative;
}

.hero-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  padding: 3px;
  background: linear-gradient(135deg, rgba(255,255,255,0.8), rgba(255,255,255,0.2) 40%, rgba(255,255,255,0.05) 60%, rgba(255,255,255,0.4));
  box-shadow:
    0 0 0 0.5px rgba(255, 255, 255, 0.6),
    0 1px 3px rgba(0, 0, 0, 0.06),
    0 4px 12px rgba(0, 0, 0, 0.04),
    inset 0 0.5px rgba(255, 255, 255, 0.9);
}

.hero-logo img {
  width: 100%;
  height: 100%;
  border-radius: 15px;
}

.hero-name {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.125rem;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
  margin-top: 0.875rem;
}

.hero-title {
  font-family: var(--font-body);
  font-size: clamp(2.75rem, 6vw, 4.25rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
  margin-top: var(--space-md);
  max-width: 600px;
}

.hero-title em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
}

.hero-tagline {
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: var(--space-sm);
  max-width: 380px;
}

/* --- App Store Button --- */
.app-store-btn {
  display: inline-flex;
  visibility: visible;
  align-items: center;
  gap: 0.6rem;
  margin-top: var(--space-lg);
  padding: 0.85rem 1.75rem;
  background: var(--text);
  color: var(--bg);
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: opacity 0.3s var(--ease-out-quart);
}

.app-store-btn:hover {
  opacity: 0.8;
}

.app-store-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* --- Scroll Indicator --- */
.scroll-indicator {
  position: absolute;
  bottom: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 48px;
  overflow: hidden;
}

.scroll-indicator::after {
  content: '';
  display: block;
  width: 1px;
  height: 100%;
  background: var(--text-tertiary);
  transform-origin: top center;
  animation: scroll-line 2.8s ease-in-out infinite;
}

@keyframes scroll-line {
  0% { transform: scaleY(0); opacity: 0; }
  30% { transform: scaleY(1); opacity: 0.5; }
  60% { transform: scaleY(1); opacity: 0.5; }
  100% { transform: scaleY(1); opacity: 0; }
}

/* ====================================
   Reviews Section
   ==================================== */
.reviews {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 var(--space-md) var(--space-md);
}

/* --- Social Proof --- */
.social-proof {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) 0;
  margin-bottom: var(--space-lg);
}

.laurel {
  width: 34px;
  height: 74px;
  flex-shrink: 0;
  object-fit: contain;
}

.laurel-right {
  transform: scaleX(-1);
}

.social-proof-content {
  text-align: center;
}

.social-proof-value {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(2rem, 4vw, 2.75rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
}

.social-proof-detail {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* --- Testimonials --- */
.testimonials {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

.testimonial-card {
  padding: 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.testimonial-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.testimonial-author {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.testimonial-stars {
  color: var(--accent);
  font-size: 0.75rem;
  letter-spacing: 2px;
  flex-shrink: 0;
}

.testimonial-text {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* --- Reviews CTA --- */
.reviews-cta {
  text-align: center;
}

.reviews-cta .app-store-btn {
  margin-top: var(--space-lg);
  margin-bottom: var(--space-lg);
}

/* ====================================
   Illustration
   ==================================== */
.illustration-section {
  display: flex;
  justify-content: center;
  padding: 0;
  margin: 0;
}

.illustration-balloon {
  height: 240px;
  width: auto;
}

/* ====================================
   Footer
   ==================================== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}

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

.footer-link {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  position: relative;
  transition: color 0.3s var(--ease-out-quart);
}

.footer-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--text-secondary);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease-out-expo);
}

.footer-link:hover {
  color: var(--text-secondary);
}

.footer-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.footer-copyright {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* ====================================
   Sub-pages (support, terms, privacy)
   ==================================== */
.page {
  max-width: 680px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md) var(--space-lg);
}

.page-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  color: var(--text-tertiary);
  margin-bottom: var(--space-md);
  transition: color 0.3s var(--ease-out-quart);
}

.page-back:hover {
  color: var(--text-secondary);
}

.page-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(2rem, 4vw, 2.75rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.page-date {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  margin-bottom: var(--space-md);
}

.page h2 {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: var(--space-md);
  margin-bottom: var(--space-xs);
  color: var(--text);
}

.page h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  margin-top: var(--space-sm);
  margin-bottom: 0.25rem;
  color: var(--text);
}

.page p,
.page li {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.page p + p {
  margin-top: var(--space-sm);
}

.page ul,
.page ol {
  padding-left: 1.25rem;
  margin-top: 0.25rem;
}

.page li + li {
  margin-top: 0.25rem;
}

.page a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.3s;
}

.page a:hover {
  text-decoration-color: var(--text);
}

.page .contact-card {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
}

.page .contact-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.page .contact-card p {
  margin-bottom: var(--space-sm);
}

.page .contact-email {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text);
}

.page .contact-email:hover {
  opacity: 0.7;
}

.page .crisis-note {
  margin-top: var(--space-lg);
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

/* ====================================
   Responsive
   ==================================== */
@media (max-width: 768px) {
  body {
    padding: 0;
  }

  .frame {
    border-radius: 0;
    min-height: 100vh;
  }

  .hero {
    min-height: 100vh;
    min-height: 100dvh;
    padding: var(--space-md) var(--space-sm);
  }

  .reviews {
    padding: 0 var(--space-sm) var(--space-lg);
  }

  .testimonials {
    grid-template-columns: 1fr;
  }

  .social-proof {
    gap: 0.75rem;
  }

  .laurel {
    width: 28px;
    height: 60px;
  }

  .page {
    padding: var(--space-lg) var(--space-sm) var(--space-md);
  }

  .site-footer {
    padding: var(--space-sm);
  }
}

@media (max-width: 375px) {
  .hero-tagline {
    font-size: 1rem;
  }

  .testimonial-card {
    padding: 1.25rem;
  }
}

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

  .scroll-indicator {
    display: none;
  }
}
