@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700&display=swap");

:root {
  color-scheme: dark;
  --bg: #090a0c;
  --surface: #111317;
  --surface-raised: #16191e;
  --line: rgba(255, 255, 255, 0.1);
  --line-bright: rgba(255, 255, 255, 0.2);
  --text: #f4f3ef;
  --muted: #93979f;
  --acid: #c8f45a;
  --page: min(1320px, calc(100vw - 80px));
  --sans: "Manrope", "Segoe UI", sans-serif;
  --mono: "DM Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    var(--bg);
  background-size: 72px 72px;
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--acid), transparent);
  content: "";
  opacity: 0.65;
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  transform: translateY(-160%);
  border-radius: 5px;
  background: var(--acid);
  color: #0a0b0c;
  font-weight: 700;
}

.skip-link:focus {
  transform: none;
}

.ambient {
  position: absolute;
  z-index: -1;
  max-width: 100vw;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.1;
  pointer-events: none;
}

.ambient--one {
  top: -160px;
  right: 0;
  width: 560px;
  height: 560px;
  background: #86adff;
}

.ambient--two {
  top: 680px;
  left: -260px;
  width: 520px;
  height: 520px;
  background: var(--acid);
}

.site-header,
main,
.site-footer {
  width: var(--page);
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 92px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.wordmark__icon {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-bright);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  object-fit: cover;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 34px;
  color: #b6b9c0;
  font-size: 12px;
  font-weight: 600;
}

.site-nav a,
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: color 180ms ease;
}

.site-nav a:hover,
.text-link:hover {
  color: var(--text);
}

.site-nav svg,
.text-link svg {
  width: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.site-nav .support-link {
  display: grid;
  width: 34px;
  height: 34px;
  margin-left: -7px;
  place-items: center;
  border: 1px solid var(--line-bright);
  border-radius: 50%;
  color: #a8acb3;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.site-nav .support-link:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.07);
  color: #ff7f92;
}

.site-nav .support-link .heart-icon {
  width: 14px;
  fill: currentColor;
  stroke: none;
}

.eyebrow {
  margin: 0;
  color: #d2d4d8;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.projects-section {
  padding: clamp(52px, 6vw, 78px) 0 84px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 48px;
}

.section-heading h2 {
  margin: 13px 0 0;
  font-size: clamp(31px, 4vw, 52px);
  font-weight: 500;
  letter-spacing: -0.055em;
}

.project-count {
  margin: 0 0 6px;
  color: #777b82;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.project-count span {
  color: var(--acid);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.project-card {
  --card-accent: var(--acid);
  position: relative;
  grid-column: span 6;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(17, 19, 23, 0.94);
  transition:
    transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 220ms ease,
    box-shadow 320ms ease;
}

.project-card:nth-child(4n + 1),
.project-card:nth-child(4n + 4) {
  grid-column: span 7;
}

.project-card:nth-child(4n + 2),
.project-card:nth-child(4n + 3) {
  grid-column: span 5;
}

.project-card:hover {
  z-index: 2;
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.project-card:focus-within {
  outline: 2px solid var(--card-accent);
  outline-offset: 3px;
}

.project-card__link {
  display: block;
}

.project-visual {
  position: relative;
  height: clamp(260px, 28vw, 390px);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #0d0f12;
}

.project-visual::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 62%, rgba(9, 10, 12, 0.5));
  content: "";
  pointer-events: none;
}

.project-visual__image {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition:
    transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1),
    filter 400ms ease;
}

.project-card:hover .project-visual__image {
  transform: scale(1.018);
  filter: saturate(1.08);
}

.project-visual__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  overflow: hidden;
  place-items: center;
  background:
    radial-gradient(circle at 70% 15%, color-mix(in srgb, var(--card-accent) 20%, transparent), transparent 38%),
    linear-gradient(145deg, #171a1f, #0c0e11 66%);
}

.project-visual__fallback::before {
  position: absolute;
  top: 17%;
  right: 9%;
  bottom: 17%;
  left: 9%;
  transform: perspective(800px) rotateX(4deg) rotateY(-4deg);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 10px;
  background:
    linear-gradient(90deg, var(--card-accent) 0 15%, transparent 15%) 24px 27px / 95px 4px no-repeat,
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px) 24px 68px / calc(100% - 48px) 42px,
    rgba(255, 255, 255, 0.025);
  box-shadow: 0 30px 50px rgba(0, 0, 0, 0.3);
  content: "";
}

.project-visual__index {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.08);
  font-family: var(--mono);
  font-size: clamp(60px, 9vw, 112px);
  letter-spacing: -0.08em;
}

.project-card__body {
  display: grid;
  min-height: 218px;
  padding: 28px 30px 30px;
}

.project-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.project-card__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #93979f;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.project-card__label::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--card-accent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--card-accent) 65%, transparent);
  content: "";
}

.project-card__index {
  color: #5f636a;
  font-family: var(--mono);
  font-size: 9px;
}

.project-card h3 {
  margin: 0 0 11px;
  font-size: clamp(21px, 2vw, 29px);
  font-weight: 500;
  letter-spacing: -0.04em;
}

.project-card__description {
  max-width: 510px;
  margin: 0;
  color: #8f939b;
  font-size: 13px;
  line-height: 1.65;
}

.project-card__action {
  display: flex;
  align-items: center;
  align-self: end;
  justify-content: space-between;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: #d5d7db;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.project-card__arrow {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--card-accent);
  font-size: 13px;
  transition:
    transform 220ms ease,
    background 220ms ease;
}

.project-card:hover .project-card__arrow {
  transform: translate(2px, -2px);
  background: color-mix(in srgb, var(--card-accent) 15%, transparent);
}

.loading-card {
  display: grid;
  grid-column: 1 / -1;
  height: 410px;
  place-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.loading-card span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--acid);
  animation: pulse 900ms ease-in-out infinite alternate;
}

.loading-card span:last-child {
  animation-delay: 300ms;
}

.project-error {
  grid-column: 1 / -1;
  padding: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 98px;
  border-top: 1px solid var(--line);
  color: #70747b;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.availability {
  display: flex;
  align-items: center;
  gap: 8px;
}

.availability span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 10px rgba(200, 244, 90, 0.7);
}

.site-footer a:hover {
  color: var(--text);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 700ms ease,
    transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

.project-card.reveal:nth-child(even) {
  transition-delay: 80ms;
}

@keyframes pulse {
  to {
    transform: translateY(12px);
    opacity: 0.25;
  }
}

@media (max-width: 900px) {
  :root {
    --page: min(100% - 40px, 760px);
  }

  .project-card,
  .project-card:nth-child(n) {
    grid-column: span 6;
  }

  .project-visual {
    height: 280px;
  }
}

@media (max-width: 650px) {
  :root {
    --page: calc(100% - 32px);
  }

  body {
    background-size: 48px 48px;
  }

  .site-header {
    min-height: 76px;
  }

  .site-nav > a:first-child {
    display: none;
  }

  .site-nav {
    gap: 18px;
  }

  .site-nav > a:not(.support-link) svg {
    display: none;
  }

  .projects-section {
    padding: 44px 0 64px;
  }

  .section-heading {
    align-items: start;
    margin-bottom: 32px;
  }

  .project-count {
    margin-top: 8px;
  }

  .project-card,
  .project-card:nth-child(n) {
    grid-column: 1 / -1;
  }

  .project-visual {
    height: 250px;
  }

  .project-card__body {
    min-height: 210px;
    padding: 24px;
  }

  .site-footer {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 26px 0;
  }

  .availability {
    grid-column: 1 / -1;
    grid-row: 1;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
