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

:root {
  --black: #080808;
  --white: #f0ede6;
  --acid: #c8ff00;
  --orange: #ff4d00;
  --dim: #1a1a1a;
  --mid: #333;

  /* fixed: always dark text on acid-colored backgrounds */
  --on-acid: #080808;
  /* acid as text color — switched to a darker shade in light mode for readability */
  --accent-text: var(--acid);
  /* card hover — slightly darker than --dim */
  --dim-hover: #111;

  /* foreground-alpha helpers (values flip in light mode) */
  --fg-70: rgba(240, 237, 230, 0.7);
  --fg-60: rgba(240, 237, 230, 0.6);
  --fg-55: var(--fg-55);
  --fg-50: rgba(240, 237, 230, 0.5);
  --fg-40: rgba(240, 237, 230, 0.4);
  --fg-30: rgba(240, 237, 230, 0.3);
  --fg-25: var(--fg-25);
  --fg-20: rgba(240, 237, 230, 0.2);
  --fg-15: var(--fg-15);
  --fg-10: rgba(240, 237, 230, 0.1);
}

/* ── LIGHT MODE ───────────────────────────────────────────── */
body.light-mode {
  --black: #f2efe8;
  --white: #141414;
  --dim: #e5e1d9;
  --mid: #b8b3aa;
  --dim-hover: #d8d3cb;
  --acid: #a5773a;
  --orange: #5a3d2e;
  --accent-text: #a5773a;
  --on-acid: #ffffff;

  --fg-70: rgba(20, 20, 20, 0.7);
  --fg-60: rgba(20, 20, 20, 0.6);
  --fg-55: rgba(20, 20, 20, 0.55);
  --fg-50: rgba(20, 20, 20, 0.5);
  --fg-40: rgba(20, 20, 20, 0.4);
  --fg-30: rgba(20, 20, 20, 0.3);
  --fg-25: rgba(20, 20, 20, 0.25);
  --fg-20: rgba(20, 20, 20, 0.2);
  --fg-15: rgba(20, 20, 20, 0.15);
  --fg-10: rgba(20, 20, 20, 0.1);
}
body.light-mode nav {
  mix-blend-mode: normal;
  background: rgba(242, 239, 232, 0);
  /* backdrop-filter: blur(10px); */
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--black);
  color: var(--white);
  transition:
    background-color 0.35s ease,
    color 0.35s ease;
  font-family: "Noto Sans TC", sans-serif;
  overflow-x: hidden;
  cursor: none;
}

/* CUSTOM CURSOR */
.cursor {
  position: fixed;
  width: 12px;
  height: 12px;
  background: var(--acid);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition:
    transform 0.1s,
    width 0.2s,
    height 0.2s,
    background 0.2s;
  mix-blend-mode: difference;
}
.cursor.hover {
  width: 40px;
  height: 40px;
  background: var(--orange);
}

/* NOISE OVERLAY */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.035;
  pointer-events: none;
  z-index: 100;
}

/* NAV */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 48px;
  mix-blend-mode: difference;
}
.nav-logo {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.15em;
  color: var(--white);
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
}
.nav-links a {
  font-family: "Space Mono", monospace;
  font-size: 0.72rem;
  color: var(--white);
  text-decoration: none;
  letter-spacing: 0.1em;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.nav-links a:hover {
  opacity: 1;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--white);
  border-radius: 1px;
  transition:
    transform 0.35s ease,
    opacity 0.25s ease;
  transform-origin: center;
}

