/* =============================================================================
   Tesla Parrain Duo — design system  ·  "BOLD MODERN PRODUCT LANDING"
   Identity: a punchy, friendly terracotta landing — big centered spotlight with
   a soft gradient mesh, oversized headline, generously rounded cards & buttons,
   and a tactile segmented code PILL. Deliberately unlike the sibling sites:
   NO serif, NO editorial cream — a humanist sans on a warm near-white paper
   with gradient accents. Light + dark. System fonts only (no blocking fetch).
   Class vocabulary is bespoke to this site (frame/zone/spotlight/codepill/…).
   ============================================================================= */

:root {
  /* warm near-white paper (a modern gradient-landing base, not the cream family) */
  --paper: #fdf6f2;
  --paper-2: #fbeade;
  --card: #ffffff;
  --ink: #221913;
  --text: #3a2f28;
  --text-2: #7d6d62;
  --line: #f3e4d9;
  --line-2: #e8d2c4;

  /* terracotta brand + gradient partners */
  --accent: #d1490f;
  --accent-strong: #b03a08;
  --accent-2: #0e7c70;      /* teal partner for "cool" accents */
  --signal: #d98a1c;        /* amber signal */
  --good: #14875a;
  --bad: #c23a2c;
  --on-accent: #fff6f0;

  /* signature warm gradient (spotlight, buttons, glow) */
  --grad: linear-gradient(135deg, #fb923c 0%, #ef5a1a 48%, #c2320a 100%);
  --grad-soft: linear-gradient(135deg, #ffd9a8 0%, #ff9d66 55%, #ff7a45 100%);

  --shadow-sm: 0 1px 2px rgba(90,50,20,.05), 0 3px 10px rgba(90,50,20,.06);
  --shadow-md: 0 14px 40px rgba(120,60,25,.14);
  --shadow-lg: 0 30px 70px rgba(120,55,20,.22);
  --glow: 0 20px 60px rgba(224,90,26,.30);

  --radius: 24px;
  --radius-sm: 14px;
  --frame: 1120px;

  --sans: "Segoe UI", "Helvetica Neue", -apple-system, system-ui, "Noto Sans",
          "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;

  --bg: var(--paper);
  --bg-2: var(--paper-2);
}

/* viewer theme toggle + OS preference both supported */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14100d;
    --paper-2: #1d1611;
    --card: #221913;
    --ink: #f6ece2;
    --text: #efe2d6;
    --text-2: #bda997;
    --line: #33291f;
    --line-2: #453727;
    --accent: #fb7a4a;
    --accent-strong: #ff9166;
    --accent-2: #4dc0af;
    --signal: #eab04f;
    --good: #4fc088;
    --bad: #f0766a;
    --on-accent: #2a150c;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.5);
    --shadow-md: 0 16px 44px rgba(0,0,0,.5);
    --shadow-lg: 0 30px 70px rgba(0,0,0,.6);
    --glow: 0 20px 60px rgba(251,122,74,.28);
    --bg: var(--paper);
    --bg-2: var(--paper-2);
  }
}

/* ── base ─────────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--sans); color: var(--text); background: var(--bg);
  line-height: 1.65; font-size: 1.04rem; text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
img, svg { max-width: 100%; height: auto; vertical-align: middle; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }

h1, h2, h3, h4 {
  font-family: var(--sans); color: var(--ink); line-height: 1.08;
  letter-spacing: -0.02em; margin: 0 0 .5em; font-weight: 800;
}
h1 { font-size: clamp(2.35rem, 6.2vw, 4rem); font-weight: 900; }
h2 { font-size: clamp(1.7rem, 4vw, 2.5rem); }
h3 { font-size: 1.32rem; font-weight: 800; }
p { margin: 0 0 1rem; }
.lead { font-size: 1.2rem; color: var(--text-2); max-width: 62ch; font-weight: 400; }
.muted { color: var(--text-2); }
.small { font-size: .9rem; } .xsmall { font-size: .8rem; line-height: 1.5; }
code { font-family: var(--mono); }
strong { color: var(--ink); }

.frame { width: min(100% - 2rem, var(--frame)); margin-inline: auto; }

/* section band */
.zone { padding: clamp(2.8rem, 7vw, 5rem) 0; }
.zone--soft { background: var(--bg-2); }
.zone--narrow > .frame { max-width: 820px; }
.zone > .frame > h2 { margin-bottom: .3em; }
.zone--narrow .prose { max-width: none; }

