/* KM Portfolio 2026 */

/* ── Local fonts ──────────────────────────────────────────────────────────── */

@font-face {
  font-family: "TeX Gyre Heros Cn";
  src: url("../fonts/TeXGyreHerosCn-Regular.woff2") format("woff2"),
       url("../fonts/TeXGyreHerosCn-Regular.woff")  format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "TeX Gyre Heros Cn";
  src: url("../fonts/TeXGyreHerosCn-Italic.woff2") format("woff2"),
       url("../fonts/TeXGyreHerosCn-Italic.woff")  format("woff");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "TeX Gyre Heros Cn";
  src: url("../fonts/TeXGyreHerosCn-Bold.woff2") format("woff2"),
       url("../fonts/TeXGyreHerosCn-Bold.woff")  format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "TeX Gyre Heros Cn";
  src: url("../fonts/TeXGyreHerosCn-BoldItalic.woff2") format("woff2"),
       url("../fonts/TeXGyreHerosCn-BoldItalic.woff")  format("woff");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --ink:      rgb(29, 29, 29);
  --ink-2:    rgb(235, 235, 235);
  --hair:     rgb(237, 237, 237);
  --bg:       rgb(255, 255, 255);
  --serif:    "Instrument Serif", "Cormorant Garamond", Georgia, serif;
  --cond:     "TeX Gyre Heros Cn", sans-serif;

  --content-w: 1060px;                       /* 878 × 1.15 × 1.05 — +20 % */
  --gutter:    16px;
}

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

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--cond);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

::selection {
  background: rgb(60, 60, 60);
  color: #fff;
}

/* Very subtle grain overlay — SVG feTurbulence tiled, no network request */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.15;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 220px;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ── Layout shell ─────────────────────────────────────────────────────────── */

.page {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--content-w));
  margin-inline: auto;
}

.section + .section { margin-top: clamp(72px, 8.25vw, 141px); }
#portfolio          { margin-top: clamp(24px, 4.5vw, 90px); }
#about              { margin-top: clamp(120px, 14vw, 210px); }
.section           { scroll-margin-top: 100px; }
.foot              { margin-top: clamp(80px, 9vw, 140px) !important; }
.section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(36px, 3.75vw, 60px);
}

/* ── Typography ───────────────────────────────────────────────────────────── */

.h-title {
  font-family: var(--serif);
  font-weight: 100;
  font-size: clamp(21px, 4.2vw, 72px);
  line-height: 1.05;
  text-align: center;
  color: var(--ink);
  margin: 0;
}
.h-title span {
  display: block;
  white-space: nowrap;
}

#rotating-word {
  display: inline-block;
}
#rotating-word::after {
  content: '';
}
#rotating-word.is-typing::after {
  content: '|';
  animation: blink .6s step-end infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}

.h-section {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(30px, 3.75vw, 48px);
  line-height: 1.1;
  text-align: center;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}

.subtitle {
  font-family: var(--cond);
  font-weight: 700;
  font-size: 11px;
  line-height: 14px;
  text-align: center;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: .02em;
  margin: 0;
  white-space: pre-line;
}

.link-quiet {
  font-family: var(--cond);
  font-weight: 700;
  font-size: 11px;
  text-align: center;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: .02em;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}
.link-quiet:hover {
  text-underline-offset: 5px;
  transition: text-underline-offset .25s;
}

/* ── Pill button (style ugogo.fr / btn-contact) ───────────────────────────── */