/* THEME TOGGLE */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--fg-30);
  color: var(--white);
  cursor: pointer;
  width: 32px;
  height: 32px;
  transition:
    border-color 0.2s,
    color 0.2s;
  flex-shrink: 0;
}
.theme-toggle:hover {
  border-color: var(--accent-text);
  color: var(--accent-text);
}
.theme-toggle svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-toggle .icon-moon {
  display: none;
}
body.light-mode .theme-toggle .icon-sun {
  display: none;
}
body.light-mode .theme-toggle .icon-moon {
  display: block;
}
body.light-mode .modal-swiper-prev,
body.light-mode .modal-swiper-next {
  background: rgba(20, 20, 20, 0.75);
  color: rgba(240, 237, 230, 0.8);
  border-color: rgba(20, 20, 20, 0.3);
}
body.light-mode .modal-swiper-prev:hover,
body.light-mode .modal-swiper-next:hover {
  border-color: var(--accent-text);
  color: var(--accent-text);
}
body.light-mode .clients-logos img {
  filter: brightness(0);
}
body.light-mode .clients-logos img:hover {
  filter: brightness(0) sepia(1) saturate(3) hue-rotate(10deg) brightness(0.8);
  opacity: 0.8;
}
body.light-mode .skill-card:hover .tag {
  border-color: rgba(165, 119, 58, 0.3);
  color: rgba(165, 119, 58, 0.7);
}

/* HERO */
#hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  overflow: hidden;
}

.hero-left {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 0 80px 48px;
  position: relative;
  z-index: 2;
}

.hero-tag {
  font-family: "Space Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  color: var(--accent-text);
  margin-bottom: 24px;
  opacity: 0;
  animation: fadeUp 0.8s 0.3s forwards;
}

.hero-name {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(5rem, 10vw, 10rem);
  line-height: 0.9;
  letter-spacing: 0.02em;
  color: var(--white);
  opacity: 0;
  animation: fadeUp 0.8s 0.5s forwards;
}
.hero-name span {
  color: var(--accent-text);
  display: block;
}

.hero-desc {
  margin-top: 32px;
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--fg-55);
  max-width: 380px;
  opacity: 0;
  animation: fadeUp 0.8s 0.7s forwards;
}

.hero-cta {
  margin-top: 48px;
  display: flex;
  gap: 16px;
  opacity: 0;
  animation: fadeUp 0.8s 0.9s forwards;
}

.btn-primary {
  background: var(--acid);
  color: var(--on-acid);
  font-family: "Space Mono", monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 14px 28px;
  min-width: 160px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  transition:
    transform 0.2s,
    background 0.2s;
}
.btn-primary:hover {
  background: var(--orange);
  transform: translate(-3px, -3px);
}

.btn-ghost {
  border: 1px solid var(--fg-30);
  color: var(--white);
  font-family: "Space Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  padding: 14px 28px;
  text-decoration: none;
  display: inline-block;
  transition:
    border-color 0.2s,
    transform 0.2s;
}
.btn-ghost:hover {
  border-color: var(--accent-text);
  transform: translate(-3px, -3px);
}

.hero-right {
  position: relative;
  overflow: hidden;
}

canvas#heroCanvas {
  /* border: 1px solid rgb(235, 0, 0); */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 0;
  right: 0;
  font-family: "Space Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--fg-30);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  opacity: 0;
  animation:
    fadeUp 1s 1.2s forwards,
    textPulse 3s 2.2s ease-in-out infinite;
}
.hero-scroll-hint::before {
  content: "";
  width: 2px;
  height: 60px;
  background: linear-gradient(to bottom, transparent, currentColor);
  display: block;
}

/* MARQUEE */
.marquee-wrap {
  background: var(--acid);
  overflow: hidden;
  padding: 14px 0;
  position: relative;
  z-index: 3;
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: 0;
  animation: marquee 18s linear infinite;
  white-space: nowrap;
}
.marquee-track span {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  color: var(--on-acid);
  padding: 0 40px;
}
.marquee-track span.dot {
  color: var(--orange);
  padding: 0;
}

/* SECTION COMMON */
section {
  padding: 120px 48px;
}

.section-label {
  font-family: "Space Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  color: var(--accent-text);
  margin-bottom: 16px;
  opacity: 0.8;
}

