/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  /* Brand Colors */
  --primary:        #2563EB;
  --primary-light:  #DBEAFE;
  --accent:         #10B981;
  --accent-light:   #D1FAE5;
  --warning:        #F59E0B;
  --warning-light:  #FEF3C7;
  --danger:         #EF4444;
  --danger-light:   #FEE2E2;

  /* Text */
  --text:           #111827;
  --secondary:      #6B7280;
  --text-invert:    #FFFFFF;

  /* Surface */
  --bg:             #FFFFFF;
  --bg-alt:         #F9FAFB;
  --border:         #E5E7EB;

  /* Elevation */
  --shadow:         0 1px 3px rgba(0,0,0,0.10), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:      0 4px 6px -1px rgba(0,0,0,0.10), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg:      0 10px 15px -3px rgba(0,0,0,0.10), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-xl:      0 20px 25px -5px rgba(0,0,0,0.10), 0 10px 10px -5px rgba(0,0,0,0.04);

  /* Shape */
  --radius:         12px;
  --radius-sm:      8px;
  --radius-lg:      16px;
  --radius-full:    9999px;

  /* Layout */
  --max-width:      1200px;
  --nav-height:     72px;

  /* Transitions */
  --transition:     150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-md:  300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   CSS RESET
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: "Inter", "Noto Sans TC", -apple-system, BlinkMacSystemFont,
               "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul, ol {
  list-style: none;
}

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

/* ============================================================
   TYPOGRAPHY SCALE
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  line-height: 1.2;
}

h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  line-height: 1.3;
}

h4 {
  font-size: 1.125rem;
  line-height: 1.4;
}

p {
  line-height: 1.7;
  color: var(--secondary);
}

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 24px;
}

@media (min-width: 768px) {
  .container {
    padding-inline: 40px;
  }
}

@media (min-width: 1280px) {
  .container {
    padding-inline: 48px;
  }
}

/* ============================================================
   SECTION BASE
   ============================================================ */
main > section {
  padding-block: 80px;
}

main > section:nth-child(even) {
  background-color: var(--bg-alt);
}

.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-header h2 {
  margin-bottom: 16px;
}

.section-header p {
  max-width: 600px;
  margin-inline: auto;
  font-size: 1.125rem;
}

.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-light);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transform: translateY(0);
  transition: transform var(--transition-md), box-shadow var(--transition-md);
}

.site-nav.nav--hidden {
  transform: translateY(-100%);
}

.site-nav.nav--visible {
  transform: translateY(0);
  box-shadow: var(--shadow-md);
}

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

.nav-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.04em;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo:hover {
  text-decoration: none;
  opacity: 0.85;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--secondary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--bg-alt);
  text-decoration: none;
}

.nav-links a.active {
  color: var(--primary);
  background: var(--primary-light);
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

/* Hamburger */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.nav-toggle:hover {
  background: var(--bg-alt);
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition-md), opacity var(--transition-md);
  transform-origin: center;
}

.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (min-width: 768px) {
  .nav-toggle {
    display: none;
  }
}

/* Mobile menu */
.nav-mobile {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px 24px;
  z-index: 99;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-lg);
}

.nav-mobile.is-open {
  display: flex;
}

.nav-mobile a {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  text-decoration: none;
}

.nav-mobile a:hover {
  background: var(--bg-alt);
  text-decoration: none;
}

@media (min-width: 768px) {
  .nav-mobile {
    display: none !important;
  }
}

/* ============================================================
   HERO SECTION
   ============================================================ */
#hero {
  padding-top: calc(var(--nav-height) + 80px);
  padding-bottom: 96px;
  text-align: center;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

#hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

#hero .container {
  position: relative;
  z-index: 1;
}

#hero h1 {
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 24px;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

#hero h1 .highlight {
  color: var(--primary);
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--secondary);
  max-width: 560px;
  margin: 0 auto 56px;
  line-height: 1.6;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--text);
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 32px 24px;
  font-size: 0.875rem;
}

.site-footer a {
  color: rgba(255,255,255,0.8);
}

.site-footer a:hover {
  color: #fff;
}

/* ============================================================
   PLACEHOLDER SECTIONS (scaffold only)
   ============================================================ */
.section-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  color: var(--secondary);
  font-size: 0.875rem;
  letter-spacing: 0.02em;
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.text-center  { text-align: center; }
.text-left    { text-align: left; }
.text-primary { color: var(--primary); }
.text-accent  { color: var(--accent); }
.text-danger  { color: var(--danger); }
.text-muted   { color: var(--secondary); }

.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }

.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}
