/* ═══════════════════════════════════════════════════════════════════════════
   Ryla Design System — Dark Theme
   Font: Inter (loaded in base.html)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Design Tokens ──────────────────────────────────────────────────────── */
:root {
  /* Text */
  --ink:   #EDEDF1;
  --ink-2: #C8C8D4;
  --sub:   #8E8EA0;
  --sub-2: #5C5C72;

  /* Surfaces */
  --bg:       #0C0C10;
  --bg-off:   #101014;
  --bg-2:     #16161C;
  --surface:  #1A1A22;
  --border:   #252530;
  --border-2: #35354A;

  /* Brand — teal (lighter for dark bg) */
  --brand:       #2DD4BF;
  --brand-hover: #5EEAD4;
  --brand-light: #0B2926;
  --brand-muted: #134E4A;
  --brand-text:  #99F6E4;

  /* Safe */
  --safe:        #4ADE80;
  --safe-bg:     #052512;
  --safe-border: #16532D;
  --safe-text:   #86EFAC;

  /* Danger */
  --danger:        #F87171;
  --danger-bg:     #2A0808;
  --danger-border: #7F1D1D;
  --danger-text:   #FCA5A5;

  /* Shadows (lighter on dark) */
  --shadow-xs: 0 1px 3px 0 rgb(0 0 0 / 0.4);
  --shadow-sm: 0 2px 6px 0 rgb(0 0 0 / 0.35);
  --shadow-md: 0 4px 12px 0 rgb(0 0 0 / 0.45);
  --shadow-lg: 0 10px 24px 0 rgb(0 0 0 / 0.5);
  --shadow-xl: 0 20px 40px 0 rgb(0 0 0 / 0.55);

  /* Radii */
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   14px;
  --r-xl:   18px;
  --r-2xl:  22px;
  --r-pill: 999px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Reset / Base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink);
  margin: 0;
}

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

/* ── Layout ─────────────────────────────────────────────────────────────── */
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.25rem;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Navigation ─────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
  background: rgba(12, 12, 16, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.nav__logo { height: 30px; width: auto; }

.nav__dot {
  width: 7px;
  height: 7px;
  background: var(--brand);
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(45, 212, 191, 0.6);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.nav__link {
  text-decoration: none;
  color: var(--sub);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: var(--r-md);
  transition: color 140ms ease, background 140ms ease;
}

.nav__link:hover {
  color: var(--ink);
  background: var(--bg-2);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

@media (max-width: 640px) {
  .nav__links { display: none; }
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 140ms ease;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  line-height: 1;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  padding: 10px 20px;
}
.btn-primary:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-brand {
  background: var(--brand);
  color: var(--bg);
  padding: 10px 20px;
}
.btn-brand:hover {
  background: var(--brand-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(45, 212, 191, 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--sub);
  padding: 10px 18px;
  border: 1.5px solid var(--border);
}
.btn-ghost:hover {
  color: var(--ink);
  border-color: var(--border-2);
  background: var(--bg-2);
}

.btn-lg {
  padding: 13px 26px;
  font-size: 1rem;
  font-weight: 700;
}

/* ── App Store button ────────────────────────────────────────────────────── */
.btn-store {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: var(--r-pill);
  padding: 10px 20px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
  transition: all 140ms ease;
  flex-shrink: 0;
  border: none;
}
.btn-store:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-store svg { flex-shrink: 0; }

@media (max-width: 640px) {
  .btn-store { font-size: 0.8rem; padding: 8px 14px; }
}

/* ── Badge / Pill ───────────────────────────────────────────────────────── */
.badge,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: var(--r-pill);
  padding: 4px 11px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  background: var(--brand-light);
  color: var(--brand-text);
  border: 1px solid var(--brand-muted);
}

.badge-neutral {
  background: var(--bg-2);
  color: var(--sub);
  border-color: var(--border);
}

.badge-green {
  background: var(--safe-bg);
  color: var(--safe);
  border-color: var(--safe-border);
}

.badge-red {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-border);
}

/* ── Card ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 24px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease), border-color 160ms ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
  border-color: var(--border-2);
}

/* ── Glass ──────────────────────────────────────────────────────────────── */
.glass {
  background: rgba(22, 22, 30, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
}

/* ── Section eyebrow ────────────────────────────────────────────────────── */
.section-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 10px;
}

/* ── App Store CTA block ────────────────────────────────────────────────── */
.ryla-cta-block,
.cta-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  padding: 28px 32px;
  margin: 28px 0;
  position: relative;
  overflow: hidden;
}

.ryla-cta-block::before,
.cta-block::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.ryla-cta-block__icon,
.cta-block__icon {
  font-size: 1.75rem;
  line-height: 1;
  margin-bottom: 12px;
}

.ryla-cta-block__headline,
.cta-block__title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 6px;
}

.ryla-cta-block__sub,
.cta-block__sub {
  color: var(--sub);
  font-size: 0.95rem;
  margin: 0 0 20px;
  line-height: 1.6;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
.footer,
.ryla-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-off);
  margin-top: 80px;
  padding: 36px 0;
}

.footer__inner,
.ryla-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}

