:root {
  color-scheme: light;
  --bg: #f6f5f0;
  --bg-alt: #eeece4;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-strong: #ffffff;
  --text: #111111;
  --muted: #666666;
  --line: rgba(17, 17, 17, 0.12);
  --line-strong: rgba(17, 17, 17, 0.82);
  --shadow: 0 18px 40px rgba(17, 17, 17, 0.06);
  --shadow-hover: 0 22px 48px rgba(17, 17, 17, 0.1);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --body-font: "Avenir Next", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --display-font: "Avenir Next Condensed", "Arial Narrow", "PingFang TC", "Noto Sans TC", sans-serif;
  --mono-font: "SFMono-Regular", "JetBrains Mono", "IBM Plex Mono", "Menlo", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body-font);
  color: var(--text);
  line-height: 1.68;
  background:
    radial-gradient(circle at top right, rgba(17, 17, 17, 0.04), transparent 24rem),
    linear-gradient(180deg, var(--bg), var(--bg-alt));
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      115deg,
      rgba(17, 17, 17, 0.045) 0,
      rgba(17, 17, 17, 0.045) 1px,
      transparent 1px,
      transparent 18px
    );
  opacity: 0.35;
  transform: translate3d(0, 0, 0);
  animation: drift 18s linear infinite;
  pointer-events: none;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.14));
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.18s ease, border-color 0.18s ease, transform 0.18s ease, background-color 0.18s ease;
}

a:hover {
  color: var(--text);
}

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

.container {
  position: relative;
  z-index: 1;
  max-width: 1160px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 52px) 20px 84px;
}

.hero {
  position: relative;
  overflow: hidden;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(250, 250, 247, 0.96));
  box-shadow: var(--shadow);
  animation: rise 0.45s ease both;
}

.hero::before {
  content: "";
  position: absolute;
  inset: auto -12% -36% 42%;
  height: 180%;
  background:
    repeating-linear-gradient(
      120deg,
      rgba(17, 17, 17, 0.09) 0,
      rgba(17, 17, 17, 0.09) 1px,
      transparent 1px,
      transparent 15px
    );
  opacity: 0.6;
  transform: rotate(-7deg);
  animation: speedLines 14s linear infinite;
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: clamp(26px, 4vw, 38px);
}

.hero-copy {
  min-width: 0;
}

h1 {
  margin: 0;
  max-width: none;
  font-family: var(--display-font);
  font-size: clamp(2.8rem, 8vw, 5.6rem);
  font-weight: 800;
  line-height: 0.86;
  letter-spacing: -0.07em;
  color: var(--text);
  background: none;
  -webkit-text-fill-color: currentColor;
  animation: none;
}

.tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  color: var(--muted);
  font-family: var(--mono-font);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.lang-switcher {
  display: inline-flex;
  gap: 6px;
  flex-shrink: 0;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 22px rgba(17, 17, 17, 0.06);
}

.lang-button {
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono-font);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.lang-button:hover {
  color: var(--text);
}

.lang-button.active {
  background: var(--text);
  color: #ffffff;
}

section {
  position: relative;
  margin-top: 22px;
  padding: 28px 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

section::before,
.grid > div::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 12px;
  width: 14px;
  height: 14px;
  border-top: 2px solid var(--line-strong);
  border-left: 2px solid var(--line-strong);
  opacity: 0.3;
  pointer-events: none;
}

section h2,
.grid > div h2 {
  margin: 0 0 18px;
  color: var(--text);
  font-family: var(--display-font);
  font-size: clamp(1.5rem, 2vw, 1.9rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

section h2::after,
.grid > div h2::after {
  content: "";
  display: block;
  width: 46px;
  height: 2px;
  margin-top: 12px;
  background: var(--line-strong);
}

section p {
  margin: 0;
  color: var(--muted);
}

section p + p {
  margin-top: 14px;
}

.note {
  color: var(--text);
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.contact-list li {
  margin: 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-strong);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  word-break: break-word;
}

.contact-list li:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-hover);
}

.contact-list span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-family: var(--mono-font);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.grid > div {
  position: relative;
  min-width: 0;
  padding: 28px 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
}

ul.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.entry {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin: 0;
  padding: 18px 20px 18px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-strong);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.entry::before {
  content: "";
  position: absolute;
  inset: 14px auto 14px 0;
  width: 3px;
  border-radius: 999px;
  background: var(--text);
}

.entry:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-hover);
}

.entry-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 124px;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f4f4f2;
  color: var(--text);
  font-family: var(--mono-font);
  font-size: 0.73rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.03em;
  text-align: center;
}

.entry-title {
  display: flex;
  align-items: center;
  min-width: 0;
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: normal;
}

.entry-title a {
  display: block;
  color: inherit;
}

.entry-title a:hover {
  color: var(--muted);
}

.entry-role {
  flex-shrink: 0;
  color: var(--muted);
  font-family: var(--mono-font);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: right;
}

.year-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.year-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--muted);
  font-family: var(--mono-font);
  font-size: 0.74rem;
  font-weight: 700;
}

.year-tag:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

footer {
  margin-top: 28px;
  color: var(--muted);
  text-align: center;
  font-family: var(--mono-font);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #ffffff;
  color: var(--text);
  font-family: var(--mono-font);
  font-size: 0.8rem;
  font-weight: 700;
}

.hero-link:hover {
  transform: translateY(-1px);
}

.hero-link-primary {
  background: var(--text);
  color: #ffffff;
}

.hero-link-primary:hover {
  background: #2a2a2a;
  color: #ffffff;
}

.error-page {
  display: grid;
  place-items: center;
}

.error-page .container {
  width: 100%;
}

.error-card {
  max-width: 680px;
  margin: 10vh auto 0;
  padding: 32px;
}

.error-code {
  margin: 0 0 10px;
  color: var(--muted);
  font-family: var(--mono-font);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.error-title {
  max-width: none;
  font-size: clamp(1.9rem, 5vw, 3.2rem);
  line-height: 0.94;
}

.error-text {
  margin-top: 16px;
  color: var(--muted);
}

.error-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(0, 44px, 0);
  }
}

@keyframes speedLines {
  from {
    transform: rotate(-7deg) translateX(0);
  }

  to {
    transform: rotate(-7deg) translateX(72px);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1024px) {
  .contact-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .container {
    padding: 22px 16px 64px;
  }

  .hero-inner,
  section,
  .grid > div,
  .error-card {
    padding: 22px 18px;
  }

  .hero-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  h1 {
    font-size: clamp(2.2rem, 13vw, 3.4rem);
  }

  .lang-switcher {
    width: 100%;
    justify-content: center;
  }

  .contact-list {
    grid-template-columns: 1fr;
  }

  .entry {
    flex-direction: column;
    gap: 12px;
  }

  .entry-head {
    width: 100%;
    flex-direction: column;
    gap: 10px;
  }

  .badge {
    min-width: 0;
  }

  .entry-role,
  .year-tags {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
  }

  .error-actions {
    flex-direction: column;
  }
}
