@font-face {
  font-family: "Syne";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("../fonts/syne-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/outfit-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../fonts/instrument-sans-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Font Awesome 6 Free";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("../fonts/fa-solid-900.woff2") format("woff2");
}

.fa-solid {
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-style: normal;
  line-height: 1;
  display: inline-block;
  -webkit-font-smoothing: antialiased;
}

.fa-cart-shopping::before {
  content: "\f07a";
}

.fa-cart-plus::before {
  content: "\f217";
}

@font-face {
  font-family: "Poiret One";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/poiret-one-latin.woff2") format("woff2");
}

:root {
  --bg: #191919;
  --ink: #141012;
  --ink-2: #1c1518;
  --wine: #7c0023;
  --wine-deep: #4a0015;
  --blood: #9a002c;
  --bone: #d8c8ac;
  --bone-soft: #cbbba2;
  --moon: #a58b62;
  --line: rgba(216, 200, 172, 0.16);
  --line-strong: rgba(216, 200, 172, 0.32);
  --header: 3.85rem;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.1rem;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 88% -10%, rgba(124, 0, 35, 0.28), transparent 60%),
    radial-gradient(700px 420px at -10% 20%, rgba(165, 139, 98, 0.08), transparent 55%),
    var(--bg);
  color: var(--bone);
  font-family: "Outfit", "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

p {
  font-family: "Instrument Sans", "Segoe UI", sans-serif;
  font-size: 1.08rem;
  font-weight: 400;
  line-height: 1.65;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--bone);
}

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

::selection {
  background: var(--wine);
  color: var(--bone);
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.6rem 0.9rem;
  background: var(--bone);
  color: var(--bg);
  border-radius: 999px;
}

.skip:focus {
  top: 0.8rem;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: auto;
  min-height: var(--header);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
  padding: 0.5rem 1rem 0.45rem;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(25, 25, 25, 0.72);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(16px);
  z-index: -1;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}

.site-header.is-stuck::before {
  border-bottom-color: var(--line);
  background: rgba(25, 25, 25, 0.9);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  min-width: 0;
}

.brand img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.wordmark {
  font-family: "Poiret One", "Syne", sans-serif;
  font-weight: 400;
  font-size: 1.65rem;
  letter-spacing: 0.01em;
  line-height: 1;
  transform: translateY(0.06em);
}

.wordmark span {
  color: var(--bone);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.35rem;
}

.nav a {
  text-decoration: none;
  color: var(--bone-soft);
  font-family: "Poiret One", "Syne", sans-serif;
  font-size: 1.28rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  transform: translateY(0.06em);
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--bone);
}

@media (min-width: 861px) {
  .site-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: auto;
    align-items: center;
  }

  .brand {
    grid-column: 1 / 2;
    grid-row: 1;
    justify-self: start;
    align-self: center;
  }

  .nav {
    grid-column: 2 / 3;
    grid-row: 1;
    justify-self: center;
    align-self: center;
  }

  .header-tools {
    grid-column: 3 / 4;
    grid-row: 1;
    justify-self: end;
    align-self: center;
    margin-left: 0;
  }
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
}

.lang {
  position: relative;
}

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--bone);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.icon-btn:hover,
.lang-toggle[aria-expanded="true"] {
  border-color: var(--bone);
  color: var(--bone);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 5;
  min-width: 11.5rem;
  margin: 0;
  padding: 0.4rem;
  background: #141012;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.lang-menu[hidden] {
  display: none;
}

.lang-menu button {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--bone-soft);
  font-family: "Poiret One", "Syne", sans-serif;
  font-size: 1.2rem;
  letter-spacing: 0.03em;
  text-align: left;
  cursor: pointer;
}

.lang-menu button:hover,
.lang-menu button.is-on {
  background: var(--wine);
  color: var(--bone);
}

.cart-toggle .fa-cart-shopping {
  font-size: 1.05rem;
  pointer-events: none;
}

.cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: var(--wine);
  color: var(--bone);
  font-family: "Instrument Sans", "Segoe UI", sans-serif;
  font-size: 0.72rem;
  line-height: 1.15rem;
  text-align: center;
}

.cart-root {
  position: fixed;
  inset: 0;
  z-index: 5000;
}

.cart-root[hidden] {
  display: none;
}

.cart-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.cart-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(420px, 100%);
  height: 100%;
  background: #141012;
  border-left: 1px solid var(--line);
}

