/* Vikzaro site stylesheet. Dark tokens by default, light via :root[data-theme="light"]. */

/* ----- Fonts (self-hosted, no external requests) ------------------------- */
@font-face {
  font-family: "InterVariable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}
@font-face {
  font-family: "InterVariable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF,
    U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ----- Design tokens : DARK (default) --------------------------------- */
:root {
  --bg: #0b1017;
  --bg-soft: #0d131c;
  --surface: #111a26;
  --surface-2: #16202e;
  --surface-3: #1c2838;
  --text: #e7edf7;
  --text-strong: #f3f7fd;
  --muted: #9fadc2;
  --line: #223044;
  --line-soft: #2c3c54;
  --accent: #3ba8fd;
  --accent-hover: #62bafd;
  --accent-ink: #a6d5fe;
  --accent-contrast: #06121f;
  --accent-tint: rgba(59, 168, 253, 0.14);
  --ring: #8ccbfe;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 14px 30px rgba(0, 0, 0, 0.42);
  --shadow-lg: 0 28px 64px rgba(0, 0, 0, 0.5);
  --header-bg: rgba(11, 16, 23, 0.72);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  color-scheme: dark;
}

/* ----- Design tokens : LIGHT (opt-in via toggle) --------------------- */
:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-soft: #f5f8fc;
  --surface: #ffffff;
  --surface-2: #f1f5fa;
  --surface-3: #e9eff7;
  --text: #101a2b;
  --text-strong: #0a1220;
  --muted: #4c5b71;
  --line: #e3e9f1;
  --line-soft: #d5deea;
  --accent: #0066f8;
  --accent-hover: #0052c8;
  --accent-ink: #0049b8;
  --accent-contrast: #ffffff;
  --accent-tint: #e8f1ff;
  --ring: #0066f8;
  --shadow-sm: 0 1px 2px rgba(16, 26, 43, 0.06), 0 1px 3px rgba(16, 26, 43, 0.05);
  --shadow-md: 0 10px 24px rgba(16, 26, 43, 0.08), 0 2px 6px rgba(16, 26, 43, 0.05);
  --shadow-lg: 0 24px 60px rgba(16, 26, 43, 0.12);
  --header-bg: rgba(255, 255, 255, 0.72);
  color-scheme: light;
}

/* ----- Reset / base -------------------------------------------------- */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "InterVariable", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv05" 1, "ss01" 1;
}

img {
  max-width: 100%;
  height: auto;
}

::selection {
  background: var(--accent);
  color: var(--accent-contrast);
}

/* ----- Layout primitives ------------------------------------------- */
.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.section {
  padding: clamp(3.5rem, 2.4rem + 4vw, 6.5rem) 0;
  scroll-margin-top: 92px;
}

.section.muted-bg {
  background: var(--bg-soft);
  border-block: 1px solid var(--line);
}

.section-head {
  max-width: 62ch;
  margin-bottom: clamp(1.8rem, 1.2rem + 1.6vw, 2.8rem);
}

/* ----- Typography ------------------------------------------------- */
h1,
h2,
h3 {
  color: var(--text-strong);
  text-wrap: balance;
}

h1 {
  margin: 0;
  font-size: clamp(2.3rem, 1.55rem + 3.1vw, 3.3rem);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.022em;
}

