:root {
  --bg: #0A0A0B;
  --text: #EDEDE6;
  --muted: #9A9A93;
  --muted-2: #B4B4AC;
  /* Raised from the reference's #77776F for 4.5:1 contrast on --card. */
  --dim: #8A8A82;
  --line: #232327;
  --line-2: #2A2A2E;
  --line-3: #3A3A3F;
  --outline: #1E1E22;
  --card: #111114;
  --card-img: #1A1A1E;
  --accent: #C6FF3D;
  --red: #FF2D55;
  --cyan: #00E5FF;
  --font-sans: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --container: 1360px;
  --gutter: 40px;
}

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
}

a {
  color: var(--text);
}

a:hover {
  color: var(--accent);
}

.container {
  max-width: var(--container);
  margin: auto;
  padding-inline: var(--gutter);
}

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

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

@media (width < 600px) {
  :root {
    --gutter: 20px;
  }
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 24px;
}

.site-header a {
  text-decoration: none;
}

.site-logo {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .08em;
}

.site-logo span {
  color: var(--accent);
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  font-size: 15px;
}

.portfolio-nav {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.portfolio-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
}

.portfolio-nav a[aria-current="page"] {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}

.hero {
  position: relative;
  overflow: visible;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  max-width: var(--container);
  margin: auto;
  padding: 40px var(--gutter) 0;
}

.hero-outline {
  position: absolute;
  left: 20px;
  top: 0;
  font-size: 260px;
  font-weight: 700;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px var(--outline);
  letter-spacing: -.04em;
  white-space: nowrap;
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1 1 560px;
  flex-direction: column;
  gap: 28px;
  min-width: 0;
  padding-bottom: 96px;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: .1em;
}

.hero h1 {
  margin: 0;
  font-size: clamp(52px, 7.6vw, 118px);
  line-height: .92;
  letter-spacing: -.04em;
  font-weight: 700;
  white-space: nowrap;
}

.glitch-word {
  display: inline-block;
  color: var(--accent);
  text-shadow: none;
  transform: none;
}

.glitch-word.is-glitching {
  animation: burst-word .5s steps(1) var(--glitch-runs, 1);
}

.hero-copy p {
  margin: 0;
  max-width: 460px;
  font-size: 19px;
  line-height: 1.55;
  color: var(--muted-2);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.btn {
  padding: 16px 26px;
  border-radius: 999px;
  font-size: 16px;
  text-decoration: none;
  transition: background .2s, color .2s;
}

.btn--primary {
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
}

.btn--outline {
  border: 1px solid var(--line-3);
  font-weight: 500;
}

.btn:hover {
  background: var(--text);
  color: var(--bg);
}

.hero-status {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.blink-dot {
  color: var(--accent);
  animation: blink 1.2s infinite;
}

.hero-photo {
  pointer-events: auto;
  position: relative;
  /* Preserve the flex layout while hiding the bottom beneath the tilted band. */
  bottom: -48px;
  z-index: 2;
  flex: 0 1 680px;
  min-width: 320px;
  margin-left: auto;
  aspect-ratio: 4 / 5;
}

.hero-photo__glow {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 0;
  height: 60%;
  border-radius: 50%;
  background: var(--accent);
  opacity: .12;
  filter: blur(70px);
}

.hero-photo__jitter,
.hero-photo__mirror {
  position: absolute;
  inset: 0;
}

.hero-photo__jitter {
  transform: none;
}

.hero-photo__mirror {
  transform: scaleX(-1);
}

.hero-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
}

.hero-photo__glitch {
  opacity: 0;
  clip-path: inset(0 0 100% 0);
  transform: none;
}

.hero-photo.is-glitching .hero-photo__glitch--red,
.hero-photo.is-glitching .hero-photo__glitch--cyan {
  mix-blend-mode: screen;
}

.hero-photo.is-glitching .hero-photo__jitter {
  animation: burst-jit .75s steps(1) var(--glitch-runs, 1);
}

.hero-photo.is-glitching .hero-photo__glitch--red {
  animation: burst-red .75s steps(1) var(--glitch-runs, 1);
}

.hero-photo.is-glitching .hero-photo__glitch--cyan {
  animation: burst-cyan .75s steps(1) var(--glitch-runs, 1);
}

.hero-photo.is-glitching .hero-photo__glitch--slice {
  animation: burst-slice .75s steps(1) var(--glitch-runs, 1);
}

@media (min-width: 1100px) {
  .hero-photo {
    margin-left: -300px;
  }
}

@media (width < 700px) {
  .hero h1 {
    white-space: normal;
    font-size: clamp(40px, 11vw, 64px);
  }

  .hero-outline {
    font-size: 38vw;
  }

  .hero-copy {
    padding-bottom: 32px;
  }

  .hero-photo {
    flex-basis: 100%;
    min-width: 0;
    margin-left: 0;
    bottom: -55px;
  }
}

.marquee {
  position: relative;
  z-index: 3;
  background: var(--accent);
  color: var(--bg);
  overflow: hidden;
  padding: 18px 0;
  transform: rotate(-1.2deg);
  margin: 0 -20px;
}

.marquee__track {
  display: flex;
  width: max-content;
  animation: marq 28s linear infinite;
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -.01em;
  white-space: nowrap;
}

.marquee__track span {
  padding-right: 40px;
}

.work {
  padding: 120px var(--gutter) 80px;
  max-width: 1360px;
  margin: 0 auto;
}

.work__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 48px;
}

