:root {
  color-scheme: light;
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-subtle: #f0f0ee;
  --text: #1b1b19;
  --muted: #686863;
  --line: #dfdfda;
  --accent: #6262c7;
  --accent-strong: #4f50b4;
  --accent-soft: #eeeeff;
  --focus: #5556c5;
  --shadow-soft: 0 18px 50px rgba(34, 34, 42, 0.07);
  --reader-paper: #fdfdfb;
  --reader-paper-line: #e7e6e2;
  --radius-sm: 12px;
  --radius-md: 22px;
  --radius-lg: 32px;
  --max-width: 1160px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121211;
  --surface: #1b1b19;
  --surface-subtle: #22221f;
  --text: #f4f4ef;
  --muted: #adada5;
  --line: #363632;
  --accent: #aaaaff;
  --accent-strong: #bdbdff;
  --accent-soft: #2b2b49;
  --focus: #b6b6ff;
  --shadow-soft: 0 20px 55px rgba(0, 0, 0, 0.24);
  --reader-paper: #eeeeea;
  --reader-paper-line: #d8d7d1;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", "Noto Sans SC", "Noto Sans TC", sans-serif;
  line-height: 1.65;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}

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

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: -5rem;
  left: 1rem;
  z-index: 200;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  padding: 0.7rem 1rem;
  font-weight: 700;
}

.skip-link:focus { top: 1rem; }
.container { width: min(calc(100% - 2rem), var(--max-width)); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  background: color-mix(in srgb, var(--bg) 91%, transparent);
  backdrop-filter: blur(14px);
}

.navbar {
  position: relative;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 0.7rem;
  font-weight: 760;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand-mark { width: 32px; height: 32px; flex: 0 0 auto; }
.nav-links { display: flex; align-items: center; gap: clamp(0.8rem, 2vw, 1.35rem); }
.nav-links a { color: var(--muted); font-size: 0.92rem; font-weight: 650; white-space: nowrap; }
.nav-links a:hover, .footer-links a:hover { color: var(--text); }
.nav-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 0.5rem; }

.icon-button,
.menu-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.icon-button:hover, .menu-button:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.icon-button svg, .menu-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-icon-sun { display: none; }
:root[data-theme="dark"] .theme-icon-moon { display: none; }
:root[data-theme="dark"] .theme-icon-sun { display: block; }

.menu-button { display: none; border-radius: var(--radius-sm); }
.menu-icon-close { display: none; }
.menu-button[aria-expanded="true"] .menu-icon-open { display: none; }
.menu-button[aria-expanded="true"] .menu-icon-close { display: block; }

.language-control { position: relative; }
.language-menu {
  position: absolute;
  top: calc(100% + 0.65rem);
  right: 0;
  z-index: 130;
  width: max-content;
  min-width: 190px;
  max-width: calc(100vw - 2rem);
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.language-menu[hidden] { display: none; }
.language-menu button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  padding: 0.65rem 0.75rem;
  text-align: left;
  cursor: pointer;
}

.language-menu button:hover,
.language-menu button:focus-visible { background: var(--surface-subtle); }
.language-menu button[aria-checked="true"] { color: var(--accent-strong); font-weight: 720; }
.language-check { visibility: hidden; }
.language-menu button[aria-checked="true"] .language-check { visibility: visible; }

.hero { padding: clamp(5.5rem, 11vw, 9rem) 0 clamp(4.5rem, 8vw, 7rem); }
.project-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr); align-items: center; gap: clamp(2rem, 7vw, 5rem); }
.eyebrow { margin: 0 0 1rem; color: var(--accent-strong); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.hero h1 { margin: 0; max-width: 820px; font-size: clamp(3.25rem, 7.8vw, 7rem); font-weight: 760; letter-spacing: -0.065em; line-height: 0.97; }
.hero h1 span { color: var(--accent); }
.hero-copy { max-width: 680px; margin: 1.8rem 0 0; color: var(--muted); font-size: clamp(1.04rem, 2vw, 1.24rem); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; margin-top: 2rem; }

.button,
.text-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius-sm);
  font-weight: 730;
}

.button {
  border: 1px solid var(--text);
  background: var(--text);
  color: var(--bg);
  padding: 0.72rem 1.12rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(25, 25, 25, 0.1); }
.button.secondary { border-color: var(--line); background: transparent; color: var(--text); }
.text-button { min-height: 44px; padding: 0.55rem 0.3rem; color: var(--muted); }
.text-button:hover { color: var(--accent-strong); }

.hero-symbol {
  position: relative;
  display: grid;
  width: min(100%, 390px);
  aspect-ratio: 1;
  justify-self: end;
  place-items: center;
}

.hero-symbol::before,
.hero-symbol::after { content: ""; position: absolute; border: 1px solid var(--line); border-radius: 50%; }
.hero-symbol::before { inset: 4%; }
.hero-symbol::after { inset: 23%; }
.hero-symbol span { color: var(--accent); font-size: clamp(8rem, 20vw, 13rem); line-height: 1; }

