/* ============================================================
   Ben Redissi · Tutos IA — newsletter landing
   Tokens mirror tools/remotion/src/design.ts (source of truth).
   Layout = the brand "Mix" hero archetype (brand/lookbook/01).
   ============================================================ */

/* ---------- fonts (self-hosted, zero CDN) ---------- */
@font-face {
  font-family: 'Anton';
  src: url('assets/anton-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('assets/jbm-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('assets/jbm-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('assets/jbm-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('assets/jbm-800.woff2') format('woff2');
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: 'RetroGaming'; /* ASCII only — no accented glyphs */
  src: url('assets/RetroGaming.ttf') format('truetype');
  font-display: swap;
}

/* ---------- design tokens (design.ts) ---------- */
:root {
  --bg-paper: #F7F1E6;
  --bg-paper-deep: #ECE3D2;
  --ink: #2D2520;
  --ink-muted: #7C6F60;
  --coral: #E96951;        /* the ONE loud signal on this page */
  --violet: #7C3AED;       /* whisper-level only (duotone law) */
  --orange: #BE5103;       /* retro chrome only */
  --orange-deep: #8A3B02;
  --mint: #22A85F;
  --wash: linear-gradient(120deg, #1f6feb 0%, #3aa7c4 45%, #6f53e0 100%);
  --font-display: 'Anton', sans-serif;
  --font-body: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --font-pixel: 'RetroGaming', monospace;
  --r-panel: 26px;
  --r-card: 22px;
  --r-badge: 12px;
  --shadow-panel: 0 24px 60px rgba(0, 0, 0, .28);
  --shadow-card: 0 3px 0 rgba(45, 37, 32, .10), 0 8px 24px rgba(190, 81, 3, .08);
  --shadow-active: 0 4px 0 rgba(45, 37, 32, .14), 0 14px 40px rgba(190, 81, 3, .18);
}

/* ---------- base / no-scroll contract ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  background: var(--wash);
  font-family: var(--font-body);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* ---------- the floating cream panel ---------- */
.panel {
  display: flex;
  flex-direction: column;
  width: min(92vw, 1040px);
  height: min(88dvh, 640px);
  background: var(--bg-paper);
  border-radius: var(--r-panel);
  box-shadow: var(--shadow-panel);
  padding: clamp(24px, 4.5vw, 56px);
  overflow: hidden;
}

.content {
  flex: 1;
  display: grid;
  grid-template-columns: 1.4fr .9fr;
  align-items: center;
  gap: clamp(20px, 3.5vw, 48px);
  min-height: 0;
}

.left {
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2.4vh, 24px);
}

/* ---------- eyebrow kicker ---------- */
.kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.kicker::before {
  content: '●';
  color: var(--coral);
  letter-spacing: 0;
}
.avatar-chip {
  display: none; /* mobile only */
  width: 40px;
  height: 40px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  image-rendering: pixelated;
}

/* ---------- headline + coral marker sweep ---------- */
h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(36px, 5.4vw, 56px);
  line-height: 1.08;
  letter-spacing: .5px;
  text-transform: none;
}
h1 .hl {
  background-image: linear-gradient(0deg, var(--coral), var(--coral));
  background-repeat: no-repeat;
  background-size: 100% 42%;
  background-position: 0 78%;
  color: var(--ink);
  padding: 0 .08em;
}

.subhead {
  font-size: clamp(14px, 1.6vw, 18px);
  line-height: 1.65;
  color: var(--ink-muted);
  max-width: 46ch;
}

/* ---------- capture form ---------- */
.capture {
  display: flex;
  gap: 10px;
}
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
.capture input[type="email"] {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  padding: 0 18px;
  font-family: var(--font-body);
  font-size: 16px; /* 16px floor: prevents iOS zoom-on-focus */
  color: var(--ink);
  background: var(--bg-paper-deep);
  border: 2px solid var(--ink);
  border-radius: var(--r-badge);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.capture input[type="email"]::placeholder { color: var(--ink-muted); }
.capture input[type="email"]:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(233, 105, 81, .25);
}
.capture button {
  min-height: 52px;
  padding: 0 22px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--coral);
  border: 2px solid var(--ink);
  border-radius: var(--r-badge);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: box-shadow .15s ease, transform .15s ease;
}
.capture button:hover {
  box-shadow: var(--shadow-active);
  transform: translateY(-1px);
}
.capture button:active {
  box-shadow: none;
  transform: translateY(1px);
}
.capture button:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
}

