/* ============================================================
   DayStar Design — Interior Design Portfolio
   Style Reference: CCD / HBA — Dark Luxury Aesthetic
   ============================================================ */

/* ——— CSS Variables ———————————————— */
:root {
  --bg-deep:     #0D0D0D;
  --bg-primary:  #141414;
  --bg-secondary:#1A1A1A;
  --bg-elevated: #222222;
  --bg-card:     #1C1C1C;

  --text-primary:   #E8E4DD;
  --text-secondary: #9E9990;
  --text-muted:     #6B6560;
  --text-inverse:   #0D0D0D;

  --accent:      #C8A96E;  /* Champagne gold */
  --accent-dark: #A68A52;
  --accent-light:#DFC89A;

  --border:      #2A2622;
  --border-light:#3A3630;

  --font-serif:  'Playfair Display', 'Noto Serif SC', 'Georgia', serif;
  --font-sans:   'Inter', 'Noto Sans SC', -apple-system, sans-serif;

  --max-width:   1400px;
  --section-pad: clamp(80px, 12vw, 160px);
  --gap:         clamp(16px, 3vw, 32px);

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:   cubic-bezier(0.65, 0, 0.35, 1);
  --duration: 0.8s;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg-deep);
  color: var(--text-primary);
}

body {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.7;
  background: var(--bg-deep);
  overflow-x: hidden;
  letter-spacing: 0.01em;
}

::selection {
  background: var(--accent);
  color: var(--bg-deep);
}

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

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

button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}

/* ——— Scrollbar ———————————————— */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ——— Loader ———————————————— */
.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-deep);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  transition: opacity 0.6s var(--ease-out-expo), visibility 0.6s;
}
.loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-logo {
  font-family: var(--font-serif);
  font-size: clamp(20px, 3vw, 28px);
  letter-spacing: 0.4em;
  color: var(--accent);
  text-transform: uppercase;
}
.loader-line {
  width: 60px;
  height: 1px;
  background: var(--text-muted);
  animation: loaderLine 1.5s ease-in-out infinite;
}
@keyframes loaderLine {
  0%, 100% { width: 60px; opacity: 0.4; }
  50% { width: 120px; opacity: 1; }
}

/* ——— Navigation ———————————————— */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 28px 48px;
  transition: background 0.4s, padding 0.4s;
  mix-blend-mode: difference;
}
.nav.scrolled {
  background: rgba(13,13,13,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 16px 48px;
  mix-blend-mode: normal;
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.25em;
  color: #fff;
  text-transform: uppercase;
}
.nav-links {
  display: flex;
  gap: 40px;
}
.nav-link {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  transition: color 0.3s;
  position: relative;
}
.nav-link:hover { color: var(--accent); }
.nav-link-zh {
  display: block;
  font-size: 10px;
  font-family: var(--font-sans);
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-top: 2px;
}
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 1px;
  background: #fff;
  transition: transform 0.3s;
}

/* ——— Hero Section ———————————————— */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 700px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: background-image 1.2s var(--ease-in-out);
  will-change: background-image;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(13,13,13,0.35) 0%,
    rgba(13,13,13,0.15) 40%,
    rgba(13,13,13,0.55) 80%,
    rgba(13,13,13,0.92) 100%
  );
}
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px;
}
.hero-title {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hero-title-en {
  font-family: var(--font-serif);
  font-size: clamp(36px, 7vw, 80px);
  font-weight: 600;
  letter-spacing: 0.15em;
  color: #fff;
  text-transform: uppercase;
  line-height: 1.1;
}
.hero-title-zh {
  font-family: var(--font-serif);
  font-size: clamp(20px, 3.5vw, 36px);
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0.3em;
}
.hero-subtitle {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}
.hero-subtitle-zh {
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  font-family: var(--font-sans);
  text-transform: none;
}
.hero-scroll {
  position: absolute;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}
.hero-scroll-line {
  width: 1px;
  height: 40px;
  background: rgba(255,255,255,0.2);
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.3); }
}
.hero-indicators {
  position: absolute;
  bottom: 48px;
  right: 48px;
  display: flex;
  gap: 10px;
  z-index: 3;
}
.hero-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.4);
  transition: all 0.4s;
  cursor: pointer;
}
.hero-indicator.active {
  background: var(--accent);
  border-color: var(--accent);
}