.section-title {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(3rem, 6vw, 6rem);
  line-height: 1;
  letter-spacing: 0.02em;
}

/* ABOUT */
#about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  border-top: 1px solid var(--mid);
}

.about-visual {
  position: relative;
  aspect-ratio: 1/1;
  overflow: hidden;
  background: var(--dim);
}

.about-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  z-index: 1;
}

.about-role-badge {
  position: absolute;
  top: 32px;
  left: 32px;
  background: var(--orange);
  color: var(--white);
  font-family: "Space Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  padding: 8px 16px;
}

.about-content p {
  font-size: 1rem;
  line-height: 1.9;
  color: var(--fg-70);
  margin-bottom: 24px;
}
.about-content strong {
  color: var(--accent-text);
  font-weight: 400;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--mid);
  margin-top: 48px;
  border: 1px solid var(--mid);
}
.stat {
  background: var(--black);
  padding: 24px 20px;
  text-align: center;
}
.stat-num {
  font-family: "Bebas Neue", sans-serif;
  font-size: 2.8rem;
  color: var(--accent-text);
  display: block;
  line-height: 1;
}
.stat-label {
  font-family: "Space Mono", monospace;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--fg-40);
  margin-top: 6px;
  display: block;
}

/* CLIENTS LOGO WALL */
.about-clients {
  padding-top: 28px;
  border-top: 1px solid var(--mid);
  margin-top: 48px;
}

.about-clients-label {
  font-family: "Space Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  color: var(--fg-30);
  margin-bottom: 36px;
}

.clients-logos {
  display: grid;
  grid-template-columns: repeat(4, 2fr);
  gap: 24px 0;
}

.clients-logos img {
  height: 30px;
  width: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.4;
  transition: opacity 0.3s;
}

.clients-logos img:hover {
  opacity: 0.9;
}

/* SKILLS */
#skills {
  border-top: 1px solid var(--mid);
  background: var(--dim);
}

.skills-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 72px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: var(--mid);
}

.skill-card {
  background: var(--black);
  padding: 40px 36px;
  position: relative;
  overflow: hidden;
  transition: background 0.3s;
  cursor: none;
}
.skill-card:hover {
  background: var(--dim-hover);
}
.skill-card:hover .skill-icon {
  color: var(--accent-text);
  animation: iconGlitch 0.35s steps(1) forwards;
}

.skill-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--acid);
  transition: width 0.4s;
}
.skill-card:hover::after {
  width: 100%;
}

.skill-icon {
  display: block;
  width: 40px;
  height: 40px;
  margin-bottom: 20px;
  color: var(--fg-50);
  transition: color 0.2s;
}

.skill-icon svg {
  width: 40px;
  height: 40px;
  display: block;
}

.skill-name {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.8rem;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  color: var(--white);
}

.skill-desc {
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--fg-50);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 20px;
}
.tag {
  font-family: "Space Mono", monospace;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  border: 1px solid var(--mid);
  color: var(--fg-50);
  padding: 4px 10px;
  transition:
    border-color 0.2s,
    color 0.2s;
}
.skill-card:hover .tag {
  border-color: rgba(200, 255, 0, 0.3);
  color: rgba(200, 255, 0, 0.7);
}

/* EXPERIENCE */
#experience {
  border-top: 1px solid var(--mid);
  background: var(--black);
}

.exp-header {
  margin-bottom: 72px;
}

.exp-list {
  display: flex;
  flex-direction: column;
  position: relative;
}

.exp-list::before {
  content: "";
  position: absolute;
  left: 180px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--acid), transparent);
  opacity: 0.15;
}

.exp-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 60px;
  padding: 48px 0;
  border-bottom: 1px solid var(--mid);
  position: relative;
  transition: background 0.3s;
}

.exp-item::before {
  content: "";
  position: absolute;
  left: 180px;
  top: 56px;
  width: 7px;
  height: 7px;
  background: var(--acid);
  transform: translateX(-50%);
  transition:
    transform 0.3s,
    background 0.3s;
}

