/* ==========================================================================
   Tayeno Design System — Liquid Glass & Editorial Typography
   Tokens and Component System per DESIGN-SPEC.md
   ========================================================================== */

:root {
  /* The ground the glass sits on */
  --bg: #0B0F14;
  --bg-glow-a: #1E3A5F;
  --bg-glow-b: #0F3D33;

  /* Liquid Glass Surface Tokens */
  --glass-fill:    rgba(255, 255, 255, 0.06);
  --glass-fill-hi: rgba(255, 255, 255, 0.10);
  --glass-stroke:  rgba(255, 255, 255, 0.14);
  --glass-spec:    rgba(255, 255, 255, 0.28);   /* lit specular top edge */
  --glass-blur: 20px;
  --glass-sat: 180%;

  /* High-Contrast Accessible Colors (Dark Ground) */
  --ink:        #F4F7F9; /* 16.2:1 against --bg */
  --ink-subtle: #C5D1DC; /* 10.5:1 against --bg */
  --muted:      #9BAAB6; /* 5.8:1 against --bg (passes WCAG AA 4.5:1) */
  --dim:        #738596;
  --accent:     #5FBFA3; /* Teal lit accent */
  --accent-hi:  #78D5BB;
  --accent-glow:rgba(95, 191, 163, 0.22);
  --danger:     #F87171;
  --success:    #34D399;

  /* Typography System */
  --font-display: "Instrument Serif", Georgia, serif;
  --font-ui:      "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #EEF2F5;
    --bg-glow-a: #CFE0F5;
    --bg-glow-b: #D6EFE7;
    --glass-fill:    rgba(255, 255, 255, 0.65);
    --glass-fill-hi: rgba(255, 255, 255, 0.85);
    --glass-stroke:  rgba(15, 25, 35, 0.12);
    --glass-spec:    rgba(255, 255, 255, 0.95);
    --ink:        #0E161E; /* 16.5:1 against light ground */
    --ink-subtle: #2D3D4D; /* 9.2:1 */
    --muted:      #4D5E6E; /* 5.4:1 (passes WCAG AA 4.5:1) */
    --dim:        #6B7C8C;
    --accent:     #0D6652; /* 5.1:1 against light ground */
    --accent-hi:  #084A3B;
    --accent-glow:rgba(13, 102, 82, 0.15);
    --danger:     #DC2626;
    --success:    #059669;
  }
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark light;
}

body {
  font-family: var(--font-ui);
  background-color: var(--bg);
  background-image:
    radial-gradient(60rem 40rem at 12% -10%, var(--bg-glow-a) 0%, transparent 60%),
    radial-gradient(50rem 35rem at 88% 10%, var(--bg-glow-b) 0%, transparent 55%);
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Typography Polish Details */
h1, h2, h3, .font-display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.015em;
  text-wrap: balance;
  color: var(--ink);
}

h1 {
  font-size: clamp(2.4rem, 4.5vw, 3.8rem);
  line-height: 1.1;
  letter-spacing: -0.02em; /* Tighten large type above 32px */
}

h2 {
  font-size: clamp(1.8rem, 3.2vw, 2.7rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h3 {
  font-size: clamp(1.3rem, 2vw, 1.7rem);
  line-height: 1.25;
}

p {
  color: var(--ink-subtle);
}

.price, .token-count, time, .num, .code-figure {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

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

/* ==========================================================================
   Liquid Glass Surface Component
   ========================================================================== */

.glass {
  position: relative;
  background: var(--glass-fill);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  border: 1px solid var(--glass-stroke);
  border-radius: 18px;
  box-shadow:
    0 1px 0 0 var(--glass-spec) inset,           /* lit specular top edge */
    0 0 0 1px rgba(255, 255, 255, 0.02) inset,
    0 20px 50px -20px rgba(0, 0, 0, 0.45);
  transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

/* Specular sweep highlight across top third */
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(160deg,
    rgba(255, 255, 255, 0.16) 0%,
    rgba(255, 255, 255, 0.03) 32%,
    transparent 58%);
  pointer-events: none;
  z-index: 1;
}

.glass > * {
  position: relative;
  z-index: 2;
}

.glass-interactive:hover {
  background: var(--glass-fill-hi);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow:
    0 1px 0 0 var(--glass-spec) inset,
    0 24px 60px -20px rgba(0, 0, 0, 0.55);
}

/* Mandatory @supports fallback for ~5% browsers without backdrop-filter */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass {
    background: rgba(16, 22, 29, 0.94);
  }
  @media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) .glass {
      background: rgba(255, 255, 255, 0.96);
    }
  }
}