@keyframes shimmer {
  0%, 88%, to { transform: translate(-150%); }
  96%          { transform: translate(150%); }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 16px 40px;
  border-radius: 9999px;
  background: linear-gradient(to bottom, #2a2a2a 0%, #1a1a1a 100%);
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 1px rgba(255, 255, 255, 0.06) inset,
    0 2px 4px rgba(26, 26, 26, 0.20),
    0 6px 16px rgba(26, 26, 26, 0.18),
    0 12px 32px rgba(26, 26, 26, 0.12);
  color: #fafafa;
  font-family: var(--cond);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  transition:
    transform .35s cubic-bezier(.25, 1, .5, 1),
    box-shadow .35s ease,
    gap .3s ease;
  cursor: pointer;
  min-width: 262px;
}

.btn.btn-sm { min-width: 142px; padding: 12px 24px; }

.btn:hover {
  gap: 8px;
  transform: translateY(-3px) scale(1.04);
  box-shadow:
    0 1px rgba(255, 255, 255, 0.06) inset,
    0 4px 8px rgba(26, 26, 26, 0.22),
    0 12px 28px rgba(26, 26, 26, 0.20),
    0 20px 48px rgba(26, 26, 26, 0.14);
}

.btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow:
    0 1px rgba(255, 255, 255, 0.04) inset,
    0 1px 3px rgba(26, 26, 26, 0.25),
    0 3px 8px rgba(26, 26, 26, 0.15);
  transition-duration: .1s;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.12) 47%,
    rgba(255, 255, 255, 0.18) 50%,
    rgba(255, 255, 255, 0.12) 53%,
    transparent 60%
  );
  transform: translate(-150%);
  animation: shimmer 10s ease-in-out infinite;
  animation-delay: 3s;
  pointer-events: none;
}

.btn-arrow {
  width: 0;
  opacity: 0;
  transform: translate(-4px);
  transition:
    width .3s cubic-bezier(.25, 1, .5, 1),
    opacity .3s ease,
    transform .3s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  align-self: flex-end;
  margin-bottom: 1px;
}

.btn:hover .btn-arrow { width: 18px; opacity: 1; transform: translate(0); }

.btn-sign {
  flex-shrink: 0;
  font-size: 20px;
  font-weight: 300;
  line-height: 1;
  margin-left: 8px;
  opacity: .85;
}

/* ── Scroll indicator ─────────────────────────────────────────────────────── */

@keyframes scroll-hint {
  0%        { transform: translateY(-100%); opacity: 0; }
  15%, 80%  { opacity: 1; }
  100%      { transform: translateY(200%); opacity: 0; }
}

.scroll-indicator {
  position: absolute;
  bottom: clamp(28px, 4vw, 52px);
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 52px;
  overflow: hidden;
  transition: opacity 0.8s ease;
}
.scroll-indicator::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ink);
  opacity: 0.15;
}
.scroll-indicator::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 45%;
  background: var(--ink);
  animation: scroll-hint 2s ease-in-out infinite;
}
.scroll-indicator.is-hidden { opacity: 0; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */

.hero {
  min-height: 100dvh;
  padding-block: clamp(60px, 8vw, 120px);
  justify-content: center;
  position: relative;
}

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

.hero .stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(21px, 2.55vw, 37px);
  width: 100%;
}

.hero .h-title + .subtitle { margin-top: clamp(4px, 0.75vw, 9px); }

.hero .actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 21px;
}

/* ── Clients (3 / 3 / 2 rows) ─────────────────────────────────────────────── */

.clients-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.clients-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px 42px;
}

.client {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 22px;
}

.client .logo {
  width: 22px; height: 22px;
  border-radius: 50%;
  background-color: rgb(255, 255, 255);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid var(--hair);
  flex: 0 0 22px;
}

.client .name {
  font-family: var(--cond);
  font-weight: 700;
  font-size: 11px;
  color: var(--ink);
  text-transform: uppercase;
  white-space: nowrap;
}

/* ── Portfolio grid + tile hover ──────────────────────────────────────────── */

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  width: 100%;
}

/* Extra tiles hidden by default, toggled via JS */
.tile-extra            { display: none; }
.tile-extra.is-visible { display: block; }

