/* =========================================================================
   Portfolio — styles
   Palette knobs live in :root. Change --accent and the whole site follows.
   ========================================================================= */

:root {
  /* ground */
  --ink:        #08080f;
  --ink-2:      #0e0e1a;
  --ink-3:      #15152a;
  --line:       rgba(255, 255, 255, .10);
  --line-soft:  rgba(255, 255, 255, .06);

  /* text */
  --text:       #f2f2f7;
  --text-dim:   #a3a3b8;
  --text-faint: #6b6b85;

  /* accents */
  --violet:     #7c5cff;
  --cyan:       #22d3ee;
  --lime:       #a3e635;
  --amber:      #ffb020;
  --pink:       #ff4d8d;
  --accent:     var(--violet);

  --radius:     22px;
  --radius-sm:  12px;
  --maxw:       1120px;
  --ease:       cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* film grain — gives the flat colour some texture */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: .035;
  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='.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { max-width: 100%; display: block; }

h1, h2, h3 {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.05;
  margin: 0;
}

p { margin: 0 0 1em; }
a { color: inherit; }

::selection { background: var(--violet); color: #fff; }

.hidden { display: none !important; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 12px 18px;
  z-index: 10000;
  border-radius: 0 0 10px 0;
}
.skip:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 6px;
}

/* gradient text used for emphasis words */
.grad {
  background: linear-gradient(100deg, var(--violet) 0%, var(--pink) 45%, var(--amber) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* =========================================================================
   NAV
   ========================================================================= */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(18px, 4vw, 40px);
  transition: background .35s var(--ease), backdrop-filter .35s var(--ease),
              border-color .35s var(--ease), padding .35s var(--ease);
  border-bottom: 1px solid transparent;
}

.nav.is-stuck {
  background: rgba(8, 8, 15, .72);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border-bottom-color: var(--line-soft);
  padding-block: 12px;
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -.02em;
  text-decoration: none;
}

.nav__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--pink));
  box-shadow: 0 0 18px var(--violet);
  animation: hue 8s linear infinite;
}
@keyframes hue { to { filter: hue-rotate(360deg); } }

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(6px, 2vw, 22px);
  font-size: 15px;
  font-weight: 500;
}

.nav__links a {
  text-decoration: none;
  color: var(--text-dim);
  padding: 8px 4px;
  transition: color .2s;
}
.nav__links a:hover { color: var(--text); }

.nav__cta {
  color: var(--text) !important;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 18px !important;
  background: rgba(255, 255, 255, .04);
  transition: border-color .25s, background .25s, transform .25s var(--ease);
}
.nav__cta:hover {
  border-color: var(--violet);
  background: rgba(124, 92, 255, .16);
  transform: translateY(-1px);
}

/* =========================================================================
   HERO
   ========================================================================= */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 140px clamp(20px, 5vw, 40px) 100px;
  overflow: hidden;
}

.hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--maxw);
}

.blobs { position: absolute; inset: 0; z-index: 0; }

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .5;
  will-change: transform;
}
.blob--violet {
  width: 46vw; height: 46vw; min-width: 320px; min-height: 320px;
  background: var(--violet);
  top: -12%; left: -8%;
  animation: drift1 22s ease-in-out infinite;
}
.blob--cyan {
  width: 34vw; height: 34vw; min-width: 260px; min-height: 260px;
  background: var(--cyan);
  bottom: -14%; right: -6%;
  opacity: .34;
  animation: drift2 27s ease-in-out infinite;
}
.blob--pink {
  width: 28vw; height: 28vw; min-width: 220px; min-height: 220px;
  background: var(--pink);
  top: 42%; left: 52%;
  opacity: .3;
  animation: drift3 19s ease-in-out infinite;
}

@keyframes drift1 {
  50% { transform: translate3d(12vw, 8vh, 0) scale(1.15); }
}
@keyframes drift2 {
  50% { transform: translate3d(-10vw, -10vh, 0) scale(1.2); }
}
@keyframes drift3 {
  50% { transform: translate3d(-14vw, 6vh, 0) scale(.85); }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  backdrop-filter: blur(10px);
  padding: 8px 16px;
  border-radius: 999px;
  margin-bottom: 28px;
}

.pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 0 rgba(163, 230, 53, .6);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  70%  { box-shadow: 0 0 0 10px rgba(163, 230, 53, 0); }
  100% { box-shadow: 0 0 0 0 rgba(163, 230, 53, 0); }
}