.section { padding: clamp(4.5rem, 8vw, 7.5rem) 0; }
.section + .section { border-top: 1px solid var(--line); }
.manifesto-section { padding-top: clamp(3.5rem, 6vw, 5.5rem); }
.manifesto { max-width: 980px; margin: 0; font-size: clamp(1.65rem, 3.5vw, 3rem); letter-spacing: -0.04em; line-height: 1.25; }
.section-heading, .about-layout { display: grid; grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr); gap: clamp(1.5rem, 5vw, 4rem); }
.section-heading { margin-bottom: 2.7rem; }
.section-heading h2, .about-layout h2 { margin: 0; font-size: clamp(2.15rem, 4.2vw, 3.75rem); letter-spacing: -0.045em; line-height: 1.05; }
.section-heading > p, .about-layout > div:last-child > p { max-width: 650px; margin: 0.3rem 0 0; color: var(--muted); }

.featured-project {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1.04fr) minmax(320px, 0.96fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
  padding: clamp(1.5rem, 5vw, 4rem);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.featured-copy { min-width: 0; }
.featured-copy h3 { margin: 0.35rem 0 1.2rem; font-size: clamp(2.4rem, 5vw, 4.75rem); letter-spacing: -0.055em; line-height: 1; }
.featured-copy > p:not(.eyebrow) { max-width: 570px; margin: 0; color: var(--muted); }
.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.4rem; }
.tag { border: 1px solid var(--line); border-radius: 999px; padding: 0.32rem 0.64rem; color: var(--muted); font-size: 0.8rem; white-space: nowrap; }

.reader-visual {
  position: relative;
  display: grid;
  min-height: 400px;
  place-items: center;
}

.reader-mark {
  display: grid;
  width: min(100%, 410px);
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid var(--reader-paper-line);
  border-radius: 26px;
  background: var(--reader-paper);
  box-shadow: 0 12px 32px rgba(38, 37, 47, 0.07);
}

.reader-mark img {
  width: 88%;
  height: auto;
}

.voyager-visual {
  position: relative;
  display: grid;
  min-height: 400px;
  place-items: center;
}

.voyager-mark {
  display: grid;
  width: min(100%, 410px);
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(38, 37, 47, 0.07);
}

.voyager-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.principles-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); padding: clamp(1.35rem, 3vw, 2rem); }
.card h3 { margin: 0.25rem 0 0.65rem; font-size: 1.35rem; letter-spacing: -0.025em; }
.card p { margin: 0; color: var(--muted); }
.principle-number { color: var(--accent-strong); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.1em; }
.card-link { display: inline-flex; align-items: center; gap: 0.45rem; margin-top: 1.3rem; color: var(--accent-strong); font-weight: 730; }

.site-footer { border-top: 1px solid var(--line); padding: 2.2rem 0; color: var(--muted); }
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; }

[data-reveal] { opacity: 1; transform: none; }
.reveal-ready [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity 0.55s ease, transform 0.55s ease; }
.reveal-ready [data-reveal].is-visible { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .nav-links {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    left: 0;
    z-index: 120;
    display: none;
    align-items: stretch;
    flex-direction: column;
    gap: 0.15rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    padding: 0.7rem;
    box-shadow: var(--shadow-soft);
  }

  .nav-links[data-open] { display: flex; }
  .nav-links a { padding: 0.65rem; white-space: normal; }
  .menu-button { display: inline-grid; }
  .project-hero { grid-template-columns: minmax(0, 1.25fr) minmax(230px, 0.75fr); }
  .featured-project { grid-template-columns: minmax(0, 1fr) minmax(280px, 0.82fr); }
  .reader-visual { min-height: 340px; }
  .voyager-visual { min-height: 340px; }
}

@media (max-width: 720px) {
  .project-hero, .featured-project, .section-heading, .about-layout, .principles-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 4.75rem; }
  .hero-symbol { width: min(78vw, 330px); justify-self: center; }
  .section-heading, .about-layout { gap: 0.9rem; }
  .reader-visual { min-height: min(88vw, 380px); order: -1; }
  .reader-mark { width: min(100%, 360px); }
  .voyager-visual { min-height: min(88vw, 380px); order: -1; }
  .voyager-mark { width: min(100%, 360px); }
  .footer-row { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 430px) {
  .container { width: min(calc(100% - 1.25rem), var(--max-width)); }
  .navbar { gap: 0.55rem; }
  .brand { gap: 0.5rem; font-size: 0.94rem; }
  .brand-mark { width: 29px; height: 29px; }
  .nav-actions { gap: 0.35rem; }
  .icon-button, .menu-button { width: 39px; height: 39px; }
  .language-menu { position: fixed; top: 4.65rem; right: 0.625rem; left: 0.625rem; width: auto; max-width: none; }
  .hero h1 { font-size: clamp(2.85rem, 15vw, 4rem); }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-actions .button, .hero-actions .text-button { width: 100%; }
  .featured-project { border-radius: 24px; }
  .reader-visual { min-height: 280px; }
  .voyager-visual { min-height: 280px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
