:root {
  color-scheme: light;
  --bg: #f8faf7;
  --ink: #17201b;
  --muted: #637069;
  --line: #dfe6df;
  --panel: #ffffff;
  --accent: #176b5f;
  --accent-strong: #0d4e45;
  --accent-soft: #dff2ed;
  --gold: #c0842f;
  --sky: #2f6fc0;
  --rose: #b84c62;
  --shadow: 0 24px 70px rgba(31, 45, 38, 0.12);
  --hero-title-size: clamp(48px, 8vw, 96px);
  --section-title-size: clamp(30px, 4vw, 48px);
  --card-title-size: 20px;
  --body-size: 18px;
  --body-line-height: 1.7;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101413;
  --ink: #f2f6f3;
  --muted: #a8b4ae;
  --line: #29342f;
  --panel: #171d1a;
  --accent-soft: #203f39;
  --accent-strong: #8ce0d2;
  --gold: #dfad62;
  --sky: #8ebfff;
  --rose: #e58ba0;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--gold), var(--rose));
}

a {
  color: inherit;
  text-decoration: none;
}

.announcement {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 42px;
  padding: 8px 20px;
  background: var(--ink);
  color: var(--panel);
  text-align: center;
}

.announcement[hidden] {
  display: none;
}

.announcement span,
.announcement a {
  font-size: 12px;
  font-weight: 800;
}

.announcement span {
  border-radius: 8px;
  background: var(--accent);
  padding: 5px 8px;
  color: white;
}

.announcement p {
  margin-bottom: 0;
  font-size: 14px;
  line-height: 1.5;
}

.announcement a {
  color: var(--gold);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 clamp(20px, 5vw, 72px);
  border-bottom: 1px solid rgba(223, 230, 223, 0.85);
  background: rgba(248, 250, 247, 0.9);
  backdrop-filter: blur(16px);
}

.brand,
.nav,
.hero-actions,
.contact-links,
.site-footer,
.header-tools {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: white;
}

.nav {
  gap: clamp(14px, 3vw, 32px);
  flex-wrap: wrap;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.nav a:hover,
.nav a[aria-current="true"],
.site-footer a:hover {
  color: var(--accent);
}

.header-tools {
  gap: 8px;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--accent-strong);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.icon-button:hover {
  border-color: var(--accent);
}

[data-theme="dark"] .site-header {
  background: rgba(16, 20, 19, 0.9);
}

[data-theme="dark"] .content-band,
[data-theme="dark"] .button.secondary,
[data-theme="dark"] .filter-chip,
[data-theme="dark"] .contact-links a,
[data-theme="dark"] .question-form,
[data-theme="dark"] .question-form textarea,
[data-theme="dark"] .question-form input,
[data-theme="dark"] .tool-input {
  background: var(--panel);
}

.section-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
  padding: clamp(52px, 8vw, 88px) 0 clamp(28px, 5vw, 56px);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 20px;
  font-size: var(--hero-title-size);
  line-height: 0.98;
  letter-spacing: 0;
  white-space: pre-line;
}

h2 {
  margin-bottom: 18px;
  font-size: var(--section-title-size);
  line-height: 1.08;
  letter-spacing: 0;
  white-space: pre-line;
}

h3 {
  margin-bottom: 10px;
  font-size: var(--card-title-size);
  line-height: 1.25;
  white-space: pre-line;
}

.lead {
  max-width: 680px;
  color: var(--muted);
  font-size: clamp(var(--body-size), 2vw, calc(var(--body-size) + 4px));
  line-height: var(--body-line-height);
  white-space: pre-line;
}

.lead.compact {
  max-width: 520px;
  margin-bottom: 0;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 700;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.button.primary:hover {
  background: var(--accent-strong);
}

.button.secondary {
  background: white;
}

.button.ghost {
  background: transparent;
  color: var(--accent-strong);
  cursor: pointer;
}

.button.ghost:hover {
  border-color: var(--accent);
  background: rgba(223, 242, 237, 0.56);
}

.home-view {
  min-height: calc(100vh - 72px);
  padding-bottom: clamp(44px, 7vw, 84px);
}

.home-menu {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.feature-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(220px, 0.7fr);
  gap: 14px;
  margin-top: 18px;
}

.mini-panel,
.widget-panel,
.stat-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.mini-panel {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 20px;
}

.mini-panel > span,
.widget-head span,
.reading-list span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.mini-panel p,
.reading-list p,
.favorite-item span,
.quick-link span,
.gallery-grid figcaption span {
  margin-bottom: 0;
  color: var(--muted);
  line-height: var(--body-line-height);
}

.quote-panel p {
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.35;
}

.quote-panel small {
  color: var(--muted);
  font-weight: 800;
}

.reaction-button {
  width: fit-content;
  min-height: 44px;
  align-self: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 0 14px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.reaction-button:hover {
  border-color: var(--accent);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.stat-card {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.stat-card strong {
  color: var(--accent-strong);
  font-size: 28px;
  line-height: 1;
}

.stat-card span {
  font-weight: 900;
}

.stat-card small {
  color: var(--muted);
  font-weight: 700;
}

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

.widget-panel {
  padding: 22px;
}

.widget-panel.wide {
  grid-column: 1 / -1;
}

.widget-head {
  margin-bottom: 16px;
}

.widget-head h2 {
  margin-bottom: 0;
  font-size: 26px;
}

.tag-cloud,
.quick-link-grid,
.reading-list,
.favorite-list {
  display: grid;
  gap: 10px;
}

.tag-cloud {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.skill-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font-weight: 900;
}

.skill-chip small {
  color: var(--muted);
  font-size: 12px;
}

.quick-link,
.favorite-item,
.reading-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
}

.quick-link strong,
.favorite-item strong {
  display: block;
  margin-bottom: 5px;
}

.quick-link:hover,
.favorite-item:hover {
  border-color: var(--accent);
}

.reading-list article h3 {
  margin: 8px 0 6px;
}

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

.gallery-grid figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}

.gallery-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--accent-soft);
}