h2 {
  margin: 0 0 0.9rem;
  font-size: clamp(1.7rem, 1.3rem + 1.7vw, 2.35rem);
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h3 {
  margin: 0 0 0.55rem;
  font-size: 1.12rem;
  line-height: 1.35;
  font-weight: 650;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

.lead {
  color: var(--muted);
  font-size: clamp(1.02rem, 0.98rem + 0.3vw, 1.15rem);
  max-width: 64ch;
}

/* ----- Skip link ----------------------------------------------- */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 700;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus-visible {
  top: 12px;
}

/* ----- Header / nav ------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--header-bg);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  flex-shrink: 0;
  color: var(--text-strong);
}

.brand-logo {
  height: clamp(22px, 2.4vw, 28px);
  width: auto;
  display: block;
}

/* Logo per theme: white wordmark on dark (default), navy wordmark on light */
.brand-logo-light {
  display: none;
}

:root[data-theme="light"] .brand-logo-light {
  display: block;
}

:root[data-theme="light"] .brand-logo-dark {
  display: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

nav[aria-label="Principal"] {
  display: flex;
  align-items: center;
  gap: 1.05rem;
}

nav[aria-label="Principal"] a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-weight: 550;
  font-size: 0.86rem;
  padding: 0.35rem 0;
  white-space: nowrap;
  transition: color 0.15s ease;
}

nav[aria-label="Principal"] a:hover {
  color: var(--text-strong);
}

nav[aria-label="Principal"] a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -2px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: right 0.2s ease;
}

nav[aria-label="Principal"] a:hover::after {
  right: 0;
}

/* control cluster: language + theme */
.controls {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.lang-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.34rem 0.66rem;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-btn:hover {
  color: var(--text-strong);
}

.lang-btn.is-active {
  background: var(--accent);
  color: var(--accent-contrast);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.icon-btn:hover {
  color: var(--text-strong);
  border-color: var(--accent);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* dark default → show the sun (tap to go light); light → show the moon */
.theme-toggle .icon-moon {
  display: none;
}
.theme-toggle .icon-sun {
  display: block;
}
:root[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}
:root[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}

/* hamburger, hidden on desktop */
.nav-toggle {
  display: none;
}

/* ----- Buttons --------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.78rem 1.25rem;
  font: inherit;
  font-weight: 650;
  font-size: 0.96rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease,
    background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: transparent;
  color: var(--text-strong);
  border-color: var(--line-soft);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
  transform: translateY(-1px);
}

.btn-block {
  width: 100%;
  margin-top: 0.9rem;
}

/* ----- Hero ---------------------------------------------- */
.hero {
  position: relative;
  padding-top: clamp(3.2rem, 2rem + 5vw, 5.5rem);
  padding-bottom: clamp(3rem, 2rem + 4vw, 5rem);
  overflow: hidden;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: clamp(1.5rem, 1rem + 3vw, 3.5rem);
  align-items: center;
}

.hero-grid > div {
  max-width: 640px;
}

.hero .lead {
  margin-top: 1.15rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.6rem;
}

.hero-trust {
  margin-top: 1.5rem;
  font-size: 0.86rem;
  color: var(--muted);
}

.hero-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 1.4rem;
}

.hero-panel h2 {
  font-size: 1.05rem;
  margin-bottom: 0.9rem;
}

/* ----- Technical hero card (Website / Linux Server / Private Git / Backup) */
.tech-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.85rem;
}

.tech-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.tech-list li > span:last-child {
  display: grid;
  gap: 0.1rem;
}

.tech-list strong {
  display: block;
  color: var(--text-strong);
  font-size: 0.96rem;
  font-weight: 650;
}

.tech-list em {
  display: block;
  font-style: normal;
  color: var(--muted);
  font-size: 0.84rem;
}

.tech-icon {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent-tint);
  color: var(--accent-ink);
}

.tech-icon svg {
  width: 18px;
  height: 18px;
}

/* ----- Stats band ------------------------------------- */
.stats {
  border-block: 1px solid var(--line);
  background: var(--surface-2);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1rem, 0.5rem + 2vw, 2.5rem);
  padding: clamp(1.8rem, 1.2rem + 2vw, 2.6rem) 0;
}

.stat {
  text-align: left;
}