.work__title {
  margin: 0;
  font-size: clamp(40px, 5vw, 72px);
  letter-spacing: -.03em;
  line-height: 1;
}

.work__count {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  text-decoration: none;
  color: var(--text);
  transition: transform .25s ease, border-color .25s ease;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-6px);
  border-color: var(--accent);
  color: var(--text);
}

.card__media {
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: var(--card-img);
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.03) 0 1px, transparent 1px 4px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--dim);
}

.card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 0 4px;
}

.card__title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text);
}

.card__num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--dim);
}

.card__tag {
  padding: 0 4px 6px;
  font-size: 15px;
  color: var(--muted);
}

@media (width < 400px) {
  .work-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.services {
  max-width: var(--container);
  margin: 0 auto;
  padding: 60px var(--gutter) 100px;
}

.eyebrow {
  margin: 0 0 32px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: .1em;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--line);
  border: 1px solid var(--line);
}

.service {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 32px;
  background: var(--bg);
}

.service__number {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
}

.service__title {
  margin: 0;
  font-size: 24px;
}

.service__description {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}

.contact {
  max-width: var(--container);
  margin: 0 auto;
  padding: 80px var(--gutter) 120px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.contact__title {
  margin: 0;
  font-size: clamp(52px, 8vw, 128px);
  line-height: .92;
  letter-spacing: -.045em;
}

.contact__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.btn--lg {
  padding: 18px 30px;
  font-size: 18px;
}

.contact__actions .btn--outline {
  font-weight: 400;
}

.site-footer {
  border-top: 1px solid var(--outline);
}

.site-footer__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 28px var(--gutter);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--dim);
}

.blink-cursor {
  animation: blink 1s infinite;
}

@media (width < 500px) {
  .contact__title {
    font-size: clamp(40px, 12vw, 64px);
  }
}

@media (width < 400px) {
  .services-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Short bursts retain the reference's bands and sideways jumps. */
@keyframes burst-red {
  0%, 100% { opacity: 0; clip-path: inset(0 0 100% 0); transform: none; }
  8% { opacity: .8; clip-path: inset(12% 0 64% 0); transform: translateX(-22px); }
  28% { opacity: .8; clip-path: inset(58% 0 18% 0); transform: translateX(18px); }
  48% { opacity: .8; clip-path: inset(30% 0 52% 0); transform: translateX(-12px); }
  72% { opacity: .8; clip-path: inset(76% 0 6% 0); transform: translateX(26px); }
  90% { opacity: .8; clip-path: inset(0); transform: translateX(-8px); }
}

@keyframes burst-cyan {
  0%, 100% { opacity: 0; clip-path: inset(0 0 100% 0); transform: none; }
  5% { opacity: .8; clip-path: inset(66% 0 10% 0); transform: translateX(24px); }
  24% { opacity: .8; clip-path: inset(6% 0 78% 0); transform: translateX(-18px); }
  44% { opacity: .8; clip-path: inset(40% 0 38% 0); transform: translateX(14px); }
  68% { opacity: .8; clip-path: inset(20% 0 66% 0); transform: translateX(-26px); }
  88% { opacity: .8; clip-path: inset(0); transform: translateX(8px); }
}

@keyframes burst-slice {
  0%, 100% { opacity: 0; clip-path: inset(0 0 100% 0); transform: none; }
  12% { opacity: 1; clip-path: inset(22% 0 70% 0); transform: translateX(30px); }
  32% { opacity: 1; clip-path: inset(48% 0 44% 0); transform: translateX(-36px); }
  56% { opacity: 1; clip-path: inset(64% 0 30% 0); transform: translateX(20px); }
  80% { opacity: 1; clip-path: inset(14% 0 80% 0); transform: translateX(-24px); }
}

@keyframes burst-jit {
  0%, 100% { transform: none; }
  10%, 50% { transform: translate(3px, -2px); }
  30%, 75% { transform: translate(-3px, 1px); }
}
@keyframes scan{from{transform:translateY(-100%)}to{transform:translateY(500%)}}
@keyframes blink{0%,49%{opacity:1}50%,100%{opacity:0}}
@keyframes marq{from{transform:translateX(0)}to{transform:translateX(-50%)}}
@keyframes burst-word {
  0%, 100% { text-shadow: none; transform: none; }
  10%, 55% { text-shadow: -4px 0 #FF2D55, 4px 0 #00E5FF; transform: skewX(-8deg); }
  30%, 80% { text-shadow: 3px 0 #FF2D55, -3px 0 #00E5FF; transform: skewX(6deg); }
}

@media (prefers-reduced-motion: reduce) {
  .marquee__track {
    animation: none;
  }

  .card,
  .card:hover,
  .card:focus-visible {
    transition: none;
    transform: none;
  }

  .glitch-word,
  .glitch-word.is-glitching,
  .glitch-word--slow,
  .blink-dot,
  .blink-cursor,
  .hero-photo__jitter,
  .hero-photo.is-glitching .hero-photo__jitter,
  .hero-photo.is-glitching .hero-photo__glitch,
  .hero-photo__glitch {
    animation: none;
  }

  .hero-photo__glitch {
    display: none;
  }
}
