/* JBrowser home page: a short hero with a real screenshot, an interactive tour, the tint picker,
   compact features and the install steps. Screenshots are real captures of the app. */

.home .section { padding: 112px 0 0; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 36px; }
.section-title { font-size: clamp(30px, 4vw, 48px); margin: 10px 0 12px; letter-spacing: -.02em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* scroll-in animation: only once home.js runs (it adds .js-reveal to <html> and .in as things appear) */
.js-reveal .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js-reveal .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js-reveal .reveal { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- hero */
.hero { position: relative; overflow: hidden; padding: 84px 0 0; text-align: center; }
.hero-glow {
  position: absolute; inset: -20% -20% auto; height: 1100px; pointer-events: none; opacity: .6;
  background:
    radial-gradient(34% 40% at 50% 38%, rgba(138, 92, 255, .42), transparent 70%),
    radial-gradient(30% 36% at 78% 58%, rgba(255, 92, 157, .32), transparent 70%),
    radial-gradient(30% 36% at 22% 55%, rgba(91, 140, 255, .34), transparent 70%);
  filter: blur(8px);
}
:root[data-theme="light"] .hero-glow { opacity: .45; }
.hero-copy { position: relative; }
.eyebrow {
  display: inline-flex; gap: 10px; align-items: center; padding: 7px 16px; border-radius: 999px; font-size: 14px;
  background: var(--surface); color: var(--text-2); border: 1px solid var(--border-2); font-weight: 600;
  box-shadow: var(--shadow);
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--accent-soft); }
.eyebrow:hover { text-decoration: none; color: var(--text); border-color: var(--accent); }
.hero h1 { font-size: clamp(44px, 6.6vw, 84px); line-height: 1.02; margin: 26px auto 18px; letter-spacing: -.035em; max-width: 13ch; }
.grad { background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: clamp(18px, 1.6vw, 21px); color: var(--text-2); max-width: 36ch; margin: 0 auto; }
.hero .cta { justify-content: center; margin: 30px 0 14px; }
.hero .fineprint { margin-bottom: 0; }

.hero-shot-wrap { position: relative; margin-top: 56px; perspective: 1800px; }
.shot-button { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; width: 100%; border-radius: 22px; }
.shot-button:focus-visible { outline: 3px solid var(--accent); outline-offset: 6px; }
.shot { display: block; width: 100%; height: auto; border-radius: 22px; }
.hero-shot {
  max-width: 1200px; margin: 0 auto;
  box-shadow: 0 40px 120px rgba(40, 20, 120, .45), 0 0 0 1px var(--border);
  transform: rotateX(var(--tilt, 14deg)) scale(var(--zoom, .94)); transform-origin: 50% 0;
  transition: transform .15s linear; will-change: transform; border-radius: 22px;
}
:root[data-theme="light"] .hero-shot { box-shadow: 0 40px 110px rgba(90, 80, 200, .28), 0 0 0 1px var(--border); }
.glance {
  list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 40px; padding: 0;
  margin: 40px auto 0; max-width: 1000px;
}
.glance li { display: flex; flex-direction: column; align-items: center; }
.glance b { font: 700 20px var(--font-display); }
.glance span { color: var(--text-3); font-size: 14px; }

/* ---------------------------------------------------------------- tour */
.tour-tabs {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 auto 28px; padding: 6px;
  width: fit-content; max-width: 100%; border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.tour-tabs button {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px;
  border: 0; border-radius: 999px; background: transparent; color: var(--text-2); font: 600 15px var(--font); cursor: pointer;
  transition: background .2s, color .2s;
}
.tour-tabs button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tour-tabs button:hover { color: var(--text); background: var(--surface-2); }
.tour-tabs button[aria-selected="true"] { color: #fff; background: var(--brand); }
.tt-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: rgba(255, 255, 255, .85); }
.tour-tabs button[aria-selected="true"] .tt-bar { animation: tt-progress var(--tour-ms, 7000ms) linear forwards; }
.tour.paused .tt-bar { animation-play-state: paused; }
@keyframes tt-progress { to { width: 100%; } }
.tour-panel { max-width: 1180px; margin: 0 auto; }
.tour-caption { text-align: center; max-width: 720px; margin: 0 auto 26px; min-height: 142px; }
.tour-caption h3 { font-size: 26px; margin: 0 0 8px; }
.tour-caption p { color: var(--text-2); font-size: 17px; margin: 0 0 16px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; }
.chips li {
  padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border);
}
.tour-shot { box-shadow: 0 30px 90px rgba(20, 10, 70, .38), 0 0 0 1px var(--border); }
.tour-shot .shot, .tour-caption { transition: opacity .35s var(--ease), transform .35s var(--ease); }
.tour-panel.swap .tour-shot .shot { opacity: 0; transform: scale(.985); }
.tour-panel.swap .tour-caption { opacity: 0; transform: translateY(8px); }

/* ---------------------------------------------------------------- colours */
.colours-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 56px; align-items: center; }
.colours-copy p { font-size: 17px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 12px; }
.sw {
  width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--bg); cursor: pointer; padding: 0;
  background: var(--s); box-shadow: 0 0 0 1px var(--border-2); transition: transform .15s var(--ease), box-shadow .15s;
}
.sw:hover { transform: scale(1.1); }
.sw[aria-checked="true"] { box-shadow: 0 0 0 3px var(--accent); transform: scale(1.1); }
.sw.none { background: linear-gradient(135deg, transparent 44%, var(--text-3) 44% 56%, transparent 56%), var(--surface-2); }
.tint-name { font: 600 18px var(--font-display); margin: 6px 0 18px; }
.colours-shot { position: relative; border-radius: 20px; }
.colours-shot .shot { border-radius: 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, .35), 0 0 0 1px var(--border); transition: opacity .25s; }
.colours-shot.loading .shot { opacity: .6; }

