/* ==========================================================================
   GR9 Studio · App pages (repchamp/, glowupdaily/)
   One screen per app. One stylesheet for both. Each page sets its own colour on <body>:
     .app--repchamp  lime green      .app--glowup  deep blue
   ========================================================================== */

:root {
  --bg: #000;
  --text: #fff;
  --muted: rgba(255, 255, 255, 0.58);
  --faint: rgba(255, 255, 255, 0.36);
  --line: rgba(255, 255, 255, 0.1);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display: "Jost", "Manrope", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --head: "Plus Jakarta Sans", "Manrope", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --pad: clamp(1.25rem, 4vw, 3rem);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --out: cubic-bezier(0.16, 1, 0.3, 1);
  /* app colour as "r g b", used as rgb(var(--c) / alpha) */
  --c: 255 255 255;
  --c2: 255 255 255;
}

.app--repchamp { --c: 132 204 22; --c2: 196 242 112; }
.app--glowup   { --c: 64 132 255; --c2: 168 200 255; }

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

/* One screen: the bar on top, the app in the middle, the moving banner at the bottom. The page doesn't scroll. */
html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

html, body {
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

::selection { background: rgb(var(--c)); color: #000; }
:focus-visible { outline: 1px solid var(--text); outline-offset: 4px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Top bar: just the way back to the home page
   -------------------------------------------------------------------------- */

.top {
  position: relative;
  z-index: 50;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding:
    max(1.9rem, env(safe-area-inset-top))
    max(var(--pad), env(safe-area-inset-right))
    1.1rem
    max(var(--pad), env(safe-area-inset-left));
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.top-home,
.top-links a {
  display: inline-flex;
  align-items: center;
  transition: opacity 0.2s ease;
}

.top-home:hover,
.top-links a:hover { opacity: 0.7; }

.top-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.top-links a { color: var(--text); opacity: 0.6; }
.top-links a:hover { opacity: 1; }

/* --------------------------------------------------------------------------
   Store buttons
   -------------------------------------------------------------------------- */

.stores {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: max-content;
  max-width: 100%;
  margin-inline: auto;
  gap: 0.75rem;
}

.stores .store { justify-content: center; }

.store {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  height: clamp(2.9rem, 6.4vh, 3.5rem);
  padding: 0 1.5rem 0 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 1.1rem;
  background: #000;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
  transition:
    transform 0.45s var(--out),
    border-color 0.3s ease,
    box-shadow 0.45s ease,
    background-color 0.3s ease;
}

.store img {
  width: auto;
  height: 24px;
  flex: none;
}

.store-text {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.15;
}

.store-text small {
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.72);
}

.store-text b {
  font-family: var(--head);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

/* a quick white sheen crosses the button on hover */
.store::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.22) 50%, transparent 65%);
  transform: translateX(-120%);
}

.store:hover::after {
  transform: translateX(120%);
  transition: transform 1.3s var(--ease);
}

.store:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 16px 34px -12px rgba(0, 0, 0, 0.95);
}

.store:active { transform: translateY(-1px) scale(0.98); }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

/* Everything is sized by the screen's height (vh) as well as its width, so the whole app always fits.
   Nothing is allowed to shrink to make room: that's what squashed the icon. */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.hero {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: clamp(0.5rem, 2vh, 1.5rem) var(--pad) clamp(1rem, 3vh, 2.25rem);
  text-align: center;
  isolation: isolate;
}

.hero-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* one soft light from above, barely tinted with the app's colour */
.blob {
  position: absolute;
  left: 50%;
  top: 0;
  width: min(1400px, 160vw);
  height: min(900px, 110vh);
  transform: translate(-50%, -38%);
  border-radius: 50%;
  background: radial-gradient(closest-side,
    rgb(var(--c2) / 0.15),
    rgb(var(--c) / 0.08) 45%,
    rgb(var(--c) / 0.025) 72%,
    transparent);
}

