/* EU Driving Theory — official site
   Ivory editorial system, aligned with the app's study layer (mobile/src/theme/editorial.ts). */

:root {
  --canvas: #fbfaf6;
  --canvas-warm: #f5f2eb;
  --surface: #ffffff;
  --ink: #092449;
  --ink-soft: #102b52;
  --text: #3b4f6c;
  --muted: #6b7c93;
  --faint: #9aa7b8;
  --line: rgba(9, 36, 73, 0.1);
  --line-strong: rgba(9, 36, 73, 0.18);
  --line-app: #d7e2ed;
  --brand: #126dcc;
  --brand-strong: #0b5eb6;
  --brand-soft: #eaf3fd;
  --aegean: #0d8b80;
  --aegean-soft: #e8f6f3;
  --success: #13a874;
  --success-strong: #087956;
  --success-soft: #ecf9f4;
  --error-strong: #a93232;
  --error-soft: #fff1f0;
  --bezel: #0c1526;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC",
    "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;

  --shell: 1200px;
  --gutter: clamp(20px, 4vw, 40px);
  --header-h: 68px;
  --section-space: clamp(72px, 8vw, 112px);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 28px;
  --radius-xl: 40px;
  --radius-pill: 999px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-soft: 0 1px 2px rgba(9, 36, 73, 0.04), 0 12px 32px -18px rgba(9, 36, 73, 0.16);
  --shadow-raised: 0 2px 4px rgba(9, 36, 73, 0.04), 0 32px 64px -32px rgba(9, 36, 73, 0.28);
}

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

html {
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--canvas);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
}

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

button {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
p,
dl,
dd,
ol,
ul,
figure {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 6px;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  color: #fff;
  background: var(--ink);
  font-size: 14px;
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease-out);
}

.skip-link:focus-visible {
  transform: none;
}

/* Buttons and links ------------------------------------------------------ */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 26px;
  border-radius: var(--radius-pill);
  color: #fff;
  background: var(--ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: background-color 0.2s ease, transform 0.2s var(--ease-out);
}

.button:hover {
  background: #0f3366;
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0) scale(0.985);
}

.button:focus-visible {
  border-radius: var(--radius-pill);
}

.button-small {
  min-height: 38px;
  padding: 0 16px;
  font-size: 14px;
}

.store-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.store-button {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-width: 156px;
  min-height: 56px;
  padding: 0 22px;
  border-radius: 14px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 12px 24px -16px rgba(9, 36, 73, 0.8);
  transition: background-color 0.2s ease, transform 0.2s var(--ease-out);
}

.store-button small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.store-button strong {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

a.store-button[href]:hover {
  background: #0f3366;
  transform: translateY(-1px);
}

.store-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.2) 50%, transparent 70%);
  transform: translateX(-120%);
  pointer-events: none;
}

a.store-button[href]:active {
  transform: scale(0.985);
}

.store-button:focus-visible {
  border-radius: 14px;
}

.link-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.25s var(--ease-out);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  transition: color 0.2s ease;
}

.text-link:hover {
  color: var(--brand);
}

.text-link:hover .link-icon {
  transform: translateX(3px);
}

/* Header ----------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  background: rgba(251, 250, 246, 0.82);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
  transition: border-color 0.3s ease;
}

.scroll-progress {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), #5aa8f0);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

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

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand img {
  border-radius: 8px;
  box-shadow: 0 0 0 1px var(--line);
}

.main-nav {
  position: relative;
  display: flex;
  gap: 32px;
}

.main-nav a {
  position: relative;
  padding: 8px 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.main-nav a:hover,
.main-nav a[aria-current="location"] {
  color: var(--ink);
}

.nav-indicator {
  position: absolute;
  bottom: 2px;
  left: 0;
  width: 0;
  height: 1.5px;
  border-radius: 2px;
  background: var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.45s var(--ease-out), width 0.45s var(--ease-out), opacity 0.3s ease;
}

.js .main-nav a[aria-current="location"]::after {
  display: none;
}

.main-nav a[aria-current="location"]::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  height: 1.5px;
  border-radius: 2px;
  background: var(--ink);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.language-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.6);
}

.language-switch button {
  min-width: 44px;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.language-switch button:hover {
  color: var(--ink);
}

.language-switch button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--surface);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(9, 36, 73, 0.12);
}

/* Shared section typography ---------------------------------------------- */

.section {
  padding-block: var(--section-space);
}

.hero + .section {
  padding-top: clamp(24px, 4vw, 56px);
}

.section-warm {
  background: var(--canvas-warm);
}

.section-head {
  max-width: 760px;
  margin-bottom: clamp(36px, 5vw, 56px);
}

.eyebrow {
  color: var(--brand);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.section-title {
  margin-top: 14px;
  color: var(--ink);
  font-size: clamp(2rem, 1.15rem + 3vw, 3.5rem);
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -0.02em;
}

.section-title span {
  display: block;
}

:lang(zh-CN) .section-title span {
  white-space: nowrap;
}

:lang(en) .section-title {
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.section-lede {
  max-width: 36em;
  margin-top: 20px;
  color: var(--text);
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  line-height: 1.75;
  text-wrap: balance;
}

/* Footer ----------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 40px;
  padding-block: 40px;
}

.footer-brand {
  display: grid;
  gap: 8px;
}

.footer-brand .brand {
  font-size: 14px;
}

.footer-brand p {
  color: var(--muted);
  font-size: 13px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
}

.footer-links a {
  color: var(--text);
  font-size: 14px;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--ink);
}

.footer-note {
  color: var(--muted);
  font-size: 13px;
}

.footer-disclaimer {
  flex-basis: 100%;
  max-width: 64em;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
