/* =====================================================
   GRATIAGO — Design System
   See docs/TYPOGRAPHY.md for the rules behind this file.
   ===================================================== */

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

:root {
  /* ---- CANVAS ---- */
  --bg:           #FFEBE0;
  --bg-2:         #FFF4ED;
  --white:        #FFFFFF;

  /* ---- INK (3 levels, always) ---- */
  --ink:          #0B191E;
  --ink-2:        #3E4A52;
  --ink-3:        #6E6862;   /* darkened for WCAG AA contrast (was #8B8580) */
  --rule:         rgba(11, 25, 30, 0.10);

  /* ---- ACCENTS (UI only — never in body text) ---- */
  --rose:         #EC8E9B;
  --rose-soft:    #FAD5DA;
  --mauve-1:      #F2A0AE;
  --mauve-2:      #B591C9;
  --mauve-3:      #7B96D3;
  --cyan:         #00D1FF;

  /* ---- SHADOWS ---- */
  --shadow-sm:    0 8px 16px -8px rgba(11, 25, 30, 0.10);
  --shadow:       0 20px 40px -28px rgba(11, 25, 30, 0.20);
  --shadow-lg:    0 32px 64px -32px rgba(11, 25, 30, 0.28);

  /* ---- TYPE ---- */
  --sans:         'Mulish', system-ui, -apple-system, sans-serif;
  --capsule:      999px;
  --radius-card:  24px;
  --radius-lg:    36px;

  /* ---- TYPE SIZES (px, fluid where useful) ---- */
  --t-display:    clamp(48px, 6.5vw, 80px);
  --t-h2:         clamp(36px, 4.5vw, 56px);
  --t-h3:         clamp(22px, 2vw, 28px);
  --t-h4:         18px;
  --t-lead:       18px;
  --t-body:       16px;
  --t-small:      14px;
  --t-meta:       13px;
  --t-micro:      11px;
}

/* ---- BASE ---- */
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink-2);                  /* body default is ink-2 */
  font-family: var(--sans);
  font-weight: 400;
  font-size: var(--t-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--mauve-2); color: var(--white); }

/* ---- ACCESSIBILITY: visible keyboard focus (WCAG 2.4.7) ---- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--mauve-2);
  outline-offset: 3px;
  border-radius: 6px;
}
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) { outline: none; }

/* ---- ACCESSIBILITY: respect reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Skip link for screen readers ---- */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--white);
  padding: 12px 20px; border-radius: 0 0 var(--capsule) 0;
  font-weight: 700; font-size: 14px; z-index: 1000;
}
.skip-link:focus { left: 0; }

/* ---- TYPOGRAPHY — the only declarations for headings ----
   RULE (May 2026, strict): a heading is ONE weight, ONE color, NO italic.
   Any <em>, <strong>, or <span> inside a heading renders identically
   to its siblings. The visual emphasis comes from the heading itself
   (size + bold + position) — never from intra-heading style variation.
*/
h1, h2, h3, h4 {
  font-family: var(--sans);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.025em;
  line-height: 1.02;
}
h1 { font-size: var(--t-display); }
h2 { font-size: var(--t-h2); line-height: 1.05; }
h3 { font-size: var(--t-h3); line-height: 1.15; letter-spacing: -0.015em; }
h4 { font-size: var(--t-h4); line-height: 1.3; letter-spacing: 0; }

/* Neutralize every intra-heading wrapper — render flat */
h1 em, h2 em, h3 em, h4 em,
h1 strong, h2 strong, h3 strong, h4 strong,
h1 span, h2 span, h3 span, h4 span {
  font-style: normal !important;
  font-weight: inherit !important;
  color: inherit !important;
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
}

/* Body emphasis */
strong, b { font-weight: 600; color: var(--ink); }
em, i { font-style: italic; }

p { font-size: var(--t-body); line-height: 1.65; color: var(--ink-2); }

/* Utility text classes — for explicit overrides */
.t-display { font-size: var(--t-display); }
.t-h2 { font-size: var(--t-h2); }
.t-h3 { font-size: var(--t-h3); }
.t-lead { font-size: var(--t-lead); line-height: 1.55; color: var(--ink-2); font-weight: 400; }
.t-body { font-size: var(--t-body); }
.t-small { font-size: var(--t-small); line-height: 1.5; }
.t-meta { font-size: var(--t-meta); color: var(--ink-3); line-height: 1.5; }
.t-micro {
  font-size: var(--t-micro);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* Tabular figures everywhere we have numbers */
.num-block, .stat, [class*="stat"], [class*="num"] {
  font-variant-numeric: tabular-nums;
}

/* ---- BACKGROUND LINE MOTIF (signature) ---- */
.bg-lines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}
.bg-lines svg { width: 100%; height: 100%; }