.exp-item:hover::before {
  background: var(--orange);
  transform: translateX(-50%) scale(1.5);
}

.exp-left {
  text-align: right;
  padding-right: 40px;
  padding-top: 6px;
}

.exp-year {
  font-family: "Space Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  color: var(--accent-text);
  line-height: 1.6;
}

.exp-duration {
  font-family: "Space Mono", monospace;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--fg-20);
  margin-top: 6px;
}

.exp-right {
  padding-right: 40px;
}

.exp-top {
  margin-bottom: 16px;
}

.exp-company {
  font-family: "Bebas Neue", sans-serif;
  font-size: 2.4rem;
  letter-spacing: 0.05em;
  color: var(--white);
  line-height: 1;
  transition: color 0.2s;
}

.exp-item:hover .exp-company {
  color: var(--accent-text);
}

.exp-role {
  font-family: "Space Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  color: var(--orange);
  margin-top: 6px;
}

.exp-desc {
  font-size: 0.88rem;
  line-height: 1.9;
  color: var(--fg-55);
  max-width: 560px;
  margin-bottom: 20px;
}

/* WORKS */
#works {
  border-top: 1px solid var(--mid);
}

.works-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 72px;
}

/* WORKS TABS */
.works-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.works-tab {
  font-family: "Space Mono", monospace;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 10px 22px;
  flex: 1;
  text-align: center;
  background: transparent;
  border: 1px solid var(--mid);
  color: var(--fg-25);
  cursor: none;
  transition:
    color 0.25s,
    border-color 0.25s,
    background 0.25s;
  position: relative;
}

.works-tab::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 1px;
  background: var(--acid);
  transition: width 0.25s;
}

.works-tab:hover {
  color: var(--fg-60);
  border-color: color-mix(in srgb, var(--acid) 20%, transparent);
  border-top-color: color-mix(in srgb, var(--acid) 20%, transparent);
}

.works-tab.active {
  color: var(--accent-text);
  border-color: color-mix(in srgb, var(--acid) 50%, transparent);
  border-top-color: var(--accent-text);
  background: var(--dim);
}

.works-tab.active::after {
  width: 100%;
}

/* WORKS LIST */
.works-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.work-item.tab-hidden {
  display: none;
}

.works-empty {
  display: none;
  font-family: "Space Mono", monospace;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--fg-15);
  text-align: center;
  padding: 72px 0;
  border: 1px solid var(--mid);
  background: var(--dim);
}

.works-empty.visible {
  display: block;
}

.work-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: center;
  gap: 40px;
  padding: 32px 40px;
  background: var(--dim);
  border: 1px solid var(--mid);
  text-decoration: none;
  color: inherit;
  transition:
    background 0.3s,
    border-color 0.3s;
  position: relative;
  overflow: hidden;
  cursor: none;
}
.work-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--acid) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.4s;
  mix-blend-mode: overlay;
}
.work-item:hover {
  background: var(--dim-hover);
  border-color: color-mix(in srgb, var(--acid) 30%, transparent);
}
.work-item:hover::before {
  opacity: 1;
}

.work-num {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.4rem;
  color: color-mix(in srgb, var(--acid) 30%, transparent);
  letter-spacing: 0.05em;
}

.work-title {
  font-family: "Bebas Neue", sans-serif;
  font-size: 2rem;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  transition: color 0.2s;
}
.work-item:hover .work-title {
  color: var(--accent-text);
}
.work-meta {
  font-family: "Space Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--fg-40);
}