.cart-head,
.cart-foot {
  padding: 1.1rem 1.2rem;
}

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.cart-head h2 {
  margin: 0;
  font-size: 2rem;
}

.cart-body {
  flex: 1;
  overflow: auto;
  padding: 1rem 1.2rem;
}

.cart-empty {
  margin: 4rem 0 0;
  color: var(--bone-soft);
  text-align: center;
}

.cart-line {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}

.cart-line img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: #100c0e;
  border-radius: 10px;
}

.cart-line strong,
.cart-line p {
  margin: 0;
}

.cart-line p {
  color: var(--bone-soft);
  font-size: 0.95rem;
}

.cart-note {
  color: var(--moon);
}

.cart-line button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--bone);
  cursor: pointer;
}

.cart-foot p {
  display: flex;
  justify-content: space-between;
  margin: 0.25rem 0;
  color: var(--bone-soft);
}

.cart-total {
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line);
  color: var(--bone);
  font-size: 1.15rem;
}

.cart-checkout {
  width: 100%;
  margin-top: 0.9rem;
}

.cart-checkout:disabled,
.cart-checkout:disabled:hover {
  opacity: 0.55;
  transform: none;
  cursor: default;
  background: var(--wine);
}

body.cart-open {
  overflow: hidden;
}

.nav-toggle {
  display: none;
  margin-left: 0;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--bone);
  padding: 0;
  cursor: pointer;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 16px;
  height: 1.5px;
  margin-inline: auto;
  background: var(--bone);
  border-radius: 2px;
  position: relative;
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle span::before { top: -5px; }
.nav-toggle span::after { top: 5px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 46px;
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: "Poiret One", "Syne", sans-serif;
  font-weight: 400;
  font-size: 1.2rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.btn-wine {
  background: var(--wine);
  color: var(--bone);
}

.btn-wine:hover {
  background: var(--blood);
  color: var(--bone);
  transform: translateY(-1px);
}

.discord-mark {
  display: block;
  flex: none;
}

.btn-ghost {
  background: transparent;
  color: var(--bone);
  border-color: var(--line-strong);
}

.btn-ghost:hover {
  border-color: var(--bone);
  color: var(--bone);
  transform: translateY(-1px);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 1.5rem 0 2.4rem;
}

.drift {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}

.drift-bit {
  --y: 40%;
  --s: 1.4rem;
  --d: 40s;
  --delay: 0s;
  --r: 0deg;
  --sway: 24px;
  position: absolute;
  left: -8vw;
  top: var(--y);
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;
  font-size: var(--s);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
  white-space: nowrap;
  opacity: 0;
  will-change: transform, opacity;
  animation: cerise-drift var(--d) linear var(--delay) infinite;
}

.drift-bit.bone { color: var(--bone); }
.drift-bit.wine { color: var(--bone); }

.hero-grid {
  position: relative;
  z-index: 1;
}

.hero-copy {
  position: relative;
}

.hero-copy::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -2rem -16% -1.6rem -18%;
  pointer-events: none;
  background: radial-gradient(ellipse at 30% 42%, rgba(25, 25, 25, 0.8) 0%, rgba(25, 25, 25, 0.28) 58%, transparent 78%);
}

@keyframes cerise-drift {
  0% {
    transform: translate3d(-6vw, 8px, 0) rotate(var(--r));
    opacity: 0;
  }
  10% {
    opacity: 0.78;
  }
  32% {
    transform: translate3d(30vw, calc(var(--sway) * -0.8), 0) rotate(calc(var(--r) + 8deg));
  }
  58% {
    transform: translate3d(60vw, calc(var(--sway) * 0.45), 0) rotate(calc(var(--r) - 6deg));
    opacity: 0.62;
  }
  82% {
    transform: translate3d(90vw, calc(var(--sway) * -0.25), 0) rotate(calc(var(--r) + 10deg));
    opacity: 0.5;
  }
  100% {
    transform: translate3d(114vw, 12px, 0) rotate(var(--r));
    opacity: 0;
  }
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  min-height: calc(100vh - var(--header) - 3rem);
}

.kicker {
  margin: 0 0 0.9rem;
  color: var(--moon);
  font-family: "Poiret One", "Syne", sans-serif;
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: "Poiret One", "Syne", sans-serif;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.05;
  margin: 0;
}

h1 {
  display: flex;
  flex-direction: column;
  font-size: clamp(4.4rem, 9vw, 7.6rem);
  line-height: 0.88;
}

