/* gerardogrimaldi.com — mobile first */

:root {
  --bg: #161828;
  --bg-2: #1e2136;
  --card: #22263f;
  --card-2: #2a2f4d;
  --line: #3a3f66;
  --text: #eef0ff;
  --muted: #a9acd0;
  --accent: #8b7cf6;
  --accent-2: #b3a8ff;

  --c1: #ffc83d; /* yellow */
  --c2: #ef4351; /* red */
  --c3: #12cf9a; /* green */
  --c4: #3fa7f5; /* blue */
  --c5: #9a5cf0; /* purple */
  --c6: #f45fae; /* pink */

  --radius: 22px;
  --gutter: clamp(18px, 5vw, 40px);
  --max: 1080px;

  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(139, 124, 246, 0.22), transparent 60%),
    radial-gradient(700px 420px at -10% 30%, rgba(18, 207, 154, 0.10), transparent 60%),
    var(--bg);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

img { max-width: 100%; display: block; }
a { color: var(--accent-2); }

h1, h2, h3 { font-family: Fredoka, "Trebuchet MS", system-ui, sans-serif; line-height: 1.12; margin: 0; }

/* ------------------------------------------------------------ header */

.top {
  max-width: var(--max);
  margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top, 0px)) var(--gutter) 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand-name { font-family: Fredoka, system-ui, sans-serif; font-weight: 600; font-size: 1.05rem; letter-spacing: 0.01em; }

.logo {
  display: grid;
  grid-template-columns: repeat(2, 12px);
  gap: 3px;
  padding: 5px;
  border-radius: 10px;
  background: var(--card);
  border: 2px solid var(--line);
}
.logo i { width: 12px; height: 12px; border-radius: 3px; }
.logo i:nth-child(1) { background: var(--c1); }
.logo i:nth-child(2) { background: var(--c3); }
.logo i:nth-child(3) { background: var(--c4); }
.logo i:nth-child(4) { background: var(--c2); }

.nav { display: flex; gap: 6px; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 8px 12px;
  border-radius: 999px;
}
.nav a:hover, .nav a:focus-visible { color: var(--text); background: var(--card); }

/* on very small screens keep only the logo + nav */
@media (max-width: 380px) {
  .brand-name { display: none; }
}

/* ------------------------------------------------------------ hero */

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(40px, 9vw, 96px) var(--gutter) 28px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent-2);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 { font-size: clamp(2.2rem, 8.5vw, 4.4rem); font-weight: 700; }

.grad {
  background: linear-gradient(90deg, var(--c1), var(--c6) 45%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  margin: 18px 0 0;
  max-width: 34rem;
  color: var(--muted);
  font-size: clamp(1.02rem, 2.6vw, 1.18rem);
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 14px;
  font-family: Fredoka, system-ui, sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(2px); }

.btn-primary {
  color: #1b1640;
  background: linear-gradient(180deg, #ffd766, var(--c1));
  box-shadow: 0 4px 0 #c9931b, 0 10px 24px rgba(255, 200, 61, 0.25);
}
.btn-primary:hover { box-shadow: 0 4px 0 #c9931b, 0 12px 30px rgba(255, 200, 61, 0.38); }
.btn-primary:active { box-shadow: 0 2px 0 #c9931b; }

.btn-ghost {
  color: var(--text);
  background: var(--card);
  border: 2px solid var(--line);
}
.btn-ghost:hover { background: var(--card-2); border-color: var(--accent); }

/* ------------------------------------------------------------ belt */

/* the belt itself spans the whole screen, edge to edge */
.belt {
  margin: 18px 0 8px;
  overflow: hidden;
  background: #34386a;
  border-block: 4px solid #5a52c4;
}

/* four identical runs; moving by exactly one run (25%) loops seamlessly,
   and four runs (~3300px) cover even very wide screens */
.belt-track {
  display: flex;
  width: max-content;
  padding: 10px 0;
  background: repeating-linear-gradient(90deg, transparent 0 34px, rgba(255, 255, 255, 0.05) 34px 38px);
  animation: belt 11s linear infinite;
}
/* with JS: the track is filled to cover any screen and moves by exactly one run */
.belt-track.js { animation-name: belt-run; }
@keyframes belt-run { to { transform: translateX(calc(-1 * var(--run, 0px))); } }

.belt-run { display: flex; gap: 10px; padding-right: 10px; }
.belt-run i {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.22), inset 0 3px 0 rgba(255, 255, 255, 0.28);
}
.belt-run i:nth-child(3n) { transform: translateY(2px) rotate(-6deg); }
.belt-run i:nth-child(4n) { transform: translateY(-2px) rotate(5deg); }
.belt-run .gap { box-shadow: none; }
.c1 { background: var(--c1); }
.c2 { background: var(--c2); }
.c3 { background: var(--c3); }
.c4 { background: var(--c4); }
.c5 { background: var(--c5); }
.c6 { background: var(--c6); }

@keyframes belt { to { transform: translateX(-25%); } }

/* ------------------------------------------------------------ projects */

.projects {
  max-width: var(--max);
  margin: 0 auto;
  padding: 48px var(--gutter) 24px;
  scroll-margin-top: 12px;
}

.section-title { font-size: clamp(1.7rem, 5vw, 2.3rem); margin-bottom: 22px; }

.grid { display: grid; gap: 22px; }

.card {
  background: linear-gradient(180deg, var(--card), var(--bg-2));
  border: 2px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-body { padding: 22px; }
.card-body h3 { font-size: 1.8rem; margin: 10px 0 8px; }
.card-body p { margin: 0 0 14px; color: var(--muted); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--card-2);
  color: var(--muted);
}
.tag.live { background: rgba(18, 207, 154, 0.16); color: #5cf0c3; }
.tag.live::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--c3);
  vertical-align: 1px;
}
.tag.soon { background: rgba(244, 95, 174, 0.16); color: #ff9bd0; }

.facts { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 8px; }
.facts li { position: relative; padding-left: 24px; font-size: 0.95rem; }
.facts li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.45em;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--c4);
}
.facts li:nth-child(2)::before { background: var(--c1); }
.facts li:nth-child(3)::before { background: var(--c6); }

.card-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.card-cta .btn { flex: 1 1 140px; }

/* game screenshot in a phone frame */
.shot {
  display: flex;
  justify-content: center;
  padding: 28px 22px 0;
  background:
    radial-gradient(260px 200px at 50% 80%, rgba(139, 124, 246, 0.35), transparent 70%),
    #1a1c30;
  border-bottom: 2px solid var(--line);
}
.phone {
  display: block;
  width: min(220px, 60vw);
  padding: 8px 8px 0;
  border-radius: 30px 30px 0 0;
  background: #0d0e1a;
  border: 2px solid #4a4f7c;
  border-bottom: none;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s ease;
  /* show the top 70% of the screen, like it's rising out of the card */
  aspect-ratio: 1 / 1.4;
  overflow: hidden;
}
.phone img { border-radius: 22px 22px 0 0; width: 100%; height: auto; }
.shot:hover .phone, .shot:focus-visible .phone { transform: translateY(-6px); }

/* coming next */
.card-next { border-style: dashed; }
.mystery {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 220px;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0 14px, transparent 14px 28px),
    #1a1c30;
  border-bottom: 2px dashed var(--line);
  overflow: hidden;
}
.q {
  font-family: Fredoka, system-ui, sans-serif;
  font-weight: 700;
  font-size: 6rem;
  line-height: 1;
  color: transparent;
  background: linear-gradient(180deg, var(--accent-2), var(--c6));
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 8px 24px rgba(244, 95, 174, 0.35));
  animation: bob 3.2s ease-in-out infinite;
}
.spark {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  opacity: 0.85;
  animation: float 6s ease-in-out infinite;
}
.s1 { background: var(--c1); left: 22%; top: 28%; }
.s2 { background: var(--c3); right: 20%; top: 40%; animation-delay: -2s; }
.s3 { background: var(--c4); left: 34%; bottom: 20%; animation-delay: -4s; }

