/* Product-deck landing for releases.jonbarnes.dev. Horizontal deck of columns,
   one product per column, cloned from the MD Studio landing. Reuses the hub's
   design tokens and the .app__download* component styles from styles.css. */

/* --wrap, --wrap-pad, --shadow-2 and all palette tokens come from styles/tokens.css */

/* Make --accent animatable so every accent-tinted surface fades together when
   the active product column changes, instead of snapping. */
@property --accent {
  syntax: "<color>";
  inherits: true;
  initial-value: #4ffcc0;
}

html {
  height: 100%;
  overflow: hidden;
  transition: --accent 0.7s var(--ease);
}
html[data-reduced="1"] {
  transition: none;
}
html[data-reduced="1"] #track {
  transition: none;
}
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
}
::selection {
  background: var(--accent);
  color: var(--accent-fg);
}

/* backdrop (.glow / .dot-field) is defined in styles.css, shared with the docs page */

/* ---- nav ---- */
.brand-logo { height: 24px; width: auto; display: block; flex-shrink: 0; filter: drop-shadow(0 2px 8px color-mix(in srgb, var(--accent) 20%, transparent)); }
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 68%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 13px var(--wrap-pad);
  gap: 16px;
}
.nav__brand { display: inline-flex; align-items: center; gap: 10px; }
.nav__actions { display: flex; align-items: center; gap: 8px; }
.nav__links { display: flex; align-items: center; gap: 4px; }
.nav__links a, .nav__links button {
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13.5px;
  color: var(--text-2);
  cursor: pointer;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.nav__links a:hover, .nav__links button:hover { color: var(--text); background: var(--surface-2); }
.nav__cta {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-fg);
  background: var(--accent);
  cursor: pointer;
  transition: background 0.6s var(--ease), filter var(--dur) var(--ease);
}
.nav__cta:hover { filter: brightness(1.06); color: var(--accent-fg); }
.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 38px;
  height: 38px;
  padding: 0 9px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
}
.nav__toggle span { display: block; height: 2px; border-radius: 2px; background: var(--text); transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease); }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 22px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--dur) var(--ease), background 0.6s var(--ease), border-color var(--dur) var(--ease), filter var(--dur) var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--accent); color: var(--accent-fg); box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 24%, transparent); }
.btn--primary:hover { color: var(--accent-fg); filter: brightness(1.05); }
.btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--border-strong); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--text-3); color: var(--text); }
.btn--block { width: 100%; }

