:root {
  --bg: #100d12;
  --bg-soft: #1d1820;
  --surface: rgba(28, 23, 31, 0.82);
  --surface-strong: #f7f0e8;
  --line: rgba(247, 240, 232, 0.13);
  --line-strong: rgba(247, 240, 232, 0.24);
  --text: #f7f0e8;
  --muted: #b9aaa6;
  --ink: #241d22;
  --accent: #f06d8f;
  --accent-deep: #8f75ff;
  --accent-soft: #ffd7b1;
  --archive-green: #8dd2a2;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  --max-width: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--text);
  background: #08070d;
  overflow-x: hidden;
}

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

a,
button {
  color: inherit;
}

a {
  text-decoration: none;
}

button {
  font: inherit;
}

.pixel-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 24%, rgba(118, 88, 180, 0.2), transparent 28rem),
    linear-gradient(180deg, rgba(8, 7, 13, 0.34), rgba(8, 7, 13, 0.72) 58%, rgba(8, 7, 13, 0.94)),
    url("assets/backgrounds/pixel-world-animated.webp") center top / cover no-repeat,
    url("assets/backgrounds/pixel-world-sprites.png") center top / cover no-repeat;
}

.pixel-field::before,
.pixel-field::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.pixel-field::before {
  background:
    radial-gradient(circle at 50% 36%, transparent 0 16rem, rgba(8, 7, 13, 0.22) 38rem, rgba(8, 7, 13, 0.72) 78rem),
    linear-gradient(90deg, rgba(8, 7, 13, 0.28), transparent 28%, transparent 72%, rgba(8, 7, 13, 0.28));
}

.pixel-field::after {
  opacity: 0.18;
  image-rendering: pixelated;
  background:
    linear-gradient(90deg, rgba(247, 240, 232, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(247, 240, 232, 0.055) 1px, transparent 1px);
  background-size: 4px 4px;
  mix-blend-mode: soft-light;
}

.page {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
  padding: 1.35rem 0 4.5rem;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(18, 15, 20, 0.72);
  backdrop-filter: blur(14px);
}

.brand {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.brand::before {
  content: "";
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  margin-right: 0.55rem;
  border-radius: 999px;
  background: var(--archive-green);
}

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

.site-nav a {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.hero {
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1.22fr);
  gap: clamp(1.25rem, 3vw, 2.4rem);
  align-items: center;
  padding: clamp(0.5rem, 2vw, 1.2rem) 0 0;
}

.profile-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  min-height: 0;
  padding: 0;
  text-align: left;
  color: var(--text);
}

.hero-copy {
  position: relative;
  padding: clamp(0.4rem, 1.5vw, 1.1rem) 0;
  overflow: hidden;
}

.hero-copy::after {
  content: "portfolio";
  position: absolute;
  right: 0;
  top: 0.1rem;
  color: rgba(247, 240, 232, 0.035);
  mix-blend-mode: screen;
  font-size: clamp(3rem, 9vw, 7.8rem);
  font-weight: 900;
  line-height: 0.75;
  text-transform: uppercase;
  pointer-events: none;
}

.pfp {
  width: 100%;
  aspect-ratio: 0.82;
  object-fit: cover;
  object-position: center 40%;
  border: 1px solid rgba(247, 240, 232, 0.18);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  filter: saturate(1.08) contrast(1.04);
}

.profile-copy {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 0 0.15rem;
}

.profile-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.profile-role {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.5;
}

.eyebrow,
.heading p {
  margin: 0;
  color: var(--archive-green);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  margin-top: 0.9rem;
  font-size: clamp(3.4rem, 9vw, 7rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(1.7rem, 3.8vw, 2.7rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  font-size: 1.08rem;
  line-height: 1.2;
}

.intro {
  max-width: 42rem;
  margin: 1.2rem 0 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 1rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.9rem 1.2rem;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(247, 240, 232, 0.08);
  cursor: pointer;
  font-weight: 800;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(196, 109, 95, 0.14);
  border-color: var(--accent);
}

.button-solid {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  border-color: rgba(93, 77, 122, 0.55);
  color: #fffaf8;
}

.hero-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.6rem;
}

.hero-notes span {
  padding: 0.65rem 0.82rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(247, 240, 232, 0.065);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.hero-showcase {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 1.05fr 1.25fr;
  gap: 0.7rem;
  margin-top: 1.6rem;
  min-height: 12rem;
}

.hero-showcase img {
  width: 100%;
  height: 100%;
  min-height: 10rem;
  object-fit: cover;
  border: 1px solid rgba(247, 240, 232, 0.16);
  border-radius: 14px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.22);
}

.hero-showcase img:nth-child(2) {
  transform: translateY(1rem);
}

.hero-showcase img:nth-child(3) {
  transform: translateY(-0.35rem);
}

.hero-showcase img:nth-child(4) {
  transform: translateY(0.65rem);
}

.section {
  padding-top: 3rem;
}

.section:not(#portfolio) {
  content-visibility: auto;
  contain-intrinsic-size: 1px 34rem;
}

#portfolio {
  margin-top: 3rem;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(247, 240, 232, 0.07), rgba(247, 240, 232, 0.025)),
    rgba(9, 8, 11, 0.42);
  box-shadow: var(--shadow);
}

