:root {
  --brown: #542719;
  --brown-2: #743c2b;
  --cream: #fff3d4;
  --paper: #fffaf0;
  --orange: #f6a02a;
  --ink: #241f1c;
  --muted: #756b64;
  --line: rgba(84, 39, 25, .16);
  --white: #fff;
  --shadow: 0 18px 44px rgba(52, 35, 24, .13);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  line-height: 1.65;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 0 24px;
  color: var(--white);
  background: var(--brown);
  box-shadow: 0 8px 26px rgba(36, 31, 28, .16);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-weight: 900;
}

.brand-logo {
  width: 124px;
  height: 34px;
  object-fit: contain;
  flex: 0 0 auto;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.language-select,
.nav-toggle {
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 8px;
  color: white;
  background: rgba(255, 255, 255, .11);
  font: inherit;
  font-weight: 800;
}

.language-select {
  min-width: 124px;
  padding: 8px 10px;
}

.language-select option { color: var(--ink); }

.nav-toggle {
  display: none;
  padding: 8px 12px;
}

.home-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 32px 22px 80px;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 32px;
  align-items: center;
  margin-bottom: 28px;
  padding: 42px;
  border-radius: 8px;
  color: white;
  background: linear-gradient(135deg, var(--brown), var(--brown-2));
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--orange);
  font-size: .78rem;
  font-weight: 950;
  letter-spacing: 0;
}

h1, h2, h3, p { margin-top: 0; overflow-wrap: anywhere; }
h1 { margin-bottom: 16px; font-size: clamp(3rem, 7vw, 5rem); line-height: 1; }
h2 { margin-bottom: 12px; font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.15; }
h3 { margin-bottom: 8px; font-size: 1.2rem; }

.lead {
  margin-bottom: 0;
  font-size: 1.12rem;
  color: rgba(255, 255, 255, .84);
}

.page-hero .lead { color: var(--muted); }

.hero-shot,
.shot { margin: 0; }

.hero-shot img,
.shot img {
  width: 100%;
  object-fit: contain;
  object-position: top center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  box-shadow: var(--shadow);
}

.hero-shot img { max-height: 78vh; }
.shot img { height: auto; max-height: none; }

figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: .9rem;
}

.home-hero figcaption { color: rgba(255, 255, 255, .74); }

.home-section {
  margin-top: 26px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.section-head p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
}

.empty-box,
.copy-card,
.page-hero {
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 8px 26px rgba(52, 35, 24, .05);
}

.empty-box { color: var(--muted); }

.empty-box strong {
  display: block;
  margin-bottom: 8px;
  color: var(--brown);
}

.release-link {
  display: inline-flex;
  max-width: 100%;
  margin-top: 4px;
  padding: 10px 14px;
  border: 1px solid rgba(84, 39, 25, .18);
  border-radius: 8px;
  color: var(--brown);
  background: var(--cream);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.release-link:hover {
  border-color: rgba(84, 39, 25, .34);
  background: #ffe8b6;
}

.community-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.community-card {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 8px 26px rgba(52, 35, 24, .06);
  transition: transform .16s ease, box-shadow .16s ease;
}

.community-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.community-card strong {
  color: var(--brown);
  font-size: 1.08rem;
}

.community-card span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.overview-card {
  display: grid;
  grid-template-rows: 260px auto auto;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 8px 26px rgba(52, 35, 24, .06);
  transition: transform .16s ease, box-shadow .16s ease;
}

.overview-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.overview-card img {
  width: 100%;
  height: 260px;
  object-fit: contain;
  object-position: top center;
  border-radius: 6px;
  background: var(--cream);
}

.overview-card span {
  font-size: 1.12rem;
  font-weight: 900;
  color: var(--brown);
}

.overview-card p {
  margin: 0;
  color: var(--muted);
}

.page-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 28px;
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 28px 22px 80px;
}

.sidebar {
  position: sticky;
  top: 88px;
  align-self: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.side-group {
  display: grid;
  gap: 4px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.side-group:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}

.side-title {
  padding: 4px 10px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 950;
}

.sidebar a {
  padding: 8px 10px;
  border-radius: 8px;
  color: #514741;
  font-weight: 820;
}

.sidebar a:hover,
.sidebar a.is-active {
  color: var(--brown);
  background: rgba(246, 160, 42, .16);
}

.page-content { min-width: 0; }
.page-hero { margin-bottom: 18px; }

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.summary-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.tech-grid,
.shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.tech-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.tech-card p {
  margin: 0;
  color: var(--muted);
}

.code-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.code-list code {
  display: block;
  padding: 12px;
  border-radius: 8px;
  color: var(--brown);
  background: var(--cream);
  white-space: normal;
  overflow-wrap: anywhere;
}

.js .overview-card,
.js .community-card,
.js .shot,
.js .copy-card,
.js .tech-card,
.js .empty-box {
  opacity: 1;
  transform: translateY(0);
  animation: reveal-in .35s ease both;
  transition: opacity .35s ease, transform .35s ease;
}

.is-visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

@keyframes reveal-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .brand span { display: none; }
  .nav-toggle { display: block; }
  .home-hero,
  .page-shell,
  .content-grid { grid-template-columns: 1fr; }
  .home-hero { padding: 28px 18px; }
  .community-grid,
  .overview-grid { grid-template-columns: 1fr; }
  .sidebar {
    display: none;
    position: fixed;
    inset: 74px 14px auto;
    z-index: 30;
    max-height: 72vh;
    overflow: auto;
    box-shadow: var(--shadow);
  }
  .sidebar.is-open { display: block; }
  .page-shell { padding: 18px 14px 72px; }
  .content-grid {
    display: flex;
    flex-direction: column;
  }
  .copy-card { order: 2; }
  .shot-grid { order: 1; width: 100%; }
  .page-hero,
  .copy-card { padding: 24px 18px; }
  .hero-shot,
  .shot {
    width: min(360px, 100%);
    margin-inline: auto;
  }
  h1 { font-size: clamp(2.6rem, 13vw, 3.5rem); }
}

@media (max-width: 560px) {
  .site-header { padding: 0 14px; }
  .home-shell { padding: 18px 14px 60px; }
  .overview-card { grid-template-rows: auto auto auto; }
  .overview-card img { height: auto; max-height: 540px; }
  .shot-grid,
  .tech-grid { grid-template-columns: 1fr; }
  .hero-shot,
  .shot { width: 100%; }
  .language-select { min-width: 104px; }
}
