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

:root {
  --bg: #f7f4ef;
  --surface: rgba(255, 255, 255, 0.72);
  --text: #1c1917;
  --text-secondary: #57534e;
  --text-muted: #a8a29e;
  --accent: #b45309;
  --accent-soft: rgba(180, 83, 9, 0.12);
  --border: rgba(28, 25, 23, 0.08);
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.04);
  --shadow-md: 0 8px 32px rgba(28, 25, 23, 0.08);
  --shadow-lg: 0 16px 48px rgba(28, 25, 23, 0.1);
  --radius: 14px;
  --font-serif: "Noto Serif SC", "Songti SC", serif;
  --font-sans: "Noto Sans SC", -apple-system, BlinkMacSystemFont, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-h: 72px;
  --footer-h: 72px;
}

html {
  font-size: 18px;
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.6;
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 32px;
  height: 100%;
}

/* Page shell — exactly one viewport */
.page {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

/* Background */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: float 20s ease-in-out infinite;
}

.bg-blob--1 {
  width: 480px;
  height: 480px;
  background: #fde8d7;
  top: -100px;
  right: -60px;
}

.bg-blob--2 {
  width: 400px;
  height: 400px;
  background: #e8dff5;
  bottom: 0;
  left: -80px;
  animation-delay: -7s;
}

.bg-blob--3 {
  width: 320px;
  height: 320px;
  background: #d4ebe3;
  top: 40%;
  right: 20%;
  animation-delay: -14s;
}

.bg-noise {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(24px, -16px) scale(1.04); }
  66% { transform: translate(-16px, 12px) scale(0.96); }
}

/* Nav */
.nav {
  flex-shrink: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(247, 244, 239, 0.8);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.nav-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #fff;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(180, 83, 9, 0.3);
}

.nav-name {
  font-size: 1.05rem;
  font-weight: 500;
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.95rem;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d97706;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* Main — fills remaining viewport */
.main {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  width: 100%;
}

/* Intro (left) */
.intro-eyebrow {
  font-size: 0.9rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.intro-title {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.intro-desc {
  font-size: 1.15rem;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 20px;
}

.intro-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.tag {
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(180, 83, 9, 0.15);
}

.intro-about {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.7;
}

.intro-contact {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 12px;
  background: var(--text);
  color: #fafaf9;
  text-decoration: none;
  font-size: 1.05rem;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s;
  box-shadow: var(--shadow-md);
}

.intro-contact:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.intro-contact svg {
  opacity: 0.7;
  transition: transform 0.3s var(--ease-out);
}

.intro-contact:hover svg {
  transform: translateX(3px);
  opacity: 1;
}

/* Gallery (right) */
.gallery-head {
  margin-bottom: 14px;
}

.gallery-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.gallery-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 300;
  margin-top: 4px;
}

.bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 12px;
  height: clamp(220px, 38vh, 340px);
}

.bento-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}

.bento-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.bento-item--wide {
  grid-column: span 2;
}

.bento-inner {
  position: relative;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    145deg,
    hsl(var(--hue), 45%, 88%) 0%,
    hsl(calc(var(--hue) + 25), 40%, 78%) 50%,
    hsl(calc(var(--hue) + 50), 35%, 72%) 100%
  );
}

.bento-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.5), transparent 60%);
}

.bento-label {
  position: absolute;
  bottom: 12px;
  left: 12px;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(28, 25, 23, 0.75);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  letter-spacing: 0.06em;
}

.bento-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.35) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.6s var(--ease-out);
}

.bento-item:hover .bento-shine {
  transform: translateX(100%);
}

/* Footer */
.footer {
  flex-shrink: 0;
  min-height: var(--footer-h);
  display: flex;
  align-items: center;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 12px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 16px;
}

.copyright {
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.beian {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.beian-icp {
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.beian-icp:hover {
  color: var(--accent);
}

.beian-divider {
  color: var(--text-muted);
  font-weight: 300;
}

.beian-psb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.beian-psb:hover {
  color: var(--accent);
}

.beian-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: block;
}

/* Short viewport — compress vertically */
@media (max-height: 700px) {
  html {
    font-size: 16px;
  }

  .intro-eyebrow { margin-bottom: 10px; }
  .intro-title { margin-bottom: 10px; }
  .intro-desc { margin-bottom: 14px; font-size: 1.05rem; }
  .intro-tags { margin-bottom: 14px; }
  .intro-about { margin-bottom: 16px; }
  .intro-contact { padding: 12px 20px; }

  .bento {
    height: clamp(180px, 32vh, 260px);
    gap: 10px;
  }
}

/* Tablet / narrow — stack but still no scroll */
@media (max-width: 860px) {
  html {
    font-size: 16px;
  }

  .main {
    align-items: stretch;
    padding: 16px 0;
  }

  .main-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 20px;
    align-content: center;
  }

  .intro-desc br {
    display: none;
  }

  .bento {
    height: clamp(160px, 28vh, 220px);
  }

  .footer-inner {
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    text-align: center;
  }

  .beian {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 20px;
  }

  .nav-name {
    display: none;
  }

  .intro-tags {
    gap: 8px;
  }

  .tag {
    padding: 6px 14px;
    font-size: 0.85rem;
  }

  .bento {
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: 1fr;
    height: clamp(72px, 14vh, 100px);
  }

  .bento-item--wide {
    grid-column: span 1;
  }

  .bento-label {
    font-size: 0.75rem;
    padding: 4px 8px;
    bottom: 6px;
    left: 6px;
  }

  .gallery-head {
    margin-bottom: 10px;
  }

  .gallery-title {
    font-size: 1.15rem;
  }

  .beian {
    font-size: 0.95rem;
    gap: 8px 10px;
  }

  .beian-divider {
    display: none;
  }

  .beian-psb {
    flex-basis: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