/* ---- LAYOUT ---- */
.wrap         { max-width: 1320px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }
.wrap-narrow  { max-width: 780px;  margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }
.wrap-medium  { max-width: 1080px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

/* ---- NAV ---- */
.nav { padding: 24px 0; }
.nav .inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--white);
  padding: 14px 22px;
  border-radius: var(--capsule);
  box-shadow: var(--shadow);
  border: 1px solid var(--rule);
}
.logo-mark { display: flex; align-items: center; }
.logo-mark img { height: 42px; width: auto; }
.logo-mark.big img { height: 64px; }
.nav ul { display: flex; gap: 4px; list-style: none; }
.nav-link {
  color: var(--ink);
  font-size: var(--t-small);
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--capsule);
  transition: background 0.2s;
}
.nav-link:hover { background: var(--bg); }
.nav-right { display: flex; gap: 10px; align-items: center; }
.lang-pill {
  display: flex;
  font-size: var(--t-micro);
  font-weight: 700;
  background: var(--bg);
  padding: 4px;
  border-radius: var(--capsule);
  letter-spacing: 0.04em;
}
.lang-pill span {
  padding: 6px 12px;
  border-radius: var(--capsule);
  color: var(--ink-3);
  cursor: pointer;
}
.lang-pill span.on { background: var(--ink); color: var(--white); }
.cta-mini {
  background: var(--ink);
  color: var(--white);
  padding: 11px 18px;
  border-radius: var(--capsule);
  font-size: var(--t-small);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.25s;
}
.cta-mini:hover { background: var(--mauve-2); }

/* ---- BUTTONS ---- */
.btn-primary {
  background: linear-gradient(135deg, var(--mauve-1) 0%, var(--mauve-2) 55%, var(--mauve-3) 100%);
  color: var(--white);
  padding: 18px 30px;
  border-radius: var(--capsule);
  font-size: var(--t-small);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: 0 12px 32px -16px rgba(181, 145, 201, 0.6);
  border: 0;
  cursor: pointer;
  letter-spacing: 0;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 20px 40px -16px rgba(181, 145, 201, 0.75); }
.btn-primary .arrow {
  width: 26px; height: 26px;
  background: var(--white); color: var(--mauve-2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.btn-ghost {
  background: var(--white);
  color: var(--ink);
  padding: 18px 26px;
  font-size: var(--t-small);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--capsule);
  border: 1px solid var(--rule);
  transition: background 0.25s, color 0.25s;
  cursor: pointer;
}
.btn-ghost:hover { background: var(--ink); color: var(--white); }

.btn-ink {
  background: var(--ink);
  color: var(--white);
  padding: 16px 26px;
  border-radius: var(--capsule);
  font-size: var(--t-small);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  transition: background 0.25s;
}
.btn-ink:hover { background: var(--mauve-2); }
.btn-ink .ic {
  width: 26px; height: 26px;
  background: var(--white); color: var(--ink);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
}

/* ---- LABELS / PILLS ---- */
.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--rose);
  color: var(--white);
  padding: 8px 16px;
  border-radius: var(--capsule);
  font-size: var(--t-meta);
  font-weight: 700;
  letter-spacing: 0;
}
.eyebrow-pill .dot {
  width: 6px; height: 6px;
  background: var(--white);
  border-radius: 50%;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.s-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  color: var(--ink);
  padding: 7px 14px;
  border-radius: var(--capsule);
  font-size: var(--t-micro);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--rule);
}
.s-label.rose { background: var(--rose); color: var(--white); border-color: transparent; }
.s-label.dark { background: rgba(255, 255, 255, 0.08); color: var(--white); border-color: rgba(255, 255, 255, 0.12); }

/* ---- CARDS ---- */
.b-card {
  background: var(--white);
  border-radius: var(--radius-card);
  padding: 28px;
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s, box-shadow 0.3s;
}
.b-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.b-card.mauve {
  background: linear-gradient(135deg, var(--mauve-1) 0%, var(--mauve-2) 55%, var(--mauve-3) 100%);
  color: var(--white);
  border: 0;
}
.b-card.dark { background: var(--ink); color: var(--white); border: 0; }

/* ---- SECTION HEADERS (reusable across pages) ---- */
.s-title-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 48px;
  margin-bottom: 56px;
  flex-wrap: wrap;
}
.s-title-row .left { flex: 1; min-width: 320px; }
.s-title-row .right { max-width: 420px; }
.s-title-row .right p {
  font-size: var(--t-body);
  color: var(--ink-2);
  line-height: 1.65;
}
.s-title-row h2 { margin-top: 20px; }

/* ---- FOOTER ---- */
.footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.6);
  padding: 56px 0 28px;
  margin-top: 80px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.footer .top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.footer .brand-line { font-size: var(--t-small); line-height: 1.7; }
.footer .brand-line .lo img {
  height: 38px;
  filter: brightness(0) invert(1);
  opacity: 0.9;
  margin-bottom: 18px;
}
.footer h5 {
  font-size: var(--t-micro);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 14px;
}
.footer ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer a {
  color: rgba(255, 255, 255, 0.65);
  font-size: var(--t-small);
  transition: color 0.2s;
}
.footer a:hover { color: var(--white); }
.footer .bottom {
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: var(--t-meta);
  color: rgba(255, 255, 255, 0.4);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
  .nav ul { display: none; }
  .footer .top { grid-template-columns: 1fr 1fr; gap: 32px; }
  .s-title-row { gap: 24px; }
}
@media (max-width: 640px) {
  .footer .top { grid-template-columns: 1fr; }
}
