@import url('https://fonts.googleapis.com/css2?family=Lexend+Mega:wght@100..900&family=Public+Sans:wght@100..900&display=swap');

/* =============================================
   CSS 变量 & 基础
============================================= */
:root {
  --cream: #f5e6c8;
  --caramel: #d4a574;
  --ink: #262117;
  --ink-80: rgba(38,33,23,0.80);
  --ink-40: rgba(38,33,23,0.40);
  --caramel-light: #e8c49a;
  --caramel-dark: #b8813a;
  --cream-dark: #e8d5a8;
  --header-h: 64px;
  --radius: 4px;
  --font-head: 'Lexend Mega', sans-serif;
  --font-body: 'Public Sans', system-ui, sans-serif;
  --transition: 0.22s ease;
}

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

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

body.vintage-body {
  background-color: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  overflow-x: hidden;
  position: relative;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration: underline; }
a:hover { color: var(--caramel-dark); }

/* =============================================
   胶片噪点 + 光晕覆层
============================================= */
.grain-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  animation: grainShift 0.15s steps(1) infinite;
}

@keyframes grainShift {
  0%   { background-position: 0 0; }
  20%  { background-position: -30px 10px; }
  40%  { background-position: 15px -20px; }
  60%  { background-position: -10px 30px; }
  80%  { background-position: 25px -5px; }
  100% { background-position: 0 0; }
}

.light-leak {
  pointer-events: none;
  position: fixed;
  top: -20%;
  right: -10%;
  width: 60%;
  height: 60%;
  z-index: 9998;
  background: radial-gradient(ellipse at top right, rgba(212,165,116,0.18) 0%, transparent 70%);
  animation: leakPulse 6s ease-in-out infinite alternate;
}

@keyframes leakPulse {
  from { opacity: 0.6; transform: scale(1); }
  to   { opacity: 1;   transform: scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  .grain-overlay { animation: none; }
  .light-leak    { animation: none; }
  html { scroll-behavior: auto; }
}

/* =============================================
   HEADER
============================================= */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 1000;
  background: var(--ink);
  border-bottom: 2px solid var(--caramel);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1.25rem;
}

.brand-mark {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  text-decoration: none;
}

.brand-text-icon {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--cream);
  background: var(--caramel);
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  border: 2px solid var(--caramel-dark);
  letter-spacing: -0.05em;
}

.brand-icon, .brand-logo {
  width: 40px; height: 40px;
  object-fit: contain;
  border-radius: var(--radius);
}

/* desktop nav */
.desktop-nav {
  display: none;
}

.desktop-nav p {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.25rem;
  align-items: center;
}

.desktop-nav p a {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--cream);
  text-decoration: none;
  padding: 0 0.6rem;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
  white-space: nowrap;
  min-height: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.desktop-nav p a:hover {
  border-color: var(--caramel);
  color: var(--caramel);
  background: rgba(212,165,116,0.08);
}

@media (min-width: 900px) {
  .desktop-nav { display: block; flex: 1; }
}

/* hamburger */
.hamburger {
  margin-left: auto;
  background: none;
  border: 2px solid var(--caramel);
  border-radius: var(--radius);
  width: 44px; height: 44px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--caramel);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =============================================
   全屏遮罩菜单
============================================= */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.nav-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.overlay-close {
  position: absolute;
  top: 1.25rem; right: 1.5rem;
  background: none;
  border: 2px solid var(--caramel);
  color: var(--caramel);
  font-size: 1.3rem;
  width: 48px; height: 48px;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}

.overlay-close:hover { background: var(--caramel-dark); color: var(--cream); }

.overlay-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0 2rem;
}

.overlay-link {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.2rem, 4vw, 2rem);
  color: var(--cream);
  text-decoration: none;
  border-bottom: 2px solid var(--caramel);
  padding: 0.5rem 1.5rem;
  min-height: 48px;
  display: flex; align-items: center;
  transition: color var(--transition), border-color var(--transition);
  letter-spacing: -0.02em;
}

.overlay-link:hover { color: var(--caramel); }

/* =============================================
   MAIN + ARTICLE + SECTION 三层结构
============================================= */
main {
  padding-top: var(--header-h);
  display: flex;
  flex-direction: column;
  gap: 0;
}

@media (min-width: 1100px) {
  main {
    flex-direction: row;
    align-items: flex-start;
  }
}

article {
  flex: 1;
  min-width: 0;
}