/* ============ horizontal deck engine ============ */
#track {
  position: fixed;
  inset: 0;
  display: flex;
  width: 100%;
  height: 100%;
  z-index: 1;
  transition: transform 0.72s cubic-bezier(0.7, 0.02, 0.2, 1);
}
.col {
  /* Isolate each column so mobile Safari doesn't consider the whole track at once. */
  contain: layout paint style;
  flex: 0 0 100vw;
  width: 100vw;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.col::-webkit-scrollbar { display: none; }

.sec {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(96px, 14vh, 140px) var(--wrap-pad) clamp(56px, 9vh, 96px);
  position: relative;
}

/* ---- typography ---- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  transition: color 0.6s var(--ease);
}
.eyebrow::before { content: ""; width: 26px; height: 2px; border-radius: 2px; background: var(--accent); transition: background 0.6s var(--ease); }
.sec h1 { margin: 14px 0 0; font-size: clamp(38px, 6vw, 76px); line-height: 1.02; letter-spacing: -0.03em; font-weight: 750; }
.sec h2 { margin: 14px 0 0; font-size: clamp(30px, 4.4vw, 52px); line-height: 1.06; letter-spacing: -0.02em; font-weight: 700; }
.lead { margin: 18px 0 0; max-width: 560px; font-size: clamp(15px, 1.5vw, 18px); line-height: 1.6; color: var(--text-2); }
.more { margin-top: 26px; font-family: var(--font-mono); font-size: 12.5px; color: var(--text-3); }
.more b { color: var(--accent); font-weight: 600; transition: color 0.6s var(--ease); }

/* ---- hero intro column ---- */
.sec--hero { align-items: flex-start; text-align: left; }
.hero__sub { margin-top: 22px; max-width: 600px; font-size: clamp(15px, 1.6vw, 19px); line-height: 1.6; color: var(--text-2); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero__scroll { margin-top: 40px; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3); display: inline-flex; align-items: center; gap: 10px; }
.hero__scroll::after { content: ""; width: 40px; height: 1px; background: linear-gradient(90deg, var(--accent), transparent); }

/* ---- product column ---- */
.product {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
}
.product__copy { max-width: 560px; min-width: 0; }
.product__highlights { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.product__highlights li { position: relative; padding-left: 26px; font-size: 15px; color: var(--text-2); line-height: 1.5; }
.product__highlights li::before {
  content: "";
  position: absolute;
  left: 0; top: 7px;
  width: 9px; height: 9px;
  border-radius: 3px;
  background: var(--accent);
  transition: background 0.6s var(--ease);
}
.product__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.product__panel {
  min-width: 0;
  padding: 28px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  box-shadow: var(--shadow-2);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.product__panel-head { display: flex; align-items: center; gap: 14px; }
.product__icon { width: 56px; height: 56px; border-radius: 14px; object-fit: contain; flex-shrink: 0; }
.product__panel-name { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.product__panel-note { font-size: 13px; color: var(--text-3); line-height: 1.5; }
.product__panel-note a { color: var(--accent); }

/* download boxes rendered by the shared engine (styles.css .app__download*) */
.product__downloads { display: flex; flex-direction: column; gap: 10px; }
.product__downloads .app__badges { margin-bottom: 2px; }
.product__downloads .app__downloads { display: flex; flex-direction: column; gap: 8px; }
.dl-loading { margin: 0; padding: 18px; text-align: center; color: var(--text-3); font-size: 13px; font-style: italic; }

/* ---- closing column ---- */
.close__links { display: flex; flex-direction: column; gap: 14px; margin-top: 28px; max-width: 420px; }
.close__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.close__link:hover { border-color: var(--accent); background: var(--surface-2); color: var(--text); transform: translateX(4px); }
.close__link span:last-child { color: var(--accent); }
.close__foot { margin-top: 40px; font-size: 13px; color: var(--text-4); }

/* ---- deck side dots ---- */
.deck-dots {
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.deck-dots button {
  width: 10px;
  height: 10px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--surface-3);
  cursor: pointer;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.deck-dots button:hover { transform: scale(1.25); }
.deck-dots button[aria-current="true"] { background: var(--accent); transform: scale(1.25); }

/* ---- reveal ---- */
[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }

/* ---- responsive ---- */
@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__links.is-open {
    display: flex;
    position: absolute;
    top: 100%;
    right: var(--wrap-pad);
    flex-direction: column;
    align-items: stretch;
    min-width: 200px;
    padding: 8px;
    gap: 2px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-2);
  }
  .nav__links.is-open a, .nav__links.is-open button { padding: 10px 12px; font-size: 15px; text-align: left; }
  .nav__toggle { display: flex; }
  .deck-dots { display: none; }
  .product { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .product__panel { order: 2; }

  /* Flatten the horizontal deck into a normal vertical-scroll page. deck.js disables
     the wheel/touch/keyboard hijacking at this same width, so scrolling is native. */
  html, body { height: auto; overflow: visible; }
  #track { position: static; display: block; width: 100%; height: auto; transform: none !important; transition: none; }
  .col { contain: none; flex: none; width: 100%; height: auto; min-height: 0; overflow: visible; }
  .sec { min-height: auto; padding-top: clamp(88px, 13vh, 116px); padding-bottom: clamp(44px, 8vh, 72px); }
}

/* Mobile / touch: drop the blurred glows, dot field, and backdrop-filter nav. They
   are the heaviest GPU/memory consumers and caused mobile Safari to run out of memory
   and crash when swiping between product columns. */
@media (max-width: 860px), (hover: none) and (pointer: coarse) {
  .glow, .dot-field { display: none; }
  .nav { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--bg); }
}

/* ---- reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  html, #track { transition: none; }
  .glow { animation: none; }
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none; }
  .btn:hover, .close__link:hover { transform: none; }
}
