/* RuleVault.org Stylesheet
   Instrument Serif / IBM Plex Sans / IBM Plex Mono
   Light, institutional, warm. */

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

:root {
  --bg: #faf9f7;
  --bg-warm: #f5f3ef;
  --bg-card: #ffffff;
  --text: #1a1a22;
  --text-sec: #4a4a56;
  --text-muted: #7a7a86;
  --gold: #8b6914;
  --gold-lt: #b8941f;
  --gold-bg: #f8f3e8;
  --border: #e2dfd8;
  --border-lt: #eceae4;
  --shadow-sm: 0 1px 3px rgba(26,26,34,0.04);
  --shadow-md: 0 4px 16px rgba(26,26,34,0.06);
  --r: 8px;
  --r-lg: 12px;
  --mw: 680px;
  --mw-wide: 1020px;
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'IBM Plex Sans', -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', Consolas, monospace;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--sans); font-size: 1.0625rem; line-height: 1.7;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--gold-lt); }
a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
::selection { background: var(--gold-bg); }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.2; }
h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); letter-spacing: -0.01em; }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); }

.label {
  font-family: var(--mono); font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold);
}

.container { max-width: var(--mw); margin: 0 auto; padding: 0 1.5rem; }
.container-wide { max-width: var(--mw-wide); margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 5rem 0; }
.section-alt { background: var(--bg-warm); }

/* Nav */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(250,249,247,0.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-lt); transition: box-shadow 0.3s;
}
.nav.scrolled { box-shadow: var(--shadow-sm); }
.nav-inner {
  max-width: var(--mw-wide); margin: 0 auto; padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between; height: 64px;
}
.nav-logo {
  font-family: var(--serif); font-size: 1.25rem; color: var(--text);
  text-decoration: none; display: flex; align-items: center; gap: 0.5rem;
}
.nav-logo:hover { color: var(--text); }
.nav-logo .dot { width: 8px; height: 8px; background: var(--gold); border-radius: 50%; }
.nav-links { display: flex; align-items: center; gap: 2rem; list-style: none; }
.nav-links a { font-size: 0.9375rem; color: var(--text-sec); transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.nav-cta {
  font-size: 0.875rem; font-weight: 500; color: var(--bg) !important;
  background: var(--text); padding: 0.5rem 1.25rem; border-radius: 6px;
  transition: background 0.2s, transform 0.15s;
}
.nav-cta:hover { background: #2a2a36; transform: translateY(-1px); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; color: var(--text); }
.nav-toggle span { display: block; width: 22px; height: 2px; background: currentColor; margin: 5px 0; transition: transform 0.3s, opacity 0.3s; }
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; background: rgba(250,249,247,0.98);
    backdrop-filter: blur(12px); border-bottom: 1px solid var(--border-lt);
    padding: 1.5rem; gap: 1rem;
  }
  .nav-links.open { display: flex; }
}

/* Language Selector */
.lang-selector { position: relative; }
.lang-btn {
  display: flex; align-items: center; gap: 0.35rem;
  font-family: var(--mono); font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.04em; color: var(--text-sec);
  background: none; border: 1px solid var(--border); border-radius: 6px;
  padding: 0.35rem 0.65rem; cursor: pointer; transition: border-color 0.2s, color 0.2s;
}
.lang-btn:hover { border-color: var(--text); color: var(--text); }
.lang-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.lang-dropdown {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--bg-card); border: 1px solid var(--border-lt); border-radius: var(--r);
  box-shadow: var(--shadow-md); min-width: 180px; padding: 0.5rem 0; z-index: 200;
}
.lang-dropdown.open { display: block; }
.lang-dropdown button {
  display: block; width: 100%; text-align: left; padding: 0.5rem 1rem;
  font-family: var(--sans); font-size: 0.875rem; color: var(--text-sec);
  background: none; border: none; cursor: pointer; transition: background 0.15s, color 0.15s;
}
.lang-dropdown button:hover { background: var(--bg-warm); color: var(--text); }
.lang-dropdown button .lang-native { color: var(--text); }
.lang-dropdown button .lang-en { color: var(--text-muted); font-size: 0.8125rem; margin-left: 0.35rem; }
@media (max-width: 768px) {
  .lang-selector { order: -1; align-self: flex-start; }
  .lang-dropdown { left: 0; right: auto; }
}

