@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Righteous&display=swap');

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: #f5e6c8;
  color: #262117;
  font-family: 'Poppins', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  line-height: 1.7;
  overflow-x: hidden;
  position: relative;
}

/* ===== Grain Overlay ===== */
.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  mix-blend-mode: multiply;
}

/* ===== VHS Scanline ===== */
.vhs-scanline {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(38, 33, 23, 0.03) 3px,
    rgba(38, 33, 23, 0.03) 4px
  );
}

/* ===== Typography ===== */
h1, h2, h3, h4 {
  font-family: 'Righteous', 'Noto Serif SC', serif;
  line-height: 1.25;
  color: #262117;
}

h1 { font-size: clamp(1.8rem, 5vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3.5vw, 2rem); margin-bottom: 0.4rem; }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); margin-bottom: 0.4rem; }

p { font-size: 1rem; line-height: 1.75; }

a { color: #d4a574; text-decoration: none; transition: color 0.2s; }
a:hover { color: #262117; }

hr {
  border: none;
  border-top: 2px solid #d4a574;
  margin: 0.75rem 0 1.25rem;
  opacity: 0.6;
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(38, 33, 23, 0.95);
  backdrop-filter: blur(6px);
  border-bottom: 2px solid #d4a574;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 56px;
}

/* Brand icon */
.brand-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.brand-img {
  height: 36px;
  width: auto;
  display: block;
}

.brand-text-icon {
  font-family: 'Righteous', serif;
  font-size: 1.5rem;
  color: #f5e6c8;
  background: #d4a574;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  letter-spacing: 0;
}

/* Nav */
.main-nav {
  flex: 1;
  overflow: hidden;
}

.nav-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.05rem;
  align-items: center;
}

.nav-link {
  font-family: 'Poppins', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: #f5e6c8;
  padding: 0.55rem 0.65rem;
  border-radius: 4px;
  white-space: nowrap;
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: background 0.2s, color 0.2s;
  letter-spacing: 0.02em;
}

.nav-link:hover {
  background: rgba(212, 165, 116, 0.25);
  color: #d4a574;
}

/* Search */
.header-search { flex-shrink: 0; }

.search-form {
  display: flex;
  align-items: center;
  background: rgba(245, 230, 200, 0.1);
  border: 1px solid rgba(212, 165, 116, 0.5);
  border-radius: 20px;
  overflow: hidden;
}

.search-input {
  background: transparent;
  border: none;
  outline: none;
  color: #f5e6c8;
  font-size: 0.82rem;
  padding: 0.4rem 0.75rem;
  width: 120px;
  font-family: 'Poppins', sans-serif;
}

.search-input::placeholder { color: rgba(245,230,200,0.5); }

.search-btn {
  background: transparent;
  border: none;
  color: #d4a574;
  cursor: pointer;
  padding: 0.55rem 0.75rem;
  display: flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  justify-content: center;
  transition: color 0.2s;
}

.search-btn:hover { color: #f5e6c8; }

/* ===== Sticky Anchor Bar ===== */
.sticky-anchor-bar {
  position: sticky;
  top: 56px;
  z-index: 190;
  background: rgba(212, 165, 116, 0.92);
  backdrop-filter: blur(4px);
  border-bottom: 1px solid rgba(38,33,23,0.25);
  overflow-x: auto;
  scrollbar-width: none;
}

.sticky-anchor-bar::-webkit-scrollbar { display: none; }

.anchor-row {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  gap: 0;
}

.anchor-link {
  font-size: 0.78rem;
  font-weight: 600;
  color: #262117;
  padding: 0.55rem 0.85rem;
  white-space: nowrap;
  min-height: 44px;
  display: flex;
  align-items: center;
  border-right: 1px solid rgba(38,33,23,0.15);
  transition: background 0.18s, color 0.18s;
  letter-spacing: 0.03em;
}

.anchor-link:last-child { border-right: none; }
.anchor-link:hover { background: rgba(38,33,23,0.12); color: #262117; }

/* ===== Hero ===== */
.hero-section {
  position: relative;
  height: 45vh;
  min-height: 280px;
  max-height: 520px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(0.45) contrast(1.05) saturate(0.75);
}

.hero-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgba(38,33,23,0.82) 0%,
    rgba(38,33,23,0.55) 50%,
    rgba(212,165,116,0.2) 100%
  );
}

.light-leak {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 85% 20%, rgba(212,165,116,0.35) 0%, transparent 60%);
  animation: lightLeak 6s ease-in-out infinite alternate;
}

