/* Mëso Gjuhët: the landing page, in the apps' brand (their palette, logos and
   Nunito Sans). The selected language's colours (--lang, --lang-soft) and each
   app panel's (--panel, --panel-soft) are set from js/languages.js, so a new
   language needs no CSS. */

:root {
  /* The apps' own palette (lib/core/constants/app_colors.dart, semantic_colors.dart) */
  --ink: #393939;          /* AppColors.blackTwo, the apps' text */
  --ink-2: #616161;        /* the apps' secondary text */
  --page: #FFFFFF;
  --tint: #FFF8F4;         /* SemanticColors.pageTint */
  --mist: #FAFAFA;         /* the apps' scaffold */
  --line: #E6E1DE;
  --brand: #F5515F;        /* AppColors.primary, the splash red */
  --brand-text: #CC242A;   /* AppColors.lipstick: the red that carries white text */
  --brand-text-hover: #B31E24;
  --dark: #403633;         /* AppColors.greyishBrown */
  --lang: #4267B2;         /* AppColors.frenchBlue; set per language from js/languages.js */
  --lang-soft: #E1E8F5;

  --font-display: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-text: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --step--1: clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);
  --step-0: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --step-1: clamp(1.125rem, 1.06rem + 0.3vw, 1.3125rem);
  --step-2: clamp(1.5rem, 1.3rem + 0.9vw, 2rem);
  --step-3: clamp(2rem, 1.55rem + 2vw, 3.25rem);
  --step-4: clamp(2.25rem, 1.4rem + 4.2vw, 5rem);

  --gutter: clamp(16px, 4vw, 40px);
  --space-section: clamp(4.5rem, 3rem + 6vw, 8.5rem);
  --radius-m: 18px;
  --radius-l: 28px;
  --topbar-h: 68px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