h1 .accent {
  color: var(--bone);
}

.hero-line {
  margin: 1.35rem 0 0.7rem;
  font-family: "Poiret One", "Syne", sans-serif;
  font-size: clamp(1.55rem, 2.3vw, 1.95rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.lede {
  margin: 0;
  max-width: 40rem;
  color: var(--bone-soft);
  font-size: 1.22rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.7rem;
}

.hero-mark {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 280px;
}

.hero-mark::before {
  content: "";
  position: absolute;
  width: min(72%, 340px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 0, 35, 0.35), transparent 68%);
  filter: blur(22px);
}

.hero-mark img {
  position: relative;
  width: min(460px, 100%);
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.35));
}

.friend-note {
  padding: 0 0 3.2rem;
}

.friend-title {
  margin: 0 0 0.7rem;
  font-family: "Poiret One", "Syne", sans-serif;
  font-size: clamp(2.4rem, 4.4vw, 3.6rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.05;
}

.friend-note p:last-child {
  max-width: none;
  margin: 0;
  color: var(--bone-soft);
  font-size: 1.08rem;
  line-height: 1.65;
}

.friend-note a,
.friend-note a:hover {
  color: inherit;
}

.section {
  padding: 4.5rem 0;
}

.section-head {
  max-width: none;
  margin-bottom: 2rem;
}

h2 {
  font-size: clamp(2.4rem, 4.4vw, 3.6rem);
  line-height: 1.05;
}

.section-head p {
  margin: 0.9rem 0 0;
  max-width: none;
  color: var(--bone-soft);
  font-size: 1.08rem;
  line-height: 1.65;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#scripts .section-head {
  margin-bottom: 1.15rem;
}

.script-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1.35rem;
}

.script-search {
  flex: 1 1 14rem;
  max-width: 18rem;
}

.script-search input {
  width: 100%;
  height: 42px;
  padding: 0 0.95rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #141012;
  color: var(--bone);
  font-family: "Instrument Sans", "Segoe UI", sans-serif;
  font-size: 0.98rem;
}

.script-search input::placeholder {
  color: var(--moon);
}

.script-search input:focus-visible {
  outline-color: var(--moon);
}

.script-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.15rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.script-filters label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--bone-soft);
  font-family: "Poiret One", "Syne", sans-serif;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.guides-open {
  flex: none;
  min-height: 42px;
  padding: 0.35rem 1.05rem;
}

.script-filters input {
  appearance: none;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #141012;
  cursor: pointer;
}

.script-filters input:checked {
  border-color: var(--wine);
  background-color: var(--wine);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23d8c8ac' stroke-width='2' d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 0.85rem;
}

.script-empty {
  margin: 0.2rem 0 0;
  color: var(--moon);
}

.script-kind {
  margin: 0;
  color: var(--moon);
  font-family: "Poiret One", "Syne", sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

.script-price {
  margin: 0;
  color: var(--bone);
  font-family: "Poiret One", "Syne", sans-serif;
  font-size: 1.35rem;
  letter-spacing: 0.03em;
}

.cards.script-grid,
.cards.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.cards.script-grid h3 {
  font-size: 1.45rem;
}

.script-card {
  padding: 0;
  gap: 0;
  overflow: hidden;
}

.script-cover {
  display: block;
  aspect-ratio: 16 / 10;
  background:
    radial-gradient(circle at 50% 45%, rgba(124, 0, 35, 0.35), transparent 62%),
    #100c0e;
}

.script-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1.1rem 1.4rem;
}

.script-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
  padding: 1.05rem 1.15rem 1.15rem;
}