.work-arrow {
  font-size: 1.5rem;
  color: var(--fg-20);
  transition:
    color 0.2s,
    transform 0.2s;
}
.work-item:hover .work-arrow {
  color: var(--accent-text);
  transform: translate(4px, -4px);
}

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 8, 0.88);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  backdrop-filter: blur(6px);
  padding: 24px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-panel {
  background: var(--dim);
  border: 1px solid var(--mid);
  border-top: 5px solid var(--acid);
  max-width: 640px;
  width: 100%;
  padding: 56px;
  position: relative;
  transform: translateY(32px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 95dvh;
  overflow-y: auto;
}

.modal-panel::-webkit-scrollbar {
  width: 3px;
}
.modal-panel::-webkit-scrollbar-track {
  background: transparent;
}
.modal-panel::-webkit-scrollbar-thumb {
  background: var(--mid);
  border-radius: 0;
}
.modal-panel::-webkit-scrollbar-thumb:hover {
  background: var(--acid);
}

.modal-overlay.active .modal-panel {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: none;
  border: 1px solid var(--mid);
  color: var(--fg-40);
  font-family: "Space Mono", monospace;
  font-size: 0.75rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: none;
  transition:
    border-color 0.2s,
    color 0.2s;
}

.modal-close:hover {
  border-color: var(--accent-text);
  color: var(--accent-text);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.modal-num {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.2rem;
  color: color-mix(in srgb, var(--acid) 30%, transparent);
  letter-spacing: 0.05em;
}

.modal-badge {
  font-family: "Space Mono", monospace;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--on-acid);
  background: var(--acid);
  padding: 4px 10px;
}

.modal-title {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: 0.04em;
  color: var(--white);
  line-height: 1;
  margin-bottom: 12px;
}

.modal-meta {
  font-family: "Space Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--orange);
  margin-bottom: 28px;
}

/* MEDIA OUTER BLOCK */
.modal-media-outer {
  display: none;
  margin-bottom: 28px;
  position: relative;
}

.modal-media-outer.has-media {
  display: block;
}

/* GLB VIEWER MODAL */
.modal-glb-viewer {
  display: none;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #ffffff;
  border: 1px solid var(--mid);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.modal-media-outer.glb-mode #modalSwiper {
  display: none;
}
.modal-media-outer.glb-mode .modal-glb-viewer {
  display: block;
}

.modal-glb-viewer .gv-canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* GLB VIEWER — LOADING */
.gv-loading {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease;
}
.gv-loading.gv-loading-out {
  opacity: 0;
}
.gv-loading-bar {
  width: min(200px, 50%);
  height: 1px;
  background: rgba(8, 8, 8, 0.12);
  position: relative;
  overflow: hidden;
}
.gv-loading-fill {
  position: absolute;
  inset: 0 100% 0 0;
  background: var(--black);
  animation: gvLoadPulse 1.2s ease-in-out infinite;
}
@keyframes gvLoadPulse {
  0% {
    inset: 0 100% 0 0;
  }
  50% {
    inset: 0 0 0 0;
  }
  100% {
    inset: 0 0 0 100%;
  }
}

.gv-toolbar {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 6px;
  z-index: 5;
}

.gv-btn {
  font-family: "Space Mono", monospace;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  color: var(--fg-50);
  background: rgba(8, 8, 8, 0.65);
  border: 1px solid var(--mid);
  padding: 5px 10px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition:
    color 0.2s,
    border-color 0.2s;
}
.gv-btn:hover {
  color: var(--white);
  border-color: var(--fg-40);
}
.gv-btn.active {
  color: var(--accent-text);
  border-color: var(--accent-text);
}

.gv-switcher {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--mid);
  border-radius: 2px;
  padding: 6px 14px;
  backdrop-filter: blur(6px);
}
.gv-switcher button {
  background: none;
  border: none;
  color: var(--accent-text);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: opacity 0.2s;
}
.gv-switcher button:disabled {
  opacity: 0.25;
  cursor: default;
}
.gv-switcher button:not(:disabled):hover {
  opacity: 0.7;
}
.gv-model-label {
  font-family: "Space Mono", monospace;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--fg);
  white-space: nowrap;
}

