:root {
  --bg: #0c0b0b;
  --surface: #171514;
  --border: #2e2623;
  --text: #f6f1ec;
  --muted: #9d948d;
  --quote: #c4b6aa;
  --accent: #ff7a3c;
  --accent-deep: #e23b2c;
  --header-height: 4.25rem;
  --gap: 0.85rem;
  --grid-peek: 7.5rem;
  --home-card-ratio: 1303 / 1024;
  --max: 1600px;
  --page-width: min(
    100%,
    calc(
      (100svh - var(--header-height) - (var(--gap) * 2) - var(--grid-peek)) *
        16 / 9
    )
  );
  --font: "IBM Plex Sans", system-ui, sans-serif;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--header-height);
  border-bottom: 1px solid var(--border);
  background: rgba(12, 11, 11, 0.92);
  backdrop-filter: blur(10px);
}

.header-inner {
  width: var(--page-width);
  max-width: var(--max);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--gap);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-name {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
}

.site-nav {
  display: flex;
  gap: 1.75rem;
}

.site-nav a {
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  position: relative;
  padding-bottom: 0.15rem;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
}

.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.2rem;
  height: 1px;
  background: var(--accent);
}

.parallax-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-left: 0.25rem;
  cursor: pointer;
  user-select: none;
  color: var(--muted);
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.parallax-toggle:hover,
.parallax-toggle:has(input:checked) {
  color: var(--text);
}

.parallax-toggle input {
  appearance: none;
  width: 2.1rem;
  height: 1.2rem;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #121110;
  position: relative;
  cursor: pointer;
}

.parallax-toggle input::after {
  content: "";
  position: absolute;
  top: 0.12rem;
  left: 0.12rem;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.2s ease, background 0.2s ease;
}

.parallax-toggle input:checked {
  border-color: var(--accent);
  background: #2a1810;
}

.parallax-toggle input:checked::after {
  transform: translateX(0.88rem);
  background: var(--accent);
}

.parallax-toggle input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

main {
  flex: 1;
  width: 100%;
}

.portfolio {
  width: var(--page-width);
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--gap);
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.project-card {
  display: block;
  position: relative;
  overflow: hidden;
  background: var(--surface);
  aspect-ratio: var(--home-card-ratio);
}

.project-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.project-card:not(:has(.parallax.is-live)) img {
  transition: transform 0.45s ease;
}

.project-card:not(:has(.parallax.is-live)):hover img {
  transform: scale(1.03);
}

.project-card--featured {
  width: 100%;
}

.parallax {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  contain: layout paint style;
}