.tile {
  position: relative;
  aspect-ratio: 374 / 210;
  border-radius: 8px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  isolation: isolate;
  transition:
    transform .38s cubic-bezier(.2, .7, .2, 1),
    box-shadow .38s cubic-bezier(.2, .7, .2, 1),
    z-index 0s linear .38s;
  z-index: 1;
}
.tile:hover {
  transform: scale(1.06);
  box-shadow: 0 14px 27px rgba(0, 0, 0, 0.18);
  z-index: 5;
  transition:
    transform .38s cubic-bezier(.2, .7, .2, 1),
    box-shadow .38s cubic-bezier(.2, .7, .2, 1),
    z-index 0s linear 0s;
}

.tile-art {
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.025) 0 1px, transparent 1px 14px),
    linear-gradient(180deg, rgb(252, 252, 252), rgb(244, 244, 244));
  background-size: cover;
  background-position: center;
  transform:
    scale(1.08)
    translate3d(
      calc((var(--mx, 0.5) - 0.5) * -16px),
      calc((var(--my, 0.5) - 0.5) * -16px),
      0
    );
  transition: transform .25s cubic-bezier(.2, .7, .2, 1);
}
.tile.is-hover .tile-art {
  transform:
    scale(1.16)
    translate3d(
      calc((var(--mx, 0.5) - 0.5) * -22px),
      calc((var(--my, 0.5) - 0.5) * -22px),
      0
    );
}

.tile-art-anim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .18s ease;
  pointer-events: none;
  display: block;
  will-change: opacity;
}
.tile.is-hover .tile-art-anim { opacity: 1; }

/* Blur layer — covers the bottom portion of the tile art */
.tile::before {
  content: "";
  position: absolute; inset: 0;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  mask-image: linear-gradient(to top, black 0%, black 28%, transparent 62%);
  -webkit-mask-image: linear-gradient(to top, black 0%, black 28%, transparent 62%);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity .35s cubic-bezier(.2, .7, .2, 1);
}
.tile.is-hover::before { opacity: 1; }

/* Dark gradient overlay — above the blur, below the text */
.tile::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(0, 0, 0, 0)    20%,
    rgba(0, 0, 0, 0.45) 55%,
    rgba(0, 0, 0, 0.78) 100%
  );
  opacity: 0;
  transition: opacity .35s cubic-bezier(.2, .7, .2, 1);
  pointer-events: none;
  z-index: 2;
}
.tile.is-hover::after { opacity: 1; }

.tile-meta {
  position: absolute;
  left: 14px; right: 14px; bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: rgb(245, 245, 245);
  z-index: 3;
  transform: translateY(8px);
  opacity: 0;
  transition:
    transform .45s cubic-bezier(.2, .7, .2, 1),
    opacity   .45s cubic-bezier(.2, .7, .2, 1);
}
.tile.is-hover .tile-meta { transform: translateY(0); opacity: 1; }

.tile-cat {
  font-family: var(--cond);
  font-weight: 700;
  font-size: 8px;
  letter-spacing: .2em;
  text-transform: uppercase;
  opacity: .85;
}

.tile-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  line-height: 1.1;
}

/* ── À propos ─────────────────────────────────────────────────────────────── */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 285px) minmax(0, 1fr);
  gap: clamp(30px, 3.75vw, 60px);
  width: 100%;
  align-items: center;
}

.about-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.portrait {
  width: 100%;
  aspect-ratio: 380 / 510;
  border-radius: 25px;
  background: url('../assets/portrait.png') top center / cover no-repeat;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Courier New", monospace;
  font-size: 9px;
  letter-spacing: .14em;
  color: rgba(0, 0, 0, .45);
  text-transform: uppercase;
  transition:
    transform .55s cubic-bezier(.2, .7, .2, 1),
    box-shadow .55s cubic-bezier(.2, .7, .2, 1);
  cursor: default;
}
.portrait:hover {
  transform: scale(1.03);
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.18),
    0 20px 48px rgba(0, 0, 0, 0.12);
}