/* Layout Utilities */
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 12px;
  font-family: var(--font-ui);
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 56px auto;
}

.section-header h2 {
  margin-bottom: 14px;
}

.section-header p {
  color: var(--muted);
  font-size: 1.05rem;
}

/* Navigation */
.navbar {
  position: sticky;
  top: 16px;
  z-index: 100;
  margin: 0 16px 24px 16px;
  padding: 12px 24px;
}

.nav-container {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.nav-links {
  display: flex;
  gap: 28px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-subtle);
}

.nav-links a {
  transition: color 0.2s ease;
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 22px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
  border-radius: 8px;
}

.btn-lg {
  padding: 15px 30px;
  font-size: 1.05rem;
  border-radius: 14px;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--accent);
  color: #061A14;
  font-weight: 700;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 16px var(--accent-glow), 0 1px 0 rgba(255, 255, 255, 0.3) inset;
}

.btn-primary:hover {
  background: var(--accent-hi);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px var(--accent-glow);
}

.btn-secondary {
  background: var(--glass-fill);
  color: var(--ink);
  border: 1px solid var(--glass-stroke);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: var(--glass-fill-hi);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Hero Section */
.hero {
  padding: 70px 0 90px 0;
  text-align: center;
}

.hero-content {
  max-width: 820px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 28px;
}

.pulse-icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.hero-title {
  margin-bottom: 22px;
}

.hero-subtitle {
  font-size: 1.18rem;
  line-height: 1.65;
  color: var(--ink-subtle);
  margin-bottom: 36px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta-group {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.hero-proof {
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 0.88rem;
  color: var(--muted);
  flex-wrap: wrap;
}

/* Interactive Preview / Phone Frame */
.demo-section {
  padding: 40px 0 80px 0;
}

.chat-frame-wrapper {
  max-width: 580px;
  margin: 0 auto;
}

.telegram-phone {
  overflow: hidden;
  padding: 0;
}

.telegram-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--glass-stroke);
  background: rgba(255, 255, 255, 0.03);
}

.bot-avatar-thumb {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent);
}

.bot-info {
  flex: 1;
}

.bot-name {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--ink);
}

.bot-status {
  font-size: 0.78rem;
  color: var(--accent);
}

.telegram-messages {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.msg {
  padding: 16px 18px;
  border-radius: 14px;
  font-size: 0.94rem;
  line-height: 1.55;
  max-width: 92%;
}

.bot-msg {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-stroke);
  border-bottom-left-radius: 4px;
}

.msg-author {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-ai {
  font-size: 0.65rem;
  padding: 2px 6px;
  background: var(--glass-fill-hi);
  border: 1px solid var(--glass-stroke);
  border-radius: 4px;
  color: var(--muted);
}

.msg-time {
  font-size: 0.72rem;
  color: var(--dim);
  text-align: right;
  margin-top: 6px;
  font-family: var(--font-mono);
}

.action-card {
  border-color: rgba(95, 191, 163, 0.3);
  background: rgba(95, 191, 163, 0.04);
}

.draft-preview {
  padding: 12px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
  margin-bottom: 12px;
}

.draft-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 4px;
}

.telegram-inline-keyboard {
  display: flex;
  gap: 8px;
}

.tg-btn {
  flex: 1;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--glass-stroke);
  background: var(--glass-fill);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tg-btn:hover {
  background: var(--glass-fill-hi);
}

.tg-btn-primary {
  background: var(--accent);
  color: #061A14;
  font-weight: 700;
  border-color: var(--accent);
}

.tg-btn-danger {
  color: var(--danger);
}

/* Skills Grid */
.skills-section {
  padding: 80px 0;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.skill-card {
  padding: 32px;
}

.skill-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 20px;
  border: 1px solid rgba(95, 191, 163, 0.3);
  color: var(--accent);
}

.skill-card h3 {
  margin-bottom: 10px;
}

.skill-card p {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 18px;
}

.skill-card ul {
  list-style: none;
  font-size: 0.88rem;
  color: var(--ink-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Personas Section & DiceBear Portraits */
.personas-section {
  padding: 80px 0;
}

.personas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.persona-card {
  padding: 24px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.persona-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--glass-fill-hi);
  border: 1px solid var(--glass-stroke);
  box-shadow: 0 1px 0 0 var(--glass-spec) inset, 0 8px 20px -8px rgba(0, 0, 0, 0.4);
  margin-bottom: 14px;
  object-fit: cover;
  display: block;
}

.persona-card h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 2px;
  color: var(--ink);
}