.gallery-grid figcaption {
  display: grid;
  gap: 4px;
  padding: 12px;
}

.menu-tile {
  display: grid;
  min-height: 168px;
  align-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.menu-tile:hover {
  border-color: var(--accent);
  box-shadow: 0 18px 45px rgba(31, 45, 38, 0.1);
  transform: translateY(-2px);
}

.menu-tile span {
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
}

.menu-tile strong {
  margin-top: 26px;
  font-size: 20px;
  line-height: 1.22;
}

.menu-tile small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.profile-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(22px, 4vw, 34px);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.avatar {
  display: grid;
  width: 128px;
  height: 128px;
  margin-bottom: 34px;
  place-items: center;
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(23, 107, 95, 0.12), rgba(192, 132, 47, 0.12)),
    var(--accent-soft);
  color: var(--accent-strong);
  font-size: 34px;
  font-weight: 800;
}

dl {
  margin: 0;
}

dl div {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 18px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

dt {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

dd {
  margin: 0;
  font-weight: 700;
}

.live-card {
  display: grid;
  gap: 6px;
  margin-top: 24px;
  border: 1px solid rgba(23, 107, 95, 0.2);
  border-radius: 8px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(223, 242, 237, 0.82), rgba(255, 255, 255, 0.86)),
    white;
}

.live-card span,
.live-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.live-card strong {
  color: var(--accent-strong);
  font-size: 30px;
  line-height: 1;
}

[data-theme="dark"] .live-card {
  background: linear-gradient(135deg, rgba(32, 63, 57, 0.72), rgba(23, 29, 26, 0.86));
}

.content-band {
  padding: clamp(64px, 9vw, 108px) 0;
  border-block: 1px solid var(--line);
  background: #ffffff;
}

.page-view {
  min-height: calc(100vh - 154px);
}

[data-view][hidden] {
  display: none !important;
}

.back-link {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 24px;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 800;
}

.back-link::before {
  content: "<";
  margin-right: 8px;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(220px, 0.38fr) minmax(0, 0.62fr);
  gap: clamp(32px, 6vw, 76px);
}

.prose {
  color: var(--muted);
  font-size: var(--body-size);
  line-height: calc(var(--body-line-height) + 0.15);
  white-space: pre-line;
}

.prose p:last-child {
  margin-bottom: 0;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 34px;
}

.timeline {
  display: grid;
  gap: 16px;
  padding: clamp(64px, 9vw, 108px) 0;
}

.timeline article,
.project-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.timeline article {
  display: grid;
  grid-template-columns: 120px 220px 1fr;
  gap: 22px;
  align-items: baseline;
  padding: 24px;
}

.timeline-date,
.project-card span {
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
}

.timeline p,
.project-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: var(--body-size);
  line-height: var(--body-line-height);
  white-space: pre-line;
}

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

.project-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.qa-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
}

.tool-input {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  outline: none;
}

.tool-input:focus {
  border-color: var(--accent);
}

