/* German Morning — landing styles. Mobile-first, light + dark, no dependencies. */
:root {
  --bg: #faf7f2;
  --bg-glow-1: rgba(244, 181, 63, .28);
  --bg-glow-2: rgba(26, 90, 166, .14);
  --surface: #ffffff;
  --surface-2: #f2ede4;
  --ink: #1b2430;
  --muted: #4f5b67;
  --line: #e7e0d4;
  --accent: #1a5aa6;
  --accent-ink: #ffffff;
  --accent-hover: #144a8a;
  --accent-soft: #e6eef8;
  --sun: #f4b53f;
  --hl: rgba(244, 181, 63, .55);
  --navy: #16324f;
  --header-bg: rgba(250, 247, 242, .86);
  --chip-bg: #1b2430;
  --chip-ink: #ffffff;
  --ghost-line: #ddd4c6;
  --ghost-hover-line: #c6bcab;
  --screen: #eef2f6;
  --screen-line: #e1e6ec;
  --bubble: #ffffff;
  --bubble-me: #d9ecff;
  --final-bg: #16324f;
  --t1: #fdeccd; --t2: #e3eefb; --t3: #e6f5ea; --t4: #fde4e4;
  --t5: #efe7fb; --t6: #fff1d6; --t7: #e0f3f5; --t8: #f3ece2;
  --shadow: 0 1px 2px rgba(27, 36, 48, .05), 0 10px 30px rgba(27, 36, 48, .07);
  --shadow-lift: 0 2px 4px rgba(27, 36, 48, .06), 0 18px 40px rgba(27, 36, 48, .12);
  --radius: 22px;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --wrap: 1140px;
  color-scheme: light;
}

/* Dark theme: follows the system unless the visitor picked light; or an explicit pick. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e141d; --bg-glow-1: rgba(244, 181, 63, .13); --bg-glow-2: rgba(120, 178, 242, .14);
    --surface: #151e2a; --surface-2: #1d2937; --ink: #eaf0f6; --muted: #a9b6c4; --line: #273647;
    --accent: #7ab4f3; --accent-ink: #0b1520; --accent-hover: #a0c9f7; --accent-soft: #1b2e45;
    --hl: rgba(244, 181, 63, .38);
    --header-bg: rgba(14, 20, 29, .82); --chip-bg: #eaf0f6; --chip-ink: #0e141d;
    --ghost-line: #2f4054; --ghost-hover-line: #45607d;
    --screen: #18222f; --screen-line: #273647; --bubble: #212e3d; --bubble-me: #25496f; --final-bg: #183654;
    --t1: #3a2e17; --t2: #1b2e45; --t3: #19352a; --t4: #3d2023; --t5: #2c2342; --t6: #3a3018; --t7: #163538; --t8: #30291f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 30px rgba(0, 0, 0, .25);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .4), 0 18px 40px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e141d; --bg-glow-1: rgba(244, 181, 63, .13); --bg-glow-2: rgba(120, 178, 242, .14);
  --surface: #151e2a; --surface-2: #1d2937; --ink: #eaf0f6; --muted: #a9b6c4; --line: #273647;
  --accent: #7ab4f3; --accent-ink: #0b1520; --accent-hover: #a0c9f7; --accent-soft: #1b2e45;
  --hl: rgba(244, 181, 63, .38);
  --header-bg: rgba(14, 20, 29, .82); --chip-bg: #eaf0f6; --chip-ink: #0e141d;
  --ghost-line: #2f4054; --ghost-hover-line: #45607d;
  --screen: #18222f; --screen-line: #273647; --bubble: #212e3d; --bubble-me: #25496f; --final-bg: #183654;
  --t1: #3a2e17; --t2: #1b2e45; --t3: #19352a; --t4: #3d2023; --t5: #2c2342; --t6: #3a3018; --t7: #163538; --t8: #30291f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 30px rgba(0, 0, 0, .25);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .4), 0 18px 40px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }

a { color: var(--accent); text-underline-offset: .18em; }
a:hover { color: var(--accent-hover); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

h1, h2, h3 { line-height: 1.12; margin: 0 0 .55em; }
h1 { font-size: clamp(2.15rem, 1.25rem + 4vw, 3.9rem); font-weight: 850; letter-spacing: -.035em; }
h2 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.6rem); font-weight: 800; letter-spacing: -.025em; }
h3 { font-size: 1.15rem; font-weight: 750; letter-spacing: -.01em; line-height: 1.3; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }

.skip-link {
  position: absolute; left: 12px; top: -80px; z-index: 30;
  background: var(--chip-bg); color: var(--chip-ink); padding: 12px 18px; border-radius: 999px;
  text-decoration: none; font-weight: 700;
}
.skip-link:focus { top: 12px; color: var(--chip-ink); }

/* ---------- header ---------- */
.site-header {
  position: -webkit-sticky; position: sticky; top: 0; z-index: 20;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  backdrop-filter: saturate(1.5) blur(14px);
}
.site-header-plain { position: static; background: transparent; border-bottom: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 64px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px; min-width: 0;
  color: var(--ink); text-decoration: none; font-weight: 850; font-size: 1.1rem; letter-spacing: -.02em;
}
.brand:hover { color: var(--ink); }
.brand img { width: 36px; height: 36px; border-radius: 10px; flex: none; }
.brand span { white-space: nowrap; }