/* Hero */
.hero { padding: 7.5rem 0 3rem; text-align: center; }
.hero h1 { margin-bottom: 1.5rem; max-width: 800px; margin-left: auto; margin-right: auto; }
.hero-sub {
  font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--text-sec);
  line-height: 1.6; max-width: 560px; margin: 0 auto 2.5rem;
}

/* Signup */
.signup-form { display: flex; gap: 0.75rem; max-width: 460px; margin: 0 auto; align-items: stretch; }
.signup-form input[type="email"] {
  flex: 1; padding: 0.875rem 1rem; font-family: var(--sans); font-size: 1rem;
  border: 1.5px solid var(--border); border-radius: var(--r); background: var(--bg-card);
  color: var(--text); transition: border-color 0.2s; min-width: 0;
}
.signup-form input[type="email"]:focus { outline: none; border-color: var(--gold); }
.signup-form input[type="email"]::placeholder { color: var(--text-muted); }
.signup-form button, .btn-primary {
  font-family: var(--sans); font-size: 0.9375rem; font-weight: 500;
  color: #fff; background: var(--text); border: none; padding: 0.875rem 1.75rem;
  border-radius: var(--r); cursor: pointer; white-space: nowrap;
  transition: background 0.2s, transform 0.15s;
}
.signup-form button:hover, .btn-primary:hover { background: #2a2a36; transform: translateY(-1px); }
.btn-secondary {
  display: inline-block; font-family: var(--sans); font-size: 0.9375rem; font-weight: 500;
  color: var(--text); background: transparent; border: 1.5px solid var(--border);
  padding: 0.75rem 1.5rem; border-radius: var(--r); cursor: pointer;
  transition: border-color 0.2s, background 0.2s; text-decoration: none;
}
.btn-secondary:hover { border-color: var(--text); background: rgba(26,26,34,0.03); color: var(--text); }
.honeypot { position: absolute; left: -9999px; top: -9999px; }
.signup-note { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.75rem; text-align: center; }
@media (max-width: 520px) {
  .signup-form { flex-direction: column; }
  .signup-form button { width: 100%; }
}

/* Counter */
.counter { display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 1.5rem; font-size: 0.875rem; color: var(--text-muted); }
.counter .pulse { width: 8px; height: 8px; background: var(--gold); border-radius: 50%; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:0.5; transform:scale(1.3); } }

/* Feature Cards */
.features-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 1.5rem; margin-top: 3rem; }
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border-lt); border-radius: var(--r-lg);
  padding: 2rem; transition: box-shadow 0.3s, transform 0.2s;
}
.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.feature-card .label { margin-bottom: 0.75rem; }
.feature-card h3 { margin-bottom: 0.75rem; line-height: 1.3; }
.feature-card p { color: var(--text-sec); font-size: 0.9375rem; line-height: 1.65; }
.feature-card .stat { font-family: var(--serif); font-size: 2rem; color: var(--gold); margin: 1rem 0 0.25rem; line-height: 1.1; }
.feature-card .stat-label { font-size: 0.8125rem; color: var(--text-muted); }
@media (max-width: 640px) { .features-grid { grid-template-columns: 1fr; } }

/* Inline Signup */
.inline-signup { text-align: center; padding: 3rem 0; }
.inline-signup p { font-family: var(--serif); font-size: 1.25rem; color: var(--text); margin-bottom: 1.5rem; }