@keyframes lightLeak {
  0% { opacity: 0.6; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.08); }
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 2rem 1.5rem 2rem 2.5rem;
  max-width: 640px;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #d4a574;
  background: rgba(38,33,23,0.6);
  padding: 0.25rem 0.65rem;
  border-left: 3px solid #d4a574;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.hero-title {
  font-family: 'Righteous', serif;
  font-size: clamp(1.8rem, 5vw, 3rem);
  color: #f5e6c8;
  margin-bottom: 0.6rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.hero-sub {
  font-size: 0.95rem;
  color: rgba(245,230,200,0.85);
  margin-bottom: 1.25rem;
  max-width: 480px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  background: #d4a574;
  color: #262117;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.65rem 1.4rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
  min-height: 44px;
  transition: background 0.2s, transform 0.2s;
  box-shadow: 0 4px 16px rgba(212,165,116,0.4);
}

.hero-cta:hover {
  background: #f5e6c8;
  color: #262117;
  transform: translateY(-2px);
}

/* Hero slash divider */
.hero-slash {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 60px;
  background: #f5e6c8;
  clip-path: polygon(0 60px, 100% 0, 100% 60px);
  z-index: 3;
}

/* ===== Scroll margin for anchored sections ===== */
main section[id],
section[id] {
  scroll-margin-top: 110px;
}

/* ===== Main Content ===== */
.site-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
}

/* Film strip decoration */
.film-strip-deco {
  display: flex;
  gap: 4px;
  margin-bottom: 2rem;
  padding: 6px 0;
  align-items: center;
}

.film-strip-deco span {
  display: block;
  width: 28px;
  height: 18px;
  border: 2px solid #d4a574;
  border-radius: 2px;
  background: rgba(212,165,116,0.12);
  opacity: 0.7;
}

/* Content + aside layout */
.content-sections {
  display: grid;
  grid-template-columns: 1fr 280px;
  grid-template-rows: auto 1fr;
  gap: 0 2rem;
  align-items: start;
}

.film-strip-deco {
  grid-column: 1 / -1;
}

.content-body {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
}

