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

:root {
  --clr-bg: #f5f0e8;
  --clr-surface: #fffdf8;
  --clr-text: #2c2a25;
  --clr-text-soft: #7a756b;
  --clr-accent: #5b7f5a;
  --clr-accent-deep: #3d5e3c;
  --clr-accent-light: #dce8db;
  --clr-warm: #c4956a;
  --clr-warm-light: #f0e0cf;
  --clr-border: #ddd8cd;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --radius: 16px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--clr-bg);
  color: var(--clr-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* hide page content until authenticated */
body.gate-locked > *:not(#gate-overlay) {
  visibility: hidden !important;
  opacity: 0 !important;
}

/* --- GRAIN OVERLAY --- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.3;
  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.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 180px;
}

/* --- NAV --- */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  padding: 1.1rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(245, 240, 232, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--clr-accent-deep);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--clr-text-soft);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.3rem 0.8rem;
  border-radius: 100px;
  transition: all 0.25s;
}

.nav-links a:hover {
  color: var(--clr-accent-deep);
  background: var(--clr-accent-light);
}

/* --- HERO --- */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 6rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}

/* decorative blobs */
.blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(60px);
  opacity: 0.45;
}

.blob-1 {
  width: 500px;
  height: 500px;
  top: -10%;
  right: -8%;
  background: var(--clr-accent-light);
  animation: drift 18s ease-in-out infinite alternate;
}

.blob-2 {
  width: 350px;
  height: 350px;
  bottom: 5%;
  left: -5%;
  background: var(--clr-warm-light);
  animation: drift 22s ease-in-out 3s infinite alternate-reverse;
}

.blob-3 {
  width: 200px;
  height: 200px;
  top: 30%;
  left: 15%;
  background: var(--clr-accent-light);
  opacity: 0.3;
  animation: drift 15s ease-in-out 1s infinite alternate;
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(30px, -20px) scale(1.08); }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1.1rem;
  border: 1px solid var(--clr-border);
  border-radius: 100px;
  font-size: 0.82rem;
  color: var(--clr-text-soft);
  margin-bottom: 2.5rem;
  background: var(--clr-surface);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  animation: fadeUp 0.7s ease-out both;
  position: relative;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.8rem, 7vw, 5rem);
  line-height: 1.12;
  max-width: 14ch;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
  animation: fadeUp 0.7s ease-out 0.12s both;
  position: relative;
}

.hero h1 em {
  color: var(--clr-accent);
  font-style: italic;
  position: relative;
}

.hero h1 em::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: -2px;
  right: -2px;
  height: 8px;
  background: var(--clr-warm-light);
  border-radius: 4px;
  z-index: -1;
}

.hero > p {
  font-size: 1.2rem;
  color: var(--clr-text-soft);
  max-width: 38ch;
  line-height: 1.65;
  animation: fadeUp 0.7s ease-out 0.24s both;
  position: relative;
}

/* --- FEATURES --- */
.features {
  padding: 5rem 2rem 7rem;
  max-width: 1040px;
  margin: 0 auto;
  position: relative;
}

.section-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--clr-warm);
  margin-bottom: 0.75rem;
}

.section-heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  line-height: 1.2;
  margin-bottom: 3rem;
  max-width: 22ch;
  letter-spacing: -0.015em;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.feature-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--clr-accent), var(--clr-warm));
  opacity: 0;
  transition: opacity 0.3s;
}

.feature-card:hover {
  border-color: transparent;
  box-shadow: 0 8px 30px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  transform: translateY(-3px);
}

.feature-card:hover::before { opacity: 1; }

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 1.25rem;
}

.feature-card:nth-child(1) .feature-icon { background: var(--clr-accent-light); }
.feature-card:nth-child(2) .feature-icon { background: var(--clr-warm-light); }
.feature-card:nth-child(3) .feature-icon { background: #dde4ee; }

.feature-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: var(--clr-text-soft);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* --- SUBPAGE CONTENT --- */
.page-content {
  max-width: 660px;
  margin: 0 auto;
  padding: 9rem 2rem 5rem;
  position: relative;
}

.page-content h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: 1.15;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.page-content h1 em {
  color: var(--clr-accent);
  font-style: italic;
  position: relative;
}

.page-content h1 em::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: -2px;
  right: -2px;
  height: 7px;
  background: var(--clr-warm-light);
  border-radius: 4px;
  z-index: -1;
}

.page-content .lead {
  font-size: 1.1rem;
  color: var(--clr-text-soft);
  margin-bottom: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--clr-border);
  line-height: 1.7;
}

.page-content h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.4rem;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  color: var(--clr-text);
}

.page-content p {
  color: var(--clr-text-soft);
  margin-bottom: 1.1rem;
  line-height: 1.75;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--clr-accent-deep);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 3rem;
  padding: 0.5rem 1rem 0.5rem 0.75rem;
  border-radius: 100px;
  transition: all 0.25s;
}

.back-link:hover {
  background: var(--clr-accent-light);
  gap: 0.6rem;
}

/* --- DIVIDER DECO --- */
.deco-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0 2rem;
  max-width: 1040px;
  margin: 0 auto;
  color: var(--clr-border);
}

.deco-divider::before,
.deco-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--clr-border);
}

.deco-divider span {
  font-size: 1.2rem;
  opacity: 0.5;
}

/* --- FOOTER --- */
footer {
  padding: 2.5rem 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--clr-text-soft);
}

/* --- ANIMATIONS --- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* --- MOBILE --- */
@media (max-width: 640px) {
  nav { padding: 0.8rem 1.25rem; }
  .nav-links { gap: 0.75rem; }
  .nav-links a { font-size: 0.82rem; }
  .hero { padding: 5rem 1.5rem 3rem; }
  .features { padding: 3rem 1.25rem 5rem; }
  .page-content { padding: 7rem 1.5rem 3rem; }
  .blob-1 { width: 300px; height: 300px; }
  .blob-2 { width: 200px; height: 200px; }
  .blob-3 { display: none; }
}

/* --- PASSWORD GATE --- */
#gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--clr-bg);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  transition: opacity 0.4s ease;
}

#gate-overlay.gate-fade-out { opacity: 0; }

.gate-box {
  text-align: center;
  max-width: 340px;
  width: 100%;
}

.gate-icon {
  font-size: 2.5rem;
  margin-bottom: 1.25rem;
}

.gate-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.8rem;
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}

.gate-text {
  color: var(--clr-text-soft);
  font-size: 0.95rem;
  margin-bottom: 1.75rem;
}

.gate-input-row {
  display: flex;
  gap: 0.5rem;
}

.gate-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid var(--clr-border);
  border-radius: 12px;
  background: var(--clr-surface);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--clr-text);
  outline: none;
  transition: border-color 0.2s;
}

.gate-input:focus { border-color: var(--clr-accent); }

.gate-btn {
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 12px;
  background: var(--clr-accent-deep);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.gate-btn:hover { background: var(--clr-accent); }

.gate-error {
  color: #b5564e;
  font-size: 0.85rem;
  margin-top: 0.75rem;
  min-height: 1.2em;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.gate-shake { animation: shake 0.4s ease; }
