:root {
  --white: #ffffff;
  --text: #111111;
  --muted: #6b6b6b;
  --border: #e5e5e5;
  --glass: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(255, 255, 255, 0.7);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Poppins", sans-serif;
  color: var(--text);
  background: var(--white);
}

body {
  overflow-x: hidden;
}

body.nav-open {
  overflow: hidden;
}

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

.container {
  width: min(1200px, 90%);
  margin: 0 auto;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--glass);
  border-bottom: 1px solid var(--glass-border);
  z-index: 100;
  transition: background 0.25s ease, border-color 0.25s ease;
  backdrop-filter: blur(14px);
}

.site-header.scrolled {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(255, 255, 255, 0.85);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  position: relative;
  z-index: 1;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.logo img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 6px;
  
}

.nav-toggle,
.nav-close {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  cursor: pointer;
  position: relative;
  backdrop-filter: blur(8px);
}

.nav-toggle span,
.nav-close span {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 2px;
  background: #111111;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle span:nth-child(1) {
  top: 16px;
}

.nav-toggle span:nth-child(2) {
  top: 26px;
}

.nav-close span:nth-child(1) {
  top: 21px;
  transform: rotate(45deg);
}

.nav-close span:nth-child(2) {
  top: 21px;
  transform: rotate(-45deg);
}

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.92);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(16px);
}

.nav-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.nav-overlay-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}

.nav-overlay-inner a {
  text-decoration: none;
  color: var(--text);
  font-size: clamp(1.4rem, 4vw, 2.6rem);
  font-weight: 500;
}

.nav-close {
  position: absolute;
  top: 24px;
  right: 24px;
}

.hero {
  position: relative;
  padding-top: 0;
  background: var(--white);
  min-height: 100vh;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  min-height: 100svh;
  z-index: 1;
}

.hero-sequence {
  position: relative;
  height: 100svh;
  min-height: 100vh;
  overflow: hidden;
  background: transparent;
}

#waveLines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.5;
  pointer-events: none;
}

#sequence-canvas {
  width: 100%;
  height: 100%;
  display: block;
  position: relative;
  z-index: 1;
  background: transparent;
}

.hero-text {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: clamp(80px, 10vh, 120px) 8vw 0;
  z-index: 2;
}

.hero-text-inner {
  position: relative;
  max-width: 420px;
  text-align: left;
  opacity: 0;
  background: transparent;
  border: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  will-change: transform, opacity;
  overflow: hidden;
}

.hero-credits {
  display: grid;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.68rem;
  color: rgba(17, 17, 17, 0.7);
  margin-bottom: 14px;
}

.hero-credits-bottom {
  position: static;
  margin-top: 12px;
  display: grid;
  gap: 4px;
  align-content: start;
  will-change: transform;
}

.hero-credits-bottom span:empty {
  display: block;
  height: 0.85rem;
  line-height: 0;
  font-size: 0;
}

.hero-credits-bottom span.is-gap {
  display: block;
  height: 0.85rem;
  line-height: 0;
  font-size: 0;
}

.credits-vertical-track {
  display: grid;
  gap: inherit;
  will-change: transform;
}

.credits-vertical-chunk {
  display: grid;
  gap: inherit;
}

.credits-loop-gap {
  height: clamp(18px, 2.4vh, 32px);
}

.hero-text h1 {
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1.1;
  margin: 0 0 12px;
}

.hero-text p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.section-title {
  margin: 80px 0 40px;
}

.section-title h2 {
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.section-title p {
  color: var(--muted);
  margin: 0;
}

.about {
  background: var(--white);
}

.about-pin {
  position: relative;
  width: 100%;
  overflow-x: hidden;
  overflow-y: visible;
  padding-bottom: 12px;
}

.about-track {
  display: flex;
  gap: 28px;
  padding: 0 5% 60px;
}

.team-card {
  flex: 0 0 320px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.82);
  padding: 20px;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  backdrop-filter: blur(10px);
}

.team-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 1px solid var(--border);
}

.team-card h3 {
  margin: 14px 0 6px;
  font-size: 1.15rem;
  font-weight: 600;
}

.team-card span {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}

.team-card p {
  font-size: 0.92rem;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.6;
}