.skip-link {
  position: absolute; left: -999px; top: .5rem; z-index: 100;
  background: var(--card); padding: .6rem 1rem; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md); color: var(--ink);
}
.skip-link:focus { left: .5rem; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ── header ───────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 1rem; height: 70px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 900;
  color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.brand-name { font-family: var(--sans); font-size: 1.16rem; font-weight: 800; }
.brand-name b { color: var(--accent); font-weight: 900; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: .1rem; }
.site-nav a { color: var(--text-2); text-decoration: none; padding: .5rem .7rem;
  border-radius: 999px; font-weight: 600; font-size: .93rem; }
.site-nav a:hover { color: var(--ink); background: var(--bg-2); }
.site-nav a[aria-current="page"] { color: var(--accent); }

/* pill FR/EN language switcher */
.lang-switch {
  border: 1.5px solid var(--line-2); font-weight: 800 !important;
  font-size: .8rem !important; text-transform: uppercase; letter-spacing: .05em;
  border-radius: 999px !important; padding: .42rem .9rem !important; color: var(--ink) !important;
}
.lang-switch::before { content: "⇄"; margin-right: .35rem; color: var(--accent); }
.lang-switch:hover { background: var(--bg-2) !important; border-color: var(--accent); }
.nav-toggle { display: none; }

/* first-class FR/EN toggle inside the landing spotlight (language-aware landing) */
.langland { display: inline-flex; gap: .25rem; padding: .3rem; margin: 0 auto 1.15rem;
  border-radius: 999px; background: var(--card); border: 1.5px solid var(--line-2);
  box-shadow: var(--shadow-sm); }
.langland__opt { padding: .42rem 1rem; border-radius: 999px; font-weight: 800; font-size: .85rem;
  color: var(--text-2); text-decoration: none; letter-spacing: .01em; }
.langland__opt:not(.is-current):hover { background: var(--bg-2); color: var(--ink); }
.langland__opt.is-current { background-image: var(--grad); color: #fff6f0; box-shadow: var(--shadow-sm); }

/* language-aware suggestion toast — position:fixed keeps it out of flow → zero CLS */
.langnudge { position: fixed; z-index: 80; left: 1rem; right: 1rem; bottom: 1rem;
  margin-inline: auto; max-width: 30rem; display: flex; align-items: center; gap: .6rem;
  background: var(--card); border: 1.5px solid var(--line-2); border-radius: var(--radius-sm);
  padding: .7rem .8rem .7rem 1rem; box-shadow: var(--shadow-lg); font-size: .92rem; }
.langnudge[hidden] { display: none; }
.langnudge__globe { flex: none; }
.langnudge__txt { flex: 1; min-width: 0; color: var(--text); }
.langnudge__cta { flex: none; font-weight: 800; text-decoration: none; color: var(--accent); white-space: nowrap; }
.langnudge__cta:hover { color: var(--accent-strong); text-decoration: underline; }
.langnudge__x { flex: none; border: 0; background: transparent; cursor: pointer;
  color: var(--text-2); font-size: 1rem; line-height: 1; padding: .3rem; border-radius: 8px; }
.langnudge__x:hover { background: var(--bg-2); color: var(--ink); }
@media (max-width: 480px) {
  .langnudge { flex-wrap: wrap; }
  .langnudge__txt { flex: 1 1 100%; order: 3; }
}

/* ── buttons — big & rounded (pill) ─────────────────────────────────────────── */
.act {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font: inherit; font-weight: 800; cursor: pointer; text-decoration: none;
  padding: .9rem 1.6rem; border-radius: 999px; border: 1.5px solid transparent;
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease, filter .14s ease;
  line-height: 1.2; font-size: 1.02rem;
}
.act:active { transform: translateY(1px) scale(.99); }
.act--fill { background-image: var(--grad); color: #fff6f0; box-shadow: var(--glow); }
.act--fill:hover { color: #fff; filter: brightness(1.05) saturate(1.05); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.act--line { background: var(--card); border-color: var(--line-2); color: var(--ink); box-shadow: var(--shadow-sm); }
.act--line:hover { background: var(--bg-2); color: var(--ink); border-color: var(--accent); transform: translateY(-2px); }
.act--mini { padding: .55rem 1.1rem; font-size: .92rem; background-image: var(--grad); color: #fff6f0; box-shadow: var(--shadow-sm); }
.act--mini:hover { color: #fff; filter: brightness(1.05); }
.act--wide { display: flex; width: 100%; margin-top: 1rem; }

/* ── spotlight (centered landing with gradient-mesh blobs) ──────────────────── */
.spotlight { position: relative; overflow: clip; text-align: center;
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.4rem, 6vw, 4rem); }
.spotlight::before, .spotlight::after {
  content: ""; position: absolute; z-index: 0; border-radius: 50%;
  filter: blur(60px); opacity: .55; pointer-events: none;
}
.spotlight::before {
  width: 620px; height: 620px; top: -240px; right: -120px;
  background: radial-gradient(circle at 30% 30%, #ff9d5c, transparent 70%);
  animation: drift 18s ease-in-out infinite alternate;
}
.spotlight::after {
  width: 560px; height: 560px; bottom: -280px; left: -140px;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--accent-2) 70%, #58c9ba), transparent 70%);
  opacity: .38; animation: drift 22s ease-in-out infinite alternate-reverse;
}
@keyframes drift {
  from { transform: translate3d(0,0,0) scale(1); }
  to   { transform: translate3d(-26px, 30px, 0) scale(1.08); }
}
.spotlight__inner { position: relative; z-index: 1; max-width: 880px; margin-inline: auto; }
.spotlight h1 { margin: .8rem 0 .3rem; }
.spotlight h1 .hl { background-image: var(--grad); -webkit-background-clip: text;
  background-clip: text; color: transparent; }
.spotlight .lead { margin-inline: auto; font-size: clamp(1.08rem, 2.4vw, 1.32rem); }

/* eyebrow flag */
.flag { display: inline-flex; align-items: center; gap: .5rem; font-weight: 800;
  font-size: .82rem; letter-spacing: .04em; color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  padding: .42rem .95rem; border-radius: 999px; }

/* chip row */
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: .55rem; padding: 0;
  margin: 1.3rem 0; justify-content: center; }
.chip { background: var(--card); border: 1.5px solid var(--line); border-radius: 999px;
  padding: .5rem 1.05rem; font-size: .9rem; font-weight: 700; box-shadow: var(--shadow-sm); color: var(--ink); }
.chip--hot { border-color: transparent; background-image: var(--grad); color: #fff6f0; }
.chip--cool { border-color: transparent; background: var(--accent-2); color: #fff; }

.cta-row { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.5rem; justify-content: center; }

/* trust / proof line */
.proof { display: flex; flex-wrap: wrap; gap: .5rem 1.6rem; margin: 1.6rem 0 0; padding: 0;
  list-style: none; color: var(--text-2); font-size: .92rem; font-weight: 700; justify-content: center; }
.proof li { display: inline-flex; align-items: center; gap: .45rem; }
.proof svg { flex: none; color: var(--good); }

/* ── the signature code unit: a tactile SEGMENTED PILL ──────────────────────── */
.coderack {
  position: relative; margin: 2rem auto 0; max-width: 560px;
  background: var(--card); border: 1px solid var(--line-2);
  border-radius: var(--radius); padding: clamp(1.3rem, 3vw, 1.9rem);
  box-shadow: var(--shadow-md);
}
.coderack::before {
  content: ""; position: absolute; inset: -2px; border-radius: calc(var(--radius) + 2px);
  padding: 2px; background: var(--grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: .55; pointer-events: none;
}
.coderack__label { font-weight: 800; font-size: 1.06rem; color: var(--ink); margin: 0 0 .9rem; }

/* segmented pill: code text fused with an integrated copy toggle */
.codepill {
  display: flex; align-items: stretch; height: 3.5rem;
  border-radius: 999px; overflow: hidden;
  background: var(--bg-2); border: 1.5px solid var(--line-2);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.05);
}
.codepill__value {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: .4rem;
  font-family: var(--mono); font-size: 1.12rem; font-weight: 700; color: var(--ink);
  padding: 0 1rem 0 1.3rem; letter-spacing: .01em;
  overflow-x: auto; white-space: nowrap; scrollbar-width: none;
}
.codepill__value::-webkit-scrollbar { display: none; }
.codepill__copy {
  flex: none; border: 0; cursor: pointer; font: inherit; font-weight: 800;
  padding: 0 1.5rem; margin: .35rem; border-radius: 999px;
  background-image: var(--grad); color: #fff6f0; white-space: nowrap;
  display: inline-flex; align-items: center; gap: .35rem; box-shadow: var(--shadow-sm);
  transition: filter .14s ease, transform .12s ease, background .2s ease;
}
.codepill__copy:hover { filter: brightness(1.06) saturate(1.05); }
.codepill__copy:active { transform: scale(.97); }
.codepill__copy.copied { background: var(--good); background-image: none; color: #fff; }

.coderack__note { margin: .9rem 0 0; }
.verified { display: inline-flex; align-items: center; gap: .5rem; margin: 1.1rem 0 .2rem;
  font-size: .82rem; font-weight: 800; color: var(--accent-2); }
.verified .dot { width: .55rem; height: .55rem; border-radius: 999px; background: var(--good);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 20%, transparent); flex: none; }
.coderack__foot { margin: .5rem 0 0; }

/* ── grids / tiles ──────────────────────────────────────────────────────────── */
.cols { display: grid; gap: 1.15rem; }
.cols--2 { grid-template-columns: repeat(2, 1fr); }
.cols--3 { grid-template-columns: repeat(3, 1fr); }
.cols--4 { grid-template-columns: repeat(4, 1fr); }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow-sm); }
.tile h3 { margin-top: 0; }
a.tile { text-decoration: none; color: inherit; display: block;
  transition: transform .16s, box-shadow .16s, border-color .16s; }
a.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--accent); }

/* big feature icon */
.glyph { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center;
  font-size: 1.7rem; background: var(--bg-2); border: 1px solid var(--line); margin-bottom: .9rem; }
.glyph--hot { background-image: var(--grad); border-color: transparent; color: #fff6f0; }
.glyph--cool { background: var(--accent-2); border-color: transparent; color: #fff; }

.stepno { display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem;
  border-radius: 16px; background-image: var(--grad); color: #fff6f0;
  font-weight: 900; font-size: 1.2rem; margin-bottom: .7rem; box-shadow: var(--shadow-sm); }

/* ── tables ─────────────────────────────────────────────────────────────────── */
.tablecard { overflow-x: auto; border: 1px solid var(--line-2); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); }
table { border-collapse: collapse; width: 100%; min-width: 520px; background: var(--card); }
th, td { text-align: left; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line);
  font-size: .95rem; vertical-align: top; }
thead th { background: var(--bg-2); font-size: .76rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-2); font-weight: 800; }
tbody tr:last-child td { border-bottom: 0; }
.pos { color: var(--good); font-weight: 800; } .neg { color: var(--bad); font-weight: 800; }

/* ── FAQ ────────────────────────────────────────────────────────────────────── */
.faq { display: grid; gap: .7rem; max-width: 820px; }
.faq-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  overflow: hidden; }
.faq-item summary { cursor: pointer; list-style: none; padding: 1.1rem 1.25rem; font-weight: 800;
  color: var(--ink); display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.5rem; color: var(--accent); line-height: 1; flex: none; }
