/* ─── Reset & Base ──────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black:   #000000;
  --white:   #ffffff;
  --gray:    #888888;
  --gray-light: #aaaaaa;
  --accent:  #ffffff;
  --font-main: 'Space Grotesk', 'Inter', sans-serif;
  --nav-h: 68px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; object-fit: cover; }

/* ─── Navigation ────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  mix-blend-mode: difference;
  transition: background 0.4s var(--ease);
}

nav.scrolled {
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(12px);
  mix-blend-mode: normal;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.nav-logo {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
}

.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
}

.nav-links a {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--white);
  opacity: 0.7;
  transition: opacity 0.25s;
}
.nav-links a:hover { opacity: 1; }

/* Hamburger (mobile) */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--white);
  transition: transform 0.3s var(--ease), opacity 0.3s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile menu */
.nav-mobile {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--black);
  z-index: 99;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 40px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
}
.nav-mobile.open { display: flex; opacity: 1; pointer-events: all; }
.nav-mobile a {
  font-size: clamp(28px, 6vw, 48px);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.nav-mobile a:hover { opacity: 1; }

/* ─── Hero ──────────────────────────────────────── */
.hero {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 40px 60px;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #0a0a0a;
}

/* 大字背景裝飾 */
.hero-bg::after {
  content: 'AH';
  position: absolute;
  bottom: -60px;
  right: -20px;
  font-size: clamp(200px, 30vw, 400px);
  font-weight: 700;
  letter-spacing: -0.05em;
  color: rgba(255,255,255,0.03);
  line-height: 1;
  user-select: none;
  pointer-events: none;
}

.hero-video-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.2) 0%,
    rgba(0,0,0,0.1) 40%,
    rgba(0,0,0,0.7) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-label {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gray-light);
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(42px, 7vw, 96px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.02em;
  max-width: 900px;
}

.hero-title em {
  font-style: italic;
  font-weight: 300;
  color: var(--gray-light);
}

.hero-scroll {
  position: absolute;
  bottom: 60px;
  right: 40px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0.5;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
}
.hero-scroll::after {
  content: '';
  width: 1px;
  height: 60px;
  background: var(--white);
  animation: scrollLine 1.8s ease-in-out infinite;
}
@keyframes scrollLine {
  0%   { transform: scaleY(0); transform-origin: top; }
  50%  { transform: scaleY(1); transform-origin: top; }
  50.1%{ transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ─── Section Common ────────────────────────────── */
section { padding: 100px 40px; }

.section-label {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.section-label::before {
  content: '';
  width: 30px;
  height: 1px;
  background: var(--gray);
}

/* ─── Work Grid ─────────────────────────────────── */
#work { padding-top: 60px; }

.work-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.work-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: #111;
}

/* 版面變化：大小交錯 */
.work-item:nth-child(1) { grid-column: span 8; grid-row: span 2; aspect-ratio: 16/10; }
.work-item:nth-child(2) { grid-column: span 4; aspect-ratio: 4/5; }
.work-item:nth-child(3) { grid-column: span 4; aspect-ratio: 4/5; }
.work-item:nth-child(4) { grid-column: span 6; aspect-ratio: 3/2; }
.work-item:nth-child(5) { grid-column: span 6; aspect-ratio: 3/2; }
.work-item:nth-child(6) { grid-column: span 4; aspect-ratio: 4/5; }
.work-item:nth-child(7) { grid-column: span 8; aspect-ratio: 16/9; }

.work-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease), filter 0.5s;
  filter: brightness(0.85) saturate(0.9);
}
.work-item:hover .work-img {
  transform: scale(1.04);
  filter: brightness(0.95) saturate(1);
}

.work-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px;
  transition: background 0.4s var(--ease);
}
.work-item:hover .work-overlay { background: rgba(0,0,0,0.45); }

.work-info {
  transform: translateY(8px);
  opacity: 0;
  transition: transform 0.4s var(--ease), opacity 0.4s;
}
.work-item:hover .work-info { transform: translateY(0); opacity: 1; }