.form-msg {
  display: none;
  font-size: 14px;
  font-weight: 600;
}
.form-msg.ok { display: block; color: var(--mint); }
.form-msg.err { display: block; color: var(--coral); }

/* ---------- RGPD microcopy ---------- */
.rgpd {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-muted);
}
.rgpd a {
  color: inherit;
  text-underline-offset: 3px;
}
.rgpd a:hover, .rgpd a:focus-visible { color: var(--coral); }

/* ---------- avatar sticker + pixel badge ---------- */
.right {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center; /* never stretch: stretch distorts the avatar */
}
.sticker {
  width: min(100%, 260px);
  aspect-ratio: 1 / 1; /* hard square guarantee, whatever the container does */
  height: auto;
  border: 3px solid var(--ink);
  border-radius: var(--r-badge);
  image-rendering: pixelated;
  transform: rotate(2deg);
  box-shadow: 10px 10px 0 var(--bg-paper-deep), var(--shadow-card);
}
.badge {
  position: absolute;
  bottom: -10px;
  left: 8%;
  font-family: var(--font-pixel); /* ASCII ONLY in this element */
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--bg-paper);
  background: var(--orange);
  padding: 8px 14px;
  border-radius: 6px;
  box-shadow: 4px 4px 0 var(--orange-deep);
  transform: rotate(-6deg);
}

/* ---------- footer microtype ---------- */
.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: clamp(12px, 2vh, 20px);
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ============================================================
   Load choreography — one orchestrated reveal (~1.3s), CSS only
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  @keyframes wash-settle {
    from { filter: brightness(.85); }
    to   { filter: brightness(1); }
  }
  @keyframes panel-rise {
    from { opacity: 0; transform: translateY(24px) scale(.985); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
  }
  @keyframes fade-up {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  @keyframes kicker-in {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
  }
  @keyframes marker-sweep {
    from { background-size: 0% 42%; }
    to   { background-size: 100% 42%; }
  }
  @keyframes stamp-drop {
    from { opacity: 0; transform: rotate(-10deg) scale(1.25); }
    to   { opacity: 1; transform: rotate(-6deg) scale(1); }
  }

  body { animation: wash-settle .5s ease-out both; }
  .panel {
    animation: panel-rise .55s cubic-bezier(.2, .8, .2, 1) both;
    animation-delay: .12s;
  }
  .kicker { animation: kicker-in .3s ease-out both; animation-delay: .38s; }
  h1 { animation: fade-up .4s cubic-bezier(.2, .8, .2, 1) both; animation-delay: .48s; }
  h1 .hl { animation: marker-sweep .45s cubic-bezier(.2, .8, .2, 1) both; animation-delay: .55s; }
  .subhead { animation: fade-up .3s ease-out both; animation-delay: .72s; }
  .capture input { animation: fade-up .3s ease-out both; animation-delay: .86s; }
  .capture button { animation: fade-up .3s ease-out both; animation-delay: .94s; }
  .rgpd, .footer { animation: fade-up .3s ease-out both; animation-delay: 1.04s; }
  .right { animation: fade-up .45s cubic-bezier(.2, .8, .2, 1) both; animation-delay: .3s; }
  .badge { animation: stamp-drop .35s cubic-bezier(.34, 1.56, .64, 1) both; animation-delay: 1.1s; }
}

/* ============================================================
   Mobile — single column, avatar shrinks to a kicker chip
   ============================================================ */
@media (max-width: 719px) {
  .panel {
    width: 94vw;
    height: auto;
    max-height: calc(100dvh - 24px);
    padding: clamp(20px, 6vw, 28px);
  }
  .content {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .right { display: none; }
  .avatar-chip { display: block; }
  .kicker { gap: 12px; letter-spacing: 1.5px; white-space: nowrap; }
  .footer { font-size: 12px; letter-spacing: 1px; white-space: nowrap; }
  .capture { flex-direction: column; }
  .capture button { width: 100%; }
  .subhead { max-width: none; }
}

/* short desktop viewports: keep the panel breathing */
@media (max-height: 560px) and (min-width: 720px) {
  .panel { height: min(94dvh, 640px); }
  .left { gap: 10px; }
}
