/* ========================================
   Yufony — Styles
   Dark mode with teal highlight.
   ======================================== */

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

/* :root {
  --color-primary: #D40078;
  --color-primary-light: #ff1a94;
  --color-primary-dark: #a3005d;
  --color-primary-bg: #fef0f6;
  --color-text: #1a1a2e;
  --color-text-light: #555;
  --color-text-muted: #888;
  --color-bg: #ffffff;
  --color-bg-alt: #f8f9fc;
  --color-border: #e8e8ee;
  --color-card-bg: #ffffff;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
  --max-width: 1120px;
  --nav-height: 72px;
} */

/* Light teal
:root {
  --color-primary: #20B2AA;
  --color-primary-light: #40E0D0;
  --color-primary-dark: #008B8B;
  --color-primary-bg: #f0f8f8;
  --color-text: #1a1a2e;
  --color-text-light: #555;
  --color-text-muted: #888;
  --color-bg: #ffffff;
  --color-bg-alt: #f8f9fc;
  --color-border: #e8e8ee;
  --color-card-bg: #ffffff;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
  --max-width: 1120px;
  --nav-height: 72px;
} */

/* :root {
  --color-primary: #ffcc66;
  --color-primary-light: #ffe699;
  --color-primary-dark: #cc9900;
  --color-primary-bg: #fff8e6;
  --color-text: #1a1a2e;
  --color-text-light: #555;
  --color-text-muted: #888;
  --color-bg: #ffffff;
  --color-bg-alt: #f8f9fc;
  --color-border: #e8e8ee;
  --color-card-bg: #ffffff;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
  --max-width: 1120px;
  --nav-height: 72px;
} */

/* Dark teal */
:root {
  --color-primary: #20B2AA;
  --color-primary-light: #40E0D0;
  --color-primary-dark: #178a84;
  --color-primary-bg: rgba(32, 178, 170, 0.1);
  --color-text: #e4e4ec;
  --color-text-light: #9a9ab0;
  --color-text-muted: #5c5c72;
  --color-bg: #0d0f14;
  --color-bg-alt: #12141b;
  --color-border: #1f2230;
  --color-card-bg: #161821;
  --color-card-hover: #1a1d28;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --max-width: 1120px;
  --nav-height: 72px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

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

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

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

/* --- Utilities --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.highlight {
  color: var(--color-primary);
}

.section {
  padding: 96px 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

/* Section background variations — texture and color shifts */
#about {
  background:
    radial-gradient(circle at 20% 50%, rgba(32, 178, 170, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(32, 178, 170, 0.04) 0%, transparent 40%),
    var(--color-bg);
}

#how-it-works {
  background:
    url("data:image/svg+xml,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='1' cy='1' r='1' fill='rgba(32,178,170,0.08)'/%3E%3C/svg%3E"),
    var(--color-bg-alt);
}

#privacy {
  background:
    linear-gradient(135deg, rgba(32, 178, 170, 0.05) 0%, transparent 50%, rgba(32, 178, 170, 0.03) 100%),
    var(--color-bg);
}

#beta {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(32, 178, 170, 0.08) 0%, transparent 60%),
    var(--color-bg-alt);
}

#contact {
  background:
    linear-gradient(180deg, var(--color-bg) 0%, #0a0c10 100%);
}

.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.section-header h2 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 1.15rem;
  color: var(--color-text-light);
  max-width: 560px;
  margin: 0 auto;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(13, 15, 20, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow 0.3s;
}

.nav.scrolled {
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.2rem;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.logo-text {
  color: var(--color-text);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 32px;
  align-items: center;
}

.nav-links a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--color-text-light);
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--color-primary);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: var(--color-primary);
  color: #0d0f14;
}

.btn-primary:hover {
  background: var(--color-primary-light);
  box-shadow: 0 4px 24px rgba(32, 178, 170, 0.35);
}

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 2px solid var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* --- Hero --- */
.hero {
  padding-top: calc(var(--nav-height) + 64px);
  padding-bottom: 96px;
  overflow: hidden;
}

.hero > .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.hero h1 {
  font-size: 3.8rem;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--color-text-light);
  line-height: 1.7;
  margin-bottom: 40px;
  max-width: 480px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Hero graphic: P2P node visualization */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-graphic {
  position: relative;
  width: 300px;
  height: 300px;
}