.hero__title {
  font-size: clamp(2.6rem, 7.4vw, 5.6rem);
  /* Looser than the 1.05 shared by other headings: the underline under the
     <em> needs clearance from the line beneath it when the title wraps. */
  line-height: 1.24;
  margin-bottom: 26px;
}
.hero__title em {
  font-style: normal;
  position: relative;
  white-space: nowrap;
}
/* hand-drawn underline under the italic phrase */
.hero__title em::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  /* Between the descender of "games" and the top of the next line. */
  bottom: -.02em;
  height: .09em;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--lime));
  transform: scaleX(0);
  transform-origin: left;
  animation: draw 1s var(--ease) .6s forwards;
}
@keyframes draw { to { transform: scaleX(1); } }

.hero__sub {
  max-width: 58ch;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--text-dim);
  margin-bottom: 38px;
}

.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  padding: 15px 30px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease),
              background .25s, border-color .25s;
}
.btn span { transition: transform .25s var(--ease); }
.btn:hover span { transform: translateX(4px); }

.btn--primary {
  background: linear-gradient(120deg, var(--violet), var(--pink));
  color: #fff;
  box-shadow: 0 10px 34px -10px rgba(124, 92, 255, .8);
}
.btn--primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 44px -12px rgba(255, 77, 141, .75);
}

.btn--ghost {
  border-color: var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, .03);
}
.btn--ghost:hover {
  border-color: rgba(255, 255, 255, .28);
  transform: translateY(-3px);
}

.btn--wide { width: 100%; justify-content: center; }

.scroll-hint {
  position: absolute;
  bottom: 30px;
  left: 50%;
  translate: -50% 0;
  width: 24px; height: 40px;
  border: 2px solid var(--line);
  border-radius: 999px;
  z-index: 2;
}
.scroll-hint span {
  position: absolute;
  top: 8px; left: 50%;
  translate: -50% 0;
  width: 4px; height: 8px;
  border-radius: 999px;
  background: var(--text-dim);
  animation: wheel 1.8s ease-in-out infinite;
}
@keyframes wheel {
  50% { transform: translateY(12px); opacity: .2; }
}

/* =========================================================================
   STATS
   ========================================================================= */

.stats {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 40px) 40px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.stat {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
  padding: 24px 20px;
  text-align: center;
}
.stat b {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  letter-spacing: -.03em;
  line-height: 1.1;
  background: linear-gradient(120deg, var(--text), var(--text-dim));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat span {
  font-size: 13px;
  color: var(--text-faint);
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* =========================================================================
   SECTIONS
   ========================================================================= */

.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(70px, 11vw, 140px) clamp(20px, 5vw, 40px);
}

.section__head { margin-bottom: 52px; }

.section__title {
  font-size: clamp(2rem, 5.2vw, 3.4rem);
  margin-bottom: 14px;
}

.section__lede {
  color: var(--text-dim);
  max-width: 54ch;
  font-size: 1.05rem;
  margin: 0;
}

/* =========================================================================
   PROJECT CARDS
   ========================================================================= */

.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
}

.card {
  --c: var(--violet);
  position: relative;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--ink-2);
  overflow: hidden;
  transition: transform .4s var(--ease), border-color .4s, box-shadow .4s;
}
.card--violet { --c: var(--violet); }
.card--cyan   { --c: var(--cyan); }
.card--lime   { --c: var(--lime); }
.card--amber  { --c: var(--amber); }
.card--pink   { --c: var(--pink); }

.card:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--c) 55%, transparent);
  box-shadow: 0 24px 60px -24px color-mix(in srgb, var(--c) 70%, transparent);
}

/* colour wash that reveals on hover */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 50% 0%,
              color-mix(in srgb, var(--c) 22%, transparent), transparent 62%);
  opacity: 0;
  transition: opacity .45s var(--ease);
  pointer-events: none;
}
.card:hover::before { opacity: 1; }

.card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  max-width: 100%;
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--c) 34%, var(--ink-3)),
      color-mix(in srgb, var(--c) 8%,  var(--ink-3)));
  display: grid;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
}
.card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease);
}
.card:hover .card__media img { transform: scale(1.05); }

.card__placeholder {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  color: rgba(255, 255, 255, .55);
  border: 1px dashed rgba(255, 255, 255, .28);
  border-radius: 8px;
  padding: 8px 14px;
  background: rgba(0, 0, 0, .25);
}

.card__body { position: relative; z-index: 1; padding: 26px 26px 28px; }

.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 16px;
}
.card__tags span {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 28%, transparent);
}

