/* Dictée 2 Fun — Porcelain. Tokens mirror dictation_app/lib/core/theme/app_tokens.dart. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/fonts/BricolageGrotesque.ttf") format("truetype");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Manrope";
  src: url("/assets/fonts/Manrope.ttf") format("truetype");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --surface: #F4F5F8;
  --raised: #FFFFFF;
  --well: #E4E7ED;
  --ink: #151A2B;
  --ink2: #4A5168;
  --ink3: #666D84;
  --cobalt: #2F45F0;
  --cobalt-deep: #1A29B8;
  --cobalt-tint: #E6E9FF;
  --brass: #E8A23A;
  --brass-deep: #8F5710;
  --brass-tint: #FFF1D6;
  --accent-ink: #1A29B8;
  --hero-top: #293DD3;
  --hero-bottom: #202FA3;
  --on-hero: #FFFFFF;

  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --radius-card: 22px;
  --radius-key: 16px;
  --radius-chip: 11px;
  --shadow: 0 1px 2px rgb(21 26 43 / 0.06), 0 8px 24px rgb(21 26 43 / 0.08);
  --gap: 16px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #12151E;
    --raised: #242A3D;
    --well: #0D1017;
    --ink: #EEF0F6;
    --ink2: #C9CEDC;
    --ink3: #AEB6CB;
    --cobalt: #7C8CFF;
    --cobalt-deep: #4D60FF;
    --cobalt-tint: #2B3A8F;
    --brass: #F2B75A;
    --brass-deep: #F2B75A;
    --brass-tint: #3B2D14;
    --accent-ink: #9AA6FF;
    --hero-top: #3346F5;
    --hero-bottom: #1C2AA8;
    --on-hero: #FFFFFF;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px rgb(0 0 0 / 0.35);
  }
}

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

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

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1 0 auto; padding-block: 24px 48px; }

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

a {
  color: var(--accent-ink);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  overflow-wrap: anywhere;
  transition: color 0.15s ease, background-color 0.15s ease;
}
a:hover { text-decoration-thickness: 2px; }

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

h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; }
h1 { font-weight: 800; font-size: 34px; line-height: 1.1; margin: 0 0 16px; }
h2 { font-weight: 700; font-size: 20px; line-height: 1.2; margin: 40px 0 12px; }
h3 { font-weight: 700; font-size: 17px; line-height: 1.25; margin: 0 0 6px; }
p { margin: 0 0 12px; }
strong { font-weight: 700; }
code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.92em;
  background: var(--well);
  padding: 1px 6px;
  border-radius: 6px;
  overflow-wrap: anywhere;
}

/* ---- layout ---- */

.wrap {
  width: 100%;
  max-width: 72ch;
  margin-inline: auto;
  padding-inline: 16px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--cobalt-deep);
  color: #FFFFFF;
  border-radius: var(--radius-chip);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.site-header {
  background: var(--raised);
  border-bottom: 1px solid var(--well);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  text-decoration: none;
}
.brand-icon { width: 32px; height: 32px; border-radius: var(--radius-chip); flex: none; }
.brand span { overflow-wrap: anywhere; }

.lang-switch {
  display: inline-flex;
  flex: none;
  gap: 4px;
  padding: 3px;
  background: var(--well);
  border-radius: var(--radius-key);
}
.lang-switch a {
  display: inline-flex;
  align-items: center;
  min-width: 40px;
  min-height: 36px;
  justify-content: center;
  padding-inline: 8px;
  border-radius: var(--radius-chip);
  color: var(--ink2);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
}
.lang-switch a:hover { color: var(--ink); }
.lang-switch a[aria-current="page"] {
  background: var(--raised);
  color: var(--accent-ink);
  box-shadow: 0 1px 2px rgb(21 26 43 / 0.15);
}

/* ---- home ---- */

.hero {
  margin-block: 8px 8px;
  padding: 32px 20px 28px;
  border-radius: var(--radius-card);
  background: linear-gradient(var(--hero-top), var(--hero-bottom));
  color: var(--on-hero);
  text-align: center;
  box-shadow: var(--shadow);
}
.hero h1 { color: var(--on-hero); margin-bottom: 10px; }
.hero-icon {
  width: 96px;
  height: 96px;
  margin: 0 auto 16px;
  display: block;
  border-radius: 24px;
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.25);
}
.hero-sub {
  max-width: 46ch;
  margin: 0 auto 20px;
  font-size: 18px;
  line-height: 1.4;
  opacity: 0.95;
}
.store-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 14px;
}
.store-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 10px 22px;
  border-radius: var(--radius-key);
  background: var(--raised);
  color: var(--accent-ink);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 3px 0 var(--brass), 0 8px 18px rgb(0 0 0 / 0.2);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