.header-tools { display: flex; align-items: center; gap: 6px; }
.lang-switch {
  display: flex; gap: 2px; margin: 0; padding: 3px; list-style: none;
  background: var(--surface-2); border-radius: 999px;
}
.lang-switch a {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 42px; min-height: 38px; padding: 0 10px;
  border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: .85rem; letter-spacing: .03em;
}
.lang-switch a:hover { color: var(--ink); }
.lang-switch a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 999px;
  background: var(--surface-2); color: var(--ink); cursor: pointer; font: inherit;
  -webkit-appearance: none; appearance: none;
}
.theme-toggle:hover { background: var(--line); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 26px;
  border-radius: 999px; border: 2px solid transparent;
  font: 750 1.05rem/1.2 var(--font); text-decoration: none; text-align: center;
  cursor: pointer; -webkit-user-select: none; user-select: none;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary, .btn-tg {
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 6px 18px rgba(26, 90, 166, .28);
}
.btn-primary:hover, .btn-tg:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--ghost-line); }
.btn-ghost:hover { color: var(--ink); border-color: var(--ghost-hover-line); }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-row .btn { flex: 1 1 100%; }
@media (min-width: 560px) { .btn-row .btn { flex: 0 0 auto; } }

/* ---------- hero ---------- */
.hero { position: relative; padding: 40px 0 48px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto -10%; height: 120%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 45% at 85% 20%, var(--bg-glow-1), transparent 70%),
    radial-gradient(45% 50% at 5% 0%, var(--bg-glow-2), transparent 70%);
}
.hero > .wrap:first-child { display: grid; gap: 44px; align-items: center; }
@media (min-width: 920px) {
  .hero { padding: 72px 0 64px; }
  .hero > .wrap:first-child { grid-template-columns: 1.2fr .8fr; gap: 56px; }
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 20px; padding: 7px 14px 7px 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  font-weight: 750; font-size: .92rem; box-shadow: var(--shadow);
}
.hl {
  background: linear-gradient(transparent 62%, var(--hl) 62%, var(--hl) 92%, transparent 92%);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  padding: 0 .06em;
}
.lead { font-size: clamp(1.1rem, 1rem + .5vw, 1.32rem); color: var(--muted); max-width: 34em; margin-bottom: 28px; }
.hero-note { margin: 16px 0 0; color: var(--muted); font-size: .95rem; }