.about-right { width: 100%; }

.bio-lede {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(20px, 1.95vw, 27px);
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 21px;
  text-wrap: pretty;
}

.bio-body {
  font-family: var(--cond);
  font-weight: 400;
  font-size: 14px;
  line-height: 17px;
  color: var(--ink);
  text-align: justify;
}
.bio-body p { margin: 0 0 11px; }
.bio-body p.pull { font-weight: 700; margin: 11px 0; }

/* Socials under the portrait, horizontally centred to it */
.socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 27px;
  margin-top: 17px;
  width: 100%;
}

.social {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  transition: transform .3s cubic-bezier(.2, .7, .2, 1);
  text-decoration: none;
}
.social:hover { transform: scale(1.12); }

.social-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: block;
  color: var(--ink);
  position: relative;
  top: -1px;
}

.social .name {
  font-family: var(--cond);
  font-weight: 700;
  font-size: 12px;
  color: var(--ink);
  text-transform: uppercase;
}

/* ── Stats ────────────────────────────────────────────────────────────────── */

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  width: 100%;
  text-align: center;
}

.stat-num {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(48px, 5.25vw, 72px);
  line-height: 1;
  color: var(--ink);
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}

.stat-label {
  font-family: var(--cond);
  font-weight: 700;
  font-size: 11px;
  color: var(--ink);
  text-transform: uppercase;
}

/* ── Footer CTA ───────────────────────────────────────────────────────────── */

.foot { padding-bottom: clamp(60px, 7.5vw, 124px); }

.foot .stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(28px, 2.6vw, 40px);
  width: 100%;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 660px) {
  .portfolio-grid { grid-template-columns: 1fr; }
  .about-grid     { grid-template-columns: 1fr; align-items: start; }
  .portrait       { max-width: 285px; margin-inline: auto; }
  .about-left     { max-width: 285px; margin-inline: auto; }
}

@media (max-width: 420px) {
.portfolio-grid { grid-template-columns: 1fr; }
  .stats          { grid-template-columns: 1fr; gap: 30px; }
  .btn            { min-width: 0; width: 100%; max-width: 320px; padding: 14px 20px; font-size: 14px; white-space: normal; text-align: center; }
  .btn-arrow      { display: none; }
  .clients-row    { gap: 14px 24px; }
  .socials        { gap: 18px; flex-wrap: wrap; }
  .bio-body       { text-align: left; }
  .tile-title     { font-size: 17px; }
  .h-title        { white-space: normal; }
  .h-title span   { white-space: normal; }
}

/* ── Bottom navigation bar ────────────────────────────────────────────────── */

.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  height: 44px;
  background: var(--bg);
  border-top: 1px solid var(--ink);
  transform: translateY(0);
  transition: transform .35s cubic-bezier(.25, 1, .5, 1);
}
.bottom-bar.is-hidden { transform: translateY(100%); }

.bottom-bar-name {
  font-family: var(--sans);
  font-style: normal;
  font-weight: 500;
  font-size: 16px;
  color: var(--ink);
}

.bottom-bar-contact {
  font-family: var(--cond);
  font-weight: 400;
  font-size: 12px;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: opacity .2s;
}
.bottom-bar-contact:hover { opacity: .55; }

/* ── Modal projet — peek carousel ────────────────────────────────────────── */