.stat-value {
  font-size: clamp(1.9rem, 1.4rem + 1.8vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  font-feature-settings: "tnum" 1;
  line-height: 1;
}

.stat-label {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ----- Card grids ----------------------------------- */
.cards {
  display: grid;
  gap: 1.1rem;
}

.cards.two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cards.three-cols {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cards.four-cols {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card,
.about-block,
.contact-block,
.eu-block,
.cross-block,
.cta-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
}

.card {
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.card-index {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 0.85rem;
  border-radius: 8px;
  background: var(--accent-tint);
  color: var(--accent-ink);
  font-size: 0.82rem;
  font-weight: 700;
  font-feature-settings: "tnum" 1;
}

.card p,
.about-block p,
.contact-block p,
.eu-block p {
  color: var(--muted);
}

.card p + p,
.about-block p + p,
.contact-block p + p,
.eu-block p + p {
  margin-top: 0.7rem;
}

.card ul {
  margin: 0.7rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.45rem;
}

.card ul li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.card ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.card .quote {
  font-style: italic;
  color: var(--text-strong);
  font-weight: 600;
}

.card-cross-note {
  margin-top: auto;
  padding-top: 0.9rem;
  font-size: 0.85rem;
}

.card-cross-note a {
  color: var(--accent-ink);
  font-weight: 600;
}

/* ----- Chips ----------------------------------------------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.4rem;
}

.chips span {
  border: 1px solid var(--line-soft);
  background: var(--surface);
  color: var(--text);
  padding: 0.46rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 500;
}

/* ----- EU hosting block ------------------------------------ */
.eu-block {
  max-width: 78ch;
}

.eu-disclaimer {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
}

/* ----- Steps ("Cum lucrăm") --------------------------------- */
.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1.1rem;
  counter-reset: step;
}

.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.1rem;
  box-shadow: var(--shadow-sm);
}

.step-index {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: 0.85rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 700;
  font-size: 0.9rem;
}

.step p {
  color: var(--muted);
  font-size: 0.88rem;
}

/* ----- About / EU / cross / contact blocks ------------------ */
.about-block,
.cross-block {
  max-width: 70ch;
}

.about-block a,
.cross-block a,
.faq-item a {
  color: var(--accent-ink);
  font-weight: 600;
}

.cross-block .btn {
  margin-top: 1.1rem;
}

/* ----- CTA band ---------------------------------------------- */
.cta-band {
  background: var(--bg-soft);
}

.cta-block {
  max-width: 62ch;
  text-align: left;
  border-color: var(--line-soft);
}

.cta-block p {
  margin-top: 0.7rem;
  color: var(--muted);
}

.cta-block .btn {
  margin-top: 1.3rem;
}

/* ----- FAQ (native details/summary) ---------------------------- */
.faq-list {
  display: grid;
  gap: 0.7rem;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.2rem 1.2rem;
}

.faq-item summary {
  cursor: pointer;
  padding: 1rem 0;
  font-weight: 650;
  color: var(--text-strong);
  list-style: none;
}

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

.faq-item summary::after {
  content: "+";
  float: right;
  color: var(--accent-ink);
  font-weight: 700;
}

.faq-item[open] summary::after {
  content: "\2212";
}

.faq-item p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ----- Contact ---------------------------------- */
.contact-block {
  max-width: 720px;
  border-color: var(--line-soft);
}

.contact-form {
  margin-top: 1.3rem;
  display: grid;
  gap: 0.95rem;
}

.form-row {
  display: grid;
  gap: 0.4rem;
}

.form-row label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-strong);
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  padding: 0.72rem 0.85rem;
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-row input::placeholder,
.form-row textarea::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

.form-row textarea {
  resize: vertical;
  min-height: 130px;
}

.contact-form .btn-primary {
  margin-top: 0.3rem;
  justify-self: start;
}

.form-status {
  margin: 0.1rem 0 0;
  font-size: 0.92rem;
  color: var(--muted);
  min-height: 1.2em;
}

.form-status.is-error {
  color: #ff9b9b;
}

.form-status.is-success {
  color: #7be4a1;
}

:root[data-theme="light"] .form-status.is-error {
  color: #c0392b;
}
:root[data-theme="light"] .form-status.is-success {
  color: #1e7d4d;
}

.contact-email {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
  color: var(--muted);
}

.contact-email-link {
  color: var(--accent-ink);
  text-decoration: none;
  font-weight: 600;
}

.contact-email-link:hover {
  text-decoration: underline;
}

/* ----- Footer --------------------------------- */
.site-footer {
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  padding: clamp(2.5rem, 1.8rem + 2vw, 3.5rem) 0 1.8rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr 1.1fr;
  gap: 1.8rem;
}

.footer-brand p {
  margin-top: 0.7rem;
  max-width: 34ch;
}

.footer-col h4 {
  margin: 0 0 0.7rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-strong);
}

