:root {
  --paper: #f7f6f2;
  --paper-soft: #eeece5;
  --ink: #1f2328;
  --muted: #6b7280;
  --slate: #334155;
  --brass: #9b7b52;
  --line: rgba(31, 35, 40, 0.13);
  --header: rgba(247, 246, 242, 0.78);
  --max: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #faf8f3 0%, #f7f4ee 45%, #f4f1ea 100%);
  color: var(--ink);
  font-family: "Inter", "Noto Sans TC", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: 0;
  line-break: strict;
  overflow-wrap: break-word;
  overflow-x: hidden;
  word-break: normal;
  word-spacing: normal;
}

body::selection {
  background: rgba(155, 123, 82, 0.22);
}

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

.text-segment {
  display: inline-block;
}

.site-header {
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 48px, var(--max));
  height: 76px;
  margin: 0 auto;
  color: var(--ink);
}

.brand {
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0;
}

.nav {
  display: flex;
  gap: clamp(16px, 3vw, 36px);
  font-size: 0.84rem;
  color: var(--muted);
}

.nav a {
  position: relative;
  padding: 8px 0;
  transition: color 220ms var(--ease);
}

.nav a::after {
  position: absolute;
  right: 0;
  bottom: 4px;
  left: 0;
  height: 1px;
  background: var(--brass);
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 260ms var(--ease);
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--ink);
}

.nav a:hover::after,
.nav a:focus-visible::after {
  transform: scaleX(1);
}

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100vh;
  padding: 140px 24px 88px;
  place-items: center;
}

.hero::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    circle at 32% 38%,
    rgba(165, 132, 83, 0.11) 0%,
    rgba(165, 132, 83, 0.055) 24%,
    transparent 58%
  );
  content: "";
}

.hero-inner,
.section,
.project-hero,
.detail-grid,
.detail-nav,
.footer {
  width: min(100% - 48px, var(--max));
  margin: 0 auto;
}

.hero-inner {
  display: grid;
  gap: 24px;
}

.eyebrow {
  margin: 0;
  color: var(--brass);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-title {
  margin: 0;
  max-width: 100%;
  font-size: clamp(4rem, 10vw, 9rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
}

.page-hero-title {
  max-width: 980px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: 0;
}

.hero-subtitle {
  max-width: 620px;
  margin: 10px 0 0;
  color: var(--slate);
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  font-weight: 500;
}

.hero-copy {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-family: "Noto Sans TC", "Inter", system-ui, sans-serif;
  font-size: clamp(1.02rem, 1.7vw, 1.3rem);
  line-height: 2;
}

.primary-link,
.detail-nav a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
}

.primary-link span,
.project-button {
  transition: transform 260ms var(--ease);
}

.primary-link:hover span {
  transform: translateX(5px);
}

.scroll-cue {
  position: absolute;
  bottom: 34px;
  left: 50%;
  color: var(--brass);
  font-size: 1.25rem;
  transform: translateX(-50%);
  animation: cue 1.8s var(--ease) infinite;
}

.section {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 2.2fr);
  gap: clamp(36px, 8vw, 120px);
  padding: clamp(96px, 14vw, 180px) 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  flex-direction: column;
  align-content: start;
  align-items: flex-start;
  gap: 0;
  color: var(--muted);
  margin: 0;
}

.section-heading-title {
  margin: 0;
  color: var(--ink);
  font-family: "Noto Sans TC", "Inter", system-ui, sans-serif;
  font-size: clamp(1.75rem, 2.2vw, 2.2rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
  word-break: keep-all;
}

.section-heading-subtitle {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.about-section,
.projects-section,
.research-log-entry,
.contact-section {
  row-gap: clamp(44px, 6vw, 64px);
  padding: clamp(88px, 12vw, 150px) 0;
}

.about-copy p {
  max-width: 860px;
  margin: 0;
  font-family: "Noto Sans TC", "Inter", system-ui, sans-serif;
  font-size: clamp(1.375rem, 2vw, 1.75rem);
  font-weight: 400;
  line-height: 1.8;
}

.projects-section {
  align-items: start;
}

.log-entry-copy {
  display: grid;
  gap: 26px;
  align-content: start;
}

.log-entry-copy p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-family: "Noto Sans TC", "Inter", system-ui, sans-serif;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.8;
}

.project-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.project-item {
  border-bottom: 1px solid var(--line);
}

.project-panel {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  gap: clamp(26px, 5vw, 72px);
  padding: clamp(34px, 6vw, 68px) 0;
  transition: transform 260ms var(--ease), color 260ms var(--ease);
}

.project-panel:hover {
  transform: translateY(-4px);
}

.project-number {
  color: var(--brass);
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  line-height: 1;
  min-width: 120px;
  white-space: nowrap;
  word-break: keep-all;
}

.project-content {
  display: grid;
  gap: 12px;
}

.project-title {
  font-size: clamp(1.8rem, 4vw, 3.4rem);
  font-weight: 500;
  line-height: 1.15;
}

.project-subtitle {
  color: var(--slate);
  font-size: 1rem;
  font-weight: 500;
}

.project-description {
  max-width: 660px;
  color: var(--muted);
  font-family: "Noto Sans TC", "Inter", system-ui, sans-serif;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.project-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid rgba(51, 65, 85, 0.28);
  border-radius: 999px;
  background: rgba(247, 246, 242, 0.58);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: transform 220ms var(--ease), background 220ms var(--ease), color 220ms var(--ease), border-color 220ms var(--ease);
}

.project-button span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  transition: color 220ms var(--ease);
}

