/* ============================================================
   USLA — U.S. Listing Association
   Shared stylesheet for index.html (中文) and en.html (English)
   Brand: deep navy + gold, serif display headings, clean & quiet
   v2: visual polish, staircase courses, progress band, a11y, print
   ============================================================ */

:root {
  --navy-950: #050d1a;
  --navy-900: #081527;
  --navy-800: #0b1e38;
  --navy-700: #12293f;
  --navy-600: #1d3a58;
  --gold: #c8a24a;
  --gold-light: #e6c877;
  --gold-pale: #f2dd9a;
  --gold-dark: #8a6d1f; /* gold darkened for text on light backgrounds (AA) */
  --paper: #f8f6f1;
  --paper-alt: #f1ede3;
  --ink: #1d2733;
  --ink-soft: #4a5766;
  --line: #ddd5c2;
  --white: #ffffff;
  --serif: Georgia, "Times New Roman", "Songti TC", "STSong", "PMingLiU", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "PingFang SC",
          "Microsoft JhengHei", "Noto Sans TC", "Noto Sans SC", sans-serif;
  --max: 1120px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy-700); text-decoration: none; }
a:hover { color: var(--gold-dark); }

/* Visible focus for keyboard users */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  background: var(--navy-900);
  color: var(--gold-light);
  padding: 10px 20px;
  font-size: 14px;
  letter-spacing: 0.06em;
  border: 1px solid var(--gold);
  transition: top 0.2s;
}
.skip-link:focus { top: 12px; color: var(--gold-light); }

.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 21, 39, 0.97);
  border-bottom: 1px solid rgba(200, 162, 74, 0.35);
}
.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: baseline; gap: 12px; }
.brand-mark {
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: 0.14em;
  color: var(--gold-light);
  font-weight: 700;
}
.brand-name {
  color: var(--white);
  font-size: 15px;
  letter-spacing: 0.08em;
  line-height: 1.3;
  display: flex;
  flex-direction: column;
}
.brand-name small {
  font-size: 10px;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
}
.site-nav { display: flex; align-items: center; gap: 26px; }
.site-nav a {
  color: rgba(255, 255, 255, 0.88);
  font-size: 14.5px;
  letter-spacing: 0.06em;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.site-nav a:hover { color: var(--gold-light); border-bottom-color: var(--gold); }
.lang-switch { display: flex; align-items: center; gap: 8px; margin-left: 6px; }
.lang-switch i { color: rgba(255, 255, 255, 0.3); font-style: normal; }
.lang-switch a { font-size: 13.5px; color: rgba(255, 255, 255, 0.6); border-bottom: none; }
.lang-switch a.active { color: var(--gold-light); }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px 4px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--gold-light);
  margin: 5px 0;
  transition: transform 0.25s, opacity 0.25s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: linear-gradient(168deg, var(--navy-800) 0%, var(--navy-900) 55%, var(--navy-950) 100%);
  color: var(--white);
  overflow: hidden;
}
.hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--max);
  margin: 0 auto;
  padding: 108px 24px 205px;
  text-align: center;
}
.hero-badge {
  display: inline-block;
  font-size: 12.5px;
  letter-spacing: 0.28em;
  color: var(--gold-light);
  background: rgba(200, 162, 74, 0.07);
  border: 1px solid rgba(200, 162, 74, 0.55);
  border-radius: 999px;
  padding: 5px 18px 5px 21px;
  margin-bottom: 34px;
}
.hero-title {
  font-family: var(--serif);
  font-size: clamp(38px, 6.4vw, 62px);
  letter-spacing: 0.12em;
  font-weight: 700;
  line-height: 1.25;
}
.hero-title-en { letter-spacing: 0.04em; }
.hero-subtitle {
  margin-top: 16px;
  font-family: var(--serif);
  font-size: clamp(14px, 2.2vw, 19px);
  letter-spacing: 0.42em;
  color: var(--gold-light);
  text-transform: uppercase;
}
.hero-subtitle::after {
  content: "";
  display: block;
  width: 64px;
  height: 2px;
  background: var(--gold);
  margin: 26px auto 0;
}
.hero-tagline {
  margin: 30px auto 0;
  max-width: 640px;
  font-size: clamp(16px, 2.4vw, 20px);
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.05em;
}
.hero-note {
  margin-top: 16px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.62);
  letter-spacing: 0.05em;
}
.hero-actions {
  margin-top: 44px;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-skyline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 190px;
  z-index: 1;
}

