@import './global.css';

:root {
  color-scheme: dark;
  --bg: #050608;
  --bg-2: #11100d;
  --text: #f4efe4;
  --muted: #a9a397;
  --faint: #706f68;
  --line: rgba(244, 239, 228, 0.12);
  --line-strong: rgba(244, 239, 228, 0.24);
  --surface: rgba(244, 239, 228, 0.055);
  --surface-strong: rgba(244, 239, 228, 0.095);
  --brass: #d6a84f;
  --cyan: #4fd7c7;
  --green: #99d17b;
  --red: #e06452;
  --ink: #090a0c;
  --font: 'IBM Plex Sans', 'Noto Sans TC', sans-serif;
  --mono: 'Azeret Mono', 'Noto Sans TC', monospace;
  --max-w: 1180px;
  --radius: 8px;
}

body {
  min-width: 320px;
  overflow-x: hidden;
  font-family: var(--font);
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(244, 239, 228, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(244, 239, 228, 0.025) 1px, transparent 1px),
    linear-gradient(135deg, var(--bg) 0%, #0b0d0d 42%, var(--bg-2) 100%);
  background-size: 72px 72px, 72px 72px, auto;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    repeating-linear-gradient(115deg, transparent 0 22px, rgba(79, 215, 199, 0.045) 22px 23px, transparent 23px 96px),
    linear-gradient(180deg, rgba(214, 168, 79, 0.12), transparent 32%, rgba(224, 100, 82, 0.075));
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.35) 1px, transparent 1px);
  background-size: 4px 4px;
  mix-blend-mode: overlay;
  pointer-events: none;
}

::selection {
  color: var(--ink);
  background: var(--cyan);
}

.site-shell {
  width: min(var(--max-w), calc(100% - 40px));
  margin: 0 auto;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 14px 0;
  backdrop-filter: blur(18px);
}

.nav::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-weight: 800;
  color: var(--ink);
  background: linear-gradient(135deg, var(--brass), var(--cyan));
  box-shadow: 0 18px 50px rgba(79, 215, 199, 0.16);
}

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

.nav-brand strong {
  font-size: 0.98rem;
  font-weight: 800;
}

.nav-brand small,
.nav-links a,
.eyebrow,
.panel-label,
.paper-meta,
.project-stack,
.signal-index,
.contribution-row span,
.role-card span,
.ramp-track strong {
  font-family: var(--mono);
}

.nav-brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-links a {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 0.78rem;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.nav-links a:hover {
  border-color: var(--line);
  color: var(--text);
  background: var(--surface);
}

.section-band {
  position: relative;
  padding: 96px 0;
}

.section-band[id] {
  scroll-margin-top: 96px;
}

.section-band + .section-band {
  border-top: 1px solid var(--line);
}

.hero {
  min-height: calc(100vh - 76px);
  display: grid;
  align-content: center;
  padding-top: 72px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(320px, 0.7fr);
  align-items: center;
  gap: 48px;
}

.hero-grid > *,
.intro-grid > *,
.split-section > *,
.beyond-grid > *,
.paper-card > *,
.compact-paper > *,
.project-card,
.stack-group,
.contribution-row > *,
.role-card {
  min-width: 0;
}

.hero-copy {
  max-width: 720px;
}

.eyebrow,
.panel-label {
  margin-bottom: 18px;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 11ch;
  font-family: var(--mono);
  font-size: 5.25rem;
  line-height: 0.95;
  font-weight: 800;
}

.hero-lede {
  max-width: 650px;
  margin-top: 28px;
  color: var(--text);
  font-size: 1.42rem;
  line-height: 1.45;
}

.hero-note,
.section-heading p,
.intro-copy p,
.signal-card p,
.paper-card p,
.compact-paper p,
.project-card p,
.stack-group span,
.role-card p,
.ramp-track p,
.contact-panel p,
.footer,
.contribution-row small {
  color: var(--muted);
}

.hero-note {
  max-width: 600px;
  margin-top: 18px;
  font-size: 1.02rem;
}

.hero-actions,
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 10px 16px;
  color: var(--text);
  font-weight: 700;
  background: rgba(5, 6, 8, 0.58);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
  border-color: var(--cyan);
  background: var(--surface-strong);
}

