/* ---------- Base / Theme ---------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  overflow-x: hidden;
}

:root {
  --bg: #0b0b12;
  --bg-2: #121224;
  --text: #e7e7ea;
  --muted: #b8b8c2;
  --brand: #6b4bff;
  --ring: rgba(255, 255, 255, 0.171);
  --radius: 16px;
  --shadow: 5px 10px 30px rgba(121, 100, 100, 0.35);
  --hover-shadow: 0 18px 40px rgba(184, 158, 8, 0.35);
  --panel: #0f0f1d;
  --overlay: rgba(10, 10, 18, 0.72);
  --speed: 420ms;
}

body {
  margin: 0;
  font: 0.95rem/1.55 system-ui, -apple-system, Segoe UI, Roboto, Inter, sans-serif;
  color: var(--text);
  background: linear-gradient(90deg, var(--bg), #1a1530 60%, #2a1b4a);
  display: grid;
  place-items: center;
  gap: clamp(16px, 2vw, 28px);
}

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

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

ul {
  padding: 0;
  margin: 0;
  list-style: none;
}

h1 {
  font-weight: 800;
  font-size: clamp(1.75rem, 2.4vw, 2.25rem);
}

h2 {
  font-weight: 800;
  font-size: clamp(1.35rem, 1.8vw, 1.75rem);
}

h3 {
  font-weight: 700;
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 10px;
}

/* ---------- Page gutters ---------- */
header,
main,
footer {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 1rem;
}

/* ---------- Header ---------- */
header {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 1rem;
  padding-block: 0.75rem;
}

header .site-branding h1 {
  font-size: clamp(1rem, 1.2rem + 1vw, 1.75rem);
  margin: 0;
  animation: 3s spin ease-in-out 1s infinite;
}

@keyframes spin {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.5);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes on-load {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#projects h2,
#skills h2,
#about-me h2,
#contact h2,
#intro h2 {
  animation: on-load 3000ms ease both;
}

header nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(0.3rem, 1.2vw, 1.2rem);
  min-width: 0;
}

header nav li {
  min-width: 0;
  flex: 0 1 auto;
}

header nav a {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  white-space: nowrap;
  font-size: clamp(0.9rem, 0.85rem + 0.2vw, 1rem);
  background: transparent;
  transition: background-color 200ms ease, color 200ms ease;
}

header nav a:hover {
  background: var(--ring);
}

/* ---------- Shared section helpers ---------- */
.rooms-feature {
  display: grid;
  gap: 0.75rem;
  place-items: center;
  place-content: center;
}

.rooms-feature .feature-note {
  margin: 0.25rem auto 0;
  max-width: min(70ch, 95%);
  color: var(--muted);
  background: var(--bg-2);
  border: 1px solid var(--ring);
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- Generic section spacing ---------- */
section {
  padding-block: 1rem;
}

#about h2,
#skills h2,
#projects h2,
#contact h2,
#about-me h2 {
  text-align: center;
  margin-bottom: 1rem;
}

/* ---------- Projects grid ---------- */
#projects {
  width: 100%;
}

.room-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  width: 100%;
  align-items: stretch;
}

.room-cards > li {
  min-width: 0;
}

.room-cards article {
  background: var(--bg-2);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: auto auto;
  min-height: 100%;
  transition: transform 300ms ease, box-shadow 300ms ease;
}

.room-cards article:hover {
  transform: translateY(-4px);
  box-shadow: var(--hover-shadow);
}

.room-cards figure {
  margin: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100%;
}

.room-cards li figure > video {
  width: 100%;
  height: 220px;
 object-fit: contain;
  background: #0a0a12;
}

.room-cards figcaption {
  padding: 0.9rem 1rem;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.95rem;
}

.room-cards article > div {
  margin-top: auto;
}

/* ---------- Skills ---------- */
#skills {
  width: 100%;
  max-width: 900px;
  margin-inline: auto;
  padding: 1.5rem 1rem;
}

.about-highlights {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
}

.about-highlights li {
  min-width: 0;
}

.about-highlights figure {
  height: 100%;
  background: var(--bg-2);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  text-align: center;
}

.about-highlights figcaption {
  padding: 1rem;
  color: var(--muted);
  line-height: 1.5;
}

.about-highlights i {
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
  color: var(--text);
}

/* ---------- Contact ---------- */
#contact p a,
#contact p span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* ---------- Footer ---------- */
footer {
  text-align: center;
  color: var(--muted);
  padding-bottom: 2rem;
}

/* ---------- Responsive ---------- */
@media (min-width: 700px) {
  .room-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .room-cards li figure > video {
    height: 240px;
  }
}

@media (min-width: 900px) {
  header {
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
  }

  .site-branding {
    grid-column: 2;
    justify-self: center;
  }

  header nav {
    grid-column: 3;
    justify-self: end;
  }

  header nav ul {
    justify-content: flex-end;
  }
}

@media (min-width: 1100px) {
  .room-cards li figure > video {
    height: 250px;
  }
}

@media (max-width: 480px) {
  header,
  main,
  footer {
    padding-inline: 0.75rem;
  }

  .room-cards {
    gap: 1rem;
  }

  .room-cards li figure > video {
    height: 200px;
  }

  .room-cards figcaption {
    font-size: 0.92rem;
    padding: 0.85rem 0.9rem;
  }

  .rooms-feature .feature-note {
    padding: 0.8rem 0.9rem;
  }
}