.hero-graphic .connections {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-graphic .connections line {
  stroke: var(--color-border);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
  animation: dash 20s linear infinite;
}

@keyframes dash {
  to { stroke-dashoffset: -100; }
}

.node {
  position: absolute;
  border-radius: 50%;
}

.node-center {
  width: 72px;
  height: 72px;
  background: var(--color-primary);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 0 0 0 8px rgba(32, 178, 170, 0.15), 0 0 0 16px rgba(32, 178, 170, 0.06);
}

.node-center .logo-icon {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: contain;
}

.node-orbit {
  width: 20px;
  height: 20px;
  background: var(--color-primary-bg);
  border: 2px solid var(--color-primary);
  animation: pulse 3s ease-in-out infinite;
}

.node-1 { top: 18%; left: 12%; animation-delay: 0s; }
.node-2 { top: 25%; right: 10%; animation-delay: 0.5s; }
.node-3 { bottom: 20%; left: 17%; animation-delay: 1s; }
.node-4 { bottom: 20%; right: 15%; animation-delay: 1.5s; }
.node-5 { top: 5%; left: 47%; animation-delay: 2s; }

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
}

/* --- Features Grid --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.feature-card {
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-card-bg);
  transition: box-shadow 0.3s, transform 0.3s, background 0.3s;
}

.feature-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  background: var(--color-card-hover);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.feature-icon svg {
  width: 24px;
  height: 24px;
  color: var(--color-primary);
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.feature-card p {
  font-size: 0.92rem;
  color: var(--color-text-light);
  line-height: 1.65;
}

/* --- Architecture Steps --- */
.architecture {
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.arch-step {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  position: relative;
  padding-left: 72px;
}

.arch-step:nth-child(even) {
  direction: rtl;
}

.arch-step:nth-child(even) > * {
  direction: ltr;
}

.arch-step-number {
  position: absolute;
  left: 0;
  top: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #0d0f14;
  font-weight: 800;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.arch-step-content h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.arch-step-content p {
  color: var(--color-text-light);
  line-height: 1.75;
}

/* Architecture step visuals */
.arch-step-visual {
  display: flex;
  justify-content: center;
}

/* Key pair visual */
.key-visual {
  width: 100%;
  max-width: 280px;
}

.key-pair {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.key {
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.key-public {
  background: var(--color-primary-bg);
  border: 2px solid var(--color-primary);
}

.key-private {
  background: rgba(255, 255, 255, 0.04);
  border: 2px dashed var(--color-border);
}

.key-label {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.key-public .key-label { color: var(--color-primary); }
.key-private .key-label { color: var(--color-text-muted); }

.key-value {
  font-size: 0.9rem;
  color: var(--color-text-light);
}

/* Manifest visual */
.manifest-visual {
  width: 100%;
  max-width: 280px;
}

.manifest-doc {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.manifest-header {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

.manifest-field {
  font-size: 0.85rem;
  color: var(--color-text-light);
  padding: 4px 0;
  font-family: monospace;
}

.manifest-field span {
  color: var(--color-primary);
  font-weight: 600;
}

.manifest-signature {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--color-border);
  font-size: 0.85rem;
  color: #3ddc84;
  font-weight: 600;
}

/* Gossip visual */
.gossip-visual {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 300px;
}

.gossip-node {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-bg);
  border: 2px solid var(--color-primary);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  color: var(--color-primary-light);
}

.gossip-sender {
  background: var(--color-primary);
  color: #0d0f14;
  border-color: var(--color-primary);
}

.gossip-arrows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.gossip-arrow {
  width: 32px;
  height: 2px;
  background: var(--color-primary);
  position: relative;
}

.gossip-arrow::after {
  content: '';
  position: absolute;
  right: 0;
  top: -4px;
  width: 0;
  height: 0;
  border-left: 6px solid var(--color-primary);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.gossip-peers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* E2EE visual */
.e2ee-visual {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 300px;
}

.e2ee-endpoint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.e2ee-user {
  font-weight: 700;
  font-size: 0.85rem;
}

.e2ee-lock {
  font-size: 1.5rem;
}

.e2ee-tunnel {
  flex: 1;
  height: 40px;
  background: repeating-linear-gradient(
    90deg,
    var(--color-primary) 0px,
    var(--color-primary) 8px,
    transparent 8px,
    transparent 16px
  );
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.e2ee-data {
  background: var(--color-primary);
  color: #0d0f14;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Seed visual */
.seed-visual {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 320px;
}

.seed-peers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.seed-peer {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-bg);
  border: 1px solid var(--color-border);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}

.seed-node-graphic {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.seed-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #0d0f14;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}

.seed-label {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  text-align: center;
  max-width: 80px;
}

/* CRDT visual */
.crdt-visual {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 320px;
}

.crdt-node {
  flex: 1;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
  font-weight: 600;
  font-size: 0.85rem;
}

.crdt-state {
  font-family: monospace;
  font-size: 0.75rem;
  color: #3ddc84;
  font-weight: 400;
}

.crdt-merge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

/* --- Privacy Grid --- */
.privacy-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.privacy-item {
  display: flex;
  gap: 20px;
  padding: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-card-bg);
}

.privacy-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--color-primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.privacy-icon svg {
  width: 24px;
  height: 24px;
  color: var(--color-primary);
}

.privacy-item h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.privacy-item p {
  font-size: 0.9rem;
  color: var(--color-text-light);
  line-height: 1.6;
}

/* --- Beta Section --- */
.beta-content {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.beta-form {
  margin-top: 32px;
}

.form-group {
  display: flex;
  gap: 12px;
  max-width: 440px;
  margin: 0 auto;
}

.form-group input[type="email"] {
  flex: 1;
  padding: 14px 18px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
  background: var(--color-card-bg);
  color: var(--color-text);
}

.form-group input[type="email"]:focus {
  border-color: var(--color-primary);
}

.form-group input[type="email"]::placeholder {
  color: var(--color-text-muted);
}

.form-note {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.beta-success {
  margin-top: 32px;
}

.beta-success p {
  font-size: 1.1rem;
  font-weight: 600;
  color: #3ddc84;
}

/* --- Contact --- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.contact-card {
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-card-bg);
  text-align: center;
  transition: box-shadow 0.3s, transform 0.3s, border-color 0.3s;
}

.contact-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--color-primary);
}

.contact-card svg {
  width: 32px;
  height: 32px;
  color: var(--color-primary);
  margin: 0 auto 16px;
}

.contact-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.contact-card p {
  font-size: 0.88rem;
  color: var(--color-text-light);
}

/* --- Footer --- */
.footer {
  background: #08090c;
  color: #888;
  padding: 64px 0 32px;
  border-top: 1px solid var(--color-border);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand {
  max-width: 260px;
}

.footer-brand .logo {
  margin-bottom: 12px;
}

.footer-brand .logo-text {
  color: var(--color-text);
}

.footer-brand p {
  font-size: 0.9rem;
  color: #666;
}

.footer-links {
  display: flex;
  gap: 64px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text);
  margin-bottom: 4px;
}

.footer-col a {
  font-size: 0.88rem;
  color: #666;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--color-primary-light);
}

.footer-bottom {
  border-top: 1px solid #1a1c24;
  padding-top: 24px;
  text-align: center;
}

.footer-bottom p {
  font-size: 0.82rem;
  color: #444;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 900px) {
  .hero > .container {
    grid-template-columns: 1fr;
    gap: 48px;
    text-align: center;
  }

  .hero h1 {
    font-size: 2.8rem;
  }

  .hero-subtitle {
    margin: 0 auto 32px;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-visual {
    order: -1;
  }

  .hero-graphic {
    width: 220px;
    height: 220px;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .arch-step {
    grid-template-columns: 1fr;
    padding-left: 60px;
  }

  .arch-step:nth-child(even) {
    direction: ltr;
  }

  .arch-step-visual {
    justify-content: flex-start;
  }

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

  .contact-grid {
    grid-template-columns: 1fr;
    max-width: 360px;
    margin: 0 auto;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-brand {
    max-width: 100%;
  }

  .footer-links {
    justify-content: center;
    gap: 40px;
  }
}

@media (max-width: 640px) {
  .section {
    padding: 64px 0;
  }

  .section-header h2 {
    font-size: 2rem;
  }

  .hero {
    padding-top: calc(var(--nav-height) + 32px);
    padding-bottom: 64px;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .hero-subtitle {
    font-size: 1.05rem;
  }

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

  .arch-step {
    padding-left: 0;
    padding-top: 56px;
  }

  .arch-step-number {
    left: 0;
    top: 0;
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .form-group {
    flex-direction: column;
  }

  .form-group .btn {
    width: 100%;
  }

  /* Mobile nav */
  .nav-toggle {
    display: flex;
    z-index: 101;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    width: 260px;
    height: 100dvh;
    background: var(--color-bg);
    flex-direction: column;
    padding: 96px 32px 32px;
    gap: 24px;
    box-shadow: -4px 0 24px rgba(0,0,0,0.4);
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-links a {
    font-size: 1.05rem;
  }

  /* Hamburger animation */
  .nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .footer-links {
    flex-direction: column;
    gap: 32px;
  }
}

/* --- Legal Pages --- */
.legal-page {
  padding-top: calc(var(--nav-height) + 48px);
  padding-bottom: 80px;
  min-height: 60vh;
}

.legal-page h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.legal-updated {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 48px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
}

.legal-page section {
  margin-bottom: 40px;
}

.legal-page h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--color-text);
}

.legal-page h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 12px;
  color: var(--color-text);
}

.legal-page p {
  font-size: 0.95rem;
  color: var(--color-text-light);
  line-height: 1.75;
  margin-bottom: 12px;
  max-width: 720px;
}

.legal-page ul {
  margin: 12px 0 16px 24px;
  max-width: 720px;
}

.legal-page li {
  font-size: 0.95rem;
  color: var(--color-text-light);
  line-height: 1.75;
  margin-bottom: 8px;
}

.legal-page code {
  background: var(--color-bg-alt);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88rem;
  border: 1px solid var(--color-border);
}

.legal-page a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-color: rgba(32, 178, 170, 0.3);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.2s;
}

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

/* --- Scroll fade-in animation --- */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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