.trust { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 22px 0 0; padding: 0; list-style: none; color: var(--muted); font-weight: 600; font-size: .95rem; }
.trust li { display: inline-flex; align-items: center; gap: 8px; }
.trust li::before {
  content: ""; width: 18px; height: 18px; flex: none; border-radius: 50%;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%231a5aa6' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round' d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* stats strip */
.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin: 44px 0 0; padding: 18px 10px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  text-align: center;
}
.stats li { display: grid; gap: 2px; padding: 4px; }
.stats li + li { border-left: 1px solid var(--line); }
.stats b { font-size: clamp(1.35rem, 1rem + 1.6vw, 2.1rem); font-weight: 850; letter-spacing: -.03em; line-height: 1.1; }
.stats span { color: var(--muted); font-size: clamp(.78rem, .72rem + .3vw, .95rem); line-height: 1.3; }

/* decorative mockup (not a screenshot) */
.mockup { position: relative; justify-self: center; width: 100%; max-width: 330px; }
.phone {
  background: #0f2236; border-radius: 40px; padding: 11px;
  box-shadow: 0 30px 70px rgba(22, 50, 79, .28), inset 0 0 0 2px rgba(255, 255, 255, .06);
}
@media (min-width: 920px) { .phone { transform: rotate(2.5deg); } }
.phone-screen { background: var(--screen); border-radius: 30px; overflow: hidden; }
.phone-bar {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  background: var(--surface); border-bottom: 1px solid var(--screen-line);
}
.phone-bar .dot { width: 34px; height: 34px; border-radius: 50%; background: var(--navy); position: relative; overflow: hidden; flex: none; }
.phone-bar .dot::after {
  content: ""; position: absolute; left: 7px; right: 7px; top: 12px; height: 20px;
  border-radius: 20px 20px 0 0; background: var(--sun); -webkit-clip-path: inset(0 0 40% 0); clip-path: inset(0 0 40% 0);
}
.phone-bar b { display: block; font-size: .95rem; }
.phone-bar small { color: var(--muted); font-size: .8rem; }
.chat { padding: 16px 14px 20px; display: grid; gap: 10px; }
.bubble {
  max-width: 86%; padding: 10px 14px; border-radius: 18px 18px 18px 6px;
  background: var(--bubble); font-size: .92rem; line-height: 1.45;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .06);
}
.bubble.me { justify-self: end; background: var(--bubble-me); border-radius: 18px 18px 6px 18px; }
.bubble .de { font-weight: 750; }
.bubble .tr { color: var(--muted); font-size: .85rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chips span {
  padding: 4px 10px; border-radius: 999px; background: var(--accent-soft);
  color: var(--accent); font-weight: 700; font-size: .78rem;
}
.sticker {
  position: absolute; padding: 8px 14px; border-radius: 999px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  font-weight: 800; font-size: .9rem; box-shadow: var(--shadow-lift); white-space: nowrap;
}
.sticker-a { top: -16px; left: -6px; transform: rotate(-6deg); }
.sticker-b { bottom: 70px; right: -8px; transform: rotate(5deg); }
.mockup-caption { margin: 26px 0 0; text-align: center; color: var(--muted); font-size: .82rem; }

/* ---------- sections ---------- */
.section { padding: 64px 0; }
@media (min-width: 920px) { .section { padding: 88px 0; } }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 40em; margin-bottom: 32px; }
.section-head p { color: var(--muted); font-size: 1.12rem; }

.cards { display: grid; gap: 12px; grid-template-columns: 1fr; margin: 0; padding: 0; list-style: none; }
@media (min-width: 360px) and (max-width: 559px) {
  .cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cards .card { padding: 16px 14px; border-radius: 18px; }
  .cards .card .ico { width: 44px; height: 44px; font-size: 1.3rem; margin-bottom: 12px; border-radius: 14px; }
  .cards .card .big { font-size: 1.35rem; }
  .cards .card h3 { font-size: 1rem; }
  .cards .card p { font-size: .88rem; line-height: 1.45; }
}
@media (min-width: 560px) { .cards { grid-template-columns: repeat(2, 1fr); gap: 14px; } }
@media (min-width: 980px) { .cards { grid-template-columns: repeat(4, 1fr); gap: 16px; } }
.card {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; transition: transform .2s ease, box-shadow .2s ease;
}
@media (hover: hover) { .card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); } }
.card .ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; margin-bottom: 16px; border-radius: 16px; font-size: 1.5rem;
}
.ico-0 { background: var(--t1); } .ico-1 { background: var(--t2); } .ico-2 { background: var(--t3); } .ico-3 { background: var(--t4); }
.ico-4 { background: var(--t5); } .ico-5 { background: var(--t6); } .ico-6 { background: var(--t7); } .ico-7 { background: var(--t8); }
.card .big { display: block; font-size: 1.7rem; font-weight: 850; letter-spacing: -.03em; line-height: 1.1; margin-bottom: 6px; }
.card h3 { margin-bottom: .4em; }
.card p { color: var(--muted); margin: 0; font-size: .98rem; }