.filter-chip {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: white;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.filter-chip:hover,
.filter-chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.project-card {
  position: relative;
  min-height: 240px;
  padding: 24px;
  overflow: hidden;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.project-card h3 {
  margin-top: 54px;
}

.project-card::after {
  content: attr(data-action-label);
  position: absolute;
  right: 18px;
  bottom: 16px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.project-card:hover,
.project-card.is-open {
  border-color: rgba(23, 107, 95, 0.5);
  box-shadow: 0 18px 45px rgba(31, 45, 38, 0.1);
  transform: translateY(-2px);
}

.project-card:hover::after,
.project-card.is-open::after {
  opacity: 1;
  transform: translateY(0);
}

.project-card.is-hidden {
  display: none;
}

.project-card.is-open {
  grid-column: span 2;
  min-height: 260px;
}

.project-card.is-open p {
  color: var(--ink);
}

.project-tag {
  display: inline-flex;
  width: fit-content;
  margin-left: 10px;
  border-radius: 8px;
  background: rgba(47, 111, 192, 0.1);
  padding: 4px 8px;
  color: var(--sky);
  font-size: 12px;
  font-weight: 800;
}

.card-link {
  display: inline-flex;
  width: fit-content;
  margin-top: 18px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 900;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(220px, 0.34fr) minmax(0, 0.66fr);
  gap: clamp(32px, 6vw, 76px);
  padding: clamp(64px, 9vw, 108px) 0;
}

.qa-list,
.event-list {
  display: grid;
  gap: 14px;
}

.question-form {
  display: grid;
  gap: 12px;
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel);
}

.question-form h3 {
  margin-bottom: 2px;
}

.question-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.question-form textarea,
.question-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  font: inherit;
  outline: none;
}

.question-form textarea {
  min-height: 112px;
  resize: vertical;
}

.check-row {
  display: flex !important;
  align-items: center;
  gap: 9px !important;
  color: var(--ink) !important;
}

.check-row input {
  width: auto;
}

.form-status {
  min-height: 20px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.qa-card,
.summary-card,
.event-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.qa-card {
  padding: 24px;
}

.visitor-qa {
  border-color: rgba(23, 107, 95, 0.28);
}

.asker {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 12px;
  border-radius: 8px;
  background: var(--accent-soft);
  padding: 6px 10px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.qa-category {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 12px;
  border-radius: 8px;
  background: rgba(47, 111, 192, 0.1);
  padding: 6px 10px;
  color: var(--sky);
  font-size: 12px;
  font-weight: 800;
}

.qa-card h3::before {
  content: "Q";
  display: inline-grid;
  width: 28px;
  height: 28px;
  margin-right: 10px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  vertical-align: 2px;
}

.qa-card p,
.summary-card p,
.event-list p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: var(--body-size);
  line-height: var(--body-line-height);
  white-space: pre-line;
}

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

.review-meter {
  display: grid;
  grid-template-columns: minmax(140px, 0.26fr) 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
}

.review-meter span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.review-meter strong {
  color: var(--rose);
  font-size: 28px;
  line-height: 1.1;
}

.meter-track {
  height: 10px;
  border-radius: 999px;
  background: #edf1ed;
  overflow: hidden;
}

.meter-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--gold), var(--rose));
  transition: width 420ms ease;
}

.summary-card {
  min-height: 220px;
  padding: 24px;
  transition:
    border-color 160ms ease,
    transform 160ms ease;
}

.summary-card span {
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
}

.summary-card h3 {
  margin-top: 46px;
}

.summary-card:hover {
  border-color: rgba(184, 76, 98, 0.42);
  transform: translateY(-2px);
}

.event-list article {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 22px;
  padding: 22px 24px;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.event-list article:hover,
.event-list article.is-active {
  border-color: rgba(192, 132, 47, 0.56);
  box-shadow: 0 16px 42px rgba(31, 45, 38, 0.09);
  transform: translateX(3px);
}

.event-list article.is-active .timeline-date {
  color: var(--rose);
}

.event-list article.is-hidden,
.qa-card.is-hidden {
  display: none;
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 0.55fr);
  gap: 40px;
  align-items: center;
  padding: clamp(64px, 9vw, 108px) 0;
}

.contact-links {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.contact-links a {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  background: white;
  color: var(--accent-strong);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.contact-links a:hover {
  border-color: var(--accent);
}

.copy-status {
  min-height: 20px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.site-footer {
  justify-content: space-between;
  min-height: 82px;
  padding: 0 clamp(20px, 5vw, 72px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 820px) {
  .site-header {
    min-height: auto;
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
    padding-block: 18px;
  }

  .nav {
    width: 100%;
    justify-content: space-between;
  }

  .site-header {
    align-items: stretch;
  }

  .header-tools {
    align-self: flex-end;
  }

  .hero,
  .two-column,
  .split-section,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .home-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-strip,
  .stats-grid,
  .home-widgets {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .timeline article {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .project-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .project-card.is-open {
    grid-column: auto;
  }

  .review-meter {
    grid-template-columns: 1fr;
  }

  .event-list article {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 520px) {
  .section-shell {
    width: min(100% - 28px, 1120px);
  }

  .nav {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  h1 {
    font-size: min(var(--hero-title-size), 44px);
  }

  .home-menu {
    grid-template-columns: 1fr;
  }

  .announcement {
    align-items: flex-start;
    flex-direction: column;
    text-align: left;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .menu-tile {
    min-height: 132px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
  }
}