.script-actions {
  display: flex;
  flex-wrap: wrap;
  align-self: flex-start;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.script-actions .script-voir {
  margin: 0;
}

.script-github {
  pointer-events: none;
}

.script-actions a.script-github {
  pointer-events: auto;
}

.script-actions .btn:hover {
  transform: none;
}

.script-buy {
  display: inline-grid;
  place-items: center;
  width: 46px;
  border: 0;
  border-left: 1px solid rgba(216, 200, 172, 0.28);
  background: var(--wine-deep);
  color: var(--bone);
  cursor: pointer;
}

.script-buy:hover {
  background: var(--blood);
}

.script-buy .fa-cart-plus {
  font-size: 0.95rem;
  pointer-events: none;
}

.fiche-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.script-page {
  padding: 2.2rem 0 4rem;
}

.script-back {
  color: var(--bone-soft);
  font-family: "Poiret One", "Syne", sans-serif;
  font-size: 1.2rem;
  letter-spacing: 0.03em;
  text-decoration: none;
}

.script-back:hover {
  color: var(--bone);
}

.script-page h1 {
  display: block;
  margin: 0.7rem 0 1.3rem;
  font-size: clamp(2.6rem, 5vw, 4.2rem);
}

.script-page h1 + .script-price {
  margin: -0.85rem 0 1.25rem;
  font-size: 1.7rem;
}

.gallery {
  margin-bottom: 1.6rem;
}

.gallery-stage {
  position: relative;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 42px;
  height: 42px;
  margin-top: -21px;
  border: 0;
  border-radius: 50%;
  background: rgba(25, 25, 25, 0.78);
  color: var(--bone);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.gallery-nav.prev { left: 12px; }
.gallery-nav.next { right: 12px; }

.gallery-nav:hover {
  background: var(--wine);
}

.stage-shot {
  cursor: zoom-in;
}

.gallery-thumbs {
  display: flex;
  gap: 0.55rem;
  margin-top: 0.7rem;
  overflow: auto;
}

.gallery-thumb {
  flex: none;
  width: 96px;
  height: 64px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: #100c0e;
  cursor: pointer;
}

.gallery-thumb.is-on {
  border-color: var(--wine);
}

.gallery-thumb img,
.thumb-play {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.thumb-play {
  display: grid;
  place-items: center;
  color: var(--bone);
  font-size: 0.85rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: grid;
  place-items: center;
  padding: 4.2rem 5.4rem 1.6rem;
  background: rgba(0, 0, 0, 0.9);
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: 100%;
  max-height: 88vh;
  object-fit: contain;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 52px;
  height: 52px;
  margin-top: -26px;
  border: 0;
  border-radius: 50%;
  background: rgba(25, 25, 25, 0.72);
  color: var(--bone);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-nav.prev { left: 18px; }
.lightbox-nav.next { right: 18px; }

.lightbox-nav:hover {
  background: var(--wine);
}

.lightbox-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(25, 25, 25, 0.85);
  color: var(--bone);
  font-size: 1.4rem;
  cursor: pointer;
}

.media-frame {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #100c0e;
  color: var(--moon);
  text-align: center;
}

.media-frame video,
.media-frame img {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  justify-self: stretch;
  align-self: stretch;
  object-fit: contain;
}

.media-frame p {
  margin: 0;
  padding: 1rem;
}

.script-copy {
  max-width: 42rem;
  margin-bottom: 1.6rem;
}

.script-copy p {
  margin: 0 0 0.8rem;
  color: var(--bone-soft);
}

.btn.is-soon:hover {
  transform: none;
  background: var(--wine);
}

.btn-ghost.is-soon:hover {
  background: transparent;
  border-color: var(--line-strong);
}

.btn.is-soon {
  cursor: default;
}

.soon-note {
  margin: 0.85rem 0 0;
  color: var(--moon);
  font-family: "Instrument Sans", "Segoe UI", sans-serif;
  font-size: 0.98rem;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 100%;
  padding: 1.35rem 1.35rem 1.2rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 40%), var(--ink);
  border: 1px solid var(--line);
  border-radius: 18px;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.card:hover {
  border-color: rgba(154, 0, 44, 0.85);
  transform: translateY(-3px);
  color: var(--bone);
}

.card-kicker {
  color: var(--moon);
  font-family: "Poiret One", "Syne", sans-serif;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.card h3 {
  font-size: 1.9rem;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.card p {
  margin: 0;
  color: var(--bone-soft);
  flex: 1;
}

.card-go {
  margin-top: 0.8rem;
  color: var(--bone);
  font-family: "Poiret One", "Syne", sans-serif;
  font-weight: 400;
  font-size: 1.2rem;
  letter-spacing: 0.03em;
}

.card-go::after {
  content: "";
  display: inline-block;
  width: 0.42em;
  height: 0.42em;
  margin-left: 0.4em;
  border-right: 1.5px solid currentColor;
  border-top: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-1px, 1px);
  vertical-align: 0.05em;
}

.site-footer {
  padding: 2.8rem 0 1.6rem;
  border-top: 1px solid var(--line);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.15fr repeat(3, 1fr);
  gap: 2rem 1.6rem;
}

.footer-name {
  font-family: "Poiret One", "Syne", sans-serif;
  font-size: 2rem;
  letter-spacing: 0.02em;
  line-height: 1;
  text-decoration: none;
  color: var(--bone);
}

.footer-brand p {
  margin: 0.55rem 0 0;
  max-width: 16rem;
  color: var(--bone-soft);
}

.footer-col h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.footer-col a,
.footer-col span {
  display: block;
  padding: 0.22rem 0;
  color: var(--bone-soft);
  font-family: "Instrument Sans", "Segoe UI", sans-serif;
  font-size: 1rem;
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--bone);
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--moon);
  font-family: "Instrument Sans", "Segoe UI", sans-serif;
  font-size: 0.95rem;
}

.footer-base a {
  color: var(--bone-soft);
  text-decoration: none;
}

.footer-base a:hover {
  color: var(--bone);
}

.doc-page {
  width: min(820px, calc(100% - 2.5rem));
  padding: 2.4rem 0 4.5rem;
}

.doc-page h1 {
  display: block;
  margin: 0.2rem 0 0.8rem;
  font-size: clamp(2.6rem, 5vw, 4.2rem);
}

.doc-lead,
.legal-date {
  color: var(--bone-soft);
}

.legal-date {
  margin: 0 0 1.3rem;
  color: var(--moon);
}

.legal-card {
  margin: 0 0 0.85rem;
  padding: 1.25rem 1.35rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #141012;
}

.legal-card h2 {
  margin: 0 0 0.7rem;
  font-size: 1.65rem;
  line-height: 1.15;
}

.legal-card p,
.legal-card li {
  color: var(--bone-soft);
}

.legal-card p {
  margin: 0 0 0.75rem;
}

.legal-card p:last-child {
  margin-bottom: 0;
}

.legal-card ul {
  margin: 0.2rem 0 0.75rem;
  padding-left: 1.15rem;
}

.legal-card li {
  margin: 0.22rem 0;
}

.legal-card a {
  color: var(--wine);
}

.legal-card a.btn-wine,
.legal-card a.btn-wine:hover {
  color: var(--bone);
}

.legal-card a:hover {
  color: var(--blood);
}

.legal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.page-404 {
  min-height: calc(100vh - var(--header));
  display: grid;
  align-content: center;
  padding: 3rem 0 4rem;
}

.page-404 h1 {
  font-size: clamp(3.4rem, 8vw, 6rem);
}

.page-404 p {
  max-width: 32rem;
  color: var(--bone-soft);
}

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-block;
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    margin: 0;
    padding: 0.4rem 1.25rem 1.15rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    background: rgba(25, 25, 25, 0.97);
    border-bottom: 1px solid var(--line);
  }

  .nav.is-open {
    display: flex;
  }

  .nav a,
  .nav .btn {
    padding: 0.75rem 0.2rem;
    justify-content: flex-start;
  }

  .script-search {
    max-width: none;
  }

  .hero-grid,
  .cards,
  .cards.script-grid,
  .cards.tool-grid {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    min-height: 0;
    padding-top: 1.2rem;
  }

  .drift-bit:nth-child(n + 11) {
    display: none;
  }

  .drift {
    opacity: 0.8;
  }

  .hero-mark {
    order: -1;
    min-height: 0;
  }

  .hero-mark img {
    width: min(300px, 78%);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .lightbox {
    padding: 4rem 3.4rem 1.2rem;
  }

  .lightbox-nav {
    width: 42px;
    height: 42px;
    margin-top: -21px;
    font-size: 1.6rem;
  }

  .lightbox-nav.prev { left: 8px; }
  .lightbox-nav.next { right: 8px; }
}

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

.docs {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 210px;
  align-items: start;
  min-height: calc(100vh - var(--header));
  border-top: 1px solid var(--line);
}

.docs-menu,
.docs-backdrop {
  display: none;
}

.docs-menu {
  align-items: center;
  min-height: 42px;
  margin: 0.85rem 1rem 0;
  padding: 0.35rem 1.05rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #141012;
  color: var(--bone);
  font-family: "Poiret One", "Syne", sans-serif;
  font-size: 1.2rem;
  letter-spacing: 0.03em;
  cursor: pointer;
}

.docs-side {
  position: sticky;
  top: var(--header);
  height: calc(100vh - var(--header));
  overflow: auto;
  padding: 1.15rem 0.85rem 2.4rem;
  background: #100c0e;
  border-right: 1px solid var(--line);
}

.docs-brand {
  margin: 0.15rem 0.55rem 0.85rem;
  color: var(--bone);
  font-family: "Poiret One", "Syne", sans-serif;
  font-size: 1.45rem;
  line-height: 1.15;
}

.docs-side .docs-search {
  display: block;
  max-width: none;
  margin: 0 0.35rem 0.85rem;
}

.docs-side .docs-search input {
  height: 38px;
  font-size: 0.95rem;
}

.docs-group,
.docs-list-label,
.docs-toc-label,
.docs-kicker {
  margin: 1.15rem 0 0.3rem;
  padding: 0 0.65rem;
  color: var(--moon);
  font-family: "Poiret One", "Syne", sans-serif;
  font-size: 0.98rem;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.docs-link {
  display: block;
  margin: 0.08rem 0;
  padding: 0.42rem 0.65rem;
  border-radius: 8px;
  color: var(--bone-soft);
  font-family: "Instrument Sans", "Segoe UI", sans-serif;
  font-size: 0.95rem;
  line-height: 1.35;
  text-decoration: none;
}

.docs-link:hover {
  background: rgba(216, 200, 172, 0.06);
  color: var(--bone);
}

.docs-link.is-on,
.docs-link.is-on:hover {
  background: var(--wine);
  color: var(--bone);
}

.docs-main {
  min-width: 0;
  max-width: 820px;
  padding: 2.1rem 2.4rem 4.5rem;
}

.docs-main h1 {
  display: block;
  margin: 0 0 0.75rem;
  font-size: clamp(2.3rem, 4vw, 3.3rem);
  line-height: 1.08;
}

.docs-main h2 {
  margin: 2rem 0 0.55rem;
  font-size: 1.7rem;
  line-height: 1.15;
  scroll-margin-top: 5rem;
}

.docs-main p,
.docs-main li {
  color: var(--bone-soft);
}

.docs-main p {
  max-width: 68ch;
}

.docs-lead {
  margin-top: 0;
  font-size: 1.08rem;
}

.docs-main a:not(.btn) {
  color: var(--wine);
  text-decoration: none;
}

.docs-main a:not(.btn):hover {
  color: var(--blood);
  text-decoration: underline;
}

.docs-main ul {
  margin: 0.3rem 0 0;
  padding-left: 1.15rem;
}

.docs-main li {
  margin: 0.38rem 0;
}

.docs-main .docs-list-label,
.docs-main .docs-kicker {
  padding: 0;
}

.docs-id {
  margin: -0.15rem 0 0.2rem;
  color: var(--moon);
  font-size: 0.98rem;
}

.docs-res {
  color: var(--moon);
  font-size: 0.92rem;
}

.docs-crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.85rem;
  color: var(--moon);
  font-size: 0.95rem;
}

.docs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.85rem;
}