/* How It Works */
.mechanism-step { display: grid; grid-template-columns: 48px 1fr; gap: 1.5rem; margin-bottom: 2.5rem; align-items: start; }
.mechanism-num {
  width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 0.875rem; color: var(--gold); flex-shrink: 0;
}
.mechanism-step h3 { margin-bottom: 0.5rem; }
.mechanism-step p { color: var(--text-sec); font-size: 0.9375rem; }

/* Credibility */
.credibility {
  display: flex; flex-wrap: wrap; gap: 2rem; justify-content: center;
  padding: 2.5rem 0; border-top: 1px solid var(--border-lt); border-bottom: 1px solid var(--border-lt);
}
.credibility-item { text-align: center; min-width: 140px; }
.credibility-item .num { font-family: var(--serif); font-size: 1.75rem; color: var(--gold); line-height: 1.2; }
.credibility-item .desc { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.25rem; }

/* Architecture Section */
.arch-block { margin-bottom: 2.5rem; padding-bottom: 2.5rem; border-bottom: 1px solid var(--border-lt); }
.arch-block:last-of-type { border-bottom: none; }
.arch-block .label { margin-bottom: 0.75rem; }
.arch-block h3 { margin-bottom: 1rem; }
.arch-block p { color: var(--text-sec); font-size: 0.9375rem; line-height: 1.7; margin-bottom: 0.75rem; }
.arch-block p:last-child { margin-bottom: 0; }

/* Doc List */
.doc-list { list-style: none; padding: 0; }
.doc-list li {
  padding: 1rem 0; border-bottom: 1px solid var(--border-lt);
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
}
.doc-list li:last-child { border-bottom: none; }
.doc-title { font-weight: 500; color: var(--text); }
.doc-desc { font-size: 0.875rem; color: var(--text-muted); text-align: right; }

/* Founder */
.founder-block { max-width: var(--mw); margin: 0 auto; }
.founder-block p { color: var(--text-sec); font-size: 0.9375rem; line-height: 1.7; margin-bottom: 0.75rem; }
.founder-block p:last-child { margin-bottom: 0; }

/* Humility callout */
.humility-callout {
  padding: 2rem; background: var(--gold-bg); border-radius: var(--r-lg);
  color: var(--text); font-size: 0.9375rem; line-height: 1.7;
}

/* Footer */
.footer { padding: 3rem 0; border-top: 1px solid var(--border-lt); text-align: center; }
.footer p { font-size: 0.8125rem; color: var(--text-muted); line-height: 1.6; }
.footer a { color: var(--text-muted); }
.footer a:hover { color: var(--gold); }

/* Response Pages */
.response-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 2rem 1.5rem; }
.response-content { max-width: 520px; }
.response-content h1 { margin-bottom: 1rem; }
.response-content p { color: var(--text-sec); margin-bottom: 1.5rem; line-height: 1.7; }
.share-row { display: flex; justify-content: center; gap: 0.75rem; flex-wrap: wrap; margin-top: 2rem; }
.share-btn {
  display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.625rem 1.25rem;
  border: 1.5px solid var(--border); border-radius: var(--r); font-family: var(--sans);
  font-size: 0.875rem; color: var(--text-sec); background: var(--bg-card); cursor: pointer;
  transition: border-color 0.2s, color 0.2s; text-decoration: none;
}
.share-btn:hover { border-color: var(--text); color: var(--text); }

/* Ko-fi */
.kofi-note { font-size: 0.8125rem; color: var(--text-muted); margin-top: 2.5rem; }
.kofi-note a { color: var(--gold); }

/* Animations */
.fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* Utility */
.text-center { text-align: center; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

@media print {
  .nav, .signup-form, .btn-primary, .btn-secondary, .nav-cta, .inline-signup { display: none; }
  .section { padding: 1.5rem 0; }
}

/* Suppress Google Translate default UI */
.goog-te-banner-frame { display: none !important; }
body { top: 0 !important; }
.goog-te-gadget { display: none !important; }
#gt-container { display: none !important; }