.btn {
  display: inline-block;
  padding: 12px 30px;
  font-size: 15px;
  letter-spacing: 0.1em;
  border-radius: 2px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn-gold { background: var(--gold); color: var(--navy-950); font-weight: 600; }
.btn-gold:hover { background: var(--gold-light); color: var(--navy-950); }
.btn-outline { border: 1px solid rgba(255, 255, 255, 0.45); color: var(--white); }
.btn-outline:hover { border-color: var(--gold-light); color: var(--gold-light); }

/* ---------- Sections ---------- */
.section { padding: 92px 0; }
.section-alt { background: var(--paper-alt); }
.section-kicker {
  font-family: var(--serif);
  font-size: 12.5px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 12px;
}
.section-title {
  font-family: var(--serif);
  font-size: clamp(27px, 4vw, 36px);
  letter-spacing: 0.06em;
  color: var(--navy-800);
  font-weight: 700;
  padding-bottom: 18px;
  margin-bottom: 32px;
  border-bottom: 2px solid var(--gold);
  display: inline-block;
}
.section-lead { max-width: 780px; color: var(--ink-soft); margin-bottom: 44px; }
.section-note { margin-top: 30px; font-size: 14px; color: var(--ink-soft); }

/* Dark band (formation progress) */
.section-dark {
  background: linear-gradient(160deg, var(--navy-800) 0%, var(--navy-950) 100%);
  color: rgba(255, 255, 255, 0.88);
}
.section-dark .section-kicker { color: var(--gold-light); }
.section-dark .section-title { color: var(--white); }
.section-dark .section-lead { color: rgba(255, 255, 255, 0.68); }

/* About */
.about-grid, .contact-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 48px;
  align-items: start;
}
.about-text p { margin-bottom: 18px; }
.about-text strong { color: var(--navy-700); }
.fact-list { border-top: 1px solid var(--line); }
.fact-list > div {
  padding: 14px 2px;
  border-bottom: 1px solid var(--line);
}
.fact-list dt {
  font-size: 12.5px;
  letter-spacing: 0.18em;
  color: var(--gold-dark);
  margin-bottom: 3px;
  font-weight: 600;
}
.fact-list dd { font-size: 15.5px; color: var(--ink); }

/* Cards (mission / membership) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
.card-grid-3 { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  padding: 32px 28px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(8, 21, 39, 0.1);
}
.card-icon {
  display: block;
  color: var(--gold-dark);
  margin-bottom: 18px;
}
.card-icon svg { width: 44px; height: 44px; display: block; }
.card h3 {
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0.05em;
  color: var(--navy-800);
  margin-bottom: 12px;
}
.card p { font-size: 15px; color: var(--ink-soft); }

/* Membership cards */
.member-card { text-align: left; }
.member-card .card-icon {
  width: 64px;
  height: 64px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
}
.member-card .card-icon svg { width: 34px; height: 34px; }

/* ---------- Formation progress ---------- */
.progress-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  position: relative;
}
.progress-steps::before {
  content: "";
  position: absolute;
  top: 27px;
  left: 14%;
  right: 14%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200, 162, 74, 0.55) 18%, rgba(200, 162, 74, 0.55) 82%, transparent);
}
.progress-step { position: relative; }
.progress-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: var(--navy-900);
  color: var(--gold-light);
  font-family: var(--serif);
  font-size: 22px;
  position: relative;
  z-index: 1;
  margin-bottom: 20px;
}
.progress-step h3 {
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0.05em;
  color: var(--white);
  margin-bottom: 10px;
}
.progress-step p { font-size: 14.5px; color: rgba(255, 255, 255, 0.64); max-width: 300px; }

/* ---------- Courses (numbered staircase) ---------- */
.course-ladder {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  align-items: start;
}
.course-card {
  background: var(--navy-800);
  color: var(--white);
  padding: 28px 24px 30px;
  position: relative;
}
.course-card::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 16px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}
.course-step {
  font-size: 11.5px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 10px;
}
.course-code {
  font-family: var(--serif);
  font-size: 30px;
  color: var(--gold-light);
  letter-spacing: 0.06em;
  line-height: 1;
  margin-bottom: 14px;
}
.course-card h3 { font-size: 17.5px; letter-spacing: 0.04em; margin-bottom: 10px; font-weight: 600; }
.course-card p { font-size: 14px; color: rgba(255, 255, 255, 0.74); line-height: 1.7; }
.course-card .course-step { color: var(--gold-light); }
.course-feature {
  margin-top: 26px;
  border: 1px solid var(--gold);
  background: linear-gradient(120deg, var(--navy-900), var(--navy-700));
  color: var(--white);
  padding: 34px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}