.button-primary {
  color: var(--ink);
  border-color: transparent;
  background: linear-gradient(135deg, var(--brass), var(--cyan));
}

.button-primary:hover {
  border-color: transparent;
  background: linear-gradient(135deg, #f0c96d, #6fe9dc);
}

.identity-panel,
.signal-card,
.experience-card,
.lab-card,
.lab-grid article,
.paper-card,
.compact-paper,
.project-card,
.stack-group,
.contribution-row,
.role-card,
.ramp-track article,
.interest-panel,
.contact-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(244, 239, 228, 0.075), rgba(244, 239, 228, 0.035));
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.28);
}

.identity-panel {
  position: relative;
  overflow: hidden;
  padding: 16px;
}

.identity-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0 49%, rgba(79, 215, 199, 0.18) 49% 50%, transparent 50%),
    linear-gradient(0deg, transparent 0 49%, rgba(214, 168, 79, 0.14) 49% 50%, transparent 50%);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, black, transparent 65%);
  pointer-events: none;
}

.avatar-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  aspect-ratio: 1;
  background: var(--ink);
}

.avatar-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(79, 215, 199, 0.42);
  mix-blend-mode: screen;
  pointer-events: none;
}

.avatar-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.85) contrast(1.08);
}

.identity-copy {
  position: relative;
  padding: 24px 8px 8px;
}

.identity-copy h2 {
  max-width: 16ch;
  font-family: var(--mono);
  font-size: 1.8rem;
  line-height: 1.05;
}

.identity-copy p:last-child {
  margin-top: 12px;
  color: var(--muted);
}

.runtime-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1px;
  overflow: hidden;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.runtime-grid span,