a.store-btn:hover { transform: translateY(-1px); }
a.store-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--brass); }
span.store-btn { flex-direction: column; gap: 6px; box-shadow: 0 3px 0 var(--brass-deep); }
.hero-note { margin: 0; font-size: 14px; opacity: 0.9; }
.store-btn mark.placeholder { overflow-wrap: normal; white-space: nowrap; font-size: 13px; }

.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: 16px 16px 16px 64px;
  background: var(--raised);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 16px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--cobalt-tint);
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-weight: 800;
}
.steps strong { display: block; font-family: var(--font-display); font-size: 17px; margin-bottom: 2px; }
.steps span { color: var(--ink2); }

.features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 12px;
}
.feature {
  padding: 16px;
  background: var(--raised);
  border-radius: var(--radius-card);
  border-top: 4px solid var(--brass);
  box-shadow: var(--shadow);
}
.feature p { margin: 0; color: var(--ink2); }

.data {
  margin-top: 40px;
  padding: 4px 20px 12px;
  background: var(--cobalt-tint);
  border-radius: var(--radius-card);
  border-left: 6px solid var(--cobalt);
}
.data h2 { margin-top: 20px; color: var(--ink); }
.data p:last-child, .data ul:last-child { margin-bottom: 0; }

.faq { display: grid; gap: 8px; }
.faq details {
  background: var(--raised);
  border-radius: var(--radius-key);
  box-shadow: var(--shadow);
  padding: 0 16px;
}
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 28px 14px 0;
  position: relative;
  font-weight: 700;
  min-height: 48px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 11px;
  font-size: 22px;
  line-height: 1;
  color: var(--brass-deep);
  transition: transform 0.15s ease;
}
.faq details[open] summary::after { content: "–"; }
.faq details > :not(summary) { color: var(--ink2); }
.faq details > :last-child { margin-bottom: 16px; }

.more { margin-top: 16px; font-weight: 700; }

/* ---- support, 404, legal ---- */

.contact {
  padding: 4px 20px 12px;
  background: var(--raised);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  border-left: 6px solid var(--brass);
}
.contact h2 { margin-top: 16px; }
.support-links { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 8px; }
.support-links a { font-weight: 700; display: inline-block; padding-block: 8px; }

.not-found { padding-block: 24px 8px; }
.not-found-en { color: var(--ink2); }

.doc { overflow-wrap: break-word; }
.doc h2 { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--well); }
.doc h2:first-of-type { border-top: 0; padding-top: 0; }
.doc h3 { margin-top: 24px; }
.doc ul, .doc ol { padding-left: 24px; margin: 0 0 12px; }
.doc li { margin-bottom: 4px; }
.doc li::marker { color: var(--brass-deep); }
.doc blockquote { margin: 16px 0; padding: 8px 16px; background: var(--brass-tint); border-left: 4px solid var(--brass); border-radius: 0 var(--radius-chip) var(--radius-chip) 0; }
.doc hr { border: 0; border-top: 1px solid var(--well); margin: 24px 0; }
.doc :target { scroll-margin-top: 16px; }

.table-wrap {
  overflow-x: auto;
  margin: 16px 0;
  border: 1px solid var(--well);
  border-radius: var(--radius-chip);
  background: var(--raised);
  -webkit-overflow-scrolling: touch;
}
.table-wrap table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 14px; }
.table-wrap th, .table-wrap td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--well); }
.table-wrap th { background: var(--cobalt-tint); color: var(--ink); font-size: 13px; font-weight: 700; }
.table-wrap tr:last-child td { border-bottom: 0; }

mark.placeholder {
  background: var(--brass-tint);
  color: var(--brass-deep);
  outline: 2px dashed var(--brass-deep);
  outline-offset: 1px;
  border-radius: 4px;
  padding: 0 4px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.hero mark.placeholder { background: var(--brass-tint); color: var(--brass-deep); }

/* ---- footer ---- */

.site-footer {
  flex: none;
  background: var(--well);
  color: var(--ink2);
  padding-block: 28px 36px;
  font-size: 14px;
}
.site-footer p { margin: 0 0 10px; }
.footer-brand { font-family: var(--font-display); font-weight: 800; font-size: 17px; color: var(--ink); }
.footer-links { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.footer-links a { display: inline-block; padding-block: 6px; }
.footer-copy { color: var(--ink3); }
.footer-trademark { font-size: 12px; color: var(--ink3); line-height: 1.5; }

/* ---- wider screens ---- */

@media (min-width: 640px) {
  h1 { font-size: 40px; }
  main { padding-block: 40px 64px; }
  .hero { padding: 48px 32px 40px; }
  .hero-sub { font-size: 20px; }
}

@media (max-width: 380px) {
  h1 { font-size: 30px; }
  .brand { font-size: 16px; }
  .store-btn { width: 100%; }
}

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