:root {
  --bg: #000000;
  --text: #f5efe7;
  --muted: #a39b91;
  --accent: #ff9a4d;
  --glass: rgba(16, 12, 9, 0.62);
  --glass-border: rgba(245, 239, 231, 0.14);
  --paper: #f5efe7;
  --paper-ink: #14110f;
  --font-display: "Anton", Impact, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
}

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

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 154, 77, 0.45) #000;
}

/* ---------- LOADER ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.65s ease, visibility 0.65s ease;
}

.loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-inner {
  width: min(360px, 84vw);
  text-align: center;
}

.loader-name {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  letter-spacing: 0.06em;
  color: var(--text);
}

.loader-role {
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.loader-bar-track {
  margin: 22px auto 10px;
  width: 100%;
  height: 2px;
  background: rgba(245, 239, 231, 0.14);
  overflow: hidden;
  border-radius: 2px;
}

.loader-bar-fill {
  width: 0%;
  height: 100%;
  background: var(--accent);
  transition: width 0.12s linear;
}

.loader-percent {
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  letter-spacing: 0.1em;
}

/* ---------- TOP BAR ---------- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: 60px;
  padding: 0 clamp(16px, 4vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0));
}

.brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  color: var(--text);
  text-decoration: none;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 26px);
}

.nav-btn {
  background: none;
  border: 0;
  padding: 6px 2px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.25s ease;
  position: relative;
}

.nav-btn:hover,
.nav-btn.is-active {
  color: var(--text);
}

.nav-btn.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
}

.top-progress-track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(245, 239, 231, 0.08);
}

.top-progress-fill {
  width: 0%;
  height: 100%;
  background: var(--accent);
}

/* ---------- FILM STAGE ---------- */
.stage {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  pointer-events: none;
}

.film-mover {
  transform: translate3d(var(--film-x, 22vw), 0, 0);
  will-change: transform;
  display: flex;
  align-items: center;
  justify-content: center;
}

.film-mask {
  position: relative;
  width: min(100vw, 177.7778vh);
  height: min(56.25vw, 100vh);
  -webkit-mask-image:
    linear-gradient(to right, transparent 0%, #000 10%, #000 90%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, #000 9%, #000 91%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent 0%, #000 10%, #000 90%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, #000 9%, #000 91%, transparent 100%);
  mask-composite: intersect;
}

.film-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

.stage-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 48%, rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
}

/* ---------- CONTACT SVG FRAME ---------- */
.contact-frame-wrap {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(calc(-50% + var(--film-x, 0vw)), -50%);
  width: min(32vw, 420px);
  height: min(62vh, 520px);
  opacity: 0;
  pointer-events: none;
}

.contact-frame-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

#contact-frame-rect {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 12px rgba(255, 154, 77, 0.45));
}

/* ---------- SECTIONS OVERLAY ---------- */
.sections {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

.scene {
  position: absolute;
  inset: 0;
  padding: 84px clamp(20px, 5vw, 68px) 48px;
  display: flex;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  will-change: opacity, transform;
}

.scene.is-visible {
  visibility: visible;
  pointer-events: auto;
}

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.eyebrow-dark {
  color: #b85c14;
}

.section-heading {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.2vw, 3.3rem);
  line-height: 1.03;
  letter-spacing: 0.015em;
  margin: 0 0 14px;
  font-weight: 400;
  color: var(--text);
}

