/* =====================================================================
   Kia Center · Event Smart Search & Share — prototype stylesheet
   Breakpoints: mobile < 768 · tablet 768–1139 · desktop ≥ 1140 (Figma 1439)
   ===================================================================== */

/* ---------- Fonts (Hanken Grotesk only, self-hosted) ---------- */
@font-face { font-family: "Hanken Grotesk"; font-weight: 200; font-style: normal; font-display: swap; src: url("Assets/fonts/HankenGrotesk-200.ttf") format("truetype"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 300; font-style: normal; font-display: swap; src: url("Assets/fonts/HankenGrotesk-300.ttf") format("truetype"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 400; font-style: normal; font-display: swap; src: url("Assets/fonts/HankenGrotesk-400.ttf") format("truetype"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 500; font-style: normal; font-display: swap; src: url("Assets/fonts/HankenGrotesk-500.ttf") format("truetype"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 600; font-style: normal; font-display: swap; src: url("Assets/fonts/HankenGrotesk-600.ttf") format("truetype"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 700; font-style: normal; font-display: swap; src: url("Assets/fonts/HankenGrotesk-700.ttf") format("truetype"); }

/* ---------- Tokens ---------- */
:root {
  --ink: #061926;
  --ink-2: #171717;
  --ink-3: #05141f;
  --text-2: #404040;
  --text-3: #525252;
  --muted: #70797f;
  --muted-hover: #3b4950;
  --muted-2: #879299;
  --placeholder: #737373;
  --line: #e4e7ec;
  --line-2: #ebebeb;
  --line-3: #d0d5dd;
  --line-4: #d4d4d4;
  --line-5: #e5e5e5;
  --line-dark: #d2d2d3;
  --soft: #f7f7f7;
  --soft-2: #fafafa;
  --hero-bg: #d1d5db;
  --white: #fff;

  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 160ms;
  --dur: 240ms;
  --dur-slow: 420ms;

  --font: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: normal;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }
h1, h2, h3, p, dl, dd, dt { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }

/* ---------- UI scale ----------
   The Figma frames are drawn 1:1 on a 1440 canvas, which renders noticeably larger on a
   real monitor than a typical production site. The whole layout is scaled down on desktop
   so type, components and spacing keep their exact Figma proportions while reading at a
   normal site scale. Wide displays step back up so a 4K monitor is not left with a tiny
   layout. Media queries evaluate against the unzoomed viewport, so these thresholds are
   real device widths. Tablet and mobile stay at 1:1. */
@media (min-width: 1140px) { html { zoom: 0.8; } }
@media (min-width: 2000px) { html { zoom: 1; } }
@media (min-width: 2800px) { html { zoom: 1.3; } }
@media (min-width: 3500px) { html { zoom: 1.6; } }

/* ---------- Icons ---------- */
.icon { display: block; flex: 0 0 auto; width: 16px; height: 16px; }
.icon--14 { width: 14px; height: 14px; }
.icon--16 { width: 16px; height: 16px; }
.icon--20 { width: 20px; height: 20px; }
.icon--24 { width: 24px; height: 24px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; line-height: normal; white-space: nowrap;
  border: 1px solid transparent;
  transition: background-color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out),
              color var(--dur) var(--ease-out), transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur) var(--ease-out);
  will-change: transform;
}
.btn:active { transform: scale(0.97); }
.btn--outline { background: var(--white); border-color: var(--line-3); color: var(--ink); }
.btn--outline:hover { border-color: var(--ink); background: var(--soft); }
.btn--dark { background: var(--ink); border-color: var(--ink); color: var(--white); }
.btn--dark:hover { background: #10293b; border-color: #10293b; box-shadow: 0 6px 16px -8px rgba(6, 25, 38, 0.5); }
.btn--block { width: 100%; }
.btn--tall { height: 48px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 999px; color: var(--ink);
  transition: background-color var(--dur) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.icon-btn:hover { background: var(--soft); }
.icon-btn:active { transform: scale(0.94); }

/* ---------- Navbar ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  transition: box-shadow var(--dur-slow) var(--ease-out);
}
.nav.is-scrolled { box-shadow: 0 6px 24px -12px rgba(6, 25, 38, 0.18); }
.nav__inner {
  max-width: 1440px; margin: 0 auto; height: 72px;
  padding: 0 72px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.nav__brand { display: flex; align-items: center; gap: 40px; min-width: 0; }
.nav__logo { display: block; height: 14px; width: 137px; flex: 0 0 auto; }
.nav__logo img { width: 100%; height: 100%; object-fit: contain; object-position: left center; }
.nav__links { display: flex; align-items: flex-start; gap: 16px; }
.nav__link {
  position: relative; display: block; padding: 8px 12px;
  font-size: 14px; font-weight: 600; text-transform: uppercase; white-space: nowrap;
  color: var(--muted);
  transition: color var(--dur) var(--ease-out);
}
/* The underline and the dark ink are reserved for the page you are actually on.
   Hover only lifts the label's colour. */
.nav__link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--ink); transform: scaleX(0); transform-origin: left center;
  transition: transform var(--dur-slow) var(--ease-out);
}
.nav__link:hover { color: var(--muted-hover); }
.nav__link.is-active { color: var(--ink); }
.nav__link.is-active::after { transform: scaleX(1); }
.nav__actions { display: flex; align-items: center; gap: 16px; }
.nav__controls { display: none; align-items: center; gap: 12px; }

.hamburger {
  position: relative; width: 26px; height: 26px; padding: 4px;
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
}
.hamburger span {
  display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 1px;
  transition: transform var(--dur-slow) var(--ease-out), opacity var(--dur) var(--ease-out);
  transform-origin: center;
}
.hamburger.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0.4); }
.hamburger.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.nav__drawer {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--white); border-bottom: 1px solid var(--line);
  padding: 8px 16px 20px;
  box-shadow: 0 24px 40px -24px rgba(6, 25, 38, 0.25);
  opacity: 0; transform: translateY(-8px);
  transition: opacity var(--dur) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
.nav__drawer.is-open { opacity: 1; transform: translateY(0); }
.drawer__links { display: flex; flex-direction: column; }
.drawer__link {
  padding: 14px 4px; font-size: 14px; font-weight: 600; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--line-2);
  transition: color var(--dur) var(--ease-out), padding-left var(--dur) var(--ease-out);
}
.drawer__link:hover { color: var(--muted-hover); padding-left: 8px; }
.drawer__link.is-active { color: var(--ink); }
.drawer__actions { display: flex; gap: 12px; padding-top: 16px; }
.nav__scrim {
  position: fixed; inset: 0; z-index: 40; background: rgba(6, 25, 38, 0.35);
  opacity: 0; transition: opacity var(--dur) var(--ease-out);
}
.nav__scrim.is-open { opacity: 1; }