/* fine film grain over the whole background: smooths the gradient, no colour banding */
.hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* a fine grid, only near the middle */
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 144px 144px, 144px 144px, 36px 36px, 36px 36px;
  /* keeps the fine lines lined up with the major ones */
  background-position: center, center, calc(50% - 18px) calc(50% - 18px), calc(50% - 18px) calc(50% - 18px);
  -webkit-mask-image: radial-gradient(ellipse 55% 50% at 50% 42%, #000 10%, transparent 75%);
  mask-image: radial-gradient(ellipse 55% 50% at 50% 42%, #000 10%, transparent 75%);
}

/* the live version of the grid (drawn by app-page.js): bends and glows around the pointer.
   It fades toward the edges itself, so no CSS mask here (a mask would be recomposited every frame). */
.hero-grid-live {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.grid-live .hero-grid { display: none; }

/* the hero melts into the black page below it */
.hero-bg::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 30%;
  background: linear-gradient(to bottom, transparent, #000);
}

/* Until the web fonts are in, the text along the top and bottom stays hidden so it never flashes in a
   fallback font. The background shows straight away (the hero text is already hidden until it animates in).
   app-page.js adds .fonts-ready; the delayed animation is a safety net in case the script never runs. */
.js .top,
.js .marquee {
  opacity: 0;
  animation: reveal 0.6s ease 2.5s forwards;
}

.js.fonts-ready .top,
.js.fonts-ready .marquee {
  opacity: 1;
  animation: none;
  transition: opacity 0.6s ease;
}

@keyframes reveal { to { opacity: 1; } }

/* Hero pieces come in one after another when the page loads.
   will-change keeps each piece on its own layer for good, so the text doesn't
   jump a hair when the slide-in ends and the browser repaints it. */
.js .in {
  opacity: 0;
  transform: translateY(18px);
  will-change: transform, opacity;
}

.is-loaded .in {
  opacity: 1;
  transform: none;
  transition: opacity 1.1s var(--ease), transform 1.3s var(--out);
  transition-delay: calc(var(--k, 0) * 110ms + 350ms);
}

/* The app icon: a glossy tile that floats, follows the pointer, and spins when clicked */
.hero-icon {
  --s: clamp(100px, min(18vw, 22vh), 230px);
  flex: none;
  position: relative;
  width: var(--s);
  height: var(--s);
  margin-bottom: clamp(1rem, 3.2vh, 2.25rem);
  perspective: 900px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.js .hero-icon { opacity: 0; }

.is-loaded .hero-icon {
  opacity: 1;
  transition: opacity 0.8s ease 0.1s;
}

.hero-icon-enter,
.hero-icon-float,
.hero-icon-tilt,
.hero-icon-spin {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.js .hero-icon-enter {
  transform: translate3d(0, 40px, -220px) rotateY(-360deg) scale(0.55);
}

.is-loaded .hero-icon-enter {
  transform: none;
  transition: transform 2s var(--out) 0.1s;
}

.hero-icon-float { animation: float 7s ease-in-out infinite; }

.hero-icon-tilt {
  transform: rotateX(calc(var(--py, 0) * -14deg)) rotateY(calc(var(--px, 0) * 18deg));
  transition: transform 0.8s var(--ease);
}

.hero-icon-spin.is-spinning { animation: spin 1.25s cubic-bezier(0.25, 0.8, 0.2, 1); }

@keyframes float {
  0%, 100% { transform: translateY(0) rotateY(-8deg) rotateX(2deg); }
  50%      { transform: translateY(-12px) rotateY(8deg) rotateX(-2deg); }
}

@keyframes spin {
  from { transform: rotateY(0); }
  to   { transform: rotateY(360deg); }
}

.hero-icon-face {
  position: absolute;
  inset: 0;
  border-radius: 22.5%;
  overflow: hidden;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.hero-icon-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-icon-front {
  transform: translateZ(4px);
  /* a plain dark shadow: the page behind already carries the app's colour */
  box-shadow: 0 24px 50px -18px rgba(0, 0, 0, 0.9);
}

.hero-icon-back {
  transform: rotateY(180deg) translateZ(4px);
  background: #080808;
}

.hero-icon-back img { filter: brightness(0.4) saturate(0.7); }

/* thickness: the coloured edge seen while it turns */
.hero-icon-edge {
  position: absolute;
  inset: 0;
  border-radius: 22.5%;
  background: linear-gradient(135deg, rgb(var(--c2)), rgb(var(--c)) 45%, #04060a);
}

.hero-icon-edge:nth-of-type(1) { transform: translateZ(-3px); }
.hero-icon-edge:nth-of-type(2) { transform: translateZ(0); }
.hero-icon-edge:nth-of-type(3) { transform: translateZ(3px); }

/* rim light + a highlight that follows the pointer + a sheen that sweeps across */
.hero-icon-front::before,
.hero-icon-front::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.hero-icon-front::before {
  z-index: 2;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.hero-icon-front::after {
  z-index: 1;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.55) 50%, transparent 62%);
  transform: translateX(-110%);
}

.hero-icon.is-shine .hero-icon-front::after {
  animation: sheen 1.5s cubic-bezier(0.4, 0, 0.2, 1) var(--sd, 0s) both;
}

@keyframes sheen {
  from { transform: translateX(-110%); }
  to   { transform: translateX(110%); }
}

.hero-icon-gloss {
  position: absolute;
  z-index: 1;
  left: -10%;
  top: -50%;
  width: 120%;
  height: 100%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.3), transparent);
  pointer-events: none;
  transform: translate(calc(var(--px, 0) * 22%), calc(var(--py, 0) * 18%));
  transition: transform 0.8s var(--ease);
}

/* The big name: each letter blurs into focus (app-page.js wraps the letters) */
.hero-title {
  font-family: var(--head);
  font-size: clamp(2.6rem, min(10vw, 13vh), 8.5rem);
  font-weight: 800;
  /* a box tall enough for the whole word, from the top of the capitals to the tails of p, y and g */
  line-height: 1.25;
  /* The fade below only shows inside this box, so the box must hold every bit of every letter: the tails of
     p, y and g, and the right edge of the last letter, which pokes past the box because of the tight letter
     spacing. Equal room left and right keeps the name centred. */
  padding: 0 0.2em 0.2em;
  letter-spacing: -0.055em;
  color: #fff;
  /* White at the top fading to soft grey at the bottom, across the whole name. */
  -webkit-mask-image: linear-gradient(180deg, #000 40%, rgba(0, 0, 0, 0.62) 80%);
  mask-image: linear-gradient(180deg, #000 40%, rgba(0, 0, 0, 0.62) 80%);
}

/* hidden until app-page.js has split it into letters (otherwise it shows for a moment in a fallback font) */
.js .hero-title:not(.is-split) { opacity: 0; }

.hero-title .ch {
  display: inline-block;
}

.js .hero-title .ch {
  will-change: transform, opacity;
  opacity: 0;
  filter: blur(14px);
  transform: translateY(0.3em) scale(1.06);
}

.is-loaded .hero-title .ch {
  opacity: 1;
  filter: blur(0);
  transform: none;
  transition: opacity 1s ease, filter 1.1s var(--ease), transform 1.4s var(--out);
  transition-delay: calc(var(--i) * 45ms + 450ms);
}

/* never let the gradient letters keep a blur layer once they've settled */
.hero-title.is-done .ch { filter: none; transition: none; }

.hero-sub {
  /* tucked up under the name (the name's box has extra room at the bottom for the tails of p, y and g) */
  margin-top: clamp(-1.1rem, -1.5vh, -0.35rem);
  padding-left: 0.34em;
  font-family: var(--display);
  font-size: clamp(0.85rem, min(1.5vw, 2.2vh), 1.2rem);
  font-weight: 300;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.hero-lead {
  max-width: 33em;
  margin-top: clamp(0.7rem, 2.2vh, 1.3rem);
  font-size: clamp(0.92rem, min(1.2vw, 2vh), 1.1rem);
  line-height: 1.7;
  color: var(--muted);
  text-wrap: balance;
}

.hero .stores { margin-top: clamp(1rem, 3.2vh, 2.1rem); }

.hero > * { flex-shrink: 0; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem 1.1rem;
  margin-top: clamp(1.2rem, 3.4vh, 2.1rem);
  font-size: 0.95rem;
  color: var(--faint);
}

.hero-meta b { color: rgba(255, 255, 255, 0.85); font-weight: 600; }

.stars {
  display: inline-flex;
  gap: 2px;
  color: #f5c542;
}

.stars svg { width: 17px; height: 17px; }

.hero-meta .rating {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.hero-meta .sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}

/* --------------------------------------------------------------------------
   Marquee
   -------------------------------------------------------------------------- */

.marquee {
  position: relative;
  padding-block: clamp(0.75rem, min(2.4vw, 2.2vh), 1.4rem);
  border-block: 1px solid var(--line);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  /* runs on the compositor, so busy frames on the page (the live grid) can't make it hitch */
  animation: marquee 40s linear infinite;
  /* keep the strip on its own GPU layer, drawn once, so it glides without stopping */
  will-change: transform;
  backface-visibility: hidden;
}


.marquee-track span {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding-right: clamp(2.25rem, 4.5vw, 3.75rem);
  font-family: var(--head);
  font-size: clamp(1.05rem, min(2.2vw, 3.3vh), 1.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.82);
}

/* a small line icon in the app's colour before each item */
.marquee-track .mi {
  flex: none;
  width: 0.9em;
  height: 0.9em;
  fill: none;
  /* each icon sets its own colour (--ic) in the page; the app colour is the fallback */
  stroke: var(--ic, rgb(var(--c)));
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.marquee-track .mi .f { fill: var(--ic, rgb(var(--c))); stroke: none; }


@keyframes marquee {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

.marquee { flex: none; }

/* --------------------------------------------------------------------------
   Phones and short screens
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
  .top { font-size: 0.65rem; letter-spacing: 0.1em; }
  .top-links { gap: 1.1rem; }
}

@media (max-width: 480px) {
  .hero-title { font-size: clamp(2.3rem, min(13vw, 8.5vh), 4rem); }
  .hero-sub { letter-spacing: 0.24em; padding-left: 0.24em; }
  .hero-lead { font-size: 0.95rem; }
  .hero-meta { flex-direction: column; gap: 0.35rem; margin-top: 1.4rem; }
  .hero-meta .sep { display: none; }

  /* both store buttons stay side by side */
  .stores { flex-wrap: nowrap; gap: 0.5rem; }
  .store { height: 3.1rem; gap: 0.55rem; padding: 0 0.95rem 0 0.8rem; border-radius: 0.9rem; }
  .store img { height: 20px; }
  .store-text small { font-size: 0.56rem; }
  .store-text b { font-size: 0.92rem; }
}

/* very short screens (a phone held sideways): too little room for everything, so the page scrolls after all */
@media (max-height: 560px) {
  html, body { height: auto; overflow: visible; }
  body { min-height: 100%; }
  .hero { padding-block: 1rem 2rem; }
}

/* --------------------------------------------------------------------------
   Pages with more below the first screen (repchamp/)
   - .page-scroll: the first screen (.screen) looks the same as before, and the page scrolls on to an About section
   - .no-reveal: nothing waits for the fonts or a fade-in; all the text is there straight away
   -------------------------------------------------------------------------- */

html.page-scroll,
html.page-scroll body {
  height: auto;
  overflow: visible;
  overflow-x: clip;
}

.page-scroll body { display: block; }

.page-scroll .screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}

.no-reveal.js .top,
.no-reveal.js .marquee,
.no-reveal.js .in,
.no-reveal.js .hero-icon,
.no-reveal.js .hero-title:not(.is-split) {
  opacity: 1;
  transform: none;
  animation: none;
}

.no-reveal.js .hero-icon-enter { transform: none; }

/* About: plain text that says what the app is and how it uses Google Sign-In */
.about {
  position: relative;
  background: #000;
  padding: clamp(3.5rem, 9vh, 6rem) var(--pad) clamp(3rem, 8vh, 5rem);
}

.about-inner {
  max-width: 46rem;
  margin: 0 auto;
}

.about h2 {
  font-family: var(--head);
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.about h3 {
  margin-top: 2.75rem;
  font-family: var(--head);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.about p,
.about li {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--muted);
}

.about p { margin-top: 0.9rem; }
.about strong { color: var(--text); font-weight: 600; }

.about-inner a {
  color: rgb(var(--c2));
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.about ol {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-left: 1.3rem;
}

.about .api-list {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-left: 1.3rem;
}

.about .features {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.features li {
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.92rem;
  line-height: 1.55;
}

.features b {
  display: block;
  margin-bottom: 0.2rem;
  font-family: var(--head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.about-note {
  margin-top: 2.75rem;
  padding: 1.25rem 1.4rem 1.4rem;
  border: 1px solid rgb(var(--c) / 0.35);
  border-radius: 1rem;
  background: rgb(var(--c) / 0.06);
}

.about-note h3 { margin-top: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
    transition-delay: 0s !important;
  }
  .js .in, .js .hero-icon, .js .hero-icon-enter, .js .hero-title .ch {
    opacity: 1;
    transform: none;
    filter: none;
  }
  .marquee-track { animation: none !important; }
}