.team-card.is-active {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.portfolio {
  padding: 40px 0 80px;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.portfolio-card {
  border: 1px solid rgba(255, 255, 255, 0.7);
  padding: 20px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  background: rgba(255, 255, 255, 0.85);
  position: relative;
  backdrop-filter: blur(10px);
}

.portfolio-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.portfolio-meta {
  display: block;
  margin-top: 14px;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.portfolio-card h3 {
  margin-top: 0;
  position: relative;
  display: inline-block;
}

.portfolio-card h3::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0%;
  height: 1px;
  background: rgba(0, 0, 0, 0.4);
  transition: width 0.25s ease;
}

.portfolio-card:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.portfolio-card:hover h3::after {
  width: 100%;
}

.portfolio-empty {
  grid-column: 1 / -1;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.footer-links a {
  display: inline-block;
  margin-right: 16px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
}

.project-page,
.admin-page {
  min-height: 100vh;
  padding: 100px 0 60px;
}

.project-detail {
  width: min(840px, 92%);
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  text-decoration: none;
  color: #111;
  border-bottom: 1px solid rgba(17, 17, 17, 0.25);
  padding-bottom: 2px;
}

.project-title {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3rem);
}

.project-meta {
  margin: 10px 0 22px;
  color: var(--muted);
}

.project-thumb {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.project-summary {
  margin-top: 18px;
  font-weight: 500;
}

.project-description {
  color: #303030;
  line-height: 1.75;
}

.project-block {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.project-block h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.project-creators,
.project-soundtrack-empty {
  margin: 0;
  color: #2f2f2f;
  line-height: 1.7;
}

.project-audio {
  width: 100%;
  margin-top: 4px;
}

.project-soundtrack-link {
  color: #111;
  text-decoration: none;
  border-bottom: 1px solid rgba(17, 17, 17, 0.25);
}

.admin-shell {
  width: min(1200px, 92%);
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.admin-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-head .back-link {
  margin-bottom: 0;
}

.admin-auth {
  display: block;
}

#adminDashboard {
  display: none;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
}

.admin-card {
  border: 1px solid var(--border);
  background: #fff;
  padding: 20px;
}

.admin-card h2 {
  margin-top: 0;
}

.admin-form {
  display: grid;
  gap: 12px;
}

.admin-form label {
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
  color: #3a3a3a;
}

.admin-form input,
.admin-form textarea {
  border: 1px solid var(--border);
  padding: 10px 12px;
  font: inherit;
}

.admin-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.admin-actions button,
.project-list-actions button,
.project-list-actions a {
  border: 1px solid #111;
  background: #111;
  color: #fff;
  padding: 9px 12px;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
}

.admin-actions .ghost-btn,
.project-list-actions .danger-btn {
  background: #fff;
  color: #111;
}

.ghost-btn {
  border: 1px solid #111;
  background: #fff;
  color: #111;
  padding: 9px 12px;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
}

#logoutButton {
  display: none;
}

.admin-message {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: #b42318;
}

.admin-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-upload-message {
  font-size: 0.8rem;
  color: var(--muted);
}

.thumb-preview {
  display: none;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.project-list {
  display: grid;
  gap: 10px;
}

.project-list-item {
  border: 1px solid var(--border);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.project-list-info {
  display: grid;
  gap: 4px;
}

.project-list-info span {
  font-size: 0.8rem;
  color: var(--muted);
}

.project-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

  .hero-text {
    justify-content: center;
    text-align: center;
    padding: 8vh 12vw 0;
    align-items: flex-start;
  }

  .hero-text-inner {
    max-width: 420px;
    text-align: center;
  }

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

  .footer-inner {
    flex-direction: column;
  }

  .footer {
    position: relative;
    z-index: 5;
    background: var(--white);
  }

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

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

@media (max-width: 768px) {
  .hero-credits-bottom {
    width: 100%;
    overflow: hidden;
    margin-top: 14px;
    letter-spacing: normal;
    text-align: center;
    justify-items: center;
  }

  .credits-marquee-track {
    display: flex;
    width: max-content;
    align-items: center;
  }

  .credits-marquee-chunk {
    display: flex;
    align-items: center;
    gap: 24px;
    padding-right: 24px;
  }

  .credits-marquee-item {
    min-width: 180px;
    display: grid;
    gap: 2px;
    padding-right: 8px;
    border-right: 1px solid rgba(17, 17, 17, 0.12);
  }

  .credits-role,
  .credits-name {
    display: block;
    font-style: normal;
    transform: none;
    line-height: 1.3;
  }

  .credits-role {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.62rem;
    color: rgba(17, 17, 17, 0.62);
  }

  .credits-name {
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    color: rgba(17, 17, 17, 0.9);
    white-space: nowrap;
  }
}
