/* ============================================================
   Kimtong Peng — Kinetic Silence
   Light mono · Geist × Geist Mono · Apple-inspired calm
   ============================================================ */

:root {
  --bg:            #f9f9f9;
  --surface:       #ffffff;
  --surface-soft:  #f5f5f7;
  --surface-gray:  #fbfbfb;
  --ink:           #1b1b1b;
  --ink-2:         #4c4546;
  --secondary:     #6e6e73;
  --line:          #e2e2e2;
  --line-2:        #cfc4c5;
  --primary:       #000000;
  --on-primary:    #ffffff;
  --live:          #28cd41;
  --capy:          #a67c52;
  --shadow:        0 20px 40px rgba(0, 0, 0, 0.04);
  --radius:        1.5rem;
  --radius-lg:     1rem;
  --maxw:          1200px;
  --gutter:        24px;
  --margin:        64px;
  --margin-m:      24px;
  --section:       160px;
  --nav-h:         64px;
  --ease:          cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { scroll-behavior: smooth }

body {
  margin: 0;
  font-family: "Geist", ui-sans-serif, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.01em;
  overflow-x: hidden;
}

img { max-width: 100%; display: block }
a { color: inherit; text-decoration: none }
ul, ol { margin: 0; padding: 0; list-style: none }
h1, h2, h3, p, pre { margin: 0 }
em { font-style: italic }

.shell {
  width: min(100% - (var(--margin-m) * 2), var(--maxw));
  margin-inline: auto;
}

@media (min-width: 768px) {
  .shell { width: min(100% - (var(--margin) * 2), var(--maxw)); }
}

/* ---- a11y ---- */
.skip-link {
  position: absolute;
  top: -200%;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--on-primary);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
}
.skip-link:focus { top: 12px }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.mono-label {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--secondary);
}

/* ---- nav ---- */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  height: 100%;
  width: min(100% - (var(--margin-m) * 2), var(--maxw));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

@media (min-width: 768px) {
  .nav-inner { width: min(100% - (var(--margin) * 2), var(--maxw)); }
}

.nav-mark {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-size: 15px;
  font-weight: 500;
  color: var(--secondary);
  transition: color 0.2s ease;
}

.nav-links a:hover { color: var(--primary) }

.nav-connect {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.nav-connect:hover { opacity: 0.7 }

@media (min-width: 768px) {
  .nav-links { display: flex }
}

/* ---- buttons ---- */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  border-radius: var(--radius-lg);
  transition: opacity 0.2s ease, transform 0.2s var(--ease), background 0.2s ease;
}

.btn.primary {
  padding: 16px 32px;
  background: var(--primary);
  color: var(--on-primary);
}

.btn.primary:hover { opacity: 0.9 }

.btn.text {
  color: var(--primary);
}

.btn.text .arrow {
  display: inline-block;
  transition: transform 0.25s var(--ease);
}

.btn.text:hover .arrow { transform: translateX(4px) }

/* ---- hero ---- */
.hero {
  min-height: 100svh;
  padding: calc(var(--nav-h) + 48px) 0 80px;
  display: flex;
  align-items: center;
}

.hero-grid {
  display: grid;
  gap: 48px;
  align-items: center;
}

@media (min-width: 960px) {
  .hero-grid {
    grid-template-columns: repeat(12, 1fr);
    gap: var(--gutter);
  }
  .hero-copy { grid-column: span 7 }
  .hero-media { grid-column: span 5 }
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 0 rgba(40, 205, 65, 0.45);
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(40, 205, 65, 0.45) }
  70%  { box-shadow: 0 0 0 8px rgba(40, 205, 65, 0) }
  100% { box-shadow: 0 0 0 0 rgba(40, 205, 65, 0) }
}

.display {
  font-size: clamp(2.75rem, 7vw, 5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
}

.display-muted { color: var(--secondary) }

.hero-sub {
  max-width: 36rem;
  color: var(--secondary);
  font-style: italic;
  margin-bottom: 40px;
  line-height: 1.55;
}

.hero-media { position: relative }

.portrait-frame {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-soft);
  box-shadow: var(--shadow);
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: grayscale(1);
  transition: filter 0.7s ease;
}

.portrait-frame:hover img { filter: grayscale(0) }

.loc-card {
  display: none;
  position: absolute;
  right: -12px;
  bottom: -20px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.loc-card .mono-label { color: var(--ink); margin-bottom: 4px }
.loc-city { font-weight: 600; font-size: 16px }
.loc-clock { margin-top: 8px; color: var(--secondary) }

@media (min-width: 768px) {
  .loc-card { display: block }
}

/* ---- sections ---- */
.section {
  padding: var(--section) 0;
}

.section-alt {
  background: var(--surface);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 64px;
}

.section-num {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--primary);
}

.section-head h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

/* ---- metrics ---- */
.metrics {
  display: grid;
  gap: var(--gutter);
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .metrics { grid-template-columns: repeat(3, 1fr) }
}

.metric {
  padding: 40px;
  background: var(--surface-gray);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.4s ease;
}

.metric:hover { border-color: var(--primary) }