.faq-item[open] summary::after { content: "–"; }
.faq-a { padding: 0 1.25rem 1.25rem; color: var(--text-2); }
.faq-a :is(p):last-child { margin-bottom: 0; }

/* ── callouts ───────────────────────────────────────────────────────────────── */
.callout { border-left: 4px solid var(--accent-2); background: var(--bg-2); padding: 1.1rem 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 1.3rem 0; }
.callout--warn { border-color: var(--signal); }
.callout--bad { border-color: var(--bad); }
.callout strong { color: var(--ink); }

/* ── breadcrumb ─────────────────────────────────────────────────────────────── */
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0;
  margin: 0 0 1.2rem; font-size: .87rem; color: var(--text-2); }
.breadcrumb li + li::before { content: "›"; margin-right: .4rem; color: var(--line-2); }
.breadcrumb a { color: var(--text-2); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

/* ── prose ──────────────────────────────────────────────────────────────────── */
.prose { max-width: 72ch; }
.prose h2 { margin-top: 2.4rem; } .prose h3 { margin-top: 1.7rem; }
.prose ul, .prose ol { padding-left: 1.25rem; } .prose li { margin: .35rem 0; }
.prose table { margin: 1rem 0; }
.prose .coderack { max-width: 520px; margin: 1.8rem 0; }

/* author byline */
.byline { display: flex; align-items: center; gap: .9rem; margin: 1.6rem 0; padding: 1.1rem 1.25rem;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); }
.byline .avatar { width: 50px; height: 50px; border-radius: 999px; flex: none;
  background-image: var(--grad); color: #fff6f0; display: grid; place-items: center;
  font-weight: 900; font-size: 1.15rem; }