@media (min-width: 768px) {
  .footer__inner,
  .ryla-footer__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.footer__brand,
.ryla-footer__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.footer__copy,
.ryla-footer__copy {
  font-size: 0.875rem;
  color: var(--sub-2);
  margin: 0;
}

/* ── Article detail page ────────────────────────────────────────────────── */

/* Page header band */
.article-header {
  background: var(--bg-off);
  border-bottom: 1px solid var(--border);
  padding: 52px 24px 44px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Safe/danger tinted header */
.article-header--safe {
  background: linear-gradient(to bottom, rgba(74, 222, 128, 0.06) 0%, transparent 100%),
              var(--bg-off);
}

.article-header--danger {
  background: linear-gradient(to bottom, rgba(248, 113, 113, 0.07) 0%, transparent 100%),
              var(--bg-off);
}

.article-breadcrumb {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--sub-2);
  margin-bottom: 20px;
}
.article-breadcrumb a {
  color: var(--sub);
  text-decoration: none;
  transition: color 120ms ease;
}
.article-breadcrumb a:hover { color: var(--ink); }
.article-breadcrumb span { color: var(--sub-2); }

/* 2-column layout */
.article-layout {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
}

@media (max-width: 900px) {
  .article-layout {
    grid-template-columns: 1fr;
  }
}

.article-aside {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Article title ──────────────────────────────────────────────────────── */
.ryla-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.ryla-title {
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.08;
  text-align: center;
  margin: 0 0 0;
  color: var(--ink);
}

/* ── Verdict alert boxes ────────────────────────────────────────────────── */
.ryla-alert {
  border-radius: var(--r-xl);
  padding: 22px 26px 22px 30px;
  margin-bottom: 24px;
  border: 1.5px solid;
  position: relative;
  overflow: hidden;
}

.ryla-alert::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
}

.ryla-alert-safe {
  background: var(--safe-bg);
  border-color: var(--safe-border);
  color: var(--safe-text);
}
.ryla-alert-safe::before { background: var(--safe); }

.ryla-alert-danger {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger-text);
}
.ryla-alert-danger::before { background: var(--danger); }

.ryla-alert-title {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.ryla-alert-text {
  margin: 0;
  font-size: 0.975rem;
  line-height: 1.65;
  opacity: 0.85;
}

/* ── Article body — the key upgrade ────────────────────────────────────── */
.ryla-content {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--sub);
  margin: 0 0 40px;
}

/* First h2 gets no top margin */
.ryla-content h2:first-child { margin-top: 0; }

.ryla-content h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--ink);
  margin: 2.2em 0 0.65em;
  padding-bottom: 0.5em;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.ryla-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink-2);
  margin: 1.6em 0 0.45em;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.ryla-content h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-2);
  margin: 1.2em 0 0.4em;
  letter-spacing: -0.01em;
}

.ryla-content p { margin: 0 0 1.1em; }

.ryla-content ul,
.ryla-content ol {
  margin: 0 0 1.1em;
  padding-left: 1.6em;
}

.ryla-content ul li,
.ryla-content ol li {
  margin-bottom: 0.45em;
  line-height: 1.75;
}

.ryla-content ul li::marker { color: var(--brand); }
.ryla-content ol li::marker { color: var(--brand); font-weight: 700; }

.ryla-content strong {
  color: var(--ink);
  font-weight: 700;
}

.ryla-content em { font-style: italic; color: var(--ink-2); }

.ryla-content a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ryla-content a:hover { color: var(--brand-hover); }

.ryla-content blockquote {
  margin: 1.5em 0;
  padding: 16px 20px;
  border-left: 3px solid var(--brand);
  background: var(--bg-2);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  color: var(--ink-2);
  font-style: italic;
}

.ryla-content code {
  font-family: ui-monospace, 'Cascadia Code', Menlo, monospace;
  font-size: 0.87em;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 2px 6px;
  color: var(--brand-text);
}

.ryla-content pre {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  overflow-x: auto;
  margin: 1.2em 0;
}

.ryla-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

/* ── Source box ─────────────────────────────────────────────────────────── */
.ryla-source {
  margin-top: 28px;
  border-top: 1px solid var(--border);
  padding-top: 28px;
}
.ryla-source h3 {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--sub-2);
  margin: 0 0 12px;
}
.ryla-source p {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  font-family: ui-monospace, 'Cascadia Code', Menlo, monospace;
  font-size: 0.83rem;
  color: var(--sub);
  line-height: 1.7;
  margin: 0;
}

/* ── FAQ ────────────────────────────────────────────────────────────────── */
.ryla-faq {
  margin-top: 40px;
  border-top: 1px solid var(--border);
  padding-top: 32px;
}
.ryla-faq h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0 0 20px;
  letter-spacing: -0.025em;
}
.ryla-faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  margin-bottom: 10px;
}
.ryla-faq-q {
  font-size: 0.975rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.ryla-faq-a {
  margin: 0;
  color: var(--sub);
  line-height: 1.7;
  font-size: 0.95rem;
}
.ryla-faq-a a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Legacy nav aliases ─────────────────────────────────────────────────── */
.ryla-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
  background: rgba(12, 12, 16, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.ryla-nav__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}
.ryla-nav__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}
.ryla-nav__logo { height: 30px; width: auto; }
.ryla-nav__name {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.ryla-nav__links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}
.ryla-nav__link {
  text-decoration: none;
  color: var(--sub);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: var(--r-md);
  transition: color 140ms ease, background 140ms ease;
}
.ryla-nav__link:hover { color: var(--ink); background: var(--bg-2); }
.ryla-nav__cta { margin-left: auto; flex-shrink: 0; }

@media (max-width: 640px) {
  .ryla-nav__links { display: none; }
  .ryla-nav__cta { font-size: 0.8rem; padding: 8px 14px; }
  .ryla-nav__cta svg { display: none; }
}

/* ── Scroll animations ──────────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0);    }
}

.animate-fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.animate-fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}