.metric-num {
  font-size: clamp(2.5rem, 4vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 12px;
}

.metric-num.muted,
.muted { color: var(--secondary); opacity: 0.45 }

.meter {
  margin-top: 24px;
  height: 4px;
  background: var(--line);
  overflow: hidden;
}

.meter i {
  display: block;
  height: 100%;
  background: var(--primary);
}

.expertise-row {
  margin-top: var(--gutter);
  display: grid;
  gap: var(--gutter);
}

@media (min-width: 960px) {
  .expertise-row {
    grid-template-columns: 5fr 7fr;
  }
}

.expertise-card {
  padding: 40px;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: var(--radius);
}

.expertise-card h3 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 28px;
}

.expertise-card li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 16px;
  font-size: 16px;
}

.expertise-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--on-primary);
  box-shadow: inset 0 0 0 3px var(--primary), inset 0 0 0 5px var(--on-primary);
}

.quote-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: #f3f3f3;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.quote-card p {
  max-width: 28rem;
  text-align: center;
  font-style: italic;
  color: var(--secondary);
  line-height: 1.6;
}

/* ---- work ---- */
.work-grid {
  display: grid;
  gap: 40px;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .work-grid { grid-template-columns: repeat(2, 1fr); gap: 48px 40px }
  .project-feature { grid-column: 1 / -1 }
}

.project-surface {
  position: relative;
  min-height: 100%;
  padding: 36px;
  background: var(--surface-soft);
  border-radius: var(--radius);
  transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease);
}

.project:hover .project-surface {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.project-surface.dashed {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 280px;
  background: transparent;
  border: 2px dashed var(--line);
  box-shadow: none;
  transform: none;
}

.project-more:hover .project-surface {
  box-shadow: none;
  transform: none;
  border-color: var(--secondary);
}

.project-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.08);
  color: var(--primary);
}

.chip.live {
  background: rgba(40, 205, 65, 0.12);
  color: #1a9a2e;
}

.chip .live-dot { width: 5px; height: 5px; animation: none; box-shadow: none }

.project-kicker { margin-bottom: 12px }

.project h3 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 12px;
}

.project p {
  color: var(--secondary);
  margin-bottom: 20px;
  max-width: 42rem;
}

.project-feature .project-surface {
  padding: 48px;
  background: linear-gradient(160deg, #f5f5f7 0%, #eeeeef 100%);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--primary);
}

.project-tags span[aria-hidden] {
  color: var(--secondary);
  opacity: 0.35;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--primary);
}

.project-link .arrow {
  transition: transform 0.25s var(--ease);
}

.project-link:hover .arrow { transform: translateX(3px) translateY(-2px) }

/* ---- about ---- */
.about-grid {
  display: grid;
  gap: 64px;
}

@media (min-width: 960px) {
  .about-grid {
    grid-template-columns: repeat(12, 1fr);
    gap: var(--gutter);
    align-items: start;
  }
  .about-copy { grid-column: span 5 }
  .edu { grid-column: 7 / span 6 }
}

.about-copy .section-head { margin-bottom: 40px }

.capy-block {
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.ascii {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.35;
  color: var(--capy);
  margin-bottom: 24px;
  white-space: pre;
}

.capy-line {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin-bottom: 16px;
}

.about-body {
  color: var(--secondary);
  line-height: 1.6;
}

.edu-label {
  letter-spacing: 0.18em;
  margin-bottom: 48px;
}

.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--line);
}

.timeline li {
  position: relative;
  padding-bottom: 40px;
}

.timeline li:last-child { padding-bottom: 0 }

.timeline li::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: var(--bg);
}

.timeline li:not(:first-child)::before {
  border-color: var(--line);
}

.timeline h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
}

.timeline .mono-label {
  display: block;
  margin-bottom: 8px;
}

.timeline p:last-child {
  font-size: 14px;
  color: var(--ink-2);
}

/* ---- contact ---- */
.contact {
  background: var(--primary);
  color: var(--on-primary);
  padding: var(--section) 0;
}

.contact-inner {
  text-align: center;
}

.contact-kicker {
  display: block;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.28em;
  margin-bottom: 32px;
}

.contact-title {
  margin-bottom: 48px;
}

.contact-title em {
  font-weight: 300;
  opacity: 0.8;
}

.contact-btn {
  display: inline-flex;
  padding: 18px 32px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--on-primary);
  transition: background 0.25s ease;
}

.contact-btn:hover { background: rgba(255, 255, 255, 0.2) }

.contact :focus-visible {
  outline-color: #fff;
}

/* ---- footer ---- */
.footer {
  padding: 80px 0;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  text-align: center;
}

@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer .mono-label { color: var(--ink); margin-bottom: 8px }

.footer-meta {
  font-size: 14px;
  color: var(--secondary);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px;
}

.footer-links a {
  font-size: 14px;
  color: var(--secondary);
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color 0.2s ease;
}

.footer-links a:hover { color: var(--primary) }

/* ---- reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* ---- 404 ---- */
.notfound {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: var(--margin-m);
}

.notfound-card {
  max-width: 520px;
  padding: 48px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.notfound .lab {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 16px;
}

.notfound .code {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.notfound p {
  color: var(--secondary);
  margin-bottom: 32px;
}

.notfound .btn.ghost {
  color: var(--secondary);
}

.notfound .btn.ghost:hover { color: var(--primary) }

/* ---- reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .live-dot { animation: none }
  .portrait-frame img { transition: none }
  .project:hover .project-surface { transform: none }
}