.course-feature .course-step { margin-bottom: 6px; }
.course-feature .course-code { font-size: 13px; letter-spacing: 0.34em; margin-bottom: 8px; }
.course-feature h3 { font-family: var(--serif); font-size: 24px; letter-spacing: 0.06em; margin-bottom: 10px; }
.course-feature p { font-size: 15px; color: rgba(255, 255, 255, 0.8); max-width: 720px; }
.course-feature .btn { flex-shrink: 0; }

/* Staircase offsets + connectors on wide screens */
@media (min-width: 1100px) {
  .course-card:nth-child(1) { margin-top: 45px; }
  .course-card:nth-child(2) { margin-top: 30px; }
  .course-card:nth-child(3) { margin-top: 15px; }
  .course-card:nth-child(4) { margin-top: 0; }
  .course-card::before {
    content: "";
    position: absolute;
    top: 50%;
    right: -14px;
    width: 9px;
    height: 9px;
    border-top: 2px solid var(--gold);
    border-right: 2px solid var(--gold);
    transform: translateY(-50%) rotate(45deg);
    z-index: 3;
  }
  .course-card:last-child::before { display: none; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-950);
  color: rgba(255, 255, 255, 0.68);
  padding: 56px 0 44px;
  font-size: 14px;
}
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(200, 162, 74, 0.25);
  margin-bottom: 22px;
}
.footer-brand {
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.08em;
  color: var(--white);
}
.footer-brand span { color: var(--gold-light); font-size: 14px; margin-left: 8px; }
.footer-lang a { color: rgba(255, 255, 255, 0.65); }
.footer-lang a:hover { color: var(--gold-light); }
.disclaimer { font-size: 12.5px; line-height: 1.8; color: rgba(255, 255, 255, 0.55); margin-bottom: 16px; }
.copyright { font-size: 12.5px; color: rgba(255, 255, 255, 0.5); letter-spacing: 0.04em; }

/* ---------- Back to top ---------- */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: var(--navy-900);
  color: var(--gold-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  z-index: 90;
}
.to-top.show { opacity: 1; pointer-events: auto; }

/* ---------- Scroll reveal (only when JS is on) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.js .reveal.visible { opacity: 1; transform: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .card, .card:hover { transform: none; transition: none; }
  .to-top, .site-nav a, .btn, .nav-toggle span { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .card-grid, .card-grid-3 { grid-template-columns: 1fr; }
  .course-ladder { grid-template-columns: repeat(2, 1fr); }
  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 30px; }
  .course-feature { flex-direction: column; align-items: flex-start; }
  .progress-steps { grid-template-columns: 1fr; gap: 30px; }
  .progress-steps::before { display: none; }
  .progress-step p { max-width: none; }
}

@media (max-width: 680px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--navy-900);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 10px 24px 18px;
    border-bottom: 1px solid rgba(200, 162, 74, 0.35);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 10px 0; width: 100%; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
  .lang-switch { margin: 12px 0 2px; }
  .lang-switch a { width: auto; border-bottom: none; padding: 0; }
  .brand-name { display: none; }
  .section { padding: 64px 0; }
  .hero-inner { padding: 72px 20px 165px; }
  .hero-skyline { height: 140px; }
  .course-ladder { grid-template-columns: 1fr; }
}

/* ---------- Print ---------- */
@media print {
  body { background: #fff; color: #000; font-size: 12pt; }
  .site-header, .site-nav, .nav-toggle, .to-top, .hero-actions, .skip-link { display: none !important; }
  .hero { background: #fff; color: #000; overflow: visible; }
  .hero-inner { padding: 24px 0 12px; text-align: left; }
  .hero-title, .hero-subtitle, .hero-tagline, .hero-note { color: #000; }
  .hero-badge { color: #000; border-color: #000; background: none; }
  .hero-subtitle::after { background: #000; margin: 12px 0 0; }
  .hero-skyline { display: none; }
  .section { padding: 26px 0; }
  .section-alt, .section-dark { background: #fff; }
  .section-dark, .section-dark .section-title, .section-dark .section-lead,
  .section-dark .progress-step h3, .section-dark .progress-step p { color: #000; }
  .progress-num { background: #fff; color: #000; border-color: #000; }
  .progress-steps::before { display: none; }
  .course-card, .course-feature { background: #fff; color: #000; border: 1px solid #888; }
  .course-card p, .course-feature p, .course-code, .course-step { color: #000; }
  .course-card::after, .course-card::before { display: none; }
  .course-card { margin-top: 0 !important; }
  .card { box-shadow: none; }
  .site-footer { background: #fff; color: #000; }
  .footer-brand, .disclaimer, .copyright, .footer-lang a { color: #000; }
  a { color: #000; text-decoration: underline; }
  .js .reveal { opacity: 1; transform: none; }
}