.docs-toc {
  position: sticky;
  top: var(--header);
  height: calc(100vh - var(--header));
  overflow: auto;
  padding: 1.5rem 1.15rem 2rem 0.9rem;
  border-left: 1px solid var(--line);
}

.docs-toc-label {
  margin-top: 0.35rem;
}

.docs-toc a {
  display: block;
  padding: 0.32rem 0;
  color: var(--bone-soft);
  font-family: "Instrument Sans", "Segoe UI", sans-serif;
  font-size: 0.92rem;
  line-height: 1.35;
  text-decoration: none;
}

.docs-toc a:hover,
.docs-toc a.is-on {
  color: var(--bone);
}

@media (max-width: 1100px) {
  .docs {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .docs-toc {
    display: none;
  }
}

@media (max-width: 860px) {
  .docs {
    display: block;
  }

  .docs-menu {
    display: inline-flex;
    margin: 0.85rem 1rem 0;
  }

  .docs-side {
    position: fixed;
    z-index: 9;
    top: var(--header);
    left: 0;
    width: min(320px, 88vw);
    transform: translateX(-105%);
    transition: transform 0.2s var(--ease);
  }

  .docs.is-open .docs-side {
    transform: none;
  }

  .docs-backdrop {
    display: block;
    position: fixed;
    z-index: 8;
    inset: var(--header) 0 0 0;
    background: rgba(0, 0, 0, 0.45);
  }

  .docs:not(.is-open) .docs-backdrop {
    display: none;
  }

  .docs-main {
    padding: 1rem 1.15rem 3.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn,
  .card { transition: none; }
  .btn:hover,
  .card:hover { transform: none; }
  .drift-bit {
    animation: none;
    opacity: 0;
  }
}
