/* ==========================================================================
   datakili — landing page styles

   Sections:
     1. Design tokens      colors for light and dark themes
     2. Base               reset and page shell
     3. Language switcher  the fixed EN/FR control
     4. Header             logo, heading, subtitle
     5. Platform cards     the two destination links
     6. Motion             prefers-reduced-motion opt-out

   Theming: every color is a token on :root, redefined once under
   prefers-color-scheme: dark. No component hardcodes a color.
   ========================================================================== */


/* 1. Design tokens
   ========================================================================== */

:root {
  color-scheme: light dark;

  --bg: #f5f6fa;
  --bg-2: #eceffa;
  --card-bg: #ffffff;
  --text: #16171d;
  --muted: #5f6376;
  --border: #e6e8f0;

  /* Each platform has three accent roles:
       --accent-N       the 3px rule on the card and its hover border
       --accent-N-soft  the pill/icon background
       --accent-N-ink   text and icons ON that soft background

     -ink exists because the brand colors are too light to sit on their own
     -soft background: #0ea5a4 on #e6f8f7 is 2.76:1, well under the 4.5:1
     WCAG AA floor. The darkened -ink values clear it (indigo 5.53:1,
     teal 4.99:1) while -accent-N keeps the original brand brightness for
     the decorative rule, where contrast rules do not apply. */
  --accent-1: #5b5ce4;
  --accent-1-soft: #eeeefd;
  --accent-1-ink: #4b4cd6;

  --accent-2: #0ea5a4;
  --accent-2-soft: #e6f8f7;
  --accent-2-ink: #0f766e;

  --shadow: 0 1px 2px rgba(16, 17, 30, 0.04), 0 12px 32px -12px rgba(16, 17, 30, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0d12;
    --bg-2: #14151d;
    --card-bg: #191a22;
    --text: #f2f3f7;
    --muted: #9ea1b2;
    --border: #2a2c38;

    /* The dark accents already clear 4.5:1 on their soft backgrounds, so
       -ink and -accent-N are the same value here. */
    --accent-1: #8b8cf5;
    --accent-1-soft: #23233a;
    --accent-1-ink: #8b8cf5;

    --accent-2: #2dd4cd;
    --accent-2-soft: #12302e;
    --accent-2-ink: #2dd4cd;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 20px 40px -16px rgba(0, 0, 0, 0.55);
  }
}


/* 2. Base
   ========================================================================== */

* {
  box-sizing: border-box;
}

/* The <symbol> definitions at the top of <body>. Hidden without display:none,
   which stops <use> resolving in some browsers. */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

body {
  margin: 0;
  /* svh is the viewport minus the mobile URL bar; vh is the fallback for
     browsers without it. Plain vh alone leaves a phantom scrollbar on iOS. */
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Top padding clears the fixed language switcher. */
  padding: 72px 20px 32px;
  background: radial-gradient(circle at 20% 15%, var(--bg-2), var(--bg) 55%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.container {
  width: 100%;
  max-width: 760px;
  text-align: center;
}


/* 3. Language switcher
   ========================================================================== */

.lang {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.lang button {
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 5px 12px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.lang button:hover {
  color: var(--text);
}

/* i18n.js keeps aria-pressed in sync, so the active state is driven by the
   same attribute screen readers announce rather than a separate class. */
.lang button[aria-pressed="true"] {
  background: var(--accent-1-soft);
  color: var(--accent-1-ink);
}

.lang button:focus-visible {
  outline: 2px solid var(--accent-1);
  outline-offset: 2px;
}


/* 4. Header
   ========================================================================== */

.brand {
  display: inline-flex;
  align-items: center;
  margin-bottom: 18px;
}

.brand img {
  display: block;
  height: 38px;
  width: auto;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 0 0 44px;
  font-size: 1.05rem;
  color: var(--muted);
}


/* 5. Platform cards
   ========================================================================== */

.links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

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

/* Lets the card stretch to the full row height when descriptions differ. */
.links > li {
  display: flex;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  padding: 26px 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card-bg);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

/* Each card maps the global palette onto generic --accent* names. Every rule
   below this point is platform-agnostic, so a third platform only needs one
   new block here plus a matching class in the markup. */
.card.data {
  --accent: var(--accent-1);
  --accent-soft: var(--accent-1-soft);
  --accent-ink: var(--accent-1-ink);
}

.card.omni {
  --accent: var(--accent-2);
  --accent-soft: var(--accent-2-soft);
  --accent-ink: var(--accent-2-ink);
}

/* The colored rule across the top of each card. */
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--accent);
}

/* Keyboard focus gets the same lift and border as hover, plus an outline. */
.card:hover,
.card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.icon svg {
  width: 22px;
  height: 22px;
}

.tag {
  display: inline-block;
  width: fit-content;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* flex-grow pushes .url to the bottom so both cards align it. */
.desc {
  flex-grow: 1;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--muted);
}

.url {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  color: var(--muted);
}

.card:hover .url,
.card:focus-visible .url {
  color: var(--text);
}

.url svg {
  width: 13px;
  height: 13px;
  transition: transform 0.18s ease;
}

.card:hover .url svg,
.card:focus-visible .url svg {
  transform: translate(2px, -2px);
}


/* 6. Motion
   ========================================================================== */

/* Honors the OS-level "reduce motion" setting. The color changes on hover and
   focus stay, so every affordance still reads — only movement is removed. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }

  .card:hover,
  .card:focus-visible {
    transform: none;
  }

  .card:hover .url svg,
  .card:focus-visible .url svg {
    transform: none;
  }
}