/* ---------- Page layout ---------- */
.page { max-width: 1440px; margin: 0 auto; padding: 24px 72px; }
.grid { display: flex; align-items: flex-start; gap: 32px; }
.col { display: flex; flex-direction: column; min-width: 0; }
.col--left { flex: 1 1 0; }
.col--right { flex: 0 0 453px; width: 453px; gap: 32px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; width: 100%; height: 518px;
  background: var(--hero-bg); border-radius: var(--radius); overflow: hidden;
  isolation: isolate;
}
.hero__img {
  width: 100%; height: 100%; object-fit: cover; object-position: 0 0;
  /* Figma crop: image 1206×667 inside 810×518, offset top −46px */
  transform: scale(1.288); transform-origin: 0 31%;
}

/* ---------- Heading row ---------- */
.heading {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 16px 0; border-bottom: 1px solid var(--line);
}
.heading__text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.heading__title { font-size: 96px; font-weight: 200; letter-spacing: -1px; color: var(--ink); white-space: nowrap; }
.heading__eyebrow { font-size: 14px; font-weight: 500; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.heading__actions { display: flex; align-items: center; gap: 12px; padding: 0 8px; flex: 0 0 auto; }
.icon--share { width: 16px; height: 16px; }

/* ---------- Info bar ---------- */
.infobar {
  display: flex; align-items: center; gap: 24px; padding: 16px 0;
  border-bottom: 1px solid var(--line); background: var(--white);
}
.infobar__item { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.infobar__date { text-transform: uppercase; }
.icon--info { width: 16px; height: 16px; }
.infobar__sep { width: 1px; height: 16px; background: var(--line); flex: 0 0 auto; }

/* ---------- Details ---------- */
.details { padding: 32px 0; display: flex; flex-direction: column; gap: 16px; }
.details__title { font-size: 24px; font-weight: 700; text-transform: uppercase; }
.details__body { display: flex; flex-direction: column; gap: 20px; font-size: 16px; }
.details__sub { font-weight: 700; text-transform: uppercase; }

/* ---------- Sidebar (specs) ---------- */
.sidebar {
  display: flex; flex-direction: column; gap: 24px;
  height: 518px; padding: 32px;
  background: var(--ink); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04);
  color: var(--white);
}
.sidebar__cta {
  width: 100%; padding: 16px; border-radius: var(--radius);
  background: var(--white); color: var(--ink); font-size: 16px; font-weight: 700;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out);
}
.sidebar__cta:hover { background: #f3f4f6; box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.6); }
.sidebar__cta:active { transform: scale(0.98); }
.specs { display: flex; flex-direction: column; gap: 16px; }
.specs__row {
  display: flex; flex-direction: column; gap: 4px; padding-bottom: 16px;
  border-bottom: 1px solid var(--line-dark); font-size: 14px; white-space: nowrap;
}
.specs__row dt { font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--white); }
.specs__row dd { font-weight: 400; color: var(--muted-2); transition: color var(--dur) var(--ease-out); }
.specs__row--link { cursor: pointer; }
.specs__row--link:hover dd { color: var(--white); }

