/* Kalma landing page — palette and typography mirror lib/theme/colors.dart
   and lib/theme/text_styles.dart so the site and the app read as one product. */

@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-Medium.ttf') format('truetype');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Bricolage';
  src: url('fonts/BricolageGrotesque-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Bricolage';
  src: url('fonts/BricolageGrotesque-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

:root {
  --pine: #0b3b38;
  --teal: #147a6b;
  --teal-deep: #0c5a50;
  --mint: #74d6ba;
  --mint2: #a6e7d3;
  --mint-soft: #dcf3ec;
  --clay: #e08a66;
  --clay-text: #c35528;
  --paper: #eef4f1;
  --surface: #ffffff;
  --line: #e0ebe6;
  --ink: #0e322f;
  --soft: #405954;
  --muted: #4e6560;
  --on-pine: #e7f5ef;
  --on-pine-muted: #96c2b6;
  --on-teal: #f0fbf7;
  --bg: radial-gradient(120% 90% at 50% -18%, #e4eeea 0%, #d8e5e0 48%, #cfded8 100%);
  --shadow: 0 18px 48px rgba(11, 59, 56, 0.12);
  --radius: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --pine: #0f332f;
    --teal: #3faf98;
    --teal-deep: #9fe3ce;
    --mint-soft: #15332c;
    --clay-text: #f0a583;
    --paper: #071614;
    --surface: #102421;
    --line: #24403a;
    --ink: #e8f3ef;
    --soft: #a9c4bd;
    --muted: #89a29b;
    --on-teal: #04211c;
    --bg: radial-gradient(120% 90% at 50% -18%, #0d2622 0%, #091b18 48%, #061311 100%);
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  }
}

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

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: 'Bricolage', 'Inter', sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
}

a {
  color: var(--teal);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: min(1080px, 100% - 2.5rem);
  margin-inline: auto;
}

/* ---------- header ---------- */

header {
  padding: 1.5rem 0;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: 'Bricolage', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
}

.mark {
  width: 34px;
  height: 34px;
  border: 2.5px solid var(--teal);
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
}

.mark::after {
  content: '';
  width: 62%;
  height: 62%;
  border: 2.5px solid var(--mint);
  border-radius: 50%;
}

.lang {
  display: flex;
  gap: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem;
}

.lang button {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--soft);
  background: none;
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  min-height: 36px;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}

.lang button[aria-pressed='true'] {
  background: var(--pine);
  color: var(--on-pine);
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
  padding: 2.5rem 0 4rem;
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 4rem;
    padding: 4rem 0 5.5rem;
  }
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.9rem;
}

.hero h1 {
  font-size: clamp(2.1rem, 6vw, 3.4rem);
}

.lede {
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  color: var(--soft);
  max-width: 46ch;
  margin: 1.1rem 0 1.9rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.8rem 1.4rem;
  border-radius: 16px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.btn-primary {
  background: var(--teal);
  color: var(--on-teal);
  box-shadow: 0 10px 24px rgba(20, 122, 107, 0.32);
}

.btn-ghost {
  border: 1.5px solid var(--line);
  color: var(--ink);
  background: var(--surface);
}

.btn:hover {
  transform: translateY(-2px);
}

.note {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 1.1rem 0 0;
}

/* ---------- phone mockup ---------- */

.phone {
  width: min(310px, 78vw);
  margin-inline: auto;
  aspect-ratio: 310 / 640;
  background: var(--paper);
  border: 10px solid #10231f;
  border-radius: 44px;
  box-shadow: var(--shadow);
  padding: 1.1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  overflow: hidden;
}

.phone-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.phone-head .eyebrow {
  margin: 0 0 0.15rem;
  font-size: 0.6rem;
}

.phone-head strong {
  font-family: 'Bricolage', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
}

.pill {
  background: var(--mint-soft);
  color: var(--teal-deep);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  white-space: nowrap;
}

.quota {
  background: var(--pine);
  border-radius: 22px;
  padding: 1.1rem;
  color: var(--on-pine);
  position: relative;
  overflow: hidden;
}

.quota::after {
  content: '';
  position: absolute;
  right: -34px;
  top: -34px;
  width: 120px;
  height: 120px;
  border: 1.5px solid rgba(116, 214, 186, 0.18);
  border-radius: 50%;
}

.quota-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.62rem;
  color: var(--on-pine-muted);
}