.card h3 {
  font-size: 1.55rem;
  margin-bottom: 12px;
}

.card p {
  color: var(--text-dim);
  font-size: 15.5px;
  margin-bottom: 18px;
}

.card__link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  color: var(--c);
}
.card__link span { transition: transform .25s var(--ease); }
.card__link:hover span { transform: translate(3px, -3px); }

/* =========================================================================
   MARQUEE
   ========================================================================= */

.marquee {
  position: relative;
  overflow: hidden;
  border-block: 1px solid var(--line-soft);
  background: var(--ink-2);
  padding: 22px 0;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee__track {
  display: flex;
  align-items: center;
  gap: 30px;
  width: max-content;
  animation: slide 34s linear infinite;
}

.marquee__track span {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.1rem, 2.4vw, 1.7rem);
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--text-faint);
  white-space: nowrap;
}
.marquee__track i {
  font-style: normal;
  font-size: 11px;
  color: var(--violet);
}

@keyframes slide { to { transform: translateX(-50%); } }

/* =========================================================================
   SKILLS
   ========================================================================= */

.skills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
}

.skill {
  background: var(--ink);
  padding: 34px 28px 32px;
  position: relative;
  transition: background .35s;
}
.skill:hover { background: var(--ink-2); }

.skill__num {
  font-family: "Space Grotesk", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--violet);
}
.skill:nth-child(2) .skill__num { color: var(--cyan); }
.skill:nth-child(3) .skill__num { color: var(--lime); }
.skill:nth-child(4) .skill__num { color: var(--amber); }
.skill:nth-child(5) .skill__num { color: var(--pink); }
.skill:nth-child(6) .skill__num { color: var(--violet); }

.skill h3 {
  font-size: 1.22rem;
  margin: 12px 0 10px;
}
.skill p {
  color: var(--text-dim);
  font-size: 15px;
  margin: 0;
}

/* =========================================================================
   ABOUT
   ========================================================================= */

.about {
  display: grid;
  gap: clamp(30px, 6vw, 70px);
  align-items: start;
}

/* Text-only about section: cap the measure so lines stay readable. */
.about__text { max-width: 68ch; }

.about__text p {
  color: var(--text-dim);
  font-size: 1.05rem;
}
.about__text .section__title { margin-bottom: 22px; }

/* =========================================================================
   CONTACT
   ========================================================================= */

.section--contact { padding-bottom: clamp(60px, 9vw, 110px); }

.contact {
  position: relative;
  border: 1px solid var(--line);
  border-radius: clamp(22px, 4vw, 34px);
  background:
    radial-gradient(90% 120% at 0% 0%, rgba(124, 92, 255, .22), transparent 58%),
    radial-gradient(80% 110% at 100% 100%, rgba(255, 77, 141, .18), transparent 58%),
    var(--ink-2);
  padding: clamp(30px, 6vw, 62px);
  text-align: center;
}

.contact__title {
  font-size: clamp(2rem, 5.4vw, 3.2rem);
  margin-bottom: 14px;
}
.contact__lede {
  color: var(--text-dim);
  max-width: 48ch;
  margin: 0 auto 38px;
}

.form {
  max-width: 620px;
  margin: 0 auto;
  text-align: left;
}

.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field { display: block; margin-bottom: 14px; }
.field > span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.field input,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: rgba(0, 0, 0, .3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  resize: vertical;
  transition: border-color .25s, background .25s, box-shadow .25s;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--text-faint); }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--violet);
  background: rgba(0, 0, 0, .45);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, .18);
}

.form .btn { margin-top: 10px; }

.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 10px;
  margin-top: 40px;
}
.socials a {
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 20px;
  transition: color .25s, border-color .25s, background .25s, transform .25s var(--ease);
}
.socials a:hover {
  color: var(--text);
  border-color: var(--violet);
  background: rgba(124, 92, 255, .14);
  transform: translateY(-2px);
}

/* =========================================================================
   FOOTER
   ========================================================================= */

.footer {
  border-top: 1px solid var(--line-soft);
  padding: 30px clamp(20px, 5vw, 40px);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-faint);
  max-width: var(--maxw);
  margin: 0 auto;
}

/* =========================================================================
   SCROLL REVEAL
   ========================================================================= */

.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* =========================================================================
   RESPONSIVE
   ========================================================================= */