/* ——— Section Shared ———————————————— */
.section-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 48px;
}
.section-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 48px;
}

/* ——— About Section ———————————————— */
.about {
  padding: var(--section-pad) 0;
  background: var(--bg-primary);
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 80px;
  align-items: start;
}
.about-heading {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 36px;
}
.about-heading .en {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4.5vw, 48px);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary);
}
.about-heading .zh {
  font-family: var(--font-serif);
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0.15em;
}
.about-text {
  font-size: 15px;
  line-height: 1.9;
  color: var(--text-secondary);
  max-width: 640px;
  margin-bottom: 20px;
}
.about-stats {
  display: flex;
  flex-direction: column;
  gap: 48px;
  padding-top: 8px;
}
.stat {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.stat-number {
  font-family: var(--font-serif);
  font-size: 48px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 8px;
}
.stat-label {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
  line-height: 1.6;
}
.stat-label span {
  display: block;
  font-size: 11px;
  font-family: var(--font-sans);
  text-transform: none;
}

/* ——— Work / Filters ———————————————— */
.work {
  padding: var(--section-pad) 0;
  background: var(--bg-deep);
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 48px;
}
.filter-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 2px;
  transition: all 0.35s;
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: 0.05em;
}
.filter-btn .en {
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.filter-btn .zh {
  font-size: 11px;
  font-family: var(--font-sans);
  margin-top: 2px;
}
.filter-btn:hover {
  color: var(--text-primary);
  border-color: var(--border);
}
.filter-btn.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(200,169,110,0.06);
}

/* ——— Project Grid ———————————————— */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
}
.project-card {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border-radius: 2px;
  aspect-ratio: 4 / 3;
  background: var(--bg-card);
  group: true;
}
.project-card.featured {
  grid-column: 1 / -1;
  aspect-ratio: 21 / 9;
}
.project-card-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease-out-expo), filter 1.2s var(--ease-out-expo);
  filter: brightness(0.75);
}
.project-card:hover .project-card-image {
  transform: scale(1.04);
  filter: brightness(0.55);
}
.project-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 36px 40px;
  background: linear-gradient(
    0deg,
    rgba(13,13,13,0.85) 0%,
    rgba(13,13,13,0.3) 50%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.5s var(--ease-out-expo);
}
.project-card:hover .project-card-overlay {
  opacity: 1;
}
.project-card-name {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.05em;
}
.project-card-name-en {
  font-size: 13px;
  font-weight: 300;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.project-card-category {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 6px;
}

/* ——— Ultra-subtle attribution text ———————————————— */
.project-card-attribution {
  font-size: 9px;
  font-weight: 300;
  color: rgba(255,255,255,0.18);
  letter-spacing: 0.05em;
  margin-top: 8px;
  transition: color 0.4s;
}
.project-card:hover .project-card-attribution {
  color: rgba(255,255,255,0.28);
}

/* Always-visible label on mobile */
.project-card-label {
  display: none;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 24px;
  background: linear-gradient(0deg, rgba(13,13,13,0.9) 0%, transparent 100%);
}
.project-card-label .project-card-name {
  font-size: 18px;
}
.project-card-label .project-card-attribution {
  font-size: 8px;
  color: rgba(255,255,255,0.15);
  margin-top: 4px;
}

/* ——— Modal ———————————————— */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s, visibility 0.4s;
}
.modal.open {
  opacity: 1;
  visibility: visible;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13,13,13,0.96);
  cursor: pointer;
}
.modal-content {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px;
}
.modal-close {
  position: absolute;
  top: 32px;
  right: 48px;
  z-index: 10;
  font-size: 36px;
  font-weight: 100;
  color: var(--text-muted);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s;
}
.modal-close:hover { color: var(--accent); }
.modal-body {
  width: 100%;
  height: 100%;
  max-width: 1200px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-body img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 40px 80px rgba(0,0,0,0.5);
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.5s var(--ease-out-expo), transform 0.5s var(--ease-out-expo);
}
.modal-body img.loaded {
  opacity: 1;
  transform: scale(1);
}
.modal-nav {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  pointer-events: none;
}
.modal-arrow {
  pointer-events: all;
  font-size: 32px;
  color: rgba(255,255,255,0.5);
  padding: 16px;
  transition: color 0.3s;
  font-weight: 100;
}
.modal-arrow:hover { color: var(--accent); }
.modal-counter {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}

