:root {
  color-scheme: dark;
  --bg: #04070d;
  --bg-soft: #09101b;
  --card: rgba(9, 15, 26, 0.84);
  --card-strong: rgba(11, 18, 31, 0.96);
  --surface: rgba(255, 255, 255, 0.04);
  --border: rgba(97, 136, 217, 0.18);
  --border-strong: rgba(224, 168, 78, 0.34);
  --text: #f7f8fb;
  --muted: rgba(247, 248, 251, 0.72);
  --subtle: rgba(247, 248, 251, 0.46);
  --accent: #e0a84e;
  --accent-cold: #7aa6ff;
  --shadow: 0 42px 140px rgba(2, 6, 14, 0.58);
  --shadow-soft: 0 28px 72px rgba(3, 8, 18, 0.42);
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --font-body: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 16% 14%, rgba(66, 111, 232, 0.32), transparent 24%),
    radial-gradient(circle at 84% 16%, rgba(224, 168, 78, 0.18), transparent 24%),
    radial-gradient(circle at 46% 72%, rgba(97, 205, 178, 0.1), transparent 28%),
    linear-gradient(180deg, #060910 0%, #04070d 52%, #02050a 100%);
  font-family: var(--font-body);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(circle at center, black 24%, transparent 82%);
  opacity: 0.72;
  z-index: -2;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.04), transparent 34%),
    radial-gradient(circle at 52% 0%, rgba(255, 255, 255, 0.06), transparent 40%);
  z-index: -1;
}

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

a:hover {
  color: inherit;
}

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

p {
  margin: 0 0 1rem;
  color: var(--muted);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.page-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 56px;
}

.site-header,
.page-hero,
.hero-rail,
.content-card,
.section,
.site-footer {
  backdrop-filter: blur(24px);
}

.site-header {
  position: sticky;
  top: 18px;
  z-index: 20;
  display: grid;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(9, 15, 26, 0.9) 0%, rgba(5, 9, 16, 0.98) 100%);
  box-shadow: var(--shadow);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand span {
  font-family: var(--font-display);
  font-size: 1.55rem;
}

.brand img {
  width: 30px;
  height: 30px;
  flex: none;
}

.header-cta,
.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease;
}

.header-cta,
.hero-cta.primary {
  color: #09060a;
  background: linear-gradient(135deg, var(--accent), #f6c36f);
  box-shadow: 0 24px 40px rgba(224, 168, 78, 0.28);
}

.header-cta:hover,
.hero-cta:hover {
  transform: translateY(-2px);
}

.site-nav,
.language-switcher,
.hero-actions,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.site-nav a,
.language-switcher a,
.footer-links a,
.hero-cta:not(.primary) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    background-color 160ms ease;
}

.site-nav a:hover,
.language-switcher a:hover,
.footer-links a:hover,
.hero-cta:not(.primary):hover,
.site-nav a:focus-visible,
.language-switcher a:focus-visible,
.footer-links a:focus-visible,
.hero-cta:not(.primary):focus-visible {
  color: var(--text);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.site-nav a.is-active,
.language-switcher a[aria-current="page"] {
  color: #09060a;
  border-color: transparent;
  background: linear-gradient(135deg, rgba(208, 169, 106, 0.96), #f1ddbb);
}

.page-main {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

.hero-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
}

.page-hero,
.content-card,
.section,
.site-footer,
.hero-rail {
  border: 1px solid var(--border);
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(9, 15, 26, 0.9) 0%, rgba(5, 9, 16, 0.98) 100%);
  box-shadow: var(--shadow);
}

.page-hero,
.hero-rail {
  position: relative;
  overflow: hidden;
}

.page-hero::before,
.hero-rail::before,
.content-card::before,
.section::before,
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent 34%),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.08), transparent 24%);
  opacity: 0.65;
}

.page-hero > *,
.hero-rail > *,
.content-card > *,
.section > *,
.site-footer > * {
  position: relative;
  z-index: 1;
}

.page-hero {
  padding: clamp(26px, 4vw, 48px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
  color: var(--subtle);
  font-size: 0.88rem;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb span {
  color: rgba(255, 255, 255, 0.24);
}

.page-hero h1 {
  max-width: 12ch;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 5.6rem);
}

.hero-copy {
  max-width: 66ch;
  margin-top: 20px;
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  line-height: 1.8;
}

.hero-actions {
  margin-top: 28px;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
}

.hero-rail {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.rail-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.rail-links {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.rail-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

.rail-links a:hover,
.rail-links a:focus-visible {
  transform: translateY(-1px);
  border-color: var(--border-strong);
}

.rail-list {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.rail-list li + li {
  margin-top: 10px;
}

.content-card {
  position: relative;
  padding: clamp(18px, 3vw, 34px);
}

.section {
  position: relative;
  padding: clamp(20px, 3vw, 28px);
  margin-bottom: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(8, 14, 24, 0.46));
  box-shadow: var(--shadow-soft);
}

.section-standalone {
  margin-bottom: 0;
}

.section:last-child {
  margin-bottom: 0;
}

.section-heading {
  margin-bottom: 16px;
}

.section-heading h2 {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2vw, 2.2rem);
}

.stack-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.stack-list li + li {
  margin-top: 10px;
}

.stack-list.numbered {
  padding-left: 22px;
}

.stack-list.numbered li::marker {
  color: var(--accent);
  font-weight: 900;
}

.formula-card,
.callout {
  padding: 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.formula {
  margin-bottom: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(208, 169, 106, 0.12);
  border: 1px solid rgba(208, 169, 106, 0.24);
  color: #f5e7cf;
  font-family: "SFMono-Regular", Consolas, ui-monospace, monospace;
  font-size: 0.98rem;
  overflow-x: auto;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: top;
}

th {
  color: #fff;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

td {
  color: var(--muted);
}

.card-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card-link {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease;
}

.card-link:hover,
.card-link:focus-visible {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.05);
}

.card-link strong {
  font-size: 1.06rem;
  letter-spacing: -0.02em;
}

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

.card-kicker {
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.card-arrow {
  margin-top: 6px;
  color: var(--text);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-list details {
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.faq-list summary {
  cursor: pointer;
  list-style: none;
  font-weight: 800;
  color: #fff;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list p {
  margin-top: 10px;
  margin-bottom: 0;
}

.callout strong {
  display: block;
  margin-bottom: 8px;
  font-size: 0.98rem;
  color: #fff;
}

.site-footer {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 22px;
  padding: 22px 24px;
  margin-top: 24px;
}

.footer-copy strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: -0.03em;
}

.site-footer p {
  margin: 8px 0 0;
  max-width: 54ch;
}

html[dir="rtl"] body {
  direction: rtl;
}

html[dir="rtl"] .site-header,
html[dir="rtl"] .site-footer,
html[dir="rtl"] .page-hero,
html[dir="rtl"] .content-card,
html[dir="rtl"] .section,
html[dir="rtl"] .hero-rail {
  text-align: right;
}

html[dir="rtl"] .site-nav,
html[dir="rtl"] .footer-links,
html[dir="rtl"] .language-switcher,
html[dir="rtl"] .hero-actions {
  justify-content: flex-start;
}

html[dir="rtl"] .breadcrumb {
  flex-direction: row-reverse;
}

html[dir="rtl"] th,
html[dir="rtl"] td {
  text-align: right;
}

@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .site-header,
  .site-footer {
    position: static;
  }

  .header-top,
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav,
  .footer-links,
  .language-switcher,
  .hero-actions {
    justify-content: flex-start;
  }

  .page-hero h1 {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
