:root {
  color-scheme: light;
  --bg: #f8f3ea;
  --paper: #fffdf8;
  --ink: #1b1915;
  --muted: #686157;
  --line: #2a2620;
  --soft-line: #d8d0c3;
  --accent: #b95c35;
  --accent-soft: #f7dfd0;
  --blue: #174cff;
  --green: #1a7f48;
  --shadow: 5px 5px 0 rgba(42, 38, 32, 0.88);
  --radius: 2px;
  --content: 1312px;
  --section-y: clamp(56px, 7vw, 112px);
  --font-body: Inter, "Noto Sans TC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Noto Serif TC", "Source Han Serif TC", "Songti TC", serif;
  font-family: var(--font-body);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(42, 38, 32, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 38, 32, 0.032) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px;
  font-weight: 400;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.nav-open {
  overflow: hidden;
}

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

img {
  display: block;
  max-width: 100%;
}

p {
  color: var(--muted);
  font-size: clamp(16px, 1.45vw, 20px);
  line-height: 1.7;
  margin: 0;
  text-wrap: pretty;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.16;
  text-wrap: balance;
}

h1 {
  font-size: clamp(42px, 5.6vw, 80px);
}

h2 {
  font-size: clamp(26px, 2.8vw, 40px);
}

.keep-cjk {
  display: inline-block !important;
  white-space: nowrap;
}

button,
input,
textarea,
select {
  font: inherit;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 100;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  background: var(--ink);
  color: white;
  padding: 0;
  border: 0;
}

.skip-link:focus {
  width: auto;
  height: auto;
  overflow: visible;
  clip-path: none;
  padding: 12px 16px;
  border: 1.5px solid var(--ink);
}

[data-shell] {
  width: min(var(--content), calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 16px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  margin-top: 16px;
  padding: 12px;
  border: 1.5px solid var(--line);
  background: rgba(255, 253, 247, 0.94);
  box-shadow: 3px 3px 0 rgba(42, 38, 32, 0.86);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 208px;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  background: var(--ink);
  color: white;
  font-weight: 600;
  border: 1.5px solid var(--ink);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 18px;
  line-height: 1.1;
  font-weight: 600;
}

.brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  padding: 12px 14px;
  border: 1.5px solid transparent;
  font-size: 15px;
  font-weight: 500;
}

.site-nav a:hover,
.site-nav a.active {
  border-color: var(--line);
  background: var(--accent-soft);
}

.menu-button {
  display: none;
  height: 44px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  padding: 0 16px;
  font-weight: 600;
  box-shadow: 3px 3px 0 rgba(42, 38, 32, 0.86);
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.section {
  width: min(var(--content), calc(100% - 32px));
  margin-inline: auto;
  padding-block: var(--section-y);
}

.section-tight {
  padding-top: 0;
}

.hero-section {
  min-height: calc(100vh - 120px);
  display: grid;
  align-content: center;
}

.eyebrow {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  align-self: start;
  margin-bottom: 22px;
  padding: 8px 12px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  text-transform: uppercase;
}

.hero-grid,
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 412px;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.hero-copy {
  display: grid;
  gap: 28px;
}

.lead {
  max-width: 760px;
  color: #343029;
  font-size: clamp(19px, 1.75vw, 24px);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 22px;
  border: 1.5px solid var(--line);
  font-size: 16px;
  font-weight: 600;
  box-shadow: 3px 3px 0 rgba(42, 38, 32, 0.86);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.button:hover {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 rgba(42, 38, 32, 0.86);
}

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

.button-secondary {
  background: var(--paper);
  color: var(--ink);
}

.profile-panel,
.about-card {
  border: 1.5px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.profile-panel img {
  width: 100%;
  aspect-ratio: 1 / 1.05;
  object-fit: cover;
  border-bottom: 1.5px solid var(--line);
}

.profile-caption {
  padding: 24px;
}

.profile-caption > span,
.profile-caption > strong {
  display: block;
}

.profile-caption > span {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
}

.profile-caption > strong {
  margin-bottom: 10px;
  font-size: 26px;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.16;
}

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

.metrics-grid article,
.service-grid article,
.blog-list article,
.timeline article {
  border: 1.5px solid var(--line);
  background: var(--paper);
}

.metrics-grid article {
  min-height: 280px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.metric,
.tag {
  display: inline-flex;
  align-self: flex-start;
  padding: 7px 10px;
  border: 1.5px solid var(--line);
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.metrics-grid h2 {
  font-size: clamp(24px, 2.3vw, 34px);
}

.split-section {
  display: grid;
  grid-template-columns: 0.82fr 1fr;
  gap: 36px;
  align-items: start;
  border-top: 1.5px solid var(--line);
}

.system-list {
  display: grid;
  border: 1.5px solid var(--line);
  background: var(--paper);
}

.system-list a {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 18px;
  padding: 24px;
  border-bottom: 1.5px solid var(--line);
}

.system-list a:last-child {
  border-bottom: 0;
}

.system-list a:hover {
  background: var(--accent-soft);
}

.system-list a > span {
  font-weight: 600;
}

.system-list a > strong,
.system-list a > small {
  display: block;
}

.system-list a > strong {
  font-size: 22px;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.22;
}

.system-list a > small {
  grid-column: 2;
  margin-top: 6px;
  color: var(--muted);
  font-size: 15px;
}

.page-hero {
  padding-bottom: 32px;
  border-bottom: 1.5px solid var(--line);
}

.page-hero h1 {
  margin-bottom: 24px;
}

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

.work-card {
  display: grid;
  align-content: start;
  border: 1.5px solid var(--line);
  background: var(--paper);
}

.work-card.featured {
  grid-column: span 2;
}

.work-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-bottom: 1.5px solid var(--line);
  background: #e8e0d3;
}

.work-card div {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.work-card h2 {
  font-size: clamp(24px, 2.35vw, 34px);
}

.timeline {
  display: grid;
  gap: 0;
}

.timeline article {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 32px;
  padding: 30px;
  border-bottom: 0;
}

.timeline article:last-child {
  border-bottom: 1.5px solid var(--line);
}

.timeline article > span,
.service-grid article > span {
  color: var(--accent);
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
}

.timeline h2 {
  margin-bottom: 12px;
  font-size: clamp(26px, 2.55vw, 38px);
}

.blog-list {
  display: grid;
  gap: 20px;
}

.blog-list article {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 24px;
  align-items: start;
  padding: 28px;
}

.blog-list h2 {
  font-size: clamp(25px, 2.3vw, 34px);
}

.blog-list a {
  align-self: center;
  border: 1.5px solid var(--line);
  padding: 12px 14px;
  background: var(--ink);
  color: white;
  font-weight: 600;
  white-space: nowrap;
}

.about-grid {
  align-items: start;
}

.about-grid > div:first-child {
  display: grid;
  gap: 24px;
}

.about-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-bottom: 1.5px solid var(--line);
}

.about-card dl {
  margin: 0;
}

.about-card div {
  padding: 20px;
  border-bottom: 1.5px solid var(--line);
}

.about-card div:last-child {
  border-bottom: 0;
}

.about-card dt {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
}

.about-card dd {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.45;
}

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

.service-grid article {
  min-height: 420px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.service-grid h2 {
  font-size: clamp(28px, 2.8vw, 40px);
}

.service-grid ul {
  display: grid;
  gap: 12px;
  margin: auto 0 0;
  padding: 0;
  list-style: none;
}

.service-grid li {
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  background: var(--bg);
  font-weight: 500;
}

.cta-section {
  display: grid;
  gap: 24px;
  justify-items: start;
  border: 1.5px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
  padding: clamp(32px, 6vw, 72px);
  margin-bottom: var(--section-y);
}

.cta-section h2 {
  max-width: 980px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 0 44px;
  border-top: 1.5px solid var(--line);
}

.site-footer strong {
  font-size: 20px;
}

.site-footer p {
  margin-top: 8px;
  font-size: 15px;
}

.site-footer nav {
  display: flex;
  gap: 18px;
  align-items: center;
}

.site-footer a {
  font-weight: 600;
}

@media (max-width: 980px) {
  .site-header {
    align-items: flex-start;
  }

  .menu-button {
    display: inline-flex;
    align-items: center;
  }

  .site-nav {
    position: fixed;
    inset: 104px 16px auto 16px;
    display: none;
    grid-template-columns: 1fr;
    gap: 0;
    border: 1.5px solid var(--line);
    background: var(--paper);
    box-shadow: var(--shadow);
  }

  body.nav-open .site-nav {
    display: grid;
  }

  .site-nav a {
    padding: 18px;
    border-bottom: 1.5px solid var(--line);
  }

  .site-nav a:last-child {
    border-bottom: 0;
  }

  .hero-grid,
  .about-grid,
  .split-section {
    grid-template-columns: 1fr;
  }

  .profile-panel {
    max-width: 520px;
  }

  .metrics-grid,
  .portfolio-grid,
  .service-grid {
    grid-template-columns: 1fr;
  }

  .work-card.featured {
    grid-column: auto;
  }

  .timeline article,
  .blog-list article {
    grid-template-columns: 1fr;
  }

  .blog-list a {
    justify-self: start;
  }
}

@media (max-width: 560px) {
  [data-shell],
  .section {
    width: min(100% - 24px, var(--content));
  }

  .site-header {
    top: 8px;
    margin-top: 8px;
    min-height: 68px;
  }

  .brand {
    min-width: 0;
  }

  .brand small {
    display: none;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .menu-button {
    height: 42px;
    padding-inline: 12px;
  }

  .site-nav {
    inset: 88px 12px auto 12px;
  }

  .hero-section {
    padding-top: 88px;
  }

  h1 {
    font-size: clamp(38px, 11vw, 54px);
    line-height: 1.18;
  }

  .lead {
    font-size: 18px;
  }

  .button,
  .hero-actions {
    width: 100%;
  }

  .metrics-grid article,
  .work-card div,
  .timeline article,
  .blog-list article,
  .service-grid article {
    padding: 20px;
  }

  .service-grid article {
    min-height: auto;
  }

  .site-footer {
    display: grid;
  }
}