.persona-style {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 10px;
}

.sample-quote {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--muted);
  line-height: 1.45;
}

/* Security Architecture Section */
.security-section {
  padding: 80px 0;
}

.security-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.security-card {
  padding: 28px;
}

.sec-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.security-card h3 {
  margin-bottom: 10px;
}

.security-card p {
  color: var(--muted);
  font-size: 0.92rem;
}

/* Pricing Section */
.pricing-section {
  padding: 80px 0;
}

.founding-banner {
  padding: 32px 36px;
  margin-bottom: 40px;
  border-color: rgba(95, 191, 163, 0.4);
  background: linear-gradient(135deg, rgba(95, 191, 163, 0.08) 0%, rgba(30, 58, 95, 0.12) 100%);
}

.founding-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 16px;
}

.badge-founding {
  padding: 4px 12px;
  background: var(--accent);
  color: #061A14;
  font-weight: 800;
  font-size: 0.78rem;
  border-radius: 999px;
  text-transform: uppercase;
}

.founding-price {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--ink);
}

.founding-price s {
  color: var(--dim);
  font-size: 1.2rem;
  margin-right: 8px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  align-items: stretch;
}

.pricing-card {
  padding: 36px 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pricing-card.featured-tier {
  border-color: rgba(95, 191, 163, 0.5);
  background: var(--glass-fill-hi);
  box-shadow:
    0 1px 0 0 var(--glass-spec) inset,
    0 0 30px -10px var(--accent-glow),
    0 20px 50px -20px rgba(0, 0, 0, 0.45);
}

.popular-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 4px 12px;
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 999px;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.tier-header h3 {
  margin-bottom: 6px;
}

.tier-header p {
  color: var(--muted);
  font-size: 0.9rem;
}

.tier-price {
  margin: 24px 0;
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.tier-price .currency {
  font-size: 1.6rem;
  font-weight: 600;
}

.tier-price .freq {
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 400;
  margin-left: 4px;
}

.tier-features {
  list-style: none;
  font-size: 0.92rem;
  color: var(--ink-subtle);
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
  flex-grow: 1;
}

/* Newsletter / Waitlist Box */
.newsletter-section {
  padding: 40px 0 80px 0;
}

.newsletter-box {
  padding: 44px;
  text-align: center;
  max-width: 680px;
}

.newsletter-box h3 {
  margin-bottom: 10px;
}

.newsletter-box p {
  color: var(--muted);
  font-size: 0.96rem;
  margin-bottom: 24px;
}

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

.input-field {
  flex: 1;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid var(--glass-stroke);
  background: rgba(0, 0, 0, 0.35);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-success {
  margin-top: 16px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid var(--success);
  color: var(--success);
  font-size: 0.92rem;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 460px;
  padding: 36px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--ink);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.modal-desc {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 18px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

/* Footer */
.footer {
  border-top: 1px solid var(--glass-stroke);
  padding: 48px 0;
  font-size: 0.85rem;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.2);
}

.footer-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

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

.footer-links a:hover {
  color: var(--ink);
}

/* ==========================================================================
   Plain High-Contrast Surface for Legal Pages (DESIGN-SPEC.md)
   privacy.html, terms.html, dpa.html stay clean, non-glass, and readable.
   ========================================================================== */

body.legal-page {
  background: #0B0F14;
  background-image: none;
  color: #E2E8F0;
  line-height: 1.7;
}

body.legal-page .legal-container {
  max-width: 780px;
  margin: 40px auto 80px auto;
  padding: 0 24px;
}

body.legal-page h1 {
  font-size: 2.4rem;
  margin-bottom: 12px;
  color: #FFFFFF;
}

body.legal-page h2 {
  font-size: 1.5rem;
  margin-top: 36px;
  margin-bottom: 12px;
  color: #FFFFFF;
}

body.legal-page h3 {
  font-size: 1.2rem;
  margin-top: 24px;
  margin-bottom: 8px;
  color: #E2E8F0;
}

body.legal-page p, body.legal-page li {
  color: #CBD5E1;
  margin-bottom: 14px;
}

body.legal-page a {
  color: var(--accent);
  text-decoration: underline;
}

/* ==========================================================================
   Accessibility: Reduced Motion Preference
   ========================================================================== */

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