p, ul, ol { margin: 0; }
h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.06;
  letter-spacing: -0.02em;
  text-wrap: balance;
  /* German has long words ("Fremdsprachen"): break them, never the layout */
  -webkit-hyphens: auto;
  hyphens: auto;
  overflow-wrap: break-word;
}
[id] { scroll-margin-top: calc(var(--topbar-h) + 16px); }
:where(a, button, summary):focus-visible {
  outline: 3px solid var(--lang);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap { width: min(1180px, 100% - 2 * var(--gutter)); margin-inline: auto; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 12px;
  z-index: 100;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  background: #fff;
  font-weight: 700;
}
.skip-link:focus { left: 12px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.8em 1.25em;
  border: 0;
  border-radius: 999px;
  font: 700 0.95rem/1.1 var(--font-text);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, transform 0.15s var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 1.2em; height: 1.2em; }
.btn-brand { background: var(--brand-text); color: #fff; }
.btn-brand:hover { background: var(--brand-text-hover); }
.btn-quiet { background: #F3EEEB; color: var(--ink); }
.btn-quiet:hover { background: #EAE3DF; }

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 248, 244, 0.9);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.topbar.is-scrolled { border-bottom-color: var(--line); }
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: var(--topbar-h);
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; }
/* The apps' logos fanned out: one more with each language */
.brand-fan { display: inline-flex; min-width: 40px; }
.brand-fan img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 0 0 2px var(--tint), 0 4px 10px -6px rgba(64, 54, 51, 0.6);
}
.brand-fan img + img { margin-left: -14px; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}
.topnav { display: none; gap: 1.75rem; margin-left: auto; }
.topnav a {
  font-weight: 700;
  color: var(--ink-2);
  text-decoration: none;
}
.topnav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.brand-name { white-space: nowrap; }
.topbar-cta { padding: 0.7em 1.1em; white-space: nowrap; }
@media (max-width: 560px) { .topbar-cta { display: none; } }
@media (max-width: 440px) { .brand-fan img { width: 34px; height: 34px; border-radius: 9px; } }
@media (max-width: 359px) { .brand-name { display: none; } }

/* The site's language */
.ui-lang { margin-left: auto; }
.ui-lang select {
  -webkit-appearance: none;
  appearance: none;
  padding: 0.55rem 2rem 0.55rem 0.9rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23393939' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 0.8rem center / 10px;
  color: var(--ink);
  font: 800 0.9rem/1.2 var(--font-text);
  cursor: pointer;
}
.ui-lang select:hover { border-color: var(--ink); }
.ui-lang select:focus-visible { outline: 3px solid var(--lang); outline-offset: 2px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
@media (min-width: 780px) {
  .topnav { display: flex; }
  .ui-lang { margin-left: 0.5rem; }
}

/* Hero */
.hero { padding-block: clamp(2.5rem, 1.5rem + 5vw, 6rem) var(--space-section); background: var(--tint); overflow-x: clip; }
.hero-grid {
  display: grid;
  gap: clamp(3rem, 6vw, 5rem);
  align-items: center;
}
.hero-copy, .deck { min-width: 0; }
@media (min-width: 980px) {
  .hero-grid { grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); }
}
.hero h1 { font-size: var(--step-4); max-width: 12.5ch; }
.lead {
  margin-top: 1.4rem;
  max-width: 40ch;
  color: var(--ink-2);
  font-size: var(--step-1);
}
.deeplink-note {
  display: inline-block;
  margin-bottom: 1.5rem;
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
  background: var(--lang-soft);
  font-weight: 700;
  font-size: var(--step--1);
}
.picker-label {
  margin-top: 2.5rem;
  font-weight: 800;
  font-size: var(--step--1);
  color: var(--ink-2);
}
.picker { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 1.15rem 0.45rem 0.45rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: 800 1rem/1.1 var(--font-text);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}
.tab:hover { border-color: var(--ink); }
.tab[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.soon-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.95rem 1.1rem;
  border: 2px dashed var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  font-weight: 700;
  font-size: 0.95rem;
}
.tab-icon { width: 34px; height: 34px; border-radius: 9px; background: #fff; }

/* Store badges: the official artwork, the Play badge's built-in padding cropped */
.hero-stores, .app-stores { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.hero-stores { margin-top: 1.6rem; min-height: 50px; }
.store-badge { display: inline-block; line-height: 0; border-radius: 10px; }
.badge-apple img { height: 48px; width: auto; }
.badge-play { height: 48px; overflow: hidden; }
.badge-play img { height: 71px; width: auto; margin: -11.5px -10px 0; }
.store-soon {
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 1rem;
  border: 2px dashed rgba(64, 54, 51, 0.28);
  border-radius: 10px;
  color: var(--ink-2);
  font-weight: 700;
  font-size: 0.9rem;
}

/* The phrase card: an index card on a deck in the language's colour */
.deck { position: relative; isolation: isolate; padding: 1rem 0.25rem 1.5rem; }
.deck-back {
  position: absolute;
  inset: 2.25rem 0.75rem 0 1.75rem;
  z-index: -1;
  border-radius: var(--radius-l);
  background: var(--lang-soft);
  transform: rotate(3.2deg);
  transition: background-color 0.35s;
}
.card {
  display: flex;
  flex-direction: column;
  min-height: 21rem;
  margin: 0;
  padding: 1.5rem clamp(1.5rem, 1rem + 2.5vw, 2.75rem) clamp(1.5rem, 1rem + 2vw, 2.25rem);
  border-radius: var(--radius-l);
  background-color: #fff;
  background-image:
    linear-gradient(to bottom, transparent 4.4rem, rgba(245, 81, 95, 0.6) 4.4rem, rgba(245, 81, 95, 0.6) calc(4.4rem + 2px), transparent calc(4.4rem + 2px)),
    repeating-linear-gradient(to bottom, transparent 0 calc(2.2rem - 1px), #F1E9E5 calc(2.2rem - 1px) 2.2rem);
  background-position: 0 0, 0 calc(4.4rem + 2px);
  background-repeat: no-repeat, repeat;
  box-shadow:
    0 1px 0 rgba(64, 54, 51, 0.05),
    0 30px 60px -30px rgba(64, 54, 51, 0.35),
    0 10px 20px -12px rgba(64, 54, 51, 0.15);
  transform: rotate(-1.6deg);
}
.card-topic { font-weight: 800; font-size: var(--step--1); color: var(--brand-text); line-height: 1.7rem; }
.card-text { transition: opacity 0.18s, transform 0.18s var(--ease-out); }
.card.is-swapping .card-text { opacity: 0; transform: translateY(6px); }
.card-source {
  margin-top: 2.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step-2);
  line-height: 1.22;
  letter-spacing: -0.01em;
}
.card-target {
  margin-top: 1.1rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--step-3);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.card-target mark {
  padding: 0 0.06em;
  color: inherit;
  background: linear-gradient(transparent 56%, var(--lang-soft) 56%);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
@supports (color: color-mix(in srgb, red 50%, white)) {
  .card-target mark { background: linear-gradient(transparent 56%, color-mix(in srgb, var(--lang) 42%, #fff) 56%); }
}
.card-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: auto; padding-top: 2rem; }
@media (max-width: 520px) {
  .card, .deck-back { transform: none; }
  .deck-back { inset: 1.6rem -0.4rem -0.6rem 0.6rem; transform: rotate(2deg); }
}

/* An app's own page (/meso-anglisht, ...): no tabs, the app leads the hero */
.is-app-page .picker-label, .is-app-page .picker { display: none; }
.is-app-page .hero h1 { max-width: none; }
.hero-app-icon {
  width: 96px;
  height: 96px;
  margin-bottom: 1.5rem;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 16px 32px -18px rgba(64, 54, 51, 0.6);
}
.hero-pair { margin-top: 0.75rem; font-size: var(--step-1); }
.hero-levels { margin-top: 1rem; }
.is-app-page .hero-stores { margin-top: 2rem; }
.app-more {
  justify-self: start;
  margin-top: 0.25rem;
  color: var(--ink);
  font-weight: 800;
  text-decoration-color: var(--panel, var(--brand));
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.app-more:hover { color: var(--brand-text); }

/* Sections */
.section-lead {
  margin-top: 1.1rem;
  max-width: 52ch;
  color: var(--ink-2);
  font-size: var(--step-1);
}
.langs, .faq { padding-block: var(--space-section); }
.langs { padding-top: 0; }
.langs h2, .learn h2 { font-size: var(--step-3); max-width: 17ch; }

/* App panels */
.apps {
  display: grid;
  gap: 1.25rem;
  margin-top: clamp(2.25rem, 4vw, 3.5rem);
}
@media (min-width: 840px) { .apps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.app {
  position: relative;
  display: grid;
  gap: 1rem;
  align-content: start;
  padding: clamp(1.5rem, 1rem + 2.2vw, 2.6rem);
  border-radius: var(--radius-l);
  background: var(--panel-soft);
  overflow: hidden;
}
.app { border-top: 6px solid var(--panel); }
.app-head { display: flex; align-items: center; gap: 1rem; }
.app-icon {
  width: 84px;
  height: 84px;
  background: #fff;
  flex: none;
  border-radius: 20px;
  box-shadow: 0 12px 24px -14px rgba(64, 54, 51, 0.55);
}
.app-name { font-size: var(--step-2); }
.app-pair { margin-top: 0.3rem; font-weight: 700; color: var(--ink-2); font-size: var(--step--1); }
.app-intro { max-width: 46ch; font-size: var(--step-1); }
.app-levels { font-weight: 800; }
.app-stores { margin-top: 0.4rem; }
.app-next {
  display: grid;
  gap: 0.75rem 2rem;
  align-items: center;
  padding: clamp(1.5rem, 1rem + 2vw, 2.25rem);
  border: 2px dashed var(--line);
  border-radius: var(--radius-l);
}
.app-next h3 { font-size: var(--step-2); }
.app-next p { color: var(--ink-2); max-width: 48ch; }
@media (min-width: 840px) {
  .app-next { grid-column: 1 / -1; grid-template-columns: auto 1fr auto; }
}

/* How you learn: the road of levels, then what is inside */
.learn { background: var(--mist); padding-block: var(--space-section); border-top: 1px solid var(--line); }
.road {
  display: grid;
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding: 0;
  list-style: none;
}
.road-stop { position: relative; padding: 0 0 2rem 2.9rem; }
.road-stop::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--level, var(--ink));
  box-shadow: 0 0 0 2px var(--ink), 0 0 0 7px var(--mist);
}
.road-stop::after {
  content: "";
  position: absolute;
  left: calc(0.75rem - 1px);
  top: 2.25rem;
  bottom: 0.2rem;
  width: 2px;
  background: rgba(64, 54, 51, 0.3);
}
.road-stop:last-child::after { display: none; }
.road-stop-light::before { background: var(--mist); border: 2px dashed var(--level); box-shadow: 0 0 0 7px var(--mist); }
.road-code, .road-name, .road-note { display: block; }
.road-code {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--step-3);
  line-height: 1;
  letter-spacing: -0.02em;
}
.road-stop-light .road-code { color: transparent; -webkit-text-stroke: 1.5px var(--ink); }
.road-name { margin-top: 0.4rem; font-weight: 800; font-size: var(--step-1); }
.road-note { color: var(--ink-2); font-size: var(--step--1); }
@media (min-width: 760px) {
  .road { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .road-stop { padding: 2.9rem 1.5rem 0 0; }
  .road-stop::before { top: 0; }
  .road-stop::after { left: 2.25rem; right: 0.6rem; top: calc(0.75rem - 1px); bottom: auto; width: auto; height: 2px; }
}

.features {
  display: grid;
  gap: 2.25rem 3rem;
  margin-top: clamp(3.5rem, 7vw, 6rem);
  padding: 0;
  list-style: none;
}
@media (min-width: 700px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .features { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.feature { padding-top: 1rem; border-top: 4px solid var(--section, var(--ink)); }
.feature h3 { font-size: var(--step-1); letter-spacing: -0.01em; line-height: 1.2; }
.feature p { margin-top: 0.5rem; max-width: 38ch; color: var(--ink-2); }

/* Trust */
.trust { background: var(--brand-text); color: #FFE9E6; padding-block: var(--space-section); }
.trust-grid { display: grid; gap: 2.25rem; }
@media (min-width: 940px) { .trust-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); align-items: start; } }
.trust h2 { color: #fff; font-size: var(--step-3); max-width: 13ch; }
.trust-copy p { max-width: 46ch; font-size: var(--step-1); }
.trust-copy p + p { margin-top: 1rem; }
.trust-links { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 2rem; padding: 0; list-style: none; }
.trust-links a {
  display: inline-block;
  padding: 0.6rem 1.05rem;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}
.trust-links a:hover { background: #fff; color: var(--brand-text); }
.trust :where(a):focus-visible { outline-color: #fff; }

/* Questions */
.faq-grid { display: grid; gap: 2rem; }
@media (min-width: 940px) { .faq-grid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); } }
.faq h2 { font-size: var(--step-3); max-width: 11ch; }
.faq-list details { border-bottom: 1.5px solid var(--line); }
.faq-list details:first-child { border-top: 1.5px solid var(--line); }
.faq-list summary {
  position: relative;
  padding: 1.2rem 2.75rem 1.2rem 0;
  font-weight: 800;
  font-size: var(--step-1);
  line-height: 1.3;
  list-style: none;
  cursor: pointer;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "";
  position: absolute;
  right: 0.35rem;
  top: 50%;
  width: 12px;
  height: 12px;
  border-right: 2.5px solid var(--ink);
  border-bottom: 2.5px solid var(--ink);
  transform: translateY(-75%) rotate(45deg);
  transition: transform 0.2s var(--ease-out);
}
.faq-list details[open] summary::after { transform: translateY(-25%) rotate(-135deg); }
.faq-list p { max-width: 60ch; padding-bottom: 1.3rem; color: var(--ink-2); }
.faq-list a, .app-next a:not(.btn) {
  color: var(--ink);
  font-weight: 700;
  text-decoration-color: var(--brand);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* Footer */
.site-footer { background: var(--dark); color: #E3DAD6; padding: clamp(3rem, 6vw, 5rem) 0 2rem; }
.footer-grid { display: grid; gap: 2.25rem 2rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.footer-brand { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .footer-grid { grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); }
  .footer-brand { grid-column: auto; }
}
.footer-brand .brand-name { color: #fff; font-size: var(--step-2); }
.footer-brand p { margin-top: 0.5rem; }
.footer-title {
  margin-bottom: 0.8rem;
  color: #fff;
  font-family: var(--font-text);
  font-size: var(--step--1);
  letter-spacing: 0;
}
.footer-list { display: grid; gap: 0.5rem; padding: 0; list-style: none; }
.footer-list a { color: #E3DAD6; text-decoration: none; }
.footer-list a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.site-footer :where(a):focus-visible { outline-color: #fff; }
.footer-base {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: var(--step--1);
}

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