:root {
  color-scheme: light;
  --bg: #f9f5ee;
  --surface: #fffefb;
  --surface-strong: #f6ede1;
  --text: #211b18;
  --muted: #6f655c;
  --line: #e4d7c5;
  --accent: #9f5631;
  --accent-dark: #7f3e1c;
  --shadow: 0 20px 48px rgba(90, 58, 30, 0.07);
  --shadow-soft: 0 10px 24px rgba(90, 58, 30, 0.05);
}

* {
  box-sizing: border-box;
}

html {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, #fffdf6 0, transparent 24rem),
    radial-gradient(circle at top right, #fff8ef 0, transparent 22rem),
    linear-gradient(180deg, #fdfaf5 0%, var(--bg) 100%);
}

body {
  margin: 0;
  min-height: 100%;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent-dark);
}

.site-shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.5rem 0 4.5rem;
}

.hero,
.page-header {
  padding: 2.5rem 0 1.75rem;
}

.hero__badge,
.card__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 254, 251, 0.88);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  max-width: 12ch;
  margin: 1rem 0 0;
  font-size: clamp(2.7rem, 6vw, 5.4rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
}

h2 {
  margin: 0.75rem 0 0;
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  line-height: 1.1;
}

p,
li {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--muted);
}

.hero__text,
.page-subtitle {
  max-width: 42rem;
  margin: 1.25rem 0 0;
  font-size: 1.1rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.5rem;
}

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

.hero__downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero__identity {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.language-picker { position: relative; }
.language-picker summary { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 44px; padding: .55rem .9rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; list-style: none; }
.language-picker summary::-webkit-details-marker { display: none; }
.language-chevron { display: block; flex: 0 0 14px; color: var(--muted); }
.language-picker[open] .language-chevron { transform: rotate(180deg); }
.language-nav { position: absolute; top: calc(100% + .5rem); right: 0; z-index: 2; min-width: 10rem; display: grid; gap: .2rem; padding: .4rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); box-shadow: var(--shadow); }
.language-nav a { display: block; padding: .65rem .85rem; border-radius: .65rem; text-decoration: none; }
.language-nav a:hover { background: var(--surface-strong); }
.language-nav a[aria-current="page"] { background: var(--text); color: var(--surface); }
.language-picker summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }

.home-about {
  margin-top: 1.15rem;
}

.home-about p { max-width: 64rem; }

.home-page:not(:lang(en)) .hero h1 {
  max-width: 18ch;
  font-size: clamp(2.1rem, 6vw, 4.8rem);
  line-height: 1.05;
}

.button,
.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.95rem 1.3rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  text-decoration: none;
  font-weight: 600;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.button:hover,
.back-link:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.button--primary {
  background: linear-gradient(180deg, #af6440 0%, var(--accent) 100%);
  border-color: #a85c37;
  color: #fff;
}

.button--secondary,
.back-link {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.button--download {
  gap: 0.65rem;
  min-height: 54px;
  padding: 0.8rem 1.15rem;
  border-radius: 1rem;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-soft);
  white-space: nowrap;
}

.download-icon {
  flex: 0 0 26px;
}

.button--download:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

@media (max-width: 540px) {
  .hero {
    padding-top: 0;
  }

  .hero__topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 1.25rem;
  }

  .hero__downloads {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 0.625rem;
  }

  .button--download {
    gap: 0.5rem;
    padding: 0.8rem 0.5rem;
    font-size: 0.875rem;
  }
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.15rem;
  margin-top: 1.75rem;
}

.content-grid--single {
  grid-template-columns: 1fr;
  max-width: 56rem;
}

.card,
.legal-card {
  padding: 1.65rem;
  border: 1px solid var(--line);
  border-radius: 1.75rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.legal-layout {
  display: grid;
  gap: 1.1rem;
  max-width: 56rem;
  margin-top: 1.75rem;
}

.feature-list,
.link-list,
.legal-card ul {
  margin: 1rem 0 0;
  padding-left: 1.15rem;
}

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

  .site-shell {
    width: min(100% - 1.25rem, 42rem);
  }

  h1 {
    max-width: 10ch;
  }
}

.language-picker { min-width: 0; max-width: 100%; font-size: 0.875rem; }
.language-nav { max-height: min(60vh, 26rem); overflow-y: auto; min-width: 12rem; max-width: calc(100vw - 2rem); }
.language-nav a { white-space: nowrap; }
.home-page .hero__identity { min-width: 0; }
.home-page .card, .home-about { overflow-wrap: anywhere; }
.home-page .hero h1 { overflow-wrap: anywhere; }
@media (max-width: 540px) {
  .home-page .hero__identity { width: 100%; justify-content: space-between; gap: 0.5rem; }
  .language-picker summary { padding: 0.55rem 0.65rem; gap: 0.4rem; }
}
