/* ==========================================================================
   KOSDEVLAB home page
   One dark theme for the whole page. The matrix background is only used in the hero.
   Colors live in the tokens below, so changing the look means editing one place.
   ========================================================================== */

:root {
  --bg: #0b0f17;
  --surface: #111725;
  --surface-2: #172036;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e8ebf2;
  --muted: #9aa3b5;
  --accent: #7b93ff;
  --accent-2: #b07ad8;
  --gradient: linear-gradient(120deg, #b07ad8, #7b93ff);
  --radius: 16px;
  --radius-sm: 10px;
  --nav-height: 68px;
  --container: 1120px;
  --font: "Lato", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a {
  color: inherit;
}

ul {
  list-style: none;
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 2000;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 700;
}

.skip-link:focus {
  top: 16px;
}

.material-symbols-outlined {
  font-size: 1.25em;
  line-height: 1;
  vertical-align: middle;
}

/* ---------- Shared text ---------- */

.eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform .2s, box-shadow .2s, background-color .2s, border-color .2s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn--primary {
  background-image: var(--gradient);
  color: #fff;
  box-shadow: 0 10px 30px rgba(123, 147, 255, 0.3);
}

.btn--primary:hover {
  box-shadow: 0 14px 36px rgba(123, 147, 255, 0.45);
}

.btn--ghost {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: var(--border-strong);
  color: var(--text);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.btn--ghost:hover {
  background-color: rgba(255, 255, 255, 0.12);
}

.btn--large {
  padding: 16px 32px;
  font-size: 17px;
}

/* ---------- Top navigation ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  height: var(--nav-height);
  transition: background-color .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}

.nav--solid {
  background-color: rgba(11, 15, 23, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}

.nav__inner {
  max-width: var(--container);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 900;
  letter-spacing: 0.14em;
  font-size: 15px;
}

.nav__logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.nav__menu {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav__link {
  position: relative;
  padding: 8px 14px;
  font-size: 15px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 999px;
  transition: color .2s, background-color .2s;
}

.nav__link:hover {
  color: var(--text);
  background-color: rgba(255, 255, 255, 0.06);
}

.nav__link.is-active {
  color: var(--text);
}

.nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background-image: var(--gradient);
}

.nav__cta {
  margin-left: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  background-image: var(--gradient);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: transform .2s;
}

.nav__cta:hover {
  transform: translateY(-1px);
}

.nav__toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
}

@media (max-width: 760px) {
  .nav__toggle {
    display: inline-flex;
  }

  .nav__menu {
    position: absolute;
    top: var(--nav-height);
    left: 16px;
    right: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px;
    background-color: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .2s, transform .2s, visibility .2s;
  }

  .nav__menu--open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav__link,
  .nav__cta {
    padding: 12px 16px;
    font-size: 16px;
    margin: 0;
    text-align: center;
  }

  .nav__link.is-active::after {
    display: none;
  }

  .nav__link.is-active {
    background-color: rgba(255, 255, 255, 0.06);
  }
}

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

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-height) + 40px) 24px 96px;
  text-align: center;
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(176, 122, 216, 0.35), transparent 55%),
    radial-gradient(ellipse at 85% 30%, rgba(123, 147, 255, 0.3), transparent 55%),
    linear-gradient(180deg, rgba(11, 15, 23, 0.55) 0%, rgba(11, 15, 23, 0.82) 65%, var(--bg) 100%),
    url(../images/indexBackground.png);
  background-size: cover;
  background-position: center top;
}

.hero__content {
  max-width: 820px;
  animation: heroIn .9s ease-out both;
}

.hero__title {
  font-size: clamp(38px, 8vw, 76px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0.04em;
  margin-bottom: 20px;
}

.hero__lead {
  max-width: 640px;
  margin: 0 auto 36px;
  font-size: clamp(17px, 2.2vw, 20px);
  color: #c9cfdc;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 56px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 640px;
  margin: 0 auto;
}

.stats__item {
  padding: 18px 12px;
  background-color: rgba(17, 23, 37, 0.6);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.stats__value {
  display: block;
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 900;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stats__label {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.stats__note {
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
}

.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  text-decoration: none;
  animation: bob 2.4s ease-in-out infinite;
}

.hero__scroll:hover {
  color: var(--text);
}

@keyframes heroIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes bob {
  0%, 100% {
    transform: translate(-50%, 0);
  }
  50% {
    transform: translate(-50%, 6px);
  }
}

@media (max-width: 520px) {
  .hero__actions .btn {
    width: 100%;
  }

  .hero .eyebrow {
    font-size: 11px;
    letter-spacing: 0.08em;
  }

  .stats {
    gap: 8px;
  }

  .stats__item {
    padding: 14px 6px;
  }

  .stats__label {
    font-size: 12px;
  }
}

/* ---------- Sections ---------- */

.section {
  padding: 104px 24px;
  scroll-margin-top: calc(var(--nav-height) - 1px);
}

.section--alt {
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section__head {
  max-width: 680px;
  margin: 0 auto 48px;
  text-align: center;
}

.section__title {
  font-size: clamp(28px, 4.5vw, 42px);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 12px;
}

.section__intro {
  color: var(--muted);
  font-size: 18px;
}

@media (max-width: 600px) {
  .section {
    padding: 72px 16px;
  }

  .section__head {
    margin-bottom: 36px;
  }
}

/* Scroll reveal: only hidden when JavaScript is running, so content never disappears without it */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease-out, transform .7s ease-out;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Cards keep their quick hover animation once they have faded in */
.js .project.reveal.is-visible {
  transition: transform .25s, border-color .25s, box-shadow .25s, opacity .7s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero__content,
  .hero__scroll {
    animation: none;
  }
}

/* ---------- Brands ---------- */

.section--brands {
  padding-top: 72px;
}

.brands {
  overflow: hidden;
  padding: 16px 0;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

.brands__track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: brandsScroll 40s linear infinite;
}

.brands:hover .brands__track,
.brands:focus-within .brands__track {
  animation-play-state: paused;
}

.brands__item {
  flex-shrink: 0;
  padding: 0 10px;
}

/* Logos sit on light tiles so dark and colored logos all stay readable on the dark page */
.brands__link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 180px;
  height: 118px;
  padding: 16px 20px 14px;
  background-color: #f4f6fb;
  border-radius: var(--radius);
  text-decoration: none;
  transition: transform .25s, box-shadow .25s;
}

.brands__item:hover .brands__link,
.brands__link:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4);
}

.brands__logo {
  max-height: 46px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0.75;
  transition: filter .3s, opacity .3s;
}

.brands__item:hover .brands__logo,
.brands__link:focus-visible .brands__logo {
  filter: none;
  opacity: 1;
}

.brands__name {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #3a4256;
  white-space: nowrap;
}

/* Video count under each logo, e.g. "12 videos" */
.brands__count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  background-color: #4c5f9a;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

.brands__count::before {
  content: "";
  width: 9px;
  height: 9px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M5 3v18l16-9z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.brands__hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

.brands__hint[hidden] {
  display: none;
}

.brands__hint-badge {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M8 5v14l11-7z'/%3E%3C/svg%3E") center / 55% no-repeat;
}

@keyframes brandsScroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@media (max-width: 600px) {
  .brands__link {
    width: 140px;
    height: 100px;
    padding: 12px 14px 10px;
    gap: 8px;
  }

  .brands__logo {
    max-height: 38px;
  }

  .brands__count {
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brands {
    -webkit-mask-image: none;
    mask-image: none;
  }

  .brands__track {
    animation: none;
    width: auto;
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 20px;
  }

  .brands__item[aria-hidden="true"] {
    display: none;
  }
}

/* ---------- Project filters ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 40px;
}

.filters__btn {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background-color: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: color .2s, background-color .2s, border-color .2s;
}

.filters__btn:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.3);
}

.filters__btn.is-active {
  color: #fff;
  border-color: transparent;
  background-image: var(--gradient);
}

/* ---------- Projects ---------- */

.projects {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 20px;
}

.project {
  --glow-x: 50%;
  --glow-y: 0%;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 24px;
  background-image: linear-gradient(160deg, var(--project-a, #172036) -60%, var(--surface-2) 45%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  isolation: isolate;
  transition: transform .25s, border-color .25s, box-shadow .25s, opacity .7s ease-out;
}

.project[hidden] {
  display: none;
}

/* Glow that follows the cursor */
.project::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(260px circle at var(--glow-x) var(--glow-y), rgba(123, 147, 255, 0.18), transparent 70%);
  opacity: 0;
  transition: opacity .3s;
}

.project:hover {
  transform: translateY(-6px);
  border-color: rgba(123, 147, 255, 0.4);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.project:hover::before {
  opacity: 1;
}

.project__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.project__icon {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  transition: transform .3s;
}

/* For logos drawn on a transparent background in a dark color */
.project__icon--light {
  object-fit: contain;
  padding: 8px;
  background-color: #f4f6fb;
}

.project:hover .project__icon {
  transform: rotate(-4deg) scale(1.05);
}

.project__badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background-color: rgba(123, 147, 255, 0.12);
  border: 1px solid rgba(123, 147, 255, 0.25);
}

.project__badge--client {
  color: var(--accent-2);
  background-color: rgba(176, 122, 216, 0.12);
  border-color: rgba(176, 122, 216, 0.3);
}

.project__title {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 8px;
}

.project__text {
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 18px;
}

.project__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 22px;
}

.project__tags li {
  padding: 3px 10px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: #c9cfdc;
  background-color: rgba(255, 255, 255, 0.06);
}

.project__link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
}

.project__link .material-symbols-outlined {
  transition: transform .2s;
}

.project__link:hover {
  color: var(--accent);
}

.project__link:hover .material-symbols-outlined {
  transform: translateX(3px);
}

/* Makes the whole card clickable through its link */
.project .project__link::after {
  content: "";
  position: absolute;
  inset: 0;
}

/* ---------- Private client work (under NDA) ---------- */

.private-work {
  grid-column: 1 / -1;
  padding: 28px;
  border-radius: var(--radius);
  border: 1px dashed rgba(176, 122, 216, 0.45);
  background-image:
    radial-gradient(ellipse at 0% 0%, rgba(176, 122, 216, 0.16), transparent 55%),
    linear-gradient(var(--surface-2), var(--surface-2));
}

.private-work[hidden] {
  display: none;
}

.private-work__head {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.private-work__lock {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background-image: var(--gradient);
  color: #fff;
  font-size: 28px;
}

.project__badge--private {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--accent-2);
  background-color: rgba(176, 122, 216, 0.12);
  border-color: rgba(176, 122, 216, 0.3);
}

.private-work__title {
  font-size: 22px;
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 6px;
}

.private-work__intro {
  max-width: 720px;
  color: var(--muted);
  font-size: 16px;
}

.private-work__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.private-work__item {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.private-work__icon {
  flex-shrink: 0;
  font-size: 24px;
  color: var(--accent);
}

.private-work__item h4 {
  font-size: 16px;
  margin-bottom: 4px;
}

.private-work__item p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.private-work__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.private-work__foot p {
  color: var(--text);
  font-weight: 700;
}

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

.projects__empty {
  text-align: center;
  color: var(--muted);
}

/* ---------- About ---------- */

.about {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 48px;
  align-items: start;
}

.about__statement {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 32px;
  scroll-margin-top: calc(var(--nav-height) + 24px);
}

.about__pillars {
  display: grid;
  gap: 16px;
}

.pillar {
  display: flex;
  gap: 16px;
  padding: 20px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 16px;
}

.pillar__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background-image: var(--gradient);
  color: #fff;
  font-size: 24px;
}

.pillar__title {
  font-size: 17px;
  color: var(--text);
  margin-bottom: 4px;
}

.founder {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.founder__photo {
  width: 100%;
  aspect-ratio: 4 / 3.4;
  object-fit: cover;
  object-position: center 20%;
  transition: transform .6s;
}

.founder:hover .founder__photo {
  transform: scale(1.03);
}

.founder__body {
  position: relative;
  padding: 24px;
  color: var(--muted);
  font-size: 16px;
  background-color: var(--surface);
}

.founder__name {
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 10px;
}

.founder__body p:not(.eyebrow) {
  margin-bottom: 16px;
}

.founder__body .project__link::after {
  display: none;
}

/* "Read more" only appears on phones */
.founder__more {
  display: none;
  margin: -8px 0 14px;
  padding: 6px 0;
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.founder__more:hover {
  text-decoration: underline;
}

/* Bigger tap area for the LinkedIn link on touch screens */
.founder__body .project__link {
  padding: 10px 0;
  margin: -10px 0;
}

@media (max-width: 860px) {
  .about {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .founder {
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
  }
}

/* ---------- Tech stack ---------- */

.stack {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 20px;
}

.stack__group {
  padding: 22px;
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stack__title {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.stack__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stack__list li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  transition: transform .2s, border-color .2s, background-color .2s;
}

.stack__list li:hover {
  transform: translateY(-2px);
  border-color: rgba(123, 147, 255, 0.45);
  background-color: rgba(123, 147, 255, 0.1);
}

.stack__list i {
  font-size: 20px;
}

/* GitHub's icon is black by default, which disappears on the dark page */
.stack__list .devicon-github-original {
  color: #fff;
}

/* ---------- Contact ---------- */

.contact {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 32px;
  text-align: center;
  border-radius: 24px;
  border: 1px solid var(--border-strong);
  background-image:
    radial-gradient(ellipse at 0% 0%, rgba(176, 122, 216, 0.25), transparent 60%),
    radial-gradient(ellipse at 100% 100%, rgba(123, 147, 255, 0.25), transparent 60%),
    linear-gradient(var(--surface), var(--surface));
}

.contact__title {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 12px;
}

.contact__text {
  max-width: 540px;
  margin: 0 auto 28px;
  color: var(--muted);
}

/* Each sentence starts on its own line, with balanced line lengths */
.contact .line {
  display: block;
  text-wrap: balance;
}

.contact__email {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--muted);
  word-break: break-all;
}

.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}

.socials {
  gap: 12px;
}

.socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  color: var(--text);
  transition: background-color .2s, border-color .2s, transform .2s, color .2s;
}

.socials svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.socials svg .fill {
  fill: currentColor;
  stroke: none;
}

.socials a:hover {
  transform: translateY(-3px);
  color: #fff;
  border-color: transparent;
  background-image: var(--gradient);
}

@media (max-width: 520px) {
  .contact {
    padding: 40px 20px;
  }

  .contact .btn--large {
    width: 100%;
  }
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
}

.footer__inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  font-size: 14px;
}

.footer__brand img {
  border-radius: 50%;
}

.footer__legal {
  font-size: 13px;
  color: var(--muted);
  text-align: right;
}

@media (max-width: 640px) {
  .footer__inner {
    flex-direction: column;
    text-align: center;
  }

  .footer__legal {
    text-align: center;
  }
}

/* ---------- Back to top ---------- */

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 900;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background-image: var(--gradient);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .3s, transform .3s, visibility .3s;
}

.back-to-top--visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.back-to-top--visible:hover {
  transform: translateY(-3px);
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top,
  .back-to-top--visible,
  .back-to-top--visible:hover {
    transform: none;
  }
}

/* ---------- Collab video popup ---------- */

.collab-modal {
  width: min(92vw, 440px);
  max-height: 92vh;
  margin: auto;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background-color: var(--surface);
  color: var(--text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.collab-modal::backdrop {
  background-color: rgba(5, 8, 14, 0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.collab-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.collab-modal__title {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.collab-modal__close {
  border: none;
  background: none;
  font-size: 32px;
  line-height: 1;
  padding: 0 6px;
  color: var(--muted);
  cursor: pointer;
}

.collab-modal__close:hover {
  color: var(--text);
}

.collab-modal__video {
  height: min(64vh, 640px);
  background-color: #000;
}

.collab-modal__video iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.collab-modal__footer {
  padding: 12px 16px;
  text-align: center;
  border-top: 1px solid var(--border);
}

.collab-modal__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 10px;
}

.collab-modal__nav[hidden] {
  display: none;
}

.collab-modal__nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding-bottom: 3px;
  border: none;
  border-radius: 50%;
  background-image: var(--gradient);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: opacity .2s, transform .2s;
}

.collab-modal__nav-btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.collab-modal__nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.collab-modal__counter {
  min-width: 60px;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.collab-modal__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 24px;
}

.collab-modal__link {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--accent);
}

.collab-modal__link[hidden] {
  display: none;
}

.collab-modal__link:hover {
  text-decoration: underline;
}

html.collab-modal-open {
  overflow: hidden;
}

/* ==========================================================================
   Phone reading layout
   One idea per screen: less text, smaller blocks, and lists you can swipe
   ========================================================================== */

@media (max-width: 600px) {

  /* Hero fills the whole phone screen, with the content centred */
  .hero {
    min-height: 100vh;
    min-height: 100svh;
    padding: calc(var(--nav-height) + 24px) 20px 40px;
  }

  /* Hide the intro sentence on phones so the name and button lead */
  .hero__lead {
    display: none;
  }

  .hero__title {
    margin-bottom: 28px;
  }

  .hero__actions {
    margin-bottom: 36px;
  }

  .hero__actions .btn--ghost,
  .hero__scroll {
    display: none;
  }

  /* Button sized to its text, centred, instead of stretching edge to edge */
  .hero__actions .btn {
    width: auto;
    padding: 13px 28px;
  }

  .stats__value {
    font-size: 24px;
  }

  /* Each section fills at least one phone screen (below the nav) with its
     content centred, so the next section doesn't peek in from the bottom */
  .section {
    min-height: calc(100vh - var(--nav-height));
    min-height: calc(100svh - var(--nav-height));
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 16px;
  }

  .section--brands {
    padding-top: 40px;
  }

  /* Keep every block full width inside the centred column */
  .section > * {
    width: 100%;
    min-width: 0;
  }

  .private-work,
  .private-work__item > div {
    min-width: 0;
  }

  .section__head {
    margin-bottom: 24px;
  }

  .section__title {
    font-size: 26px;
    margin-bottom: 0;
  }

  .section__intro {
    display: none;
  }

  .section--brands .section__intro {
    display: block;
    font-size: 15px;
    margin-top: 8px;
  }

  /* Filters: one swipeable row instead of wrapping onto two lines */
  .filters {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    margin: 0 -16px 20px;
    padding: 0 16px 4px;
    scrollbar-width: none;
  }

  .filters::-webkit-scrollbar {
    display: none;
  }

  .filters__btn {
    flex-shrink: 0;
    padding: 8px 16px;
    font-size: 14px;
  }

  /* Projects: compact rows (icon, name, one short line, arrow) instead of tall cards */
  .projects {
    gap: 10px;
  }

  .project {
    display: grid;
    grid-template-columns: 56px 1fr 24px;
    align-items: center;
    column-gap: 14px;
    padding: 14px;
  }

  .project:hover {
    transform: none;
  }

  .project__top {
    grid-row: 1 / span 2;
    margin: 0;
  }

  .project__icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
  }

  .project__badge,
  .project__tags {
    display: none;
  }

  .project__title {
    grid-column: 2;
    font-size: 17px;
    margin: 0;
    line-height: 1.3;
  }

  .project__text {
    grid-column: 2;
    font-size: 14px;
    line-height: 1.45;
    margin: 2px 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Only the arrow shows; the whole row is still the link */
  .project__link {
    grid-column: 3;
    grid-row: 1 / span 2;
    margin: 0;
    font-size: 0;
    color: var(--muted);
  }

  .project__link .material-symbols-outlined {
    font-size: 22px;
  }

  /* About: short blocks, founder as a compact card */
  .about {
    gap: 16px;
  }

  .about__pillars {
    gap: 10px;
  }

  .pillar {
    padding: 14px;
    gap: 14px;
    font-size: 15px;
    line-height: 1.5;
  }

  .pillar__icon {
    width: 38px;
    height: 38px;
    font-size: 20px;
  }

  .pillar__title {
    font-size: 16px;
    margin-bottom: 2px;
  }

  .founder {
    position: relative;
    display: grid;
    grid-template-columns: 96px 1fr;
    align-items: start;
  }

  /* Photo keeps a fixed height, so "Read more" never stretches it */
  .founder__photo {
    position: relative;
    z-index: 1;
    width: 96px;
    height: 240px;
    aspect-ratio: auto;
    -webkit-mask-image: linear-gradient(to bottom, #000 75%, transparent);
    mask-image: linear-gradient(to bottom, #000 75%, transparent);
  }

  /* Blurred copy of the photo fills the column below it when the bio is expanded */
  .founder::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 96px;
    background: url(../images/prof.jpg) center bottom / cover no-repeat;
    filter: blur(14px) brightness(0.55);
    transform: scale(1.25);
    transform-origin: left center;
  }

  .founder__body {
    position: relative;
    z-index: 1;
  }

  .founder:hover .founder__photo {
    transform: none;
  }

  .founder__body {
    padding: 16px;
    font-size: 14px;
    line-height: 1.5;
  }

  .founder__body .eyebrow {
    margin-bottom: 2px;
    font-size: 11px;
  }

  .founder__name {
    font-size: 18px;
    margin-bottom: 6px;
  }

  .founder__body p:not(.eyebrow) {
    margin-bottom: 8px;
  }

  /* Tech stack: no boxes, just a label and a row of small chips */
  .stack {
    gap: 20px;
  }

  .stack__group {
    padding: 0;
    background: none;
    border: none;
  }

  .stack__title {
    margin-bottom: 10px;
    font-size: 12px;
  }

  .stack__list {
    gap: 6px;
  }

  .stack__list li {
    padding: 6px 12px;
    font-size: 14px;
  }

  .stack__list i {
    font-size: 16px;
  }

  /* Contact */
  .contact {
    padding: 36px 20px;
  }

  .contact__title {
    font-size: 24px;
  }

  .contact__text {
    font-size: 15px;
    margin-bottom: 22px;
  }

  .socials {
    gap: 8px;
    margin-top: 24px;
    flex-wrap: nowrap;
  }

  .socials a {
    width: 44px;
    height: 44px;
  }

  .socials svg {
    width: 20px;
    height: 20px;
  }

  /* Room at the bottom so the back-to-top button never covers the legal text */
  .footer {
    padding-bottom: 88px;
  }
}

/* Phone sizes for the stats notes and the private work box */
@media (max-width: 600px) {
  .stats__note {
    font-size: 10px;
  }

  .private-work {
    padding: 18px;
  }

  .private-work__head {
    gap: 14px;
    margin-bottom: 16px;
  }

  .private-work__lock {
    width: 44px;
    height: 44px;
    font-size: 22px;
    border-radius: 12px;
  }

  .private-work__title {
    font-size: 18px;
  }

  .private-work__intro {
    font-size: 14px;
  }

  .private-work__list {
    gap: 8px;
    margin-bottom: 16px;
  }

  .private-work__item {
    padding: 12px;
  }

  .private-work__foot .btn {
    width: 100%;
  }
}

/* Founder bio on phones: show the first lines, expand with "Read more" */
@media (max-width: 600px) {
  .founder__bio {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .founder__bio.founder__bio--open {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
  }

  .founder__more {
    display: block;
    margin: -4px 0 6px;
  }

  /* The project rows hide their link text on phones; the LinkedIn link keeps its words */
  .founder__body .project__link {
    font-size: 14px;
    color: var(--text);
  }

  .founder__body .project__link .material-symbols-outlined {
    font-size: 18px;
  }
}