/* SWIPER MODAL */
.modal-swiper {
  width: 100%;
  aspect-ratio: 16/9;
  border: 1px solid var(--mid);
  background: var(--black);
}

.modal-swiper .swiper-slide {
  position: relative;
  overflow: hidden;
}

.modal-swiper .swiper-slide img,
.modal-swiper .swiper-slide video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Pagination dots */
.modal-swiper .swiper-pagination {
  bottom: 12px;
}

.modal-swiper .swiper-pagination-bullet {
  width: 5px;
  height: 5px;
  border-radius: 0;
  background: var(--fg-25);
  opacity: 1;
  transition:
    background 0.2s,
    transform 0.2s;
}

.modal-swiper .swiper-pagination-bullet-active {
  background: var(--acid);
  transform: scale(1.4);
}

/* Navigation arrows */
.modal-swiper-prev,
.modal-swiper-next {
  position: absolute;
  top: 50%;
  margin-top: 0; /* neutralize Swiper's built-in margin-top offset */
  transform: translateY(-50%);
  z-index: 10;
  width: 36px;
  height: 36px;
  background: rgba(8, 8, 8, 0.72);
  border: 1px solid var(--mid);
  color: var(--fg-50);
  transition:
    border-color 0.2s,
    color 0.2s,
    opacity 0.2s;
  backdrop-filter: blur(4px);
}
.modal-swiper-prev {
  left: 10px;
}
.modal-swiper-next {
  right: 10px;
}

.modal-swiper-prev::after,
.modal-swiper-next::after {
  font-size: 13px;
  font-weight: 700;
}

.modal-swiper-prev:hover,
.modal-swiper-next:hover {
  border-color: var(--accent-text);
  color: var(--accent-text);
}

.swiper-button-disabled.modal-swiper-prev,
.swiper-button-disabled.modal-swiper-next {
  opacity: 0;
  pointer-events: none;
}

/* glb-mode: hide buttons when only 1 model */
.modal-media-outer.glb-mode.glb-single .modal-swiper-prev,
.modal-media-outer.glb-mode.glb-single .modal-swiper-next {
  display: none;
}

/* hide pagination when only 1 slide */
.modal-swiper .swiper-pagination:has(.swiper-pagination-bullet:only-child) {
  display: none;
}

/* Fancybox theme override */
:root {
  --f-button-bg: rgba(8, 8, 8, 0.72);
  --f-button-border-color: rgba(200, 200, 200, 0.2);
  --f-button-color: var(--fg-60);
  --f-button-hover-bg: rgba(8, 8, 8, 0.9);
  --f-button-hover-color: #c8ff00;
  --f-button-hover-border-color: #c8ff00;
}

.fancybox__container {
  z-index: 3000 !important;
}

.modal-swiper-slide a {
  cursor: none !important;
}

.modal-swiper-slide.loading {
  background: linear-gradient(90deg, #1a1a1a 25%, #252525 50%, #1a1a1a 75%);
  background-size: 200% 100%;
  animation: slide-shimmer 1.4s infinite;
}

@keyframes slide-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.modal-role-block {
  margin-bottom: 28px;
}

.modal-role-label {
  font-family: "Space Mono", monospace;
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  color: var(--accent-text);
  opacity: 0.7;
  display: block;
  margin-bottom: 8px;
}

.modal-section-label {
  font-family: "Space Mono", monospace;
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  color: var(--accent-text);
  opacity: 0.7;
  margin-bottom: 8px;
}

.modal-desc,
.modal-role {
  font-size: 0.9rem;
  line-height: 1.9;
  color: var(--fg-60);
  margin-bottom: 40px;
  border-left: 2px solid rgba(200, 255, 0, 0.2);
  padding-left: 20px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
}

.modal-cta {
  background: var(--acid);
  color: var(--on-acid);
  font-family: "Space Mono", monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 14px 32px;
  text-decoration: none;
  display: inline-block;
  transition:
    background 0.2s,
    transform 0.2s;
  cursor: none;
}

.modal-cta:hover:not(.modal-cta--disabled) {
  background: var(--orange);
  transform: translate(-3px, -3px);
}

.modal-cta--disabled {
  background: transparent;
  color: var(--mid);
  border: 1px solid var(--mid);
  pointer-events: none;
  cursor: default;
}

/* CONTACT */
#contact {
  border-top: 1px solid var(--mid);
  background: var(--dim);
  text-align: center;
  position: relative;
  overflow: hidden;
}