.quota-num {
  font-family: 'Bricolage', sans-serif;
  font-size: 2rem;
  font-weight: 600;
  color: #fff;
  margin: 0.3rem 0 0.6rem;
}

.quota-num span {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: #8cb8ac;
}

.track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.track i {
  display: block;
  height: 100%;
  width: 50%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mint), var(--mint2));
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.6rem 0.5rem;
}

.stat b {
  font-family: 'Bricolage', sans-serif;
  font-size: 1rem;
  display: block;
}

.stat span {
  font-size: 0.58rem;
  color: var(--soft);
  line-height: 1.3;
  display: block;
}

.urge {
  margin-top: auto;
  background: var(--teal);
  color: var(--on-teal);
  border-radius: 18px;
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  box-shadow: 0 10px 22px rgba(20, 122, 107, 0.35);
}

.urge b {
  font-family: 'Bricolage', sans-serif;
  font-size: 0.95rem;
  display: block;
}

.urge span {
  font-size: 0.65rem;
  opacity: 0.8;
}

.urge i {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  font-style: normal;
  flex: none;
}

/* ---------- sections ---------- */

section {
  padding: 3.5rem 0;
}

.section-head {
  max-width: 52ch;
  margin-bottom: 2.2rem;
}

.section-head p {
  color: var(--soft);
  margin: 0.7rem 0 0;
}

.cards {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.card p {
  color: var(--soft);
  margin: 0;
  font-size: 0.95rem;
}

.card .glyph {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--mint-soft);
  color: var(--teal-deep);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.privacy-band {
  background: var(--pine);
  color: var(--on-pine);
  border-radius: 26px;
  padding: 2.5rem;
}

.privacy-band h2 {
  color: var(--on-pine);
}

.privacy-band p {
  color: var(--on-pine-muted);
  max-width: 54ch;
}

.privacy-band ul {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.privacy-band li {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  font-size: 0.92rem;
}

.privacy-band li::before {
  content: '✓';
  color: var(--mint);
  font-weight: 700;
  flex: none;
}

/* ---------- share ---------- */

.share {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
  align-items: center;
  justify-content: space-between;
}

.share h2 {
  font-size: clamp(1.15rem, 2.6vw, 1.5rem);
  max-width: 22ch;
}

.share p {
  color: var(--soft);
  margin: 0.6rem 0 0;
  max-width: 34ch;
}

.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.share-btn {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.7rem 1.15rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease;
}

.share-btn:hover {
  background: var(--mint-soft);
  border-color: var(--mint);
}

.share-btn.copied {
  background: var(--mint-soft);
  border-color: var(--teal);
  color: var(--teal-deep);
}

details {
  border-bottom: 1px solid var(--line);
  padding: 1.1rem 0;
}

summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  min-height: 32px;
  align-items: center;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: '+';
  color: var(--teal);
  font-size: 1.3rem;
  line-height: 1;
}

details[open] summary::after {
  content: '−';
}

details p {
  color: var(--soft);
  margin: 0.7rem 0 0;
  max-width: 62ch;
}

/* ---------- article pages ---------- */

.doc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 5vw, 3rem);
  margin-bottom: 3rem;
}

.doc h2 {
  font-size: 1.25rem;
  margin-top: 2.2rem;
}

.doc h2:first-of-type {
  margin-top: 1.6rem;
}

.doc p,
.doc li {
  color: var(--soft);
}

.doc strong {
  color: var(--ink);
}

.updated {
  font-size: 0.85rem;
  color: var(--muted);
}

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

footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem 0 3.5rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.disclaimer {
  max-width: 70ch;
  margin: 0;
}

/* ---------- language switching ---------- */

[lang]:not(:lang(x)) {
  display: revert;
}

body[data-lang='fr'] [data-i18n='en'],
body[data-lang='en'] [data-i18n='fr'] {
  display: none;
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }

  .btn:hover {
    transform: none;
  }
}