/* ——— Contact ———————————————— */
.contact {
  padding: var(--section-pad) 0;
  background: var(--bg-primary);
}
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 80px;
}
.contact-heading {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.contact-heading .en {
  font-family: var(--font-serif);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 600;
  line-height: 1.15;
  color: var(--text-primary);
}
.contact-heading .zh {
  font-family: var(--font-serif);
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0.15em;
}
.contact-text {
  margin-top: 20px;
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 420px;
  line-height: 1.8;
}
.contact-details {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.contact-item {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.contact-item-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.contact-item-value {
  font-size: 16px;
  font-weight: 300;
  color: var(--text-primary);
  letter-spacing: 0.03em;
}

/* ——— Footer ———————————————— */
.footer {
  padding: 48px 0;
  background: var(--bg-deep);
  border-top: 1px solid var(--border);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-brand {
  font-family: var(--font-serif);
  font-size: 14px;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.footer-copy {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* ——— Reveal Animations ———————————————— */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s var(--ease-out-expo), transform 0.9s var(--ease-out-expo);
}
.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; }

/* ——— Fade-in from below ———————————————— */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ——— Responsive ———————————————— */
@media (max-width: 1024px) {
  .section-container { padding: 0 32px; }
  .about-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .about-stats {
    flex-direction: row;
    gap: 32px;
  }
  .stat { padding-bottom: 0; border-bottom: none; padding-right: 32px; border-right: 1px solid var(--border); }
  .stat:last-child { border-right: none; }
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .project-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .modal-content { padding: 40px; }
}

@media (max-width: 768px) {
  .nav { padding: 20px 24px; }
  .nav.scrolled { padding: 14px 24px; }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav.mobile-open .nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(13,13,13,0.98);
    backdrop-filter: blur(20px);
    padding: 32px 24px;
    gap: 24px;
    border-bottom: 1px solid var(--border);
  }
  .hero-indicators { right: 24px; bottom: 32px; }
  .hero-scroll { bottom: 32px; }
  .section-label { margin-bottom: 32px; }
  .project-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .project-card { aspect-ratio: 4 / 3; }
  .project-card.featured { aspect-ratio: 4 / 3; grid-column: auto; }
  .project-card-overlay {
    opacity: 1;
    padding: 24px;
  }
  .project-card-label {
    display: block;
  }
  .project-card-overlay { display: none; }
  .filters { gap: 4px; margin-bottom: 32px; }
  .filter-btn { padding: 8px 14px; font-size: 12px; }
  .filter-btn .zh { display: none; }
  .about { padding: 80px 0; }
  .about-stats { flex-wrap: wrap; gap: 24px; }
  .stat-number { font-size: 36px; }
  .contact { padding: 80px 0; }
  .modal-content { padding: 24px; }
  .modal-close { top: 16px; right: 24px; }
  .modal-body img { max-height: 60vh; }
  .footer-inner { flex-direction: column; gap: 12px; text-align: center; }
}

@media (max-width: 480px) {
  .section-container { padding: 0 20px; }
  .hero-content { padding: 0 16px; }
  .hero-title-en { font-size: 32px; letter-spacing: 0.1em; }
  .hero-title-zh { font-size: 18px; letter-spacing: 0.15em; }
  .about-heading .en { font-size: 26px; }
  .nav-logo { font-size: 14px; }
}