.runtime-grid strong {
  min-height: 38px;
  padding: 10px 12px;
  background: rgba(5, 6, 8, 0.78);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.runtime-grid span {
  color: var(--muted);
}

.runtime-grid strong {
  color: var(--green);
  text-align: right;
}

.proof-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  overflow: hidden;
  margin-top: 56px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.proof-item {
  min-height: 116px;
  padding: 24px;
  background: rgba(5, 6, 8, 0.76);
}

.proof-item strong {
  display: block;
  color: var(--brass);
  font-family: var(--mono);
  font-size: 2.05rem;
  line-height: 1;
}

.proof-item span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.intro-grid,
.beyond-grid {
  display: grid;
  grid-template-columns: 0.72fr 1fr;
  gap: 48px;
}

.section-heading h2 {
  max-width: 14ch;
  font-family: var(--mono);
  font-size: 3rem;
  line-height: 1.04;
}

.wide-heading h2 {
  max-width: 18ch;
}

.section-heading p {
  max-width: 34ch;
  margin-top: 18px;
  font-size: 1rem;
}

.intro-copy {
  display: grid;
  gap: 22px;
  padding-top: 42px;
}

.intro-copy p {
  max-width: 68ch;
  font-size: 1.08rem;
  line-height: 1.75;
}

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

.signal-card {
  position: relative;
  overflow: hidden;
  min-height: 250px;
  padding: 24px;
}

.signal-card::after,
.project-card::after {
  content: '';
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 56px;
  height: 2px;
  background: linear-gradient(90deg, var(--brass), var(--cyan));
  transform: scaleX(0.45);
  transform-origin: right;
  transition: transform 180ms ease;
}

.signal-card:hover::after,
.project-card:hover::after {
  transform: scaleX(1);
}

.signal-index,
.paper-meta,
.project-stack,
.contribution-row span,
.role-card span {
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.signal-card h3,
.paper-card h3,
.compact-paper h3,
.project-card h3,
.stack-group h3,
.role-card h3,
.contact-panel h2 {
  margin-top: 14px;
  font-family: var(--mono);
  line-height: 1.18;
}

.signal-card p,
.project-card p {
  margin-top: 16px;
  line-height: 1.65;
}

.split-section {
  display: grid;
  grid-template-columns: 0.46fr 1fr;
  align-items: start;
  gap: 48px;
}

.sticky-heading {
  position: sticky;
  top: 108px;
}

.research-list,
.experience-list,
.lab-panel,
.stack-board,
.contribution-list {
  display: grid;
  gap: 14px;
}

.lab-panel {
  align-content: start;
}

.lab-card,
.lab-grid article {
  padding: 24px;
}

.lab-card span,
.lab-grid strong {
  display: block;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}

.lab-card h3 {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 1.45rem;
  line-height: 1.18;
}

.lab-card p,
.lab-grid p {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.65;
}

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

.lab-grid strong {
  color: var(--brass);
}

.lab-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.lab-links a {
  border: 1px solid rgba(79, 215, 199, 0.34);
  border-radius: 999px;
  padding: 8px 10px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.72rem;
  background: rgba(79, 215, 199, 0.08);
}

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

.experience-card {
  padding: 24px;
}

.experience-card span,
.experience-card strong {
  display: block;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}

.experience-card span {
  color: var(--cyan);
}

.experience-card strong {
  margin-top: 10px;
  color: var(--brass);
}

.experience-card h3 {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 1.25rem;
  line-height: 1.18;
}

.experience-card p {
  max-width: 78ch;
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.65;
}

.paper-card {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.paper-card:hover,
.experience-card:hover,
.project-card:hover,
.contribution-row:hover,
.role-card:hover {
  transform: translateY(-3px);
  border-color: rgba(79, 215, 199, 0.42);
  background: linear-gradient(180deg, rgba(79, 215, 199, 0.09), rgba(244, 239, 228, 0.04));
}

.paper-card h3 {
  max-width: 28ch;
  font-size: 1.35rem;
  overflow-wrap: anywhere;
}

.paper-card p {
  max-width: 70ch;
  margin-top: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.paper-role {
  align-self: flex-start;
  flex: 0 0 auto;
  border: 1px solid rgba(214, 168, 79, 0.36);
  border-radius: 999px;
  padding: 8px 10px;
  color: var(--brass);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.domestic-stack {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.compact-paper {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  padding: 18px;
}

.compact-paper > span {
  color: var(--brass);
  font-family: var(--mono);
  font-weight: 800;
}

.compact-paper h3 {
  margin-top: 0;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.compact-paper small,
.compact-paper strong {
  display: block;
  margin-top: 6px;
  color: var(--faint);
  overflow-wrap: anywhere;
}

.compact-paper strong {
  color: var(--green);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 14px;
  margin-top: 34px;
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow: hidden;
  min-height: 272px;
  padding: 22px 22px 44px;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.project-card h3 {
  max-width: 100%;
  font-size: 1.32rem;
  overflow-wrap: anywhere;
}

.project-card strong {
  display: inline-flex;
  max-width: 100%;
  margin-top: 18px;
  border: 1px solid rgba(153, 209, 123, 0.38);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}

.project-stack {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.project-card p {
  margin-bottom: 18px;
}

.project-card strong {
  margin-top: auto;
}

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

.stack-group {
  padding: 22px;
}

.stack-group h3 {
  margin-top: 0;
  margin-bottom: 16px;
  color: var(--brass);
  font-size: 1rem;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-cloud span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 11px;
  font-size: 0.9rem;
  background: rgba(5, 6, 8, 0.38);
}

.large-tags span {
  padding: 12px 14px;
}

.interest-panel {
  position: relative;
  align-self: center;
  overflow: hidden;
  padding: 24px;
}

.interest-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0 49%, rgba(214, 168, 79, 0.14) 49% 50%, transparent 50%),
    repeating-linear-gradient(135deg, transparent 0 28px, rgba(79, 215, 199, 0.06) 28px 29px, transparent 29px 84px);
  mask-image: linear-gradient(180deg, black, transparent 82%);
  pointer-events: none;
}

.interest-panel > * {
  position: relative;
}

.interest-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.interest-panel-head span,
.interest-panel-head strong {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.interest-panel-head span {
  color: var(--cyan);
}

.interest-panel-head strong {
  color: var(--brass);
}

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

.interest-list span {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 82px;
  border: 1px solid rgba(244, 239, 228, 0.14);
  border-radius: var(--radius);
  padding: 14px 14px 14px 36px;
  color: var(--text);
  line-height: 1.4;
  background: rgba(5, 6, 8, 0.58);
  overflow-wrap: anywhere;
}

.interest-list span::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 50%;
  width: 7px;
  height: 7px;
  border: 1px solid var(--cyan);
  background: rgba(79, 215, 199, 0.22);
  box-shadow: 0 0 18px rgba(79, 215, 199, 0.3);
  transform: translateY(-50%);
}

.contribution-row {
  display: grid;
  grid-template-columns: 110px 1fr minmax(160px, 0.55fr);
  align-items: center;
  gap: 18px;
  padding: 18px;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.contribution-row strong,
.contribution-row small {
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.role-lab {
  overflow: hidden;
}

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

.role-card {
  min-height: 218px;
  padding: 22px;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.role-card h3 {
  color: var(--text);
  font-size: 1.25rem;
}

.role-card p {
  margin-top: 14px;
  line-height: 1.6;
}

.ramp-track {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.ramp-track article {
  border: 0;
  border-radius: 0;
  padding: 22px;
  background: rgba(5, 6, 8, 0.74);
  box-shadow: none;
}

.ramp-track strong {
  color: var(--brass);
  font-size: 0.8rem;
}

.ramp-track p {
  margin-top: 12px;
}

.contact-panel {
  position: relative;
  overflow: hidden;
  margin: 72px 0 24px;
  padding: 44px;
}

.contact-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(214, 168, 79, 0.16), transparent 36%),
    linear-gradient(120deg, transparent 0 50%, rgba(79, 215, 199, 0.12) 50% 51%, transparent 51%);
  pointer-events: none;
}

.contact-panel > * {
  position: relative;
}

.contact-panel h2 {
  max-width: 17ch;
  font-size: 2.55rem;
}

.contact-panel p {
  max-width: 58ch;
  margin-top: 18px;
}

.source-list {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.source-list a {
  border: 1px solid rgba(244, 239, 228, 0.14);
  border-radius: 999px;
  padding: 8px 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  background: rgba(5, 6, 8, 0.44);
  transition: color 180ms ease, border-color 180ms ease;
}

.source-list a:hover {
  border-color: rgba(79, 215, 199, 0.46);
  color: var(--text);
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0 42px;
  font-size: 0.84rem;
}

@media (max-width: 1080px) {
  .section-band {
    padding: 76px 0;
  }

  .hero {
    min-height: auto;
  }

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

  .hero h1 {
    font-size: 4.25rem;
  }

  .sticky-heading {
    position: static;
  }

  .section-heading h2 {
    max-width: 18ch;
  }

  .intro-copy {
    padding-top: 0;
  }

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

  .signal-grid,
  .role-grid,
  .ramp-track {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 720px) {
  .site-shell {
    width: min(var(--max-w), calc(100% - 28px));
  }

  .nav {
    position: relative;
    align-items: flex-start;
    min-height: 0;
    flex-direction: column;
  }

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

  .section-band {
    padding: 58px 0;
  }

  .section-band[id] {
    scroll-margin-top: 24px;
  }

  .hero {
    padding-top: 44px;
  }

  .hero h1 {
    font-size: 3.15rem;
  }

  .hero-lede {
    font-size: 1.18rem;
  }

  .proof-strip,
  .lab-grid,
  .stack-board,
  .interest-list {
    grid-template-columns: 1fr;
  }

  .proof-item {
    min-height: 0;
    padding: 18px;
  }

  .paper-card {
    flex-direction: column;
  }

  .paper-role {
    white-space: normal;
  }

  .compact-paper,
  .contribution-row {
    grid-template-columns: 1fr;
  }

  .contact-panel {
    padding: 28px;
  }

  .contact-panel h2,
  .section-heading h2 {
    font-size: 2.2rem;
  }

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