/* =============================================
   HERO SECTION
============================================= */
.hero-section {
  min-height: 100vh;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  scroll-margin-top: var(--header-h);
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(212,165,116,0.12) 0%, transparent 60%),
              linear-gradient(225deg, rgba(245,230,200,0.06) 0%, transparent 50%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 3rem 1.5rem 2rem;
  max-width: 780px;
  width: 100%;
}

.hero-badges {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.vhs-badge {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  color: var(--ink);
  background: var(--caramel);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius);
  border: 2px solid var(--caramel-dark);
  text-transform: uppercase;
  position: relative;
  animation: vhsBadgePulse 3s ease-in-out infinite;
}

.vhs-badge--alt {
  background: transparent;
  color: var(--caramel);
  border-color: var(--caramel);
  animation-delay: 1s;
}

@keyframes vhsBadgePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

@media (prefers-reduced-motion: reduce) {
  .vhs-badge { animation: none; }
}

.hero-h1 {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(2rem, 7vw, 4.5rem);
  color: var(--cream);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  text-shadow: 3px 3px 0 var(--caramel-dark);
}

.hero-lead {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--caramel-light);
  max-width: 560px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

.hero-cta-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-primary {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--caramel);
  border: 2.5px solid var(--caramel-dark);
  padding: 0.75rem 2rem;
  border-radius: var(--radius);
  text-decoration: none;
  min-height: 48px;
  display: inline-flex; align-items: center;
  transition: background var(--transition), transform 0.1s ease;
  letter-spacing: -0.01em;
}

.btn-primary:hover {
  background: var(--caramel-dark);
  color: var(--cream);
  transform: translate(-2px, -2px);
}

.btn-secondary {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--cream);
  background: transparent;
  border: 2.5px solid var(--caramel);
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  text-decoration: none;
  min-height: 48px;
  display: inline-flex; align-items: center;
  transition: background var(--transition), transform 0.1s ease;
}

.btn-secondary:hover {
  background: var(--caramel);
  color: var(--ink);
  transform: translate(-2px, -2px);
}

.hero-vhs-bar {
  position: absolute;
  bottom: 1.5rem;
  left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 2rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--caramel);
  opacity: 0.7;
  z-index: 2;
}

/* VHS 扫描线 */
.hero-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0,0,0,0.08) 3px,
    rgba(0,0,0,0.08) 4px
  );
  pointer-events: none;
  z-index: 1;
}

/* =============================================
   正文内容 section（来自 page.content）
============================================= */
article section {
  max-width: 860px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
  border-bottom: 2px solid var(--caramel);
  scroll-margin-top: calc(var(--header-h) + 0.5rem);
}

article section:last-child { border-bottom: none; }

article section h2 {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  color: var(--ink);
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
  position: relative;
  padding-left: 1rem;
}

article section h2::before {
  content: '';
  position: absolute;
  left: 0; top: 0.15em; bottom: 0.15em;
  width: 4px;
  background: var(--caramel);
  border-radius: 2px;
}

article div h2 + p,
article div h2 + .subtitle {
  font-size: 1rem;
  color: var(--ink-80);
  margin-bottom: 1.5rem;
  font-weight: 500;
}

article div h3 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  margin: 2rem 0 0.75rem;
  color: var(--ink);
  letter-spacing: -0.02em;
}

article div p {
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 1rem;
  color: var(--ink);
}

article div ul,
article div ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

article div li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
  font-size: 1rem;
}

article div a {
  color: var(--caramel-dark);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

article div a:hover { color: var(--ink); }

article div blockquote {
  border-left: 4px solid var(--caramel);
  padding: 1rem 1.25rem;
  background: var(--cream-dark);
  margin: 1.5rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--ink-80);
}

article div table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

article div th,
article div td {
  border: 2px solid var(--caramel);
  padding: 0.6rem 0.9rem;
  text-align: left;
}

article div th {
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-head);
  font-weight: 700;
}

article div td { background: var(--cream); }

article div .card {
  border: 2.5px solid var(--caramel);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  background: var(--cream);
  transition: transform 0.15s ease;
}

article div .card:hover { transform: translate(-2px, -2px); }

article div img {
  border: 3px solid var(--ink);
  padding: 0.5rem;
  background: white;
  box-shadow: 4px 4px 0 var(--ink);
  border-radius: var(--radius);
  margin: 1.25rem auto;
}

/* =============================================
   ASIDE（右侧边栏）
============================================= */
.site-aside {
  width: 100%;
  background: var(--cream-dark);
  border-top: 2px solid var(--caramel);
  padding: 2rem 1.5rem;
}

@media (min-width: 1100px) {
  .site-aside {
    width: 260px;
    flex-shrink: 0;
    border-top: none;
    border-left: 2px solid var(--caramel);
    position: sticky;
    top: var(--header-h);
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    padding: 2rem 1.25rem;
  }
}