.compact {
  padding-top: 2.2rem;
}

.heading {
  margin-bottom: 1rem;
}

.heading p {
  margin-bottom: 0.45rem;
}

.gallery-grid,
.about-grid {
  display: grid;
  gap: 1rem;
}

.gallery-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  align-items: stretch;
}

.gallery-grid.gallery-natural-flow {
  display: block;
  column-count: 4;
  column-gap: 1rem;
}

.about-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gallery-card,
.about-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.gallery-card {
  position: relative;
  grid-column: span 3;
  min-height: 18rem;
  content-visibility: auto;
  contain-intrinsic-size: 19rem 24rem;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.gallery-natural-flow .gallery-card {
  display: inline-block;
  width: 100%;
  min-height: 0;
  margin: 0 0 1rem;
  break-inside: avoid;
}

.gallery-card:hover,
.gallery-card:focus-within {
  transform: translateY(-4px);
  border-color: rgba(240, 109, 143, 0.5);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
}

.card-featured {
  grid-column: span 6;
  grid-row: span 2;
  min-height: 34rem;
}

.card-wide {
  grid-column: span 6;
}

.card-portrait {
  min-height: 25rem;
}

.card-character {
  min-height: 27rem;
}

.gallery-natural-flow .card-character {
  min-height: 0;
}

.card-logo {
  min-height: 16rem;
}

.about-card {
  padding: 1.35rem;
}

.about-card p {
  margin: 0.7rem 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.media-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  appearance: none;
  background: #0f0c12;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.gallery-card .media-frame {
  aspect-ratio: auto;
  min-height: inherit;
}

.gallery-natural-flow .gallery-card .media-frame {
  min-height: 0;
}

.media-frame img,
.media-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  background: #110e14;
}

.card-contain .media-frame,
.card-logo .media-frame,
.card-pixel .media-frame {
  padding: 1rem;
}

.card-contain .media-frame img,
.card-contain .media-frame video,
.card-logo .media-frame img,
.card-logo .media-frame video,
.card-pixel .media-frame img,
.card-pixel .media-frame video {
  object-fit: contain;
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 18%, rgba(247, 240, 232, 0.16), transparent 44%),
    rgba(247, 240, 232, 0.055);
}

.card-character .media-frame {
  padding: 1.25rem;
}

.card-character .media-frame img,
.card-character .media-frame video {
  object-fit: contain;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.28));
}

.card-natural .media-frame {
  padding: 0;
}

.card-natural .media-frame img,
.card-natural .media-frame video {
  height: auto;
  object-fit: initial;
  border-radius: 0;
  background: transparent;
  filter: none;
}

.card-pixel .media-frame img,
.card-pixel .media-frame video {
  image-rendering: pixelated;
}

.card-capsule .media-frame img,
.card-capsule .media-frame video,
.card-wide .media-frame img,
.card-wide .media-frame video {
  object-fit: cover;
}