.parallax-fallback {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.parallax.is-live .parallax-fallback {
  visibility: hidden;
}

.parallax-scene {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.parallax-veil {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: var(--bg);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.9s ease;
}

.parallax.is-ready .parallax-veil {
  opacity: 0;
}

@media (hover: none), (pointer: coarse) {
  .parallax-toggle {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .parallax-veil {
    transition-duration: 0.01s;
  }

  .project-screen img {
    transition: none;
  }

  .parallax-toggle input::after {
    transition: none;
  }
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

.about-main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.project-page {
  width: var(--page-width);
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem var(--gap) 4rem;
}

.about-main h1,
.project-page h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 1rem;
}

.about-copy {
  display: grid;
  gap: 1.1rem;
  max-width: 40rem;
}

.about-copy p,
.project-copy p {
  margin: 0;
  max-width: 40rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.project-copy p {
  color: var(--quote);
}

.project-page-hero {
  width: 100%;
  max-height: min(72vh, 820px);
  object-fit: cover;
  margin-bottom: 2rem;
  background: var(--surface);
}

.project-body {
  display: grid;
  grid-template-columns: 1fr minmax(22rem, 0.84fr);
  gap: 1.35rem;
  align-items: start;
}

.project-side {
  display: grid;
  gap: 1.35rem;
  align-content: start;
  min-width: 0;
}

.project-copy {
  display: grid;
  gap: 1.1rem;
  align-content: start;
}

.project-copy h1 {
  margin: 0;
}

.project-quote {
  margin: 0;
  max-width: 40rem;
  color: var(--muted);
  font-style: italic;
}

.project-quote p {
  color: inherit;
}

.project-copy ul {
  margin: 0;
  padding-left: 1.2rem;
  max-width: 40rem;
  display: grid;
  gap: 0.95rem;
  color: var(--quote);
  font-size: 1.05rem;
}

.project-copy li::marker {
  color: var(--accent);
}

.project-copy strong {
  color: var(--text);
  font-weight: 600;
}

.project-copy em {
  font-style: italic;
}

.project-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 1.35rem;
  padding: 2rem 1.75rem;
  background: var(--surface);
  color: var(--text);
}

.project-info-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.project-info-item--stores {
  grid-column: 1 / -1;
  flex-direction: column;
  gap: 0.75rem;
}

.project-info-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
  color: var(--accent);
  background-color: currentColor;
  mask: var(--icon) center / contain no-repeat;
  -webkit-mask: var(--icon) center / contain no-repeat;
}

.project-info-icon[data-icon="house"] {
  --icon: url("/images/icons/house.svg");
}

.project-info-icon[data-icon="controller"] {
  --icon: url("/images/icons/controller.svg");
}

.project-info-icon[data-icon="tag"] {
  --icon: url("/images/icons/tag.svg");
}

.project-info-icon[data-icon="box-seam"] {
  --icon: url("/images/icons/box-seam.svg");
}

.project-info-icon[data-icon="calendar"] {
  --icon: url("/images/icons/calendar.svg");
}

.project-info-icon[data-icon="globe"] {
  --icon: url("/images/icons/globe.svg");
}

.project-info-label {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.3;
}

.project-info-value {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.project-info-value a {
  color: inherit;
}

.project-info-value a:hover {
  color: var(--accent);
}

.project-stores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.project-store {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  color: var(--text);
  background: #121110;
}

.project-store-icon {
  width: 1.7rem;
  height: 1.7rem;
  background-color: currentColor;
  mask: var(--icon) center / contain no-repeat;
  -webkit-mask: var(--icon) center / contain no-repeat;
}

.project-store-icon[data-icon="steam"] {
  --icon: url("/images/icons/steam.svg");
}

.project-store-icon[data-icon="playstation"] {
  --icon: url("/images/icons/playstation.svg");
}

.project-store-icon[data-icon="xbox"] {
  --icon: url("/images/icons/xbox.svg");
}

.project-store-icon[data-icon="nintendo-switch"] {
  --icon: url("/images/icons/nintendo-switch.svg");
}

.project-store-icon[data-icon="android"] {
  --icon: url("/images/icons/android.svg");
}

.project-store-icon[data-icon="apple"] {
  --icon: url("/images/icons/apple.svg");
}

.project-store-icon[data-icon="itchio"] {
  --icon: url("/images/icons/itchio.svg");
}

.project-store:hover {
  color: var(--accent);
  border-color: var(--accent);
}

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

.project-screens {
  border: 1px solid var(--border);
  border-radius: 1.35rem;
  padding: 1.5rem 1.5rem 1.35rem;
  background: var(--surface);
}

.project-screens-heading {
  margin: 0 0 1rem;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.3;
}

.project-screens-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.project-screen {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0.7rem;
  overflow: hidden;
  background: #121110;
  color: inherit;
  font: inherit;
  cursor: zoom-in;
  appearance: none;
}

.project-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.project-screen:hover img,
.project-screen:focus-visible img {
  transform: scale(1.03);
}

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

.project-screen--placeholder {
  border: 1px dashed var(--border);
  cursor: default;
}

.lightbox {
  display: none;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 1.25rem;
  border: 0;
  background: transparent;
  color: var(--text);
}

.lightbox[open] {
  display: grid;
  place-items: center;
}

.lightbox::backdrop {
  background: rgba(8, 7, 7, 0.88);
}

.lightbox-image {
  max-width: min(96vw, 1400px);
  max-height: min(86vh, 900px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.7rem;
  box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.45);
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.lightbox-close {
  top: 1.1rem;
  right: 1.1rem;
}

.lightbox-prev {
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-close:hover,
.lightbox-nav:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.lightbox-close:focus-visible,
.lightbox-nav:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lightbox-close svg,
.lightbox-nav svg {
  width: 1.1rem;
  height: 1.1rem;
}

.lightbox-nav[hidden] {
  display: none;
}

.contact {
  width: 100%;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.contact-inner {
  width: var(--page-width);
  max-width: var(--max);
  margin: 0 auto;
  padding: 3.25rem var(--gap) 4rem;
}

.contact-heading {
  margin: 0 0 1.5rem;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(16rem, 0.42fr) 1fr;
  gap: 1.35rem;
  align-items: start;
}

.contact-info,
.contact-form {
  border: 1px solid var(--border);
  border-radius: 1.35rem;
  padding: 2rem 1.75rem;
}

.contact-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2rem;
  min-height: 18rem;
  background: var(--surface);
  color: var(--text);
}

.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.contact-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
  color: var(--accent);
}

.contact-info-label {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.3;
}

.contact-info-value {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.contact-info-value a {
  color: inherit;
}

.contact-info-value a:hover {
  color: var(--accent);
}

.contact-form {
  display: grid;
  gap: 1.15rem;
  background: var(--surface);
  color: var(--text);
}

.contact-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.15rem;
}

.contact-field {
  display: grid;
  gap: 0.5rem;
}

.contact-field span {
  font-size: 0.92rem;
  font-weight: 500;
}

.contact-field input,
.contact-field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  background: #121110;
  color: var(--text);
  font: inherit;
  padding: 0.85rem 1rem;
}

.contact-field textarea {
  min-height: 8.5rem;
  resize: vertical;
}

.contact-field input::placeholder,
.contact-field textarea::placeholder {
  color: #7a736e;
}

.contact-field input:focus,
.contact-field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.contact-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.contact-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 0;
  border-radius: 0.7rem;
  background: var(--accent);
  color: #140c08;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.9rem 1.25rem;
  cursor: pointer;
}

.contact-submit svg {
  width: 1rem;
  height: 1rem;
}

.contact-submit:hover {
  background: var(--accent-deep);
  color: #fff;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 700px) {
  :root {
    --grid-peek: 6.5rem;
  }

  .header-inner {
    padding: 0 1.25rem;
  }

  .site-name {
    font-size: 1.05rem;
  }

  .site-nav {
    gap: 1.1rem;
  }

  .about-main {
    padding: 1.75rem 1rem 3rem;
  }

  .project-page {
    padding: 1.75rem var(--gap) 3rem;
  }

  .contact-inner {
    padding: 2.25rem var(--gap) 3rem;
  }

  .contact-layout,
  .contact-row,
  .project-body,
  .project-info {
    grid-template-columns: 1fr;
  }

  .contact-info,
  .contact-form,
  .project-info,
  .project-screens {
    padding: 1.5rem 1.25rem;
  }
}

@media (min-width: 871px) {
  .project-card--featured {
    aspect-ratio: 16 / 9;
  }
}

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

@media (max-width: 920px) {
  .project-body {
    grid-template-columns: 1fr;
  }
}