.glass-panel {
  background: var(--glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: clamp(22px, 3vw, 34px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

/* ---------- 00 INTRO ---------- */
.scene-intro {
  justify-content: flex-start;
}

.intro-content {
  max-width: 580px;
}

.intro-greeting {
  margin: 0 0 8px;
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.intro-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 7.6vw, 6.4rem);
  line-height: 0.96;
  letter-spacing: 0.01em;
  font-weight: 400;
  text-transform: uppercase;
}

.intro-title .line-1 {
  display: block;
  color: var(--text);
}

.intro-title .line-2 {
  display: block;
  color: var(--accent);
}

.intro-role {
  margin: 18px 0 14px;
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  font-weight: 500;
  color: var(--text);
}

.intro-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(16, 12, 9, 0.62);
  border: 1px solid var(--glass-border);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 10px #4ade80;
}

/* ---------- 01 ABOUT ---------- */
.scene-about {
  justify-content: flex-start;
}

.about-panel {
  width: min(490px, 92vw);
}

.about-text {
  margin: 0 0 22px;
  font-size: 0.98rem;
  line-height: 1.65;
  color: rgba(245, 239, 231, 0.88);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  border-top: 1px solid var(--glass-border);
  padding-top: 18px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.5vw, 2.1rem);
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  margin-top: 6px;
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.35;
}

/* ---------- 02 WORK ---------- */
.scene-work {
  justify-content: flex-end;
}

.work-shell {
  width: min(660px, 56vw);
  max-height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
}

.work-header {
  margin-bottom: 12px;
}

.work-header .section-heading {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  margin-bottom: 0;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  perspective: 1100px;
}

.work-card {
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  will-change: transform, opacity;
}

.work-card:hover {
  border-color: rgba(255, 154, 77, 0.55);
  background: rgba(28, 21, 16, 0.78);
}

.work-thumb {
  width: 78px;
  height: 54px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #12100e;
}

.work-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.work-meta {
  min-width: 0;
}

.work-card-title {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.work-card-tags {
  margin-top: 2px;
  font-size: 0.67rem;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.work-card-desc {
  margin: 3px 0 0;
  font-size: 0.69rem;
  color: var(--muted);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 03 SKILLS ---------- */
.scene-skills {
  justify-content: flex-start;
}

.skills-panel {
  width: min(480px, 92vw);
}

.skills-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-chip {
  padding: 9px 15px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text);
  background: rgba(255, 154, 77, 0.12);
  border: 1px solid rgba(255, 154, 77, 0.34);
  will-change: transform, filter, opacity;
}

/* ---------- 04 RESUME (LIGHT PAPER CARD) ---------- */
.scene-resume {
  justify-content: flex-end;
}

.paper-card {
  width: min(460px, 92vw);
  background: var(--paper);
  color: var(--paper-ink);
  border-radius: 18px;
  padding: clamp(22px, 3vw, 32px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.72);
  will-change: transform, opacity;
}

.paper-heading {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  margin: 0 0 4px;
  line-height: 1.05;
  font-weight: 400;
}

.paper-subtitle {
  margin: 0 0 18px;
  font-size: 0.82rem;
  color: #575049;
}

.paper-block {
  border-top: 1px solid rgba(20, 17, 15, 0.14);
  padding: 14px 0;
}

.paper-block-title {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #b85c14;
}

.paper-item-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
}

.paper-item-meta {
  margin: 3px 0 6px;
  font-size: 0.78rem;
  color: #575049;
}

.paper-item-desc {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #2f2a26;
}

.paper-footer {
  margin-top: 10px;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 10px;
  background: #14110f;
  color: var(--paper);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn-download:hover {
  background: #b85c14;
  transform: translateY(-1px);
}

/* ---------- 05 CONTACT ---------- */
.scene-contact {
  justify-content: flex-start;
}

.contact-panel {
  width: min(440px, 92vw);
}

.contact-subtitle {
  margin: 0 0 18px;
  font-size: 0.92rem;
  line-height: 1.55;
  color: rgba(245, 239, 231, 0.85);
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(245, 239, 231, 0.06);
  border: 1px solid var(--glass-border);
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.contact-link:hover {
  border-color: var(--accent);
  background: rgba(255, 154, 77, 0.14);
}

.contact-link-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.site-footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent);
}

/* ---------- SCROLL HINT ---------- */
.scroll-hint {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.scroll-hint.is-hidden {
  opacity: 0;
}

.scroll-hint-line {
  width: 1px;
  height: 26px;
  background: linear-gradient(to bottom, var(--accent), transparent);
}

/* ---------- LIGHTBOX ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 24px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: rgba(16, 12, 9, 0.85);
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-content {
  max-width: min(920px, 94vw);
  text-align: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 74vh;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  display: block;
  margin: 0 auto;
}

.lightbox-caption {
  margin-top: 14px;
}

.lightbox-caption h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.lightbox-caption p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
}

/* ---------- TABLET & MOBILE (900px AND BELOW) ---------- */
@media (max-width: 900px) {
  .film-mover {
    transform: translate3d(0, 0, 0) !important;
  }

  .film-mask {
    width: max(100vw, 177.7778vh);
    height: 100vh;
  }

  /* Every panel sits at the bottom over a dark gradient, never over face */
  .scene {
    align-items: flex-end;
    justify-content: center !important;
    padding: 68px 20px 26px;
    background: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.94) 0%,
      rgba(0, 0, 0, 0.76) 38%,
      rgba(0, 0, 0, 0) 64%
    );
  }

  .scene-intro {
    padding-bottom: 72px;
  }

  .intro-content,
  .about-panel,
  .skills-panel,
  .paper-card,
  .contact-panel,
  .work-shell {
    width: min(640px, 100%);
    max-width: 100%;
  }

  .contact-frame-wrap {
    top: 26%;
    transform: translate(-50%, -50%);
    width: min(56vw, 380px);
    height: 36vh;
  }
}