.card-meta {
  position: absolute;
  inset: auto 0 0;
  padding: 4.5rem 1rem 1rem;
  background: linear-gradient(180deg, transparent, rgba(10, 8, 12, 0.82) 58%, rgba(10, 8, 12, 0.96));
  pointer-events: none;
}

.card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.3;
}

.card-tag {
  display: inline-block;
  margin-top: 0.45rem;
  color: rgba(247, 240, 232, 0.72);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card-index {
  display: block;
  width: fit-content;
  margin-bottom: 0.45rem;
  padding: 0.18rem 0.45rem;
  border: 1px solid rgba(247, 240, 232, 0.2);
  border-radius: 999px;
  color: rgba(247, 240, 232, 0.76);
  background: rgba(18, 15, 20, 0.52);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.1rem;
}

.tabs-primary {
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(247, 240, 232, 0.06);
}

.tabs-secondary {
  margin-top: -0.2rem;
  margin-bottom: 1.2rem;
}

.category-description {
  max-width: 48rem;
  margin: -0.25rem 0 0.95rem;
  padding-left: 0.85rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  line-height: 1.6;
}

.tab {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(247, 240, 232, 0.075);
  padding: 0.78rem 0.95rem;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
}

.tab[aria-selected="true"] {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(240, 109, 143, 0.2), rgba(141, 117, 255, 0.18));
  color: var(--text);
}

.tab-primary {
  min-height: 3.15rem;
}

.tab-secondary {
  padding: 0.58rem 0.76rem;
  border-style: dashed;
  font-size: 0.86rem;
}

.gallery-actions {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.mail-link {
  display: inline-flex;
  align-items: center;
  min-height: 3.1rem;
  padding: 0.95rem 1.2rem;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(247, 240, 232, 0.08);
  font-weight: 800;
  box-shadow: var(--shadow);
}

.lightbox {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(28, 19, 17, 0.82);
  z-index: 100;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-figure {
  margin: 0;
  max-width: min(92vw, 1200px);
  max-height: 88vh;
}

.lightbox-figure img,
.lightbox-figure video {
  max-width: 100%;
  max-height: calc(88vh - 3rem);
  border-radius: 10px;
  background: var(--surface-strong);
}

.lightbox-figure figcaption {
  margin-top: 0.85rem;
  text-align: center;
  color: #f5e9e3;
}

.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fffaf8;
  padding: 0.7rem 1rem;
  cursor: pointer;
}

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

  .profile-panel {
    max-width: 34rem;
  }

  .about-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-card {
    grid-column: span 6;
  }

  .gallery-grid.gallery-natural-flow {
    column-count: 3;
  }

  .card-featured,
  .card-wide {
    grid-column: span 12;
  }
}

@media (max-width: 760px) {
  .page {
    width: min(calc(100% - 1.1rem), var(--max-width));
    padding-top: 1rem;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    gap: 0.8rem;
  }

  .hero {
    gap: 1.2rem;
  }

  .profile-panel {
    max-width: none;
  }

  .pixel-field {
    background-position: 43% top;
  }

  .hero-showcase {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: auto;
  }

  .hero-showcase img {
    min-height: 9rem;
  }

  h1 {
    font-size: clamp(3.1rem, 19vw, 4.8rem);
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid.gallery-natural-flow {
    column-count: 1;
  }

  .gallery-card,
  .card-featured,
  .card-wide {
    grid-column: auto;
    min-height: 21rem;
  }

  .card-capsule,
  .card-logo,
  .card-pixel {
    min-height: 16rem;
  }
}

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

  .pixel-field {
    background:
      radial-gradient(circle at 50% 24%, rgba(118, 88, 180, 0.2), transparent 28rem),
      linear-gradient(180deg, rgba(8, 7, 13, 0.34), rgba(8, 7, 13, 0.72) 58%, rgba(8, 7, 13, 0.94)),
      url("assets/backgrounds/pixel-world-sprites.png") center top / cover no-repeat;
  }
}