@media (max-width: 900px) {
  .cards  { grid-template-columns: 1fr; }
  .skills { grid-template-columns: repeat(2, 1fr); }
  .about  { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .stats  { grid-template-columns: repeat(2, 1fr); }
  .skills { grid-template-columns: 1fr; }
  .form__row { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding-top: 130px; padding-bottom: 80px; }
  .scroll-hint { display: none; }
  .nav__links a:not(.nav__cta) { display: none; }
  .btn { padding: 14px 24px; font-size: 15px; }
  .footer { justify-content: center; text-align: center; }
}

/* =========================================================================
   MOTION PREFERENCES
   ========================================================================= */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .hero__title em::after { transform: scaleX(1); }
}

/* =========================================================================
   GAME LINKS
   The chips rotate through the five accent colours automatically, so adding
   or deleting one never leaves a gap in the sequence.
   ========================================================================= */

.games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.game {
  --c: var(--violet);
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 10px;
  align-items: center;
  text-decoration: none;
  font-size: 15.5px;
  padding: 16px 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
  transition: border-color .25s, background .25s, transform .25s var(--ease),
              box-shadow .25s var(--ease);
}

.game:nth-child(5n + 1) { --c: var(--violet); }
.game:nth-child(5n + 2) { --c: var(--cyan); }
.game:nth-child(5n + 3) { --c: var(--lime); }
.game:nth-child(5n + 4) { --c: var(--amber); }
.game:nth-child(5n + 5) { --c: var(--pink); }

/* small colour dot so the row reads as a list of titles, not buttons */
.game b {
  position: relative;
  padding-left: 18px;
  font-weight: 500;
  color: var(--text-dim);
  transition: color .25s;
}
.game b::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
  opacity: .75;
  transition: opacity .25s, box-shadow .25s;
}

/* optional short note under a title */
.game i {
  grid-column: 1;
  padding-left: 18px;
  margin-top: 3px;
  font-style: normal;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--text-faint);
}

.game > span {
  grid-column: 2;
  grid-row: 1 / -1;
  font-size: 13px;
  color: var(--text-faint);
  transition: transform .25s var(--ease), color .25s;
}

.game:hover {
  border-color: color-mix(in srgb, var(--c) 52%, transparent);
  background: color-mix(in srgb, var(--c) 9%, transparent);
  transform: translateY(-3px);
  box-shadow: 0 14px 34px -18px color-mix(in srgb, var(--c) 85%, transparent);
}
.game:hover b { color: var(--text); }
.game:hover b::before { opacity: 1; box-shadow: 0 0 12px var(--c); }
.game:hover > span { color: var(--c); transform: translate(2px, -2px); }

@media (max-width: 560px) {
  .games { grid-template-columns: 1fr 1fr; gap: 10px; }
  .game { padding: 13px 14px; font-size: 14px; }
  .game b { padding-left: 15px; }
}

/* =========================================================================
   TIMELINE
   ========================================================================= */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 34px;
  position: relative;
}

/* the vertical spine */
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--violet), var(--cyan) 50%, var(--lime));
  opacity: .55;
}

.tl {
  --c: var(--violet);
  position: relative;
  padding: 0 0 44px;
}
.tl--cyan { --c: var(--cyan); }
.tl--lime { --c: var(--lime); }
.tl:last-child { padding-bottom: 0; }

/* the node on the spine */
.tl::before {
  content: "";
  position: absolute;
  left: -34px;
  top: 7px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ink);
  border: 3px solid var(--c);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 14%, transparent);
}

.tl__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 18px;
  margin-bottom: 12px;
}

.tl__org { font-size: clamp(1.35rem, 3vw, 1.75rem); }

.tl__role {
  margin: 4px 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--c);
}

.tl__when {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13.5px;
  color: var(--text-faint);
  white-space: nowrap;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 5px 13px;
}

.tl__body {
  color: var(--text-dim);
  max-width: 62ch;
  margin-bottom: 0;
}

@media (max-width: 560px) {
  .timeline { padding-left: 26px; }
  .timeline::before { left: 6px; }
  .tl::before { left: -26px; width: 13px; height: 13px; }
  .tl__when { font-size: 12.5px; }
}

/* =========================================================================
   SERVICES
   ========================================================================= */

.services {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.service {
  --c: var(--violet);
  position: relative;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--ink-2);
  padding: 30px 26px 28px;
  overflow: hidden;
  transition: transform .4s var(--ease), border-color .4s, box-shadow .4s;
}
.service--violet { --c: var(--violet); }
.service--cyan   { --c: var(--cyan); }
.service--lime   { --c: var(--lime); }