.aside-inner h2 {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.aside-inner .subtitle {
  font-size: 0.82rem;
  color: var(--ink-80);
  margin-bottom: 1.25rem;
}

.aside-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.aside-links li a {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--ink);
  text-decoration: none;
  padding: 0.55rem 0.75rem;
  border: 1.5px solid var(--caramel);
  border-radius: var(--radius);
  background: var(--cream);
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: background var(--transition), border-color var(--transition);
}

.aside-links li a:hover {
  background: var(--caramel);
  border-color: var(--caramel-dark);
  color: var(--ink);
}

.aside-badge {
  display: flex;
  justify-content: center;
}

.polaroid-tag {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--caramel-dark);
  border: 2px solid var(--caramel);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius);
  background: white;
  box-shadow: 2px 2px 0 var(--ink);
}

/* =============================================
   FOOTER
============================================= */
.site-footer {
  background: var(--ink);
  color: var(--cream);
  border-top: 3px solid var(--caramel);
}

.footer-form-block {
  padding: 3rem 1.5rem 2rem;
  max-width: 860px;
  margin: 0 auto;
  border-bottom: 1.5px solid rgba(212,165,116,0.25);
  text-align: center;
}

.footer-form-block h2 {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(1.3rem, 3vw, 2rem);
  color: var(--cream);
  letter-spacing: -0.03em;
  margin-bottom: 0.35rem;
}

.footer-form-block .subtitle {
  font-size: 0.9rem;
  color: var(--caramel-light);
  margin-bottom: 1.5rem;
}

.subscribe-form {
  display: flex;
  gap: 0.5rem;
  max-width: 440px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.subscribe-form input[type="email"] {
  flex: 1;
  min-width: 180px;
  padding: 0.75rem 1rem;
  border: 2px solid var(--caramel);
  border-radius: var(--radius);
  background: rgba(245,230,200,0.08);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition);
}

.subscribe-form input[type="email"]::placeholder { color: var(--ink-40); }
.subscribe-form input[type="email"]:focus { border-color: var(--caramel-light); }

.subscribe-form button {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.88rem;
  padding: 0.75rem 1.5rem;
  background: var(--caramel);
  color: var(--ink);
  border: 2px solid var(--caramel-dark);
  border-radius: var(--radius);
  cursor: pointer;
  min-height: 48px;
  transition: background var(--transition);
}

.subscribe-form button:hover { background: var(--caramel-dark); color: var(--cream); }

/* footer columns — 三个 dl */
.footer-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  max-width: 1080px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

@media (min-width: 600px) {
  .footer-cols { grid-template-columns: repeat(3, 1fr); gap: 0 1.5rem; }
}

.footer-col {
  padding: 1rem 0;
  border-bottom: 1px solid rgba(212,165,116,0.15);
}

@media (min-width: 600px) {
  .footer-col { border-bottom: none; border-right: 1px solid rgba(212,165,116,0.15); padding: 0 1.25rem; }
  .footer-col:last-child { border-right: none; }
}

.footer-col dt {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--caramel);
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.footer-col dd {
  margin-bottom: 0.45rem;
}

.footer-col dd a,
.footer-col dd {
  font-size: 0.88rem;
  color: rgba(245,230,200,0.75);
  text-decoration: none;
  line-height: 1.6;
  transition: color var(--transition);
}

.footer-col dd a:hover { color: var(--caramel); }

/* footer bottom */
.footer-bottom {
  border-top: 1.5px solid rgba(212,165,116,0.2);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  text-align: center;
}

@media (min-width: 720px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-copy {
  font-size: 0.82rem;
  color: var(--caramel);
  font-weight: 600;
}

.footer-disclaimer {
  font-size: 0.78rem;
  color: rgba(245,230,200,0.5);
}

/* =============================================
   Scroll Reveal（原生 JS IntersectionObserver）
============================================= */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* =============================================
   scroll-margin-top for anchored sections
============================================= */
div[id] {
  scroll-margin-top: calc(var(--header-h) + 0.5rem);
}

/* =============================================
   Responsive safety
============================================= */
@media (max-width: 480px) {
  .hero-vhs-bar { font-size: 0.65rem; padding: 0 1rem; }
  .footer-cols  { padding: 1.5rem 1rem; }
  .footer-form-block { padding: 2rem 1rem 1.5rem; }
  article div { padding: 2.5rem 1rem; }
}

button[aria-expanded]{min-width:44px;min-height:44px}