.byline p { margin: 0; font-size: .9rem; }
.byline strong { color: var(--ink); }

/* blog list */
.post-list { display: grid; gap: 1.15rem; }
.post-tile { display: block; }
.post-tag { font-size: .78rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .05em; color: var(--accent-2); }
.post-meta { font-size: .82rem; color: var(--text-2); }

/* ── footer ─────────────────────────────────────────────────────────────────── */
.site-footer { background: var(--bg-2); border-top: 1px solid var(--line); margin-top: 2rem;
  padding-top: 2.8rem; }
.footer-grid { display: grid; grid-template-columns: 1.7fr 1fr 1fr 1fr; gap: 1.6rem; }
.footer-grid .brand { margin-bottom: .5rem; }
.footer-grid nav { display: flex; flex-direction: column; gap: .35rem; }
.footer-grid nav a { color: var(--text-2); text-decoration: none; font-size: .92rem; }
.footer-grid nav a:hover { color: var(--accent); }
.foot-h { font-size: .76rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink); margin: 0 0 .3rem; font-weight: 800; }
.foot-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  border-top: 1px solid var(--line); margin-top: 2.2rem; padding: 1.3rem 0; }

/* ── utilities ──────────────────────────────────────────────────────────────── */
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.stack > * + * { margin-top: 1rem; }
.form-field { width: 100%; padding: .75rem .9rem; border: 1.5px solid var(--line-2);
  border-radius: var(--radius-sm); background: var(--card); color: var(--text); font: inherit; }
.form-field:focus-visible { border-color: var(--accent); }

/* ── responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .cols--4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .cols--3 { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-flex; flex-direction: column; gap: 4px; margin-left: auto;
    background: transparent; border: 1.5px solid var(--line-2); border-radius: 12px;
    padding: 9px 8px; cursor: pointer; }
  .nav-toggle span { width: 20px; height: 2px; background: var(--ink); border-radius: 2px; transition: .2s; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .site-nav { position: fixed; inset: 70px 0 auto 0; flex-direction: column; align-items: stretch;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: .75rem 1rem 1.25rem;
    gap: .25rem; transform: translateY(-130%); transition: transform .24s ease; box-shadow: var(--shadow-md); }
  .site-nav.open { transform: translateY(0); }
  .site-nav a { padding: .8rem .6rem; }
  .site-nav .act, .site-nav .lang-switch { margin-top: .4rem; text-align: center; justify-content: center; }
}
@media (max-width: 480px) {
  .cols--2, .cols--4 { grid-template-columns: 1fr; }
  .foot-bottom { flex-direction: column; }
  .codepill__copy { padding: 0 1.1rem; }
}
