/* Grapes Labs front page. Same look as the GrapesLabs Account pages: aubergine atmosphere, Fraunces + Inter.
 * Per-app colors (--accent, --accent2 on .app-<id>) come from /theme.css, generated from apps.json. */

@font-face { font-family: "Fraunces GL"; src: url("fonts/fraunces.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Inter GL"; src: url("fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

@property --live { syntax: "<color>"; inherits: true; initial-value: #8b3fd1; }

:root {
  --bg: #0b0613;
  --ink: #f4ecff;
  --muted: #a99bc4;
  --faint: #7d6f98;
  --card: rgba(255, 255, 255, 0.045);
  --edge: rgba(255, 255, 255, 0.10);
  --violet: #8b3fd1;
  --violet-hi: #b98ee0;
  --wine: #c2418f;
  --serif: "Fraunces GL", "Iowan Old Style", Georgia, serif;
  --sans: "Inter GL", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --live: var(--violet);
  --ease: cubic-bezier(.2, .8, .2, 1);
  transition: --live 900ms ease;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--violet-hi); outline-offset: 3px; border-radius: 8px; }

/* ---------- atmosphere ---------- */
.atmosphere { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.atmosphere span { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; }
.atmosphere span:nth-child(1) { width: 60vmax; height: 60vmax; left: -18vmax; top: -22vmax; background: rgba(139, 63, 209, .55); animation: drift 26s ease-in-out infinite alternate; }
.atmosphere span:nth-child(2) { width: 46vmax; height: 46vmax; right: -16vmax; top: 8vmax; background: rgba(194, 65, 143, .35); animation: drift 32s ease-in-out infinite alternate-reverse; }
.atmosphere span:nth-child(3) { width: 54vmax; height: 54vmax; left: 20vmax; top: 70vh; background: var(--live); opacity: .28; animation: drift 38s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate3d(6vmax, 4vmax, 0) scale(1.12); } }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1240px; margin: 0 auto; padding: 22px clamp(20px, 4vw, 40px);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 19px/1 var(--serif); letter-spacing: -.01em; }
.topbar nav { display: flex; align-items: center; gap: 10px; }
.topbar nav gl-github { color: var(--ink); }
.topbar nav a:not(.glg) {
  text-decoration: none; color: var(--muted); font-weight: 500; font-size: 15px;
  padding: 8px 16px; border: 1px solid var(--edge); border-radius: 999px; background: var(--card);
  transition: color .2s, border-color .2s;
}
.topbar nav a:not(.glg):hover { color: var(--ink); border-color: rgba(255, 255, 255, .25); }

/* ---------- hero ---------- */
.hero { max-width: 980px; margin: 0 auto; padding: clamp(56px, 11vh, 120px) clamp(20px, 4vw, 40px) clamp(48px, 8vh, 88px); text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 26px;
  padding: 7px 16px; border: 1px solid var(--edge); border-radius: 999px; background: var(--card);
  color: var(--muted); font-size: 14px; font-weight: 500; letter-spacing: .02em;
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 0 rgba(74, 222, 128, .6); animation: pulse 2.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(74, 222, 128, 0); } 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); } }
h1 {
  margin: 0; font: 600 clamp(46px, 8.4vw, 104px)/1.02 var(--serif); letter-spacing: -.035em;
  font-variation-settings: "opsz" 144;
}
.gradient {
  background: linear-gradient(100deg, #e9b8ff 0%, #b98ee0 30%, #e46fb4 62%, #ffb38a 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 9s ease-in-out infinite alternate;
}
@keyframes shimmer { to { background-position: 100% 0; } }
.lede { max-width: 640px; margin: 26px auto 0; color: var(--muted); font-size: clamp(17px, 2vw, 20px); line-height: 1.6; }
.hero-cta {
  display: inline-flex; gap: 10px; align-items: center; margin-top: 36px; padding: 14px 26px;
  border-radius: 999px; text-decoration: none; font-weight: 600;
  background: linear-gradient(135deg, var(--violet), var(--wine));
  box-shadow: 0 18px 40px -16px rgba(194, 65, 143, .7), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .25s var(--ease), box-shadow .25s;
}
.hero-cta:hover { transform: translateY(-2px); box-shadow: 0 24px 50px -16px rgba(194, 65, 143, .85), inset 0 1px 0 rgba(255, 255, 255, .25); }

/* ---------- showcase (carousel) ---------- */
.showcase { position: relative; max-width: 1320px; margin: 0 auto; padding: 0 clamp(12px, 3vw, 40px); scroll-margin-top: 16px; }
.showcase-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 20px; padding: 0 clamp(8px, 1.5vw, 20px) 22px; }
h2 { margin: 0; font: 600 clamp(28px, 3.6vw, 42px)/1.1 var(--serif); letter-spacing: -.02em; }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 9px;
  padding: 8px 16px 8px 9px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--edge); background: var(--card); color: var(--muted);
  font: 600 15px/1 var(--sans); transition: color .3s, border-color .3s, background .3s, box-shadow .3s;
}
.tab img { border-radius: 7px; }
.tab:hover { color: var(--ink); }
.tab[aria-current="true"] {
  color: var(--ink); border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--accent) 70%, transparent);
}
.tab-progress { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.tab[aria-current="true"] .tab-progress { width: 100%; transition: none; }
.autoplaying .tab[aria-current="true"] .tab-progress { animation: fill var(--slide-ms, 7000ms) linear forwards; }
.paused .tab[aria-current="true"] .tab-progress { animation-play-state: paused; }
@keyframes fill { from { width: 0; } to { width: 100%; } }

.stage { position: relative; }
.track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; border-radius: 32px; overscroll-behavior-x: contain;
}
.track::-webkit-scrollbar { display: none; }
.track:focus-visible { outline-offset: -2px; border-radius: 32px; }

