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

:root {
  --spring-green: #7EC850;
  --summer-blue: #2E86C1;
  --autumn-orange: #E67E22;
  --winter-white: #F8F9FA;
  --china-red: #D32F2F;
  --rock-gray: #707070;
  --clay: #A67B5B;
  --slate: #2C3E50;
  --font-heading: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Noto Serif SC', 'Songti SC', 'Times New Roman', serif;
  --font-size-h1: 3rem;
  --font-size-h2: 2.25rem;
  --font-size-h3: 1.75rem;
  --font-size-body: 1rem;
  --font-size-small: 0.875rem;
  --content-max-width: 1200px;
  --header-height: 80px;
  --header-bottom-border: 3px solid var(--china-red);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  color: var(--slate);
  background: var(--winter-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
  letter-spacing: 0.02em;
}

h1 { font-size: var(--font-size-h1); font-weight: 800; }
h2 { font-size: var(--font-size-h2); font-weight: 700; }
h3 { font-size: var(--font-size-h3); font-weight: 600; }

a { color: var(--summer-blue); text-decoration: none; transition: color 0.2s; }
a:hover, a:focus-visible { color: var(--china-red); }

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

/* === Skip Link === */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--china-red);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 1000;
  font-family: var(--font-heading);
}
.skip-link:focus { top: 0; }

/* === Container === */
.container {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* === Header === */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: var(--winter-white);
  border-bottom: var(--header-bottom-border);
  height: var(--header-height);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
  height: 100%;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--slate);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.navigation ul {
  list-style: none;
  display: flex;
  gap: 1.25rem;
}

.navigation a {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  color: var(--slate);
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}

.navigation a:hover,
.navigation a:focus-visible,
.navigation a[aria-current="page"] {
  color: var(--china-red);
  border-bottom-color: var(--china-red);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 10;
}

.nav-toggle-icon {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--slate);
  position: relative;
  transition: background 0.2s;
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--slate);
  transition: transform 0.3s;
}

.nav-toggle-icon::before { top: -8px; }
.nav-toggle-icon::after { top: 8px; }

button[data-nav-toggle][aria-expanded="true"] .nav-toggle-icon { background: transparent; }
button[data-nav-toggle][aria-expanded="true"] .nav-toggle-icon::before { transform: rotate(45deg); top: 0; }
button[data-nav-toggle][aria-expanded="true"] .nav-toggle-icon::after { transform: rotate(-45deg); top: 0; }

.scroll-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background: var(--china-red);
  width: 0%;
  transition: width 0.1s linear;
  will-change: width;
  z-index: 1;
}

/* === Footer === */
.site-footer {
  background: var(--slate);
  color: var(--winter-white);
  padding: 3rem 0;
  text-align: center;
  font-size: var(--font-size-small);
  line-height: 1.8;
}

.site-footer a {
  color: var(--summer-blue);
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--autumn-orange);
}

.footer-brand {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  letter-spacing: 0.06em;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.footer-contact,
.footer-icp,
.footer-note,
.footer-copy {
  margin-bottom: 0.5rem;
}

/* === General Button === */
.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  border: none;
  background: var(--summer-blue);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  text-align: center;
}

.btn:hover,
.btn:focus-visible {
  background: var(--china-red);
  transform: scale(1.02);
}

/* === Section Label (optional shared) === */
.section-label {
  writing-mode: vertical-rl;
  font-family: var(--font-heading);
  font-size: var(--font-size-small);
  color: var(--clay);
  letter-spacing: 0.3em;
}

/* === Back-to-top (created by JS) === */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  background: var(--summer-blue);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, background 0.2s;
  z-index: 998;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover,
.back-to-top:focus-visible {
  background: var(--china-red);
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .scroll-progress { transition: none; }
}

/* === Responsive === */
@media (max-width: 768px) {
  :root { --header-height: 64px; }

  .header-inner { padding: 0 1rem; }
  .brand-title { font-size: 1.5rem; }

  .nav-toggle { display: block; }

  .navigation {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--winter-white);
    border-bottom: 2px solid var(--china-red);
    padding: 1rem;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s, opacity 0.3s, visibility 0.3s;
  }

  .navigation[data-open] {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .navigation ul {
    flex-direction: column;
    gap: 0.75rem;
  }

  .footer-links {
    flex-direction: column;
    gap: 0.5rem;
  }
}

@media (min-width: 769px) {
  .navigation { display: block !important; }
  .nav-toggle { display: none; }
}

/* === Focus Visible === */
:focus-visible {
  outline: 3px solid var(--china-red);
  outline-offset: 2px;
}

/* === Placeholder for images (used in page-specific CSS) === */
.img-placeholder {
  background: var(--clay);
  display: block;
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
}