/* coloured cap along the top edge */
.service::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--c), transparent 85%);
}

/* wash that lifts on hover */
.service::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(110% 70% at 0% 0%,
              color-mix(in srgb, var(--c) 16%, transparent), transparent 60%);
  opacity: 0;
  transition: opacity .45s var(--ease);
  pointer-events: none;
}
.service:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--c) 45%, transparent);
  box-shadow: 0 22px 54px -26px color-mix(in srgb, var(--c) 80%, transparent);
}
.service:hover::after { opacity: 1; }

.service__tag {
  position: relative;
  z-index: 1;
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
  border-radius: 999px;
  padding: 5px 13px;
  margin-bottom: 18px;
}

.service h3 {
  position: relative;
  z-index: 1;
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.service p {
  position: relative;
  z-index: 1;
  color: var(--text-dim);
  font-size: 15.5px;
  margin: 0;
}

@media (max-width: 900px) {
  .services { grid-template-columns: 1fr; }
}

/* The availability pill wraps to two lines on a phone; a stadium radius looks
   odd once it is that tall, so soften it into a rounded callout instead. */
@media (max-width: 640px) {
  .eyebrow {
    border-radius: 16px;
    align-items: flex-start;
    line-height: 1.5;
  }
  .eyebrow .pulse { margin-top: 6px; flex: 0 0 auto; }
}

/* Discord is a copy button, not a link — it has to match the social chips
   around it exactly, including the reset of the browser's button styling. */
.socials .copy {
  font: inherit;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 20px;
  cursor: pointer;
  transition: color .25s, border-color .25s, background .25s, transform .25s var(--ease);
}
.socials .copy:hover {
  color: var(--text);
  border-color: var(--violet);
  background: rgba(124, 92, 255, .14);
  transform: translateY(-2px);
}
.socials .copy.is-copied {
  color: var(--lime);
  border-color: color-mix(in srgb, var(--lime) 55%, transparent);
  background: color-mix(in srgb, var(--lime) 12%, transparent);
}

/* A figure called out inside a timeline entry should lift off the body text. */
.tl__body strong {
  color: var(--text);
  font-weight: 600;
}

/* Link out from a timeline entry to the thing it produced. Picks up the
   entry's accent colour like everything else in .tl. */
.tl__link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  color: var(--c);
}
.tl__link span { transition: transform .25s var(--ease); }
.tl__link:hover span { transform: translate(3px, -3px); }

/* =========================================================================
   CARD DIAGRAM (inline SVG standing in for a screenshot)
   Inherits --c from the card, so it recolours with the card's accent.
   ========================================================================= */

.diagram {
  width: 100%;
  height: 100%;
  font-family: Inter, sans-serif;
  font-size: 11px;
  font-weight: 500;
}

.diagram text { fill: var(--text-dim); }

/* game-layer boxes: neutral, they are not the subject */
.diagram__game rect {
  fill: rgba(255, 255, 255, .04);
  stroke: rgba(255, 255, 255, .18);
  stroke-width: 1;
}
.diagram__game text { text-anchor: middle; }

/* connectors */
.diagram__wire path {
  fill: none;
  stroke: color-mix(in srgb, var(--c) 45%, transparent);
  stroke-width: 1.5;
  stroke-linecap: round;
}

/* the core is the subject, so it carries the accent */
.diagram__core {
  fill: color-mix(in srgb, var(--c) 9%, transparent);
  stroke: color-mix(in srgb, var(--c) 55%, transparent);
  stroke-width: 1.5;
}

.diagram__label {
  text-anchor: middle;
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  fill: var(--c) !important;
}

.diagram__rule {
  stroke: color-mix(in srgb, var(--c) 28%, transparent);
  stroke-width: 1;
}

.diagram__rows circle { fill: color-mix(in srgb, var(--c) 70%, transparent); }

/* the seam: the one point where game code plugs into the core */
.diagram__seam {
  fill: var(--ink-2);
  stroke: var(--c);
  stroke-width: 2;
}

@media (prefers-reduced-motion: no-preference) {
  .diagram__seam {
    transform-origin: 178px 90px;
    animation: seam 3s ease-in-out infinite;
  }
}
@keyframes seam {
  50% { transform: scale(1.35); }
}

/* Credit line on a project card: who did what, kept quiet so it reads as a
   footnote to the description rather than competing with it. */
.card__credit {
  position: relative;
  z-index: 1;
  margin: -6px 0 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 13.5px;
  color: var(--text-faint);
}
