:root {
  --bg: #f7f5f0;
  --bg-alt: #efece4;
  --text: #2b2823;
  --text-soft: #5c574c;
  --accent: #6b6154;
  --line: #ded8c9;
  --transition: 0.35s ease;
}
[data-theme="dark"] {
  --bg: #14130f;
  --bg-alt: #1c1a15;
  --text: #e9e4d8;
  --text-soft: #b3ac9b;
  --accent: #b7ab8f;
  --line: #35322a;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'EB Garamond', Georgia, serif;
  line-height: 1.65;
  transition: background var(--transition), color var(--transition);
}

html[lang="zh"] body {
  font-family: 'Noto Serif SC', 'EB Garamond', serif;
}

/* language visibility */
body.lang-en .zh { display: none; }
body.lang-zh .en { display: none; }

a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--line); }
a:hover { border-bottom-color: var(--accent); }

.wrap { max-width: 860px; margin: 0 auto; padding: 0 28px; }

/* Header / Nav */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  transition: background var(--transition), border-color var(--transition);
}
.nav-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}
.brand {
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  font-weight: 500;
  color: var(--text);
}
nav ul {
  list-style: none;
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  font-size: 0.95rem;
}
nav a {
  color: var(--text-soft);
  border-bottom: none;
}
nav a:hover { color: var(--accent); }
.controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ctrl-btn {
  font-family: inherit;
  font-size: 0.85rem;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-soft);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--transition);
}
.ctrl-btn:hover { border-color: var(--accent); color: var(--accent); }
.inquire-btn {
  font-size: 0.9rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 7px 16px;
  border-radius: 999px;
  white-space: nowrap;
}
.inquire-btn:hover { background: var(--accent); color: var(--bg); }

section { padding: 90px 0; transition: background var(--transition); }
section.section-alt { background: var(--bg-alt); }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  color: var(--text-soft);
  font-family: system-ui, sans-serif;
  margin-bottom: 18px;
}

h1 { font-size: 2.6rem; font-weight: 500; margin: 0 0 20px; }
h2 { font-size: 1.9rem; font-weight: 500; margin: 0 0 20px; }
h3 { font-size: 1.25rem; font-weight: 500; margin: 0 0 10px; }

.lede { font-size: 1.25rem; color: var(--text-soft); max-width: 620px; }

/* Home */
#home { padding-top: 70px; }
.home-cta { margin-top: 28px; }

/* What is offered — two cards */
.offer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 40px;
}
.offer-card {
  background: var(--bg-alt);
  border-radius: 6px;
  padding: 30px;
  transition: background var(--transition);
}

/* Practice three columns */
.practice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
  margin-top: 40px;
}
.practice-card {
  background: var(--bg-alt);
  border-radius: 6px;
  padding: 28px 26px;
  transition: background var(--transition);
}
.practice-card .eyebrow { margin-bottom: 8px; }

/* Fields */
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 480px));
  justify-content: start;
  gap: 32px;
  margin-top: 40px;
}
.field-card {
  background: var(--bg);
  border-radius: 6px;
  padding: 30px;
  transition: background var(--transition);
}
.field-card .status { margin-bottom: 6px; }
.field-card h3 { margin-bottom: 10px; }
.field-meta {
  font-size: 0.9rem;
  color: var(--text-soft);
  margin-bottom: 18px;
}
.field-inquire {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.9rem;
}

/* Records */
.record-item {
  border-top: 1px solid var(--line);
  padding: 28px 0;
}
.record-item:first-of-type { border-top: none; }
.status {
  font-style: italic;
  color: var(--text-soft);
  font-size: 0.95rem;
}

/* Video: one large, centered thumbnail at a time. Clicking it opens the
   video on YouTube in a new tab (no embedded iframe player, which
   YouTube's player can refuse to run on some origins). Prev/next arrows
   step through the group — no scrollbar. */
.video-viewer { margin-top: 28px; }
.video-stage {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
}
.video-cover {
  position: relative;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(100deg, var(--bg-alt) 30%, var(--line) 50%, var(--bg-alt) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}
.video-cover.loaded { animation: none; background: var(--bg-alt); }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.video-cover-img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease, transform var(--transition);
}
.video-cover-img.loaded { opacity: 0.92; }
.video-cover:hover .video-cover-img.loaded {
  opacity: 1;
  transform: scale(1.01);
}
.video-cover::after {
  content: '▷';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
  color: #f5f2ea;
  background: rgba(20, 19, 15, 0.22);
  opacity: 0.55;
  transition: opacity var(--transition);
}
.video-cover:hover::after,
.video-cover:focus-visible::after { opacity: 1; }

/* Prev / next arrows, overlaid on the stage edges */
.video-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: rgba(20, 19, 15, 0.55);
  color: #f5f2ea;
  font-size: 1.6rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.9;
  z-index: 2;
  transition: opacity var(--transition), background var(--transition), transform var(--transition);
}
.video-nav:hover { opacity: 1; background: rgba(20, 19, 15, 0.8); }
.video-nav:active { transform: translateY(-50%) scale(0.92); }
.video-nav.prev { left: 12px; }
.video-nav.next { right: 12px; }
.video-nav[hidden] { display: none; }

.video-cover-title {
  margin-top: 16px;
  min-height: 1.4em;
  font-size: 0.95rem;
  font-style: italic;
  color: var(--text-soft);
  text-align: center;
  opacity: 1;
  transition: opacity 0.2s ease;
}
.video-cover-title.swapping { opacity: 0; }
.video-counter {
  margin-top: 4px;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  text-align: center;
}

/* About */
#about p { max-width: 620px; }

/* Footer / contact */
footer {
  padding: 60px 0 40px;
  font-size: 0.9rem;
  color: var(--text-soft);
  border-top: 1px solid var(--line);
}
footer .brand-line { color: var(--text); margin-bottom: 6px; }
footer .contact-block { margin: 24px 0; }
footer .legal { margin-top: 20px; }
footer .legal a { border-bottom: none; margin-right: 14px; }
footer .legal a.current { color: var(--accent); }

/* Legal / policy pages */
.legal-page main { padding: 70px 0 40px; }
.legal-page .eff-date {
  color: var(--text-soft);
  font-size: 1rem;
  margin-bottom: 40px;
}
.legal-page .back-link {
  display: inline-block;
  margin-bottom: 36px;
  font-size: 0.9rem;
  border-bottom: none;
  color: var(--text-soft);
}
.legal-page .back-link:hover { color: var(--accent); }
.legal-page h3 {
  margin-top: 44px;
  font-size: 1.15rem;
}
.legal-page p { max-width: 700px; }
.legal-page ul {
  max-width: 700px;
  padding-left: 22px;
  margin: 16px 0;
}
.legal-page li { margin-bottom: 6px; }

/* Scroll reveal: one-time fade + rise as elements enter view */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; opacity: 1; transform: none; }
  .video-cover { animation: none; }
  .video-cover-img, .video-cover-title { transition: none; }
}

@media (max-width: 720px) {
  .offer-grid, .practice-grid { grid-template-columns: 1fr; }
  h1 { font-size: 2.1rem; }
  .nav-inner { flex-direction: column; align-items: flex-start; }
  nav { display: none; }
  section { padding: 56px 0; }
}