.content-aside {
  grid-column: 2;
  grid-row: 2;
  position: sticky;
  top: 110px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ===== Content Body Styles ===== */
.content-body section {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(212,165,116,0.3);
}

.content-body section:last-child {
  border-bottom: none;
}

.content-body h2 {
  font-family: 'Righteous', serif;
  font-size: clamp(1.3rem, 3vw, 1.75rem);
  color: #262117;
  margin-bottom: 0.3rem;
  position: relative;
}

.content-body h2 + hr {
  border-top-color: #d4a574;
  opacity: 0.7;
  margin-bottom: 1rem;
}

.content-body h3 {
  font-size: 1.1rem;
  color: #262117;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.content-body p {
  margin-bottom: 0.9rem;
  color: #3a2e1f;
}

.content-body ul, .content-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.content-body li {
  margin-bottom: 0.45rem;
  color: #3a2e1f;
  line-height: 1.7;
}

.content-body strong {
  color: #262117;
  font-weight: 600;
}

.content-body blockquote {
  border-left: 4px solid #d4a574;
  background: rgba(212,165,116,0.1);
  padding: 0.8rem 1.25rem;
  margin: 1.25rem 0;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: #4a3a28;
}

.content-body img {
  max-width: 100%;
  border-radius: 8px;
  filter: sepia(0.2) contrast(1.02) saturate(0.85);
  margin: 1rem 0;
}

.content-body a {
  color: #b8843a;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.content-body a:hover { color: #262117; }

/* figure inside section (contract requirement) */
.content-body section figure {
  margin: 1.25rem 0;
  border: 3px solid #d4a574;
  border-radius: 6px;
  padding: 0.6rem;
  background: rgba(245,230,200,0.6);
  display: inline-block;
  max-width: 100%;
}

.content-body section figure figcaption {
  font-size: 0.8rem;
  color: #7a6040;
  text-align: center;
  margin-top: 0.4rem;
  font-style: italic;
}

/* aside inside section (contract requirement) */
.content-body section aside {
  background: rgba(212,165,116,0.12);
  border-left: 4px solid #d4a574;
  border-radius: 0 8px 8px 0;
  padding: 0.85rem 1rem;
  margin: 1.25rem 0;
  font-size: 0.92rem;
  color: #4a3a28;
}

/* ===== Glass Cards ===== */
.glass-card {
  background: rgba(245,230,200,0.55);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(212,165,116,0.45);
  border-radius: 18px;
  padding: 1.25rem 1.1rem;
  box-shadow: 0 4px 24px rgba(38,33,23,0.08);
  transition: box-shadow 0.25s, transform 0.25s;
}

.glass-card:hover {
  box-shadow: 0 8px 32px rgba(38,33,23,0.13);
  transform: translateY(-2px);
}

.aside-title {
  font-family: 'Righteous', serif;
  font-size: 1rem;
  color: #262117;
  margin-bottom: 0.3rem;
}

.aside-nav-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.aside-link {
  font-size: 0.85rem;
  color: #7a5c30;
  font-weight: 500;
  display: block;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(212,165,116,0.2);
  transition: color 0.18s, padding-left 0.18s;
  min-height: 40px;
  line-height: 1.5;
}

.aside-link:hover { color: #262117; padding-left: 4px; }

.aside-tip-text {
  font-size: 0.85rem;
  color: #4a3a28;
  line-height: 1.65;
}

/* ===== Footer ===== */
.site-footer {
  background: #262117;
  color: #f5e6c8;
  margin-top: 4rem;
  position: relative;
  overflow: hidden;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #d4a574, #f5e6c8, #d4a574);
}

.footer-brand-bar {
  padding: 2.5rem 1.5rem 1rem;
  text-align: center;
  border-bottom: 1px solid rgba(212,165,116,0.2);
}

.footer-mega-brand {
  font-family: 'Righteous', serif;
  font-size: clamp(2.5rem, 8vw, 5rem);
  color: rgba(245,230,200,0.12);
  letter-spacing: 0.06em;
  line-height: 1;
  user-select: none;
}

.footer-cols {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.footer-dl dt {
  font-family: 'Righteous', serif;
  font-size: 0.95rem;
  color: #d4a574;
  margin-bottom: 0.75rem;
  letter-spacing: 0.06em;
}

.footer-dl dd {
  font-size: 0.82rem;
  color: rgba(245,230,200,0.7);
  margin-bottom: 0.45rem;
  line-height: 1.6;
}

.footer-link {
  color: rgba(245,230,200,0.7);
  font-size: 0.82rem;
  transition: color 0.18s;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.25rem 0;
}

.footer-link:hover { color: #d4a574; }

.footer-contact {
  font-size: 0.82rem;
  color: rgba(245,230,200,0.55);
}

.footer-bottom {
  border-top: 1px solid rgba(212,165,116,0.15);
  text-align: center;
  padding: 1.25rem 1rem;
}

.footer-copy {
  font-size: 0.78rem;
  color: rgba(245,230,200,0.4);
  letter-spacing: 0.04em;
}

/* ===== Animation: Stagger + Micro ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes polaroidShake {
  0%, 100% { transform: rotate(-1deg); }
  50% { transform: rotate(1.5deg); }
}

.content-body article {
  animation: fadeInUp 0.5s ease both;
}

.content-body article:nth-child(2) { animation-delay: 0.07s; }
.content-body article:nth-child(3) { animation-delay: 0.14s; }
.content-body article:nth-child(4) { animation-delay: 0.21s; }
.content-body article:nth-child(5) { animation-delay: 0.28s; }
.content-body article:nth-child(6) { animation-delay: 0.35s; }
.content-body article:nth-child(7) { animation-delay: 0.42s; }

.film-strip-deco span {
  animation: polaroidShake 2.5s ease-in-out infinite;
}
.film-strip-deco span:nth-child(2) { animation-delay: 0.3s; }
.film-strip-deco span:nth-child(3) { animation-delay: 0.6s; }
.film-strip-deco span:nth-child(4) { animation-delay: 0.9s; }
.film-strip-deco span:nth-child(5) { animation-delay: 1.2s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .light-leak { animation: none; }
  html { scroll-behavior: auto; }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .content-sections {
    grid-template-columns: 1fr;
  }

  .film-strip-deco { grid-column: 1; }

  .content-body {
    grid-column: 1;
    grid-row: 2;
  }

  .content-aside {
    grid-column: 1;
    grid-row: 3;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .aside-card {
    flex: 1 1 260px;
  }

  .footer-cols {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .header-inner {
    flex-wrap: wrap;
    padding: 0.5rem 1rem;
    gap: 0.5rem;
    min-height: auto;
  }

  .main-nav {
    order: 3;
    width: 100%;
  }

  .nav-row {
    gap: 0.1rem;
  }

  .nav-link {
    font-size: 0.75rem;
    padding: 0.5rem 0.5rem;
    min-height: 44px;
  }

  .header-search {
    order: 2;
  }

  .search-input {
    width: 90px;
  }

  .sticky-anchor-bar {
    top: 0;
  }

  .anchor-link {
    min-height: 44px;
    padding: 0.6rem 0.75rem;
  }

  .hero-content {
    padding: 1.5rem 1rem;
  }

  .hero-slash {
    height: 36px;
    clip-path: polygon(0 36px, 100% 0, 100% 36px);
  }

  .site-main {
    padding: 1.5rem 1rem 2rem;
  }

  .footer-cols {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .footer-mega-brand {
    font-size: clamp(2rem, 12vw, 3.5rem);
  }

  article[id] {
    scroll-margin-top: 140px;
  }
}