@keyframes bob { 50% { transform: translateY(-8px) rotate(-4deg); } }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(25deg); }
}

.progress {
  height: 10px;
  border-radius: 999px;
  background: var(--card-2);
  overflow: hidden;
  margin: 4px 0 16px;
}
.progress span {
  display: block;
  height: 100%;
  width: 35%;
  border-radius: inherit;
  background: repeating-linear-gradient(135deg, var(--c6) 0 10px, #ff8cc8 10px 20px);
  background-size: 28px 28px;
  animation: stripes 1.2s linear infinite;
}
@keyframes stripes { to { background-position: 28px 0; } }

.small { font-size: 0.92rem; }

/* ------------------------------------------------------------ footer */

.foot {
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px var(--gutter) calc(32px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  color: var(--muted);
  font-size: 0.9rem;
}
.foot p { margin: 0; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--text); }

/* ------------------------------------------------------------ larger screens */

@media (min-width: 760px) {
  .grid { align-items: stretch; }
  .card-game { display: grid; grid-template-columns: minmax(180px, 0.8fr) 1.2fr; }
  .card-game .shot { border-bottom: none; border-right: 2px solid var(--line); align-items: center; padding: 28px; }
  /* full phone, vertically centered */
  .card-game .phone {
    width: 100%;
    max-width: 250px;
    aspect-ratio: 1 / 2;
    padding: 8px;
    border-radius: 32px;
    border-bottom: 2px solid #4a4f7c;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  }
  .card-game .phone img { border-radius: 24px; }
  .card-game .card-body { align-self: center; }
  .card-next { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(180px, 0.4fr) 1fr; }
  .card-next .mystery { min-height: 180px; border-bottom: none; border-right: 2px dashed var(--line); }
  .card-next .card-body { align-self: center; }
}

/* wide screens: game cards side by side, all the same size (phone on top, text below,
   buttons pinned to the bottom); the teaser is a full-width strip below */
@media (min-width: 1000px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-game { display: flex; flex-direction: column; }
  .card-game .shot {
    border-right: none;
    border-bottom: 2px solid var(--line);
    align-items: flex-end;
    padding: 30px 22px 0;
  }
  .card-game .phone {
    width: 230px;
    max-width: none;
    aspect-ratio: 1 / 1.25;
    padding: 8px 8px 0;
    border-radius: 32px 32px 0 0;
    border-bottom: none;
  }
  .card-game .phone img { border-radius: 24px 24px 0 0; }
  .card-game .card-body { flex: 1; display: flex; flex-direction: column; }
  .card-game .card-cta { margin-top: auto; }
}

/* ------------------------------------------------------------ a11y */

:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; }

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