#contact::before {
  content: "LET'S\ATALK";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(8rem, 20vw, 22rem);
  color: rgba(200, 255, 0, 0.03);
  white-space: nowrap;
  pointer-events: none;
  line-height: 0.85;
}

.contact-inner {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
}

.contact-inner .section-title {
  margin-bottom: 24px;
}

.contact-sub {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--fg-50);
  /* margin-bottom: 56px; */
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.contact-link {
  font-family: "Space Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--white);
  text-decoration: none;
  border: 1px solid var(--mid);
  padding: 14px 32px;
  min-width: 130px;
  text-align: center;
  transition:
    border-color 0.2s,
    color 0.2s,
    transform 0.2s;
}
.contact-link:hover {
  border-color: var(--accent-text);
  color: var(--accent-text);
  transform: translate(-3px, -3px);
}
.contact-link.highlight {
  background: var(--acid);
  color: var(--on-acid);
  border-color: var(--accent-text);
  font-weight: 700;
}
.contact-link.highlight:hover {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--white);
}

/* FOOTER */
footer {
  border-top: 1px solid var(--mid);
  padding: 32px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
footer span {
  font-family: "Space Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--fg-25);
}
.footer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--acid);
  display: inline-block;
  animation: pulse 2s ease-in-out infinite;
}

/* ANIMATIONS */
@keyframes iconGlitch {
  0% {
    transform: translate(0);
    filter: none;
  }
  15% {
    transform: translate(-3px, 1px);
    filter: drop-shadow(3px 0 0 var(--orange));
  }
  30% {
    transform: translate(3px, -1px);
    filter: drop-shadow(-3px 0 0 var(--acid));
  }
  45% {
    transform: translate(-2px, 2px);
    filter: drop-shadow(2px 0 0 var(--orange));
  }
  60% {
    transform: translate(2px, 0);
    filter: drop-shadow(-2px 0 0 var(--acid));
  }
  75% {
    transform: translate(-1px, -1px);
    filter: drop-shadow(1px 0 0 var(--orange));
  }
  100% {
    transform: translate(0);
    filter: none;
  }
}

@keyframes textPulse {
  0%,
  100% {
    color: var(--fg-30);
  }
  50% {
    color: var(--accent-text);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(0.7);
  }
}
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* REVEAL ANIMATION */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.7s,
    transform 0.7s;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 {
  transition-delay: 0.1s;
}
.reveal-delay-2 {
  transition-delay: 0.2s;
}
.reveal-delay-3 {
  transition-delay: 0.3s;
}
.reveal-delay-4 {
  transition-delay: 0.4s;
}
.reveal-delay-5 {
  transition-delay: 0.5s;
}

/* LOADING SCREEN */
#loadingScreen {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease;
}

#loadingScreen.ls-exit {
  opacity: 0;
  pointer-events: none;
}

.ls-bottom {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(360px, 70vw);
  display: flex;
  align-items: center;
  gap: 14px;
  pointer-events: none;
}

.ls-bar-track {
  flex: 1;
  height: 2px;
  background: var(--fg-10);
  position: relative;
  overflow: hidden;
}

.ls-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: var(--acid);
  transition: width 0.3s ease;
  box-shadow: 0 0 8px var(--acid);
}

.ls-pct {
  font-family: "Space Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--accent-text);
  width: 4.5ch;
  text-align: right;
  flex-shrink: 0;
}