/* ---------------------------------------------------------------- features */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature {
  display: flex; gap: 16px; align-items: flex-start; padding: 22px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: transform .25s var(--ease), border-color .25s, box-shadow .25s;
}
.feature:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.feature h3 { margin: 2px 0 4px; font-size: 18px; }
.feature p { margin: 0; color: var(--text-2); font-size: 15px; }
.f-icon {
  flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px;
  background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c);
}
.f-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- install */
.install-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 56px; align-items: center; }
.steps-mini { list-style: none; padding: 0; margin: 26px 0; display: grid; gap: 18px; }
.steps-mini li { display: flex; gap: 16px; align-items: flex-start; }
.steps-mini li > span {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px;
  background: var(--brand); color: #fff; font-weight: 700;
}
.steps-mini b { font-size: 17px; }
.steps-mini p { margin: 2px 0 0; color: var(--text-2); font-size: 15px; }
.install-shot { box-shadow: 0 30px 80px rgba(20, 10, 70, .35), 0 0 0 1px var(--border); }

/* ---------------------------------------------------------------- open source */
.os-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 48px; align-items: center; }
.os-copy .section-title { margin-top: 10px; }
.os-lead { color: var(--text-2); font-size: 18px; line-height: 1.6; margin: 0 0 24px; max-width: 30em; }
.os-copy .btn svg { width: 18px; height: 18px; fill: currentColor; }
.os-points { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.os-point {
  padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow);
}
.os-point h3 { margin: 12px 0 4px; font-size: 17px; }
.os-point p { margin: 0; color: var(--text-2); font-size: 14.5px; line-height: 1.5; }
@media (max-width: 900px) {
  .os-grid { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 520px) {
  .os-points { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- closing */
.closing-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; }
.news-card, .dev-card-big {
  padding: 32px; border-radius: 22px; border: 1px solid var(--border); box-shadow: var(--shadow);
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand-1) 12%, var(--surface)), color-mix(in srgb, var(--brand-3) 9%, var(--surface)));
}
.dev-card-big { background: var(--surface); }
.chips.big { justify-content: flex-start; margin: 18px 0 20px; }
.chips.big li { font-size: 15px; padding: 8px 16px; }
.more { font-weight: 600; }
.dev-card-big h3 { font-size: 24px; margin: 10px 0 6px; }
.dev-card-big p { color: var(--text-2); margin: 0 0 20px; }
.dev-links { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- lightbox */
.lightbox {
  width: min(96vw, 1800px); max-width: none; max-height: 94vh; padding: 0; border: 0; border-radius: 18px;
  background: transparent; overflow: visible;
}
.lightbox::backdrop { background: rgba(8, 8, 14, .82); backdrop-filter: blur(6px); }
.lightbox img { display: block; width: 100%; height: auto; max-height: 94vh; object-fit: contain; border-radius: 18px; }
.lightbox-close {
  position: absolute; top: -16px; right: -16px; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--surface); color: var(--text); font-size: 24px; line-height: 1; box-shadow: var(--shadow-big);
}
.lightbox[open] { animation: lb-in .25s var(--ease); }
@keyframes lb-in { from { opacity: 0; transform: scale(.97); } }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1000px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .colours-grid, .install-grid, .closing-grid { grid-template-columns: 1fr; }
  .install-shot { order: -1; }
}
@media (max-width: 640px) {
  .home .section { padding-top: 80px; }
  .feature-grid { grid-template-columns: 1fr; }
  .tour-tabs { border-radius: 18px; }
  .tour-tabs button { height: 38px; padding: 0 12px; font-size: 14px; }
  .hero-shot { transform: none; }
  .shot, .shot-button, .hero-shot { border-radius: 12px; }
  .btn-large { width: 100%; }
  .news-card, .dev-card-big { padding: 24px; }
}