.footer-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.45rem;
}

.footer-col a {
  color: var(--muted);
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--text-strong);
  text-decoration: underline;
}

.footer-bottom {
  margin-top: 2.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.footer-legal-note {
  max-width: 60ch;
}

/* ----- Focus ring ---------------------------- */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ----- Reduced motion --------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ----- Honeypot ---------------------------- */
.honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

/* ----- Legal pages ------------------------ */
.legal {
  padding: clamp(2.5rem, 2rem + 3vw, 4.5rem) 0;
}

.legal .container {
  width: min(760px, 92vw);
}

.legal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}

.legal-top .back-link {
  margin-bottom: 0;
}

.legal [data-lang][hidden] {
  display: none !important;
}

.legal h1 {
  font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.5rem);
  margin-bottom: 1rem;
}

.legal h2 {
  font-size: 1.2rem;
  margin-top: 2rem;
}

.legal p,
.legal li {
  color: var(--muted);
}

.legal a {
  color: var(--accent-ink);
}

.legal .back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-weight: 600;
  color: var(--accent-ink);
  text-decoration: none;
}

/* ----- 404 page ---------------------------- */
.not-found {
  padding: clamp(4rem, 3rem + 5vw, 7rem) 0;
  text-align: center;
}

.not-found .container {
  width: min(620px, 92vw);
}

.not-found h1 {
  font-size: clamp(2.4rem, 1.8rem + 2vw, 3.4rem);
}

.not-found p {
  margin-top: 0.9rem;
  color: var(--muted);
}

.not-found .btn {
  margin-top: 1.6rem;
}

/* ========================================================================
   Responsive
   ======================================================================== */
@media (max-width: 1080px) {
  nav[aria-label="Principal"] {
    display: none;
  }

  .nav-toggle {
    display: inline-grid;
  }

  .header-right {
    display: contents;
  }
}

@media (max-width: 900px) {
  .nav-wrap {
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: inline-grid;
    order: 3;
  }

  .header-right {
    display: flex;
    order: 4;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.9rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.25s ease;
    padding: 0;
  }

  .site-header.nav-open .header-right {
    max-height: 80vh;
    opacity: 1;
    padding: 0.4rem 0 1rem;
  }

  nav[aria-label="Principal"] {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
  }

  nav[aria-label="Principal"] a {
    padding: 0.7rem 0.2rem;
    border-bottom: 1px solid var(--line);
    font-size: 0.98rem;
  }

  nav[aria-label="Principal"] a::after {
    display: none;
  }

  .controls {
    justify-content: space-between;
  }

  .hero-grid,
  .cards.two-cols,
  .cards.three-cols,
  .cards.four-cols,
  .steps {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    order: -1;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.4rem;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.4rem;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .btn {
    width: 100%;
  }

  .hero-actions {
    flex-direction: column;
  }
}

@media (min-width: 901px) and (max-width: 1080px) {
  /* between breakpoints: hamburger shown (nav hidden above), but header-right
     must stay visible/inline until the 900px stacked layout kicks in */
  .header-right {
    display: flex;
    order: 0;
    width: auto;
    max-height: none;
    opacity: 1;
    padding: 0;
    flex-direction: row;
  }
  nav[aria-label="Principal"] {
    display: none;
  }
}

@media (max-width: 520px) {
  .stats-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .stat {
    text-align: center;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}