/* ---------- Smart search ---------- */
.smart {
  display: flex; flex-direction: column; gap: 24px;
  width: 100%; padding: 32px;
  background: var(--soft); border: 1px solid var(--line-2); border-radius: var(--radius);
  transition: box-shadow var(--dur-slow) var(--ease-out);
}
.smart.is-highlight { box-shadow: 0 0 0 4px rgba(6, 25, 38, 0.08); }
.smart__head { display: flex; justify-content: center; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 99px;
  background: var(--white); border: 1px solid var(--line-2);
  font-size: 13px; font-weight: 500; color: var(--ink);
  transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.pill:hover { border-color: var(--line-3); box-shadow: 0 4px 12px -6px rgba(6, 25, 38, 0.25); }
.pill:active { transform: scale(0.96); }
.pill__icons { position: relative; width: 14px; height: 14px; display: block; }
.pill__icon { position: absolute; inset: 0; transition: opacity var(--dur) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
.pill__icon--search { opacity: 0; transform: rotate(-90deg) scale(0.6); }
.pill.is-history .pill__icon--clock { opacity: 0; transform: rotate(90deg) scale(0.6); }
.pill.is-history .pill__icon--search { opacity: 1; transform: none; }
.pill__label { display: inline-block; transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.pill__label.is-swapping { opacity: 0; transform: translateY(4px); }

.smart__title { font-size: 28px; font-weight: 400; text-align: center; color: var(--ink); }
.smart__title span { display: inline-block; transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.smart__title span.is-swapping { opacity: 0; transform: translateY(6px); }

/* At rest the body must NOT clip: the query field's soft drop shadow extends ~12px
   past its box and was being cut off. Clipping is only turned on while a height
   transition is running, so the views can slide without spilling. */
.smart__body { position: relative; overflow: visible; }
.smart__body.is-animating { overflow: hidden; transition: height var(--dur-slow) var(--ease-out); }
.smart__view { display: flex; flex-direction: column; gap: 24px; }
.smart__view.is-entering { opacity: 0; transform: translateY(8px); }
.smart__view.is-live { transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }

.query { display: flex; align-items: stretch; gap: 12px; }
.query__field {
  position: relative; flex: 1 1 0; min-width: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius);
  background: var(--white); border: 1px solid var(--line-2);
  box-shadow: 0 0 16px -4px rgba(0, 0, 0, 0.18);
  cursor: text;
  transition: box-shadow var(--dur-slow) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.query__field:focus-within {
  border-color: var(--line-3);
  box-shadow: 0 0 0 3px rgba(6, 25, 38, 0.08), 0 0 16px -4px rgba(0, 0, 0, 0.18);
}
.query__icon { color: var(--ink); }
.query__input {
  flex: 1 1 0; min-width: 0; border: 0; outline: 0; background: transparent;
  font-size: 15px; font-weight: 400; color: var(--ink); line-height: normal; padding: 0;
}
.query__input::placeholder { color: var(--muted); opacity: 1; }
.query__clear {
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 99px; color: var(--muted);
  opacity: 0; transform: scale(0.6); pointer-events: none;
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}
.query.has-text .query__clear { opacity: 1; transform: scale(1); pointer-events: auto; }
.query__clear:hover { color: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px; border-radius: 99px;
  background: var(--white); border: 1px solid var(--line-3);
  font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap;
  transition: border-color var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out),
              color var(--dur) var(--ease-out), transform var(--dur-fast) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.chip:hover { border-color: var(--ink); box-shadow: 0 4px 12px -8px rgba(6, 25, 38, 0.4); transform: translateY(-1px); }
.chip:active, .chip.is-selected { background: var(--ink); border-color: var(--ink); color: var(--white); transform: translateY(0); }
.chips.is-leaving { opacity: 0; transform: translateY(-4px); transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }

.answer:empty { display: none; }

.card {
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px 20px; border-radius: var(--radius);
  background: var(--white); border: 1px solid var(--line);
  transition: box-shadow var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
.card--enter { animation: rise-in var(--dur-slow) var(--ease-out) both; }
.card__title { font-size: 16px; font-weight: 600; color: var(--ink-2); }
.card__body { font-size: 14px; font-weight: 400; color: var(--ink); }
.card__source {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  font-size: 14px; font-weight: 600; color: var(--ink); border-radius: var(--radius);
  transition: opacity var(--dur) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.card__source:hover { opacity: 0.7; }
.card__source:active { transform: scale(0.98); }
.card__source .icon { transition: transform var(--dur) var(--ease-out); }
.card__source:hover .icon { transform: translate(1px, -1px); }
.card--fallback .card__body { color: var(--text-3); }
.card__hint { display: flex; flex-wrap: wrap; gap: 8px; }

/* Thinking skeleton */
.card--thinking { gap: 14px; }
.skel { position: relative; overflow: hidden; height: 12px; border-radius: 6px; background: #eef0f2; }
.skel--title { height: 16px; width: 55%; }
.skel--w1 { width: 100%; } .skel--w2 { width: 92%; } .skel--w3 { width: 70%; }
.skel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
  transform: translateX(-100%); animation: shimmer 1.2s ease-in-out infinite;
}
.thinking__label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--muted); animation: dot 1s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: 0.15s; } .dots i:nth-child(3) { animation-delay: 0.3s; }

/* History */
.history { display: flex; flex-direction: column; gap: 24px; }
.history__empty { text-align: center; font-size: 14px; color: var(--muted); padding: 8px 0; }
.history__foot { display: flex; justify-content: center; }

/* ---------- Spotify ---------- */
.spotify { width: 100%; border-radius: 12px; overflow: hidden; background: #282828; line-height: 0; }
.spotify img { width: 100%; height: auto; }
spotify-embed { display: block; width: 100%; }
spotify-embed iframe { display: block; width: 100%; border: 0; }
/* Offline fallback keeps the static mockup's proportions */
spotify-embed[data-state="offline"] .spotify-embed__fallback,
spotify-embed[data-state="invalid"] .spotify-embed__fallback { display: block; }

/* ---------- Share modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal__backdrop {
  position: absolute; inset: 0; background: rgba(6, 25, 38, 0.55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity var(--dur-slow) var(--ease-out);
}
.modal.is-open .modal__backdrop { opacity: 1; }
.modal__dialog {
  position: relative; width: 980px; max-width: 100%; max-height: 100%;
  display: flex; flex-direction: column;
  /* Dark behind the header so the rounded corners don't show a light fringe */
  background: linear-gradient(var(--ink) 0 40px, var(--white) 40px);
  border-radius: var(--radius-xl); overflow: hidden;
  box-shadow: 0 40px 80px -24px rgba(6, 25, 38, 0.45);
  opacity: 0; transform: translateY(16px) scale(0.98);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
  outline: 0;
}
.modal.is-open .modal__dialog { opacity: 1; transform: none; }
.modal.is-closing .modal__dialog { opacity: 0; transform: translateY(8px) scale(0.985); transition-duration: var(--dur); }
.modal.is-closing .modal__backdrop { opacity: 0; transition-duration: var(--dur); }

.modal__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 32px 20px; background: var(--ink); border-bottom: 1px solid var(--line-5); flex: 0 0 auto;
}
.modal__title { font-size: 32px; font-weight: 700; text-transform: uppercase; color: var(--white); }
.modal__close {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 8px; border-radius: var(--radius); color: var(--white);
  transition: background-color var(--dur) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.modal__close:hover { background: rgba(255, 255, 255, 0.1); }
.modal__close:active { transform: scale(0.92); }
.modal__close:focus-visible { outline-color: var(--white); }
.modal__body { display: flex; gap: 32px; padding: 32px; overflow: auto; align-items: stretch; }

/* ---------- Story card (left column) ----------
   Pre-rendered PNG in the 9:16 story format. The event URL is part of the artwork,
   so the card always carries the link wherever it is posted. */
.story-card {
  flex: 0 0 300px; width: 300px; margin: 0; align-self: start;
  border-radius: var(--radius-lg); overflow: hidden; background: var(--ink);
  box-shadow: 0 18px 40px -24px rgba(6, 25, 38, 0.55);
}
.story-card img { display: block; width: 100%; height: auto; aspect-ratio: 857 / 1528; object-fit: cover; }

/* ---------- Share actions (right column) ---------- */
.share-actions { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.share-link { display: flex; align-items: stretch; gap: 10px; }
.share-link__field {
  flex: 1 1 0; min-width: 0; display: flex; align-items: center; padding: 10px 16px;
  border-radius: var(--radius); background: var(--soft-2); border: 1px solid var(--line-4);
  font-size: 13px; color: var(--text-3);
}
.share-link__field span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#copy-btn { min-width: 112px; }
#copy-btn.is-copied { background: #0f5132; border-color: #0f5132; }
.share-download {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center; width: 48px;
  border-radius: var(--radius); background: var(--white); border: 1px solid var(--line-4); color: var(--ink);
  transition: border-color var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out),
              transform var(--dur-fast) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.share-download:hover { border-color: var(--ink); box-shadow: 0 8px 20px -12px rgba(6, 25, 38, 0.35); }
.share-download:active { transform: scale(0.95); background: var(--soft); }
.share-download .icon { transition: transform var(--dur) var(--ease-out); }
.share-download:hover .icon { transform: translateY(2px); }
.share-download.is-saved { background: var(--ink); border-color: var(--ink); color: var(--white); }

.share-story { display: flex; flex-direction: column; gap: 14px; }
.share-story__title { font-size: 16px; font-weight: 700; color: var(--ink-2); }
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.share-btn {
  display: flex; align-items: center; gap: 12px; height: 45px; padding: 10px 12px;
  border: 1px solid var(--line-4); border-radius: var(--radius); background: var(--white);
  font-size: 14px; font-weight: 600; color: var(--ink);
  transition: border-color var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out),
              transform var(--dur-fast) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.share-btn img, .share-btn .icon { width: 24px; height: 24px; flex: 0 0 auto; }
.share-btn__x { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; flex: 0 0 auto; }
.share-btn__x img { width: 21px; height: 21px; border-radius: 4px; }
.share-btn:hover { border-color: var(--ink); box-shadow: 0 8px 20px -12px rgba(6, 25, 38, 0.35); transform: translateY(-1px); }
.share-btn:active { transform: scale(0.98); background: var(--soft); }
.share-btn.is-busy { opacity: 0.6; pointer-events: none; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 200;
  padding: 12px 18px; border-radius: 999px;
  background: var(--ink); color: var(--white); font-size: 14px; font-weight: 500; white-space: nowrap;
  box-shadow: 0 16px 40px -16px rgba(6, 25, 38, 0.6);
  opacity: 0; transform: translate(-50%, 12px); pointer-events: none;
  transition: opacity var(--dur) var(--ease-out), transform var(--dur-slow) var(--ease-out);
  max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Page entrance ---------- */
.reveal { opacity: 0; transform: translateY(14px); }
body.is-ready .reveal {
  opacity: 1; transform: none;
  transition: opacity 640ms var(--ease-out), transform 720ms var(--ease-out);
  transition-delay: calc(var(--d, 0) * 70ms);
}

/* ---------- Keyframes ---------- */
@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: none; } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes dot { 0%, 80%, 100% { transform: translateY(0); opacity: 0.5; } 40% { transform: translateY(-3px); opacity: 1; } }

/* =====================================================================
   TABLET  (768 – 1139)  — Figma frame 768
   ===================================================================== */
@media (max-width: 1139px) {
  .nav__inner { height: 72px; padding: 0 32px; gap: 16px; }
  .nav__brand { gap: 12px; }
  .nav__logo { width: 110px; height: 11px; }
  .nav__links { gap: 12px; }
  .nav__link--wide { display: none; }
  .nav__actions { display: none; }
  .nav__controls { display: flex; }

  .page { padding: 32px; }
  .grid {
    display: grid; gap: 32px 24px;
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-areas:
      "hero hero"
      "heading heading"
      "infobar sidebar"
      "details sidebar"
      "smart smart"
      "spotify spotify";
    align-items: start;
  }
  .col { display: contents; }
  [data-area="hero"] { grid-area: hero; }
  [data-area="heading"] { grid-area: heading; }
  [data-area="infobar"] { grid-area: infobar; }
  [data-area="details"] { grid-area: details; }
  [data-area="sidebar"] { grid-area: sidebar; }
  [data-area="smart"] { grid-area: smart; }
  [data-area="spotify"] { grid-area: spotify; }

  .hero { height: 380px; }
  .hero__img { transform: scale(1.148); transform-origin: 0 0; }

  .heading { padding: 0 0 16px; }
  .heading__title { font-size: 52px; letter-spacing: 0; }
  .heading__eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0; }
  .heading__actions { width: 333px; padding: 0; }
  .heading__actions .btn { flex: 1 1 0; height: 48px; }
  .icon--share { width: 24px; height: 24px; }

  .infobar { gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
  .infobar__item { gap: 6px; font-size: 12px; }
  .infobar__date { text-transform: none; }
  .icon--info { width: 24px; height: 24px; }
  .infobar__sep { height: 12px; }
  .infobar__sep--trail { display: none; }

  .details { padding: 0; margin-top: -8px; }
  .details__title { font-size: 18px; }
  .details__body { font-size: 15px; }

  .sidebar { height: auto; width: 300px; }
  .sidebar__cta { display: none; }

  .pill { font-size: 14px; }
  .query__input { font-size: 14px; }
  .chip { font-size: 14px; }

  /* Share modal keeps both columns, on a narrower dialog with a smaller story card */
  .modal__dialog { width: 660px; }
  .modal__title { font-size: 28px; }
  .modal__body { gap: 24px; }
  .story-card { flex-basis: 230px; width: 230px; }
}

/* =====================================================================
   MOBILE  (< 768)  — Figma frame 390 / iPhone 16 (393)
   ===================================================================== */
@media (max-width: 767px) {
  .nav__inner { height: 56px; padding: 0 16px; }
  .nav__links { display: none; }

  .page { padding: 0 16px 16px; }
  .grid {
    gap: 24px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "hero"
      "heading"
      "infobar"
      "sidebar"
      "details"
      "smart"
      "spotify";
  }

  .hero { height: 240px; margin: 0 -16px -8px; width: auto; border-radius: 0; }
  .hero__img { transform: scale(1.16); transform-origin: 0 0; }

  .heading { flex-direction: column; align-items: stretch; gap: 12px; padding: 0; border-bottom: 0; }
  .heading__text { gap: 4px; }
  .heading__title { font-size: 42px; white-space: normal; }
  .heading__eyebrow { font-size: 12px; white-space: normal; }
  .heading__actions { width: 100%; }

  .infobar { border-top: 1px solid var(--line); }
  .details { margin-top: 0; }
  .details__body { font-size: 14px; }
  .sidebar { width: 100%; }
  .specs__row { white-space: normal; }

  /* Modal becomes a full-screen sheet */
  .modal { padding: 0; align-items: flex-end; }
  .modal__dialog {
    width: 100%; height: 100%; max-height: 100%; border-radius: 0;
    transform: translateY(24px); transition-duration: 460ms;
  }
  .modal.is-closing .modal__dialog { transform: translateY(24px); }
  .modal__header { padding: 20px 16px 16px; }
  .modal__title { font-size: 26px; }
  .modal__body { flex-direction: column; align-items: center; padding: 20px 16px 32px; gap: 24px; }
  /* Story card is height-capped so the share actions stay above the fold */
  .story-card { flex: 0 0 auto; width: auto; max-width: 100%; align-self: center; }
  .story-card img { width: auto; height: 42vh; min-height: 260px; max-height: 420px; aspect-ratio: 857 / 1528; }
  .share-actions { width: 100%; gap: 20px; }
  /* Link on its own row, then Copy Link + download share the row below */
  .share-link { flex-wrap: wrap; }
  .share-link__field { flex: 1 0 100%; }
  #copy-btn { flex: 1 1 auto; padding: 12px 16px; min-width: 0; }

  .toast { bottom: 20px; }
}

@media (max-width: 400px) {
  .share-grid { gap: 8px; }
  .share-btn { padding: 10px; gap: 10px; }
}

/* Short viewports: cap the story card so the whole modal still fits on screen */
@media (min-width: 768px) and (max-height: 700px) {
  .story-card { flex-basis: auto; width: auto; }
  .story-card img { width: auto; height: 46vh; aspect-ratio: 857 / 1528; }
}

/* ---------- 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; }
  .reveal { opacity: 1; transform: none; }
}