.slide {
  flex: 0 0 100%; scroll-snap-align: center; position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; gap: clamp(20px, 3vw, 48px);
  min-height: 560px; padding: clamp(28px, 4.5vw, 64px);
  border-radius: 32px; border: 1px solid var(--edge);
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    radial-gradient(90% 80% at 0% 100%, color-mix(in srgb, var(--accent2) 10%, transparent), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .02));
}
.slide + .slide { margin-left: 16px; }

.app-badge { display: inline-flex; align-items: center; gap: 12px; font: 600 15px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: color-mix(in srgb, var(--accent) 55%, white); }
.app-badge img { border-radius: 12px; box-shadow: 0 10px 26px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.slide-title { margin: 22px 0 0; font: 600 clamp(32px, 3.8vw, 52px)/1.05 var(--serif); letter-spacing: -.025em; }
.slide-summary { margin: 18px 0 0; color: var(--muted); font-size: 17px; }
.slide-points { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 10px; }
.slide-points li { position: relative; padding-left: 28px; color: #ddd0f3; font-size: 15.5px; line-height: 1.5; }
.slide-points li::before {
  content: ""; position: absolute; left: 2px; top: .42em; width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, white -40%, var(--accent2) 20%, var(--accent) 80%);
  box-shadow: 0 0 12px -2px var(--accent);
}
.cta {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 30px; padding: 14px 24px; border-radius: 14px;
  text-decoration: none; font-weight: 700; color: #160b1f;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  box-shadow: 0 16px 36px -14px var(--accent), inset 0 1px 0 rgba(255, 255, 255, .45);
  transition: transform .25s var(--ease), box-shadow .25s;
}
.cta span { transition: transform .25s var(--ease); }
.cta:hover { transform: translateY(-2px); box-shadow: 0 22px 44px -14px var(--accent), inset 0 1px 0 rgba(255, 255, 255, .45); }
.cta:hover span { transform: translateX(4px); }

/* device mockups */
.slide-visual { position: relative; perspective: 1600px; padding: 10px 0 40px; }
.halo {
  position: absolute; inset: 8% 4% 0 12%; border-radius: 50%; filter: blur(60px);
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 55%, transparent), transparent 70%);
}
.device { margin: 0; position: relative; overflow: hidden; background: #0e0a16; }
.browser {
  border-radius: 14px; border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 50px 100px -30px rgba(0, 0, 0, .85), 0 0 0 1px rgba(0, 0, 0, .4);
  transform: rotateY(-9deg) rotateX(3deg) translateZ(0); transform-origin: 30% 50%;
  transition: transform 1.1s var(--ease);
}
.browser-bar { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; background: rgba(255, 255, 255, .06); border-bottom: 1px solid rgba(255, 255, 255, .08); }
.browser-bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .22); }
.browser-bar i:nth-child(1) { background: #ff6159; } .browser-bar i:nth-child(2) { background: #ffbd2e; } .browser-bar i:nth-child(3) { background: #28c941; }
.browser-bar span { margin-left: 12px; padding: 3px 12px; border-radius: 6px; background: rgba(255, 255, 255, .07); color: var(--muted); font-size: 11.5px; letter-spacing: .01em; }
.browser img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; }
.phone {
  position: absolute; right: -2%; bottom: 0; width: 25%; border-radius: 26px; padding: 6px; background: #120d1b;
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 40px 70px -20px rgba(0, 0, 0, .9), 0 0 0 1px rgba(0, 0, 0, .5);
  transform: rotate(4deg) translateZ(40px); transition: transform 1.1s var(--ease);
}
.phone img { width: 100%; aspect-ratio: 9 / 19.5; object-fit: cover; object-position: top; border-radius: 20px; }