.steps { display: grid; gap: 14px; counter-reset: step; margin: 0; padding: 0; list-style: none; }
@media (min-width: 820px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
.steps li {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px 22px; box-shadow: var(--shadow);
}
.steps li::before {
  counter-increment: step; content: counter(step);
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin-bottom: 16px; border-radius: 14px;
  background: var(--navy); color: var(--sun); font-weight: 850; font-size: 1.2rem;
}
.steps p { color: var(--muted); margin: 0; }

.audience { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 820px) { .audience { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
.audience li { background: var(--bg); border: 1px solid var(--line); padding: 22px; border-radius: var(--radius); }
.who-ico { display: block; font-size: 1.9rem; line-height: 1; margin-bottom: 14px; }
.audience p { color: var(--muted); margin: 0; }

.langs { display: grid; gap: 14px; }
@media (min-width: 640px) { .langs { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; } }
.lang-card {
  display: block; padding: 22px 24px; border-radius: var(--radius);
  background: var(--surface); border: 2px solid var(--line); color: var(--ink); text-decoration: none;
  transition: border-color .15s ease, transform .15s ease;
}
.lang-card:hover { border-color: var(--accent); color: var(--ink); }
.lang-card.is-current { border-color: var(--accent); }
.code {
  display: inline-block; margin-bottom: 10px; padding: 3px 10px; border-radius: 999px;
  background: var(--chip-bg); color: var(--chip-ink); font-weight: 800; font-size: .78rem; letter-spacing: .06em;
}
.lang-card strong { display: block; font-size: 1.25rem; margin-bottom: 2px; }
.lang-card .sub { color: var(--muted); }

/* FAQ */
.faq { display: grid; gap: 10px; max-width: 840px; }
.faq details { background: var(--bg); border: 1px solid var(--line); border-radius: 18px; }
.faq details[open] { border-color: var(--ghost-hover-line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 18px 56px 18px 20px; position: relative;
  font-weight: 750; font-size: 1.05rem; min-height: 44px; border-radius: 18px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 18px; top: 50%; width: 28px; height: 28px; margin-top: -14px;
  border-radius: 50%; background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%237d8894' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round' d='m7 10 5 5 5-5'/%3E%3C/svg%3E") center / 16px no-repeat;
  transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(180deg); }
.faq .answer { padding: 0 20px 18px; color: var(--muted); }
.faq .answer p:last-child { margin-bottom: 0; }

/* final CTA */
.final {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--final-bg); color: #fff; border-radius: 28px;
  padding: 44px 22px; text-align: center;
}
.final::before {
  content: ""; position: absolute; z-index: -1; left: 50%; bottom: -160px; width: 340px; height: 340px; margin-left: -170px;
  border-radius: 50%; background: radial-gradient(circle, rgba(244, 181, 63, .45), rgba(244, 181, 63, 0) 70%);
}
@media (min-width: 700px) { .final { padding: 64px 48px; } }
.final h2 { color: #fff; }
.final p { color: #d5dee8; font-size: 1.12rem; max-width: 32em; margin: 0 auto 28px; }
.final .btn-primary { background: var(--sun); color: #1b2430; box-shadow: 0 8px 24px rgba(244, 181, 63, .3); }
.final .btn-primary:hover { background: #f7c665; color: #1b2430; }
.final .btn-row { justify-content: center; }
.final :focus-visible { outline-color: var(--sun); }

/* footer */
.tricolor { height: 6px; background: linear-gradient(90deg, #1b1b1b 0 33.3%, #c81e28 33.3% 66.6%, var(--sun) 66.6%); }

/* sticky CTA bar — phones only; JS hides it while another CTA is on screen */
.sticky-cta { display: none; }
@media (max-width: 759px) {
  .sticky-cta {
    display: block; position: fixed; z-index: 15; left: 0; right: 0; bottom: 0;
    padding: 10px 16px; padding-bottom: max(10px, env(safe-area-inset-bottom));
    background: var(--header-bg); border-top: 1px solid var(--line);
    -webkit-backdrop-filter: saturate(1.5) blur(14px); backdrop-filter: saturate(1.5) blur(14px);
    transition: transform .25s ease, opacity .25s ease;
  }
  .sticky-cta .btn { width: 100%; }
  .sticky-cta.is-hidden { transform: translateY(110%); opacity: 0; pointer-events: none; }
  body.has-sticky { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
}

/* root language picker */
.picker { position: relative; padding: 24px 0 64px; overflow: hidden; }
.picker::before {
  content: ""; position: absolute; inset: -10% -20% auto -20%; height: 90%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(35% 40% at 80% 20%, var(--bg-glow-1), transparent 70%),
    radial-gradient(40% 45% at 15% 10%, var(--bg-glow-2), transparent 70%);
}
@media (min-width: 800px) { .picker { padding: 48px 0 96px; } }
.picker .wrap { max-width: 820px; text-align: center; }
.picker-logo { width: 96px; height: 96px; margin: 0 auto 24px; border-radius: 26px; box-shadow: var(--shadow-lift); }
.picker .lead { margin-left: auto; margin-right: auto; }
.picker .lead span { display: block; }
.picker .lead span + span { margin-top: .4em; font-size: .92em; }
.picker-choices { display: grid; gap: 12px; margin: 32px 0 28px; }
.picker-choices.three { grid-template-columns: 1fr; }
@media (min-width: 640px) { .picker-choices.three { grid-template-columns: repeat(3, 1fr); } }
.picker-choices .btn { min-height: 64px; font-size: 1.15rem; }
.picker-choices .code { margin: 0; }
.picker-choices .btn-primary .code { background: var(--accent-ink); color: var(--accent); }
.picker-tg { justify-content: center; }

/* 404 */
.notfound { padding: 96px 0; text-align: center; }
.notfound .btn-row { justify-content: center; }

/* very narrow phones */
@media (max-width: 400px) {
  .wrap { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .brand { font-size: 1rem; gap: 8px; }
  .brand img { width: 32px; height: 32px; }
  .lang-switch a { min-width: 36px; padding: 0 7px; font-size: .8rem; }
  .theme-toggle { width: 40px; height: 40px; }
}
@media (max-width: 359px) { .brand span { display: none; } }

/* CSS flag: emoji flags do not render on Windows */
.flag {
  display: inline-block; width: 1.25em; height: .82em; border-radius: 3px; vertical-align: -.06em;
  background: linear-gradient(#1b1b1b 0 33.3%, #dd0000 33.3% 66.6%, #ffce00 66.6%);
  box-shadow: 0 0 0 1px rgba(127, 127, 127, .25);
}
.flag-lg { width: .95em; height: .62em; border-radius: 5px; vertical-align: .05em; }

/* section backgrounds alternate: cards take the opposite surface */
.section-alt .steps li, .section-alt .lang-card, .section-alt .faq details { background: var(--bg); }
.section:not(.section-alt) .audience li, .section:not(.section-alt) .faq details { background: var(--surface); }
.section:not(.section-alt) .faq summary::after { background-color: var(--surface-2); }

/* news rubrics */
.rubrics { display: grid; gap: 10px; grid-template-columns: 1fr; margin: 0; padding: 0; list-style: none; }
@media (min-width: 520px) { .rubrics { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .rubrics { grid-template-columns: repeat(5, 1fr); gap: 14px; } }
.rubric {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
}
@media (min-width: 980px) { .rubric { flex-direction: column; align-items: flex-start; padding: 20px; } }
.rubric-ico {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 48px; height: 48px; border-radius: 14px; background: var(--accent-soft); font-size: 1.45rem;
}
.rubric b { display: block; font-size: 1.05rem; line-height: 1.3; }
.rubric small { display: block; color: var(--muted); font-size: .9rem; line-height: 1.4; margin-top: 2px; }
.news-note { margin: 18px 0 0; color: var(--muted); font-size: .95rem; }

/* "coming soon" language */
.lang-card.is-soon { border-style: dashed; cursor: default; }
.lang-card.is-soon:hover { border-color: var(--line); }
.lang-card.is-soon .code { background: var(--surface-2); color: var(--muted); }
.soon-badge {
  display: inline-block; margin-right: 6px; padding: 1px 9px; border-radius: 999px;
  background: var(--t1); color: var(--ink); font-weight: 700; font-size: .8rem; vertical-align: 1px;
}

/* ---------- footer ---------- */
.site-footer { padding: 8px 0 28px; color: var(--muted); font-size: .95rem; }
.foot-grid { display: grid; gap: 14px; }
@media (min-width: 820px) { .foot-grid { grid-template-columns: 1fr 1fr; gap: 16px; } }
.foot-card {
  border-radius: var(--radius); padding: 22px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.foot-about { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.foot-logo { display: flex; align-items: center; gap: 12px; margin: 0; color: var(--ink); font-size: 1.15rem; }
.foot-logo img { width: 44px; height: 44px; border-radius: 12px; }
.foot-tag { margin: 0; }
.btn-sm { min-height: 46px; padding: 0 20px; font-size: .98rem; }
.btn-sm svg { width: 20px; height: 20px; }

.feedback-card {
  display: flex; align-items: flex-start; gap: 16px; text-decoration: none; color: var(--ink);
  position: relative; overflow: hidden; isolation: isolate;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.feedback-card::after {
  content: ""; position: absolute; z-index: -1; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, var(--bg-glow-1), transparent 70%);
}
.feedback-card:hover { color: var(--ink); border-color: var(--accent); }
@media (hover: hover) { .feedback-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); } }
.fb-ico {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 48px; height: 48px; border-radius: 14px; background: var(--accent-soft); color: var(--accent);
}
.fb-ico svg { width: 24px; height: 24px; }
.fb-body { display: grid; gap: 4px; }
.fb-body b { font-size: 1.1rem; line-height: 1.3; }
.fb-text { color: var(--muted); }
.fb-handle { margin-top: 6px; color: var(--accent); font-weight: 750; }
.feedback-card:hover .fb-handle { text-decoration: underline; text-underline-offset: .18em; }

.foot-bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line);
}
.foot-langs { display: flex; gap: 2px; margin: 0; padding: 3px; list-style: none; background: var(--surface-2); border-radius: 999px; }
.foot-langs a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-weight: 650; font-size: .9rem;
}
.foot-langs a:hover { color: var(--ink); }
.foot-langs a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.foot-copy { margin: 0; font-size: .88rem; }
@media (max-width: 400px) { .foot-langs a { padding: 0 10px; font-size: .85rem; } }

/* ---------- course programme ---------- */
.program { display: grid; gap: 10px; max-width: 920px; }
.pg-level { background: var(--bg); border: 1px solid var(--line); border-radius: 18px; }
.pg-level summary {
  list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 16px 20px; min-height: 44px; border-radius: 18px;
}
.pg-level summary::-webkit-details-marker { display: none; }
.pg-level summary b { font-size: 1.25rem; font-weight: 850; color: var(--accent); }
.pg-level summary span { color: var(--muted); font-weight: 600; }
.pg-list { margin: 0; padding: 0 20px 18px; list-style: none; display: grid; gap: 2px; }
@media (min-width: 760px) { .pg-list { grid-template-columns: 1fr 1fr; column-gap: 28px; } }
.pg-list li { display: grid; grid-template-columns: 2.2em 1fr; padding: 8px 0; border-top: 1px solid var(--line); }
.pg-n { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 700; grid-row: span 2; }
.pg-de { font-weight: 700; }
.pg-tr { color: var(--muted); font-size: .93rem; }

/* ---------- news cards (landing + archive) ---------- */
.news-latest { margin: 32px 0 14px; font-size: 1.2rem; }
.news-grid { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 620px) { .news-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .news-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
.news-card a {
  display: flex; flex-direction: column; height: 100%; overflow: hidden; color: inherit; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  transition: transform .2s ease, box-shadow .2s ease;
}
@media (hover: hover) { .news-card a:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); } }
.news-card img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: var(--surface-2); }
.nc-body { display: grid; gap: 6px; padding: 14px 16px 18px; }
.nc-meta { color: var(--muted); font-size: .85rem; font-weight: 650; }
.news-card h2, .news-card h3 { margin: 0; font-size: 1.05rem; line-height: 1.35; }
.nc-tr { color: var(--muted); font-size: .93rem; line-height: 1.45; }
.news-more { margin: 22px 0 0; }
.book-cover {
  display: grid; place-items: center; aspect-ratio: 16 / 7; font-size: 3.4rem; line-height: 1;
  background: linear-gradient(135deg, var(--t1), var(--t2));
}
.book-card:nth-child(3n+2) .book-cover { background: linear-gradient(135deg, var(--t3), var(--t7)); }
.book-card:nth-child(3n) .book-cover { background: linear-gradient(135deg, var(--t5), var(--t4)); }
.news-rubric { margin: 40px 0 16px; font-size: 1.4rem; }

/* ---------- inner pages: archive and article ---------- */
.article-page { padding: 24px 0 64px; }
.article-page h1 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem); line-height: 1.15; letter-spacing: -.02em; margin: 8px 0 12px; }
.wrap-narrow { max-width: 820px; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 16px; padding: 0; list-style: none; font-size: .9rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 8px; }
.crumbs a { color: var(--accent); }
.crumbs [aria-current] { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.lang-other {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 40px; padding: 0 12px;
  border-radius: 999px; background: var(--surface-2); color: var(--ink); font-weight: 750; text-decoration: none;
}
.art-meta { color: var(--muted); font-size: .92rem; margin: 0 0 24px; }
.art-meta a { color: var(--accent); }
.art-par { margin: 0 0 22px; }
.art-de { font-size: 1.12rem; line-height: 1.65; margin: 0 0 8px; }
.art-tr { color: var(--muted); line-height: 1.6; margin: 0; padding-left: 14px; border-left: 3px solid var(--sun); }
.art-fig { margin: 8px 0 26px; }
.art-fig img { display: block; width: 100%; height: auto; border-radius: 16px; background: var(--surface-2); }
.art-fig figcaption { color: var(--muted); font-size: .9rem; margin-top: 8px; }
.art-fig small { display: block; opacity: .85; }
.art-grammar { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.art-license { color: var(--muted); font-size: .85rem; }
.art-license a { color: var(--accent); }
.book-blurb { font-size: 1.05rem; line-height: 1.6; }
.book-toc { margin: 24px 0 8px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.book-toc h2 { margin: 0 0 8px; font-size: 1.05rem; }
.book-toc ol { margin: 0; padding-left: 1.4em; line-height: 1.7; }
.book-toc a { color: var(--accent); }
.book-ch { margin: 40px 0 18px; font-size: 1.45rem; line-height: 1.25; }
.book-ch small { display: block; margin-top: 4px; color: var(--muted); font-size: .95rem; font-weight: 600; }
.read-cta {
  margin: 32px 0 8px; padding: 24px; border-radius: var(--radius);
  background: var(--accent-soft); border: 1px solid var(--line);
}
.read-cta h2 { margin: 0 0 8px; font-size: 1.3rem; }
.read-cta p { margin: 0 0 16px; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