/* Backdrop: clips the peeking slides at the viewport edges */
.modal-bd {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.modal-bd.is-open { opacity: 1; pointer-events: auto; }

/* Transparent shell: vertically centres the track */
.modal {
  position: absolute;
  inset: 0;
  background: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  transform: none;
  transition: none;
  display: flex;
  align-items: center;
}

/* Close button: always fixed top-right, white on dark backdrop */
.modal-close {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  color: #fff;
  transition: background .2s;
}
.modal-close:hover { background: rgba(255, 255, 255, 0.34); }

/* #modal-inner fills the shell width so the track can stretch */
#modal-inner { width: 100%; }

/* Peek carousel track */
.modal-track {
  display: flex;
  align-items: center;
  gap: 24px;
  /* centres the first card: (viewport − card-width) / 2 */
  padding-left: calc((100vw - clamp(300px, 52vw, 740px)) / 2);
  padding-block: clamp(32px, 6vh, 64px);
  transition: transform .48s cubic-bezier(.25, 1, .5, 1);
  will-change: transform;
}

/* Each card */
.modal-card {
  /* ~50 % of viewport, capped; the remaining ~26 % on each side = padding + peek */
  width: clamp(300px, 52vw, 740px);
  flex-shrink: 0;
  background: var(--bg);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.26), 0 2px 8px rgba(0,0,0,0.12);
  cursor: pointer;
  transition: opacity .35s ease, transform .35s cubic-bezier(.2,.7,.2,1);
}

/* Active card: fully opaque, no shrink */
.modal-card.is-active {
  cursor: default;
  opacity: 1;
  transform: scale(1);
}

/* Peeking cards: dimmed and slightly shrunk */
.modal-card:not(.is-active) {
  opacity: 0.5;
  transform: scale(0.94) translateY(8px);
}

/* Iframes/vidéos dans les cartes inactives : jamais interactifs */
.modal-card:not(.is-active) iframe,
.modal-card:not(.is-active) video { pointer-events: none; }
.modal-card:not(.is-active):hover {
  opacity: 0.72;
  transform: scale(0.96) translateY(6px);
}

/* ── Content inside cards ──────────────────────────────────────────────────── */

.modal-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #f0ede8;
  overflow: hidden;
  flex-shrink: 0;
}
.modal-media iframe,
.modal-media video { width: 100%; height: 100%; border: none; display: block; }
.modal-media > img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Image-only card: natural aspect ratio, dark background */
.modal-card-img img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 78vh;
  object-fit: contain;
  background: #111;
}

.modal-card-vid .modal-media { background: #000; }

.modal-body {
  padding: clamp(20px, 3vw, 32px) clamp(20px, 3.5vw, 36px) clamp(24px, 3.5vw, 36px);
}

.modal-cat {
  font-family: var(--cond);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(29, 29, 29, 0.4);
  margin-bottom: 6px;
}

.modal-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.1;
  color: var(--ink);
  margin: 0 0 18px;
}

.modal-desc {
  font-family: var(--cond);
  font-size: 14px;
  line-height: 1.7;
  color: rgba(29, 29, 29, 0.75);
  margin: 0 0 16px;
  white-space: pre-line;
}

.modal-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.modal-tool {
  position: relative;
  display: inline-flex;
}

.modal-tool img {
  width: 18px;
  height: 18px;
  opacity: 0.5;
  transition: opacity 0.15s;
  display: block;
}

.modal-tool:hover img { opacity: 1; }

.modal-tool::before,
.modal-tool::after {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}

.modal-tool::after {
  content: attr(data-label);
  bottom: calc(100% + 8px);
  background: var(--ink);
  color: var(--bg);
  font-family: var(--cond);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .04em;
  white-space: nowrap;
  padding: 0 8px;
  height: 22px;
  line-height: 22px;
  border-radius: 3px;
}

.modal-tool::before {
  content: '';
  bottom: calc(100% + 4px);
  width: 0;
  height: 0;
  border: 4px solid transparent;
  border-top-color: var(--ink);
  border-bottom: none;
}

.modal-tool:hover::before,
.modal-tool:hover::after { opacity: 1; }

@media (max-width: 600px) {
  .modal-track {
    padding-left: 20px;
    gap: 16px;
    padding-block: 28px;
  }
  .modal-card {
    width: calc(100vw - 56px); /* 20 px left + 36 px peek */
    min-width: 0;
  }
  .modal-close { top: 14px; right: 14px; }
}