.work-category {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gray-light);
  margin-bottom: 6px;
}
.work-title {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* 佔位符顏色（無圖時） */
.work-item:nth-child(1) .work-img-placeholder { background: #1a1a1a; }
.work-item:nth-child(2) .work-img-placeholder { background: #151515; }
.work-item:nth-child(3) .work-img-placeholder { background: #181818; }
.work-item:nth-child(4) .work-img-placeholder { background: #121212; }
.work-item:nth-child(5) .work-img-placeholder { background: #161616; }
.work-item:nth-child(6) .work-img-placeholder { background: #141414; }
.work-item:nth-child(7) .work-img-placeholder { background: #1c1c1c; }

.work-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.5s;
}
.work-img-placeholder::after {
  content: '+';
  font-size: 32px;
  color: rgba(255,255,255,0.1);
  font-weight: 300;
}

/* ─── About ─────────────────────────────────────── */
#about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.about-text h2 {
  font-size: clamp(32px, 4vw, 56px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 40px;
}
.about-text h2 em {
  font-style: italic;
  font-weight: 300;
  color: var(--gray-light);
}

.about-text p {
  font-size: 16px;
  line-height: 1.85;
  color: rgba(255,255,255,0.65);
  max-width: 480px;
  margin-bottom: 24px;
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 60px;
}

.stat-num {
  font-size: clamp(36px, 4vw, 52px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 8px;
}
.stat-label {
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gray);
}

.about-image {
  position: relative;
  aspect-ratio: 4/5;
  overflow: hidden;
  background: #111;
}
.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(20%);
}
.about-image-placeholder {
  width: 100%;
  height: 100%;
  background: #111;
}

/* ─── Services ──────────────────────────────────── */
#services { border-top: 1px solid rgba(255,255,255,0.08); }

.services-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 80px;
}
.services-header h2 {
  font-size: clamp(28px, 3.5vw, 48px);
  font-weight: 500;
  letter-spacing: -0.02em;
  max-width: 480px;
}

.services-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(255,255,255,0.08);
}

.service-item {
  background: var(--black);
  padding: 48px 40px;
  transition: background 0.3s;
}
.service-item:hover { background: #0d0d0d; }

.service-num {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--gray);
  margin-bottom: 28px;
}
.service-title {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}
.service-desc {
  font-size: 14px;
  line-height: 1.8;
  color: rgba(255,255,255,0.5);
}

/* ─── Marquee ───────────────────────────────────── */
.marquee-section {
  padding: 50px 0;
  overflow: hidden;
  border-top: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.marquee-track {
  display: flex;
  gap: 60px;
  white-space: nowrap;
  animation: marquee 25s linear infinite;
}
.marquee-track:hover { animation-play-state: paused; }

.marquee-item {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: rgba(255,255,255,0.15);
  flex-shrink: 0;
}
.marquee-item span {
  color: rgba(255,255,255,0.5);
  margin: 0 30px;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ─── Contact ───────────────────────────────────── */
#contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.contact-left h2 {
  font-size: clamp(32px, 4vw, 56px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 32px;
}
.contact-left h2 em {
  font-style: italic;
  font-weight: 300;
  color: var(--gray-light);
}
.contact-left p {
  font-size: 15px;
  line-height: 1.8;
  color: rgba(255,255,255,0.55);
  max-width: 380px;
  margin-bottom: 48px;
}

.contact-info-item {
  margin-bottom: 28px;
}
.contact-info-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 6px;
}
.contact-info-value {
  font-size: 16px;
  font-weight: 400;
}

/* Form */
.contact-form { display: flex; flex-direction: column; gap: 0; }

.form-group {
  border-bottom: 1px solid rgba(255,255,255,0.12);
  padding: 20px 0;
  transition: border-color 0.3s;
}
.form-group:focus-within { border-color: var(--white); }

.form-group label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 10px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--white);
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 400;
  resize: none;
  appearance: none;
}
.form-group textarea { min-height: 100px; }
.form-group input::placeholder,
.form-group textarea::placeholder { color: rgba(255,255,255,0.25); }

.btn-submit {
  margin-top: 40px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  color: var(--black);
  border: none;
  padding: 16px 36px;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, gap 0.25s;
}
.btn-submit:hover { background: var(--gray-light); gap: 20px; }
.btn-submit svg { transition: transform 0.25s; }
.btn-submit:hover svg { transform: translateX(4px); }

/* ─── Footer ────────────────────────────────────── */
footer {
  padding: 60px 40px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.footer-logo {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.footer-links {
  display: flex;
  gap: 28px;
  list-style: none;
}
.footer-links a {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray);
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--white); }

.footer-copy {
  font-size: 12px;
  color: var(--gray);
}

/* ─── Page Loader ───────────────────────────────── */
.loader {
  position: fixed;
  inset: 0;
  background: var(--black);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: opacity 0.8s var(--ease), visibility 0.8s;
}
.loader.hide { opacity: 0; visibility: hidden; }
.loader-text {
  font-size: 13px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gray);
  overflow: hidden;
}
.loader-bar {
  width: 160px;
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin-top: 24px;
  position: relative;
}
.loader-bar::after {
  content: '';
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  background: var(--white);
  animation: loadBar 1.6s var(--ease) forwards;
}
@keyframes loadBar {
  from { width: 0; }
  to   { width: 100%; }
}

/* ─── Animations ────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ─── Responsive ────────────────────────────────── */
@media (max-width: 1024px) {
  .work-item:nth-child(1) { grid-column: span 12; }
  .work-item:nth-child(2),
  .work-item:nth-child(3) { grid-column: span 6; }
  .work-item:nth-child(4),
  .work-item:nth-child(5) { grid-column: span 6; }
  .work-item:nth-child(6) { grid-column: span 6; }
  .work-item:nth-child(7) { grid-column: span 12; }
  #about { grid-template-columns: 1fr; }
  .about-image { max-width: 500px; }
  #contact { grid-template-columns: 1fr; }
  .services-list { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  nav { padding: 0 24px; }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  section { padding: 80px 24px; }
  .hero { padding: 0 24px 48px; }
  .hero-scroll { display: none; }
  .work-item:nth-child(n) { grid-column: span 12; aspect-ratio: 4/3; }
  .services-list { grid-template-columns: 1fr; }
  .services-header { flex-direction: column; align-items: flex-start; gap: 20px; }
  footer { flex-direction: column; gap: 28px; align-items: flex-start; }
  .about-stats { grid-template-columns: 1fr 1fr; }
  .work-grid { gap: 10px; }
}