.project-button:hover,
.project-button:focus-visible {
  border-color: var(--slate);
  background: var(--slate);
  color: #fff;
  transform: translateY(-2px);
}

.project-button:hover span,
.project-button:focus-visible span {
  color: rgba(255, 255, 255, 0.76);
}

.project-button-muted {
  border-color: rgba(155, 123, 82, 0.36);
}

.project-button.is-disabled {
  cursor: default;
  opacity: 0.62;
  pointer-events: none;
}

.project-button.is-disabled:hover,
.project-button.is-disabled:focus-visible {
  border-color: rgba(51, 65, 85, 0.28);
  background: rgba(247, 246, 242, 0.58);
  color: var(--ink);
  transform: none;
}

.project-button.is-disabled:hover span,
.project-button.is-disabled:focus-visible span {
  color: var(--muted);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 22px 48px;
}

.contact-email {
  display: grid;
  gap: 0.55rem;
}

.contact-email span {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0;
}

.contact-links a {
  border-bottom: 1px solid rgba(155, 123, 82, 0.65);
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  transition: color 220ms var(--ease), border 220ms var(--ease);
}

.contact-links a:hover,
.contact-links a:focus-visible {
  border-color: var(--ink);
  color: var(--brass);
}

.footer {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 24px;
  padding: 42px 0 52px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.footer p {
  margin: 0;
}

.footer p:first-child {
  color: var(--ink);
  font-weight: 600;
}

.project-hero {
  padding: 180px 0 96px;
}

.detail-page {
  min-height: 72vh;
  display: grid;
  align-content: center;
  gap: 18px;
}

.detail-title {
  max-width: 940px;
}

.detail-subtitle {
  margin: 0;
  color: var(--slate);
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  font-weight: 500;
}

.detail-lead {
  max-width: 780px;
  margin: 20px 0 0;
  color: var(--muted);
  font-family: "Noto Sans TC", "Inter", system-ui, sans-serif;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  line-height: 2;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.detail-block {
  min-height: 260px;
  padding: clamp(30px, 5vw, 60px);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.detail-block:nth-child(2n) {
  border-right: 0;
}

.detail-block span {
  display: block;
  margin-bottom: 28px;
  color: var(--brass);
  font-size: 0.82rem;
  font-weight: 600;
}

.detail-block p {
  margin: 0;
  color: var(--muted);
  font-family: "Noto Sans TC", "Inter", system-ui, sans-serif;
  font-size: 1.02rem;
}

.detail-nav {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 56px 0 120px;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 720ms var(--ease), transform 720ms var(--ease);
}

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

@keyframes cue {
  0%,
  100% {
    transform: translate(-50%, 0);
  }
  50% {
    transform: translate(-50%, 8px);
  }
}

@media (max-width: 760px) {
  .site-header {
    width: min(100% - 28px, var(--max));
    height: auto;
    min-height: 68px;
  }

  .nav {
    gap: 12px;
    font-size: 0.78rem;
  }

  .hero {
    align-items: end;
    padding: 116px 20px 96px;
  }

  .hero::before {
    background: radial-gradient(
      circle at 34% 38%,
      rgba(165, 132, 83, 0.07) 0%,
      rgba(165, 132, 83, 0.034) 22%,
      transparent 52%
    );
  }

  .hero-inner,
  .section,
  .project-hero,
  .detail-grid,
  .detail-nav,
  .footer {
    width: min(100% - 32px, var(--max));
  }

  .hero-title {
    font-size: clamp(3.2rem, 16vw, 5.2rem);
  }

  .page-hero-title {
    font-size: clamp(2.4rem, 12vw, 3.8rem);
  }

  .section {
    grid-template-columns: 1fr;
    gap: clamp(1.75rem, 7vw, 2.25rem);
    padding: 88px 0;
  }

  .section-heading-title {
    font-size: clamp(1.7rem, 7vw, 2rem);
  }

  .section-heading-subtitle {
    margin-top: 0.45rem;
    font-size: 1rem;
  }

  .about-copy p {
    max-width: 100%;
    font-size: clamp(1.06rem, 4.8vw, 1.25rem);
    line-height: 1.8;
  }

  .project-panel {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .project-actions {
    gap: 10px;
  }

  .project-button {
    flex: 1 1 150px;
  }

  .project-number {
    font-size: 3.2rem;
    min-width: 0;
  }

  .contact-links {
    display: grid;
    gap: 18px;
  }

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

  .project-hero {
    padding: 150px 0 76px;
  }

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

  .detail-block,
  .detail-block:nth-child(2n) {
    min-height: auto;
    padding: 34px 0;
    border-right: 0;
  }

  .detail-nav {
    display: grid;
    padding-bottom: 88px;
  }
}

@media (max-width: 520px) {
  .site-header {
    justify-content: center;
  }

  .brand {
    display: none;
  }

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

  .nav a {
    font-size: 0.74rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