/* entrance animation (only once JS runs, so without it everything is simply visible) */
.js .slide .slide-copy > * { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .slide.is-active .slide-copy > * { opacity: 1; transform: none; }
.js .slide.is-active .slide-copy > :nth-child(2) { transition-delay: .08s; }
.js .slide.is-active .slide-copy > :nth-child(3) { transition-delay: .16s; }
.js .slide.is-active .slide-copy > :nth-child(4) { transition-delay: .24s; }
.js .slide.is-active .slide-copy > :nth-child(5) { transition-delay: .32s; }
.js .slide .browser { transform: rotateY(-20deg) rotateX(8deg) translate3d(60px, 20px, -80px); opacity: .4; transition: transform 1.1s var(--ease), opacity .9s; }
.js .slide.is-active .browser { transform: rotateY(-9deg) rotateX(3deg); opacity: 1; }
.js .slide .phone { transform: rotate(12deg) translate3d(40px, 60px, 40px); opacity: 0; transition: transform 1.2s var(--ease) .15s, opacity .9s .15s; }
.js .slide.is-active .phone { transform: rotate(4deg) translateZ(40px); opacity: 1; }
.slide.is-active:hover .browser { transform: rotateY(-4deg) rotateX(1deg) scale(1.01); }
.slide.is-active:hover .phone { transform: rotate(1deg) translate3d(-6px, -8px, 40px); }

.nav {
  position: absolute; top: 50%; z-index: 2; width: 48px; height: 48px; margin-top: -24px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .18); background: rgba(20, 12, 32, .7); color: var(--ink);
  font: 400 28px/1 var(--sans); cursor: pointer; backdrop-filter: blur(10px);
  display: grid; place-items: center; padding-bottom: 4px;
  transition: background .2s, transform .2s;
}
.nav:hover { background: rgba(60, 30, 90, .85); transform: scale(1.06); }
.prev { left: -14px; } .next { right: -14px; }
.autoplay {
  position: absolute; right: clamp(24px, 4.5vw, 60px); bottom: 18px; z-index: 2;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--edge); background: rgba(20, 12, 32, .6);
  color: var(--muted); font: 500 12px/1 var(--sans); cursor: pointer; backdrop-filter: blur(8px);
}
.autoplay:hover { color: var(--ink); }

/* ---------- directory ---------- */
.directory { max-width: 1240px; margin: 0 auto; padding: clamp(72px, 10vh, 120px) clamp(20px, 4vw, 40px) 40px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 26px; }
.app-card {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; align-items: center;
  padding: 22px; border-radius: 20px; text-decoration: none;
  border: 1px solid var(--edge); background: var(--card); overflow: hidden;
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
.app-card::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .4s;
  background: radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%);
}
.app-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 50%, transparent); box-shadow: 0 24px 50px -24px color-mix(in srgb, var(--accent) 70%, transparent); }
.app-card:hover::before { opacity: 1; }
.app-card > * { position: relative; }
.app-card img { border-radius: 13px; grid-row: span 2; }
.app-card-text { display: grid; gap: 2px; }
.app-card-text strong { font: 600 20px/1.2 var(--serif); }
.app-card-text span { color: var(--muted); font-size: 14.5px; }
.app-card-host { grid-column: 2; color: var(--faint); font-size: 13px; }

/* ---------- footer: the shared Grapes Labs footer (gl-footer.css) ---------- */
gl-footer { color: var(--ink); }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .slide { grid-template-columns: 1fr; min-height: 0; gap: 8px; }
  .slide-visual { order: -1; padding: 0 0 26px; margin: 0 4% 0 0; }
  .slide-title { margin-top: 16px; }
  .slide-points { display: none; }
  .nav { display: none !important; }
  .showcase-head { align-items: start; }
  .autoplay { bottom: 14px; right: 26px; }
}
@media (max-width: 520px) {
  .slide { padding: 22px; border-radius: 24px; }
  .track { border-radius: 24px; }
  .slide + .slide { margin-left: 10px; }
  .slide-summary { font-size: 15.5px; }
  .tab span { display: none; }
  .tab { padding: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html, .track { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0s !important; transition-delay: 0s !important; }
}