/* ---------- MOBILE (760px AND BELOW) ---------- */
@media (max-width: 760px) {
  .topbar {
    height: 52px;
    padding: 0 10px;
    gap: 8px;
  }

  .brand {
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    flex-shrink: 0;
  }

  .nav-links {
    gap: 7px;
    flex-wrap: nowrap;
  }

  .nav-btn {
    font-size: 0.6rem;
    letter-spacing: 0.02em;
    padding: 6px 1px;
  }

  /* Film fills screen height & stays centered */
  .film-mover {
    transform: translate3d(0, 0, 0) !important;
  }

  .film-mask {
    width: max(100vw, 177.7778vh);
    height: 100vh;
  }

  /* Every panel sits at the bottom over a dark gradient, never over face */
  .scene {
    align-items: flex-end;
    justify-content: center !important;
    padding: 64px 14px 20px;
    background: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.94) 0%,
      rgba(0, 0, 0, 0.76) 38%,
      rgba(0, 0, 0, 0) 64%
    );
  }

  .scene-intro {
    padding-bottom: 68px;
  }

  .intro-content,
  .about-panel,
  .skills-panel,
  .paper-card,
  .contact-panel,
  .work-shell {
    width: 100%;
    max-width: 100%;
  }

  .intro-title {
    font-size: clamp(2.5rem, 11vw, 3.4rem);
  }

  .glass-panel,
  .paper-card {
    padding: 16px;
    border-radius: 16px;
  }

  .section-heading,
  .paper-heading {
    font-size: 1.55rem;
    margin-bottom: 8px;
  }

  .about-text {
    font-size: 0.84rem;
    margin-bottom: 12px;
  }

  .work-shell {
    max-height: 46vh;
  }

  .work-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    overflow-y: auto;
    padding-right: 2px;
  }

  .work-card {
    padding: 6px;
    gap: 7px;
  }

  .work-thumb {
    width: 44px;
    height: 36px;
  }

  .work-card-desc {
    display: none;
  }

  .skill-chip {
    padding: 6px 11px;
    font-size: 0.75rem;
  }

  /* Contact SVG frame wraps only upper body on mobile */
  .contact-frame-wrap {
    top: 26%;
    transform: translate(-50%, -50%);
    width: 72vw;
    height: 40vh;
  }

  .scroll-hint {
    bottom: 10px;
  }
}