/* MOBILE */
@media (max-width: 768px) {
  .cursor {
    display: none;
  }
  body {
    cursor: auto;
  }
  nav {
    padding: 20px 24px;
    transition:
      background 0.3s,
      border-color 0.3s;
    border-bottom: 1px solid transparent;
  }
  nav.nav-open {
    mix-blend-mode: normal;
    background: var(--black);
    border-bottom-color: var(--mid);
  }
  .nav-toggle {
    display: flex;
    position: relative;
    z-index: 499;
  }
  nav.nav-open .nav-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  nav.nav-open .nav-toggle span:nth-child(2) {
    opacity: 0;
  }
  nav.nav-open .nav-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
  .nav-links {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--black);
    padding: 80px 32px 40px;
    gap: 0;
    transform: translateY(-100%);
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 498;
    pointer-events: none;
    border-bottom: 1px solid var(--mid);
  }
  nav.nav-open .nav-links {
    transform: translateY(0);
    pointer-events: auto;
  }
  .nav-links li {
    border-top: 1px solid var(--mid);
  }
  .nav-links li:last-child {
    border-bottom: 1px solid var(--mid);
  }
  .nav-links a {
    display: block;
    padding: 20px 0;
    font-family: "Bebas Neue", sans-serif;
    font-size: 1.5rem;
    letter-spacing: 0.1em;
    opacity: 0.7;
    color: var(--white);
  }
  .nav-links a:hover {
    opacity: 1;
    color: var(--accent-text);
  }
  section {
    padding: 60px 24px;
  }
  #hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 60px 24px 170px 24px;
  }
  .hero-left {
    padding: 30px 24px 60px;
    align-items: center;
    text-align: center;
  }
  .hero-right {
    height: 300px;
  }
  .hero-scroll-hint {
    left: 0;
    right: 0;
    transform: none;
    bottom: 40px;
  }
  .btn-primary,
  .btn-ghost {
    padding: 16px 16px;
    min-width: 140px;
  }

  #about {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .stat {
    padding: 16px 12px;
  }
  .about-visual {
    aspect-ratio: 1/1;
  }
  .skills-grid {
    grid-template-columns: 1fr;
  }
  .clients-logos {
    grid-template-columns: repeat(3, 4fr);
    gap: 24px 0;
  }
  .exp-list::before {
    display: none;
  }
  .exp-item {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 36px 0;
  }
  .exp-item::before {
    display: none;
  }
  .exp-left {
    text-align: left;
    padding-right: 0;
    padding-top: 0;
    display: flex;
    align-items: center;
    gap: 16px;
  }
  .exp-duration {
    margin-top: 0;
  }
  .exp-right {
    padding-right: 0;
  }
  .exp-company {
    font-size: 1.8rem;
  }
  .work-item {
    grid-template-columns: 50px 1fr auto;
    gap: 16px;
    padding: 24px 20px;
  }
  footer {
    flex-direction: column;
    gap: 12px;
    text-align: center;
    padding: 24px 48px;
  }
  #contact::before {
    font-size: 4rem;
  }
  .contact-links {
    max-width: 250px;
    margin-left: auto;
    margin-right: auto;
  }
  .contact-link.highlight {
    width: 100%;
    min-width: unset;
  }
  .contact-link:not(.highlight) {
    flex: 1;
    min-width: unset;
  }
  .skills-header,
  .works-header,
  .exp-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 36px;
  }
  .modal-overlay {
    align-items: center;
    padding: 16px;
  }
  .modal-panel {
    padding: 28px 20px;
    max-height: 95dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .modal-footer {
    justify-content: center;
  }
  .modal-swiper-prev,
  .modal-swiper-next {
    width: 28px;
    height: 28px;
  }
  .modal-swiper-prev::after,
  .modal-swiper-next::after {
    font-size: 10px;
  }
}
