/* ---------------------------------------------------------
   Tokens
--------------------------------------------------------- */
:root {
  --bg: #0b0f14;
  --bg-raised: #10161d;
  --bg-raised-2: #161e27;
  --line: #202a35;
  --line-soft: #1a222b;

  --text: #e7ecf1;
  --text-dim: #93a1b0;
  --text-faint: #5c6c7c;

  --cool: #4fb3bf;
  --cool-dim: #2f6b73;
  --hot: #c9832e;
  --hot-dim: #8a5a1f;

  --gradient-thermal: linear-gradient(90deg, var(--cool) 0%, #9a8a5c 50%, var(--hot) 100%);

  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --radius: 3px;
  --max-w: 880px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--text);
  text-decoration: none;
}

h1, h2, h3 {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 0.5em;
}

p { color: var(--text-dim); }

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

/* ---------------------------------------------------------
   Nav
--------------------------------------------------------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 15, 20, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft);
}

.site-nav__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-nav__mark {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.site-nav__blip {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hot);
  box-shadow: 0 0 0 3px rgba(201, 131, 46, 0.15);
}

.site-nav nav {
  display: flex;
  gap: 22px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.site-nav nav a {
  color: var(--text-dim);
  transition: color 0.15s ease;
}
.site-nav nav a:hover { color: var(--cool); }

/* ---------------------------------------------------------
   Layout shell
--------------------------------------------------------- */
main { display: block; }

section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 96px 24px;
  border-bottom: 1px solid var(--line-soft);
}
section:last-of-type { border-bottom: none; }

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

.section-head__index {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
}

.section-head h2 {
  font-size: 22px;
  text-transform: lowercase;
}

/* ---------------------------------------------------------
   Hero / About
--------------------------------------------------------- */
.hero {
  padding-top: 72px;
  padding-bottom: 64px;
  position: relative;
}

.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--cool);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero__eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--cool);
}

.hero h1 {
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.15;
  max-width: 14ch;
}

.hero__role {
  font-size: 17px;
  color: var(--text-dim);
  max-width: 60ch;
  margin-bottom: 28px;
}

.hero__trace {
  width: 100%;
  max-width: 640px;
  height: 64px;
  margin: 8px 0 28px;
  display: block;
}

.hero__trace path {
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.hero__trace .trace-cool { stroke: var(--cool); }
.hero__trace .trace-hot { stroke: var(--hot); }

.hero__trace .animated {
  stroke-dasharray: 6 5;
  animation: trace-scroll 3.5s linear infinite;
}

@keyframes trace-scroll {
  to { stroke-dashoffset: -220; }
}

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

.btn {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 10px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  color: var(--text);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { border-color: var(--cool); color: var(--cool); }
.btn--fill {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.btn--fill:hover {
  background: var(--cool);
  border-color: var(--cool);
  color: var(--bg);
}

.about-body {
  margin-top: 8px;
  max-width: 68ch;
}
.about-body p { margin-bottom: 1em; }

/* ---------------------------------------------------------
   Skills
--------------------------------------------------------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px 40px;
}

.skill-group h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 12px;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.skill-tags li {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-dim);
  background: var(--bg-raised);
}

/* ---------------------------------------------------------
   Experience
--------------------------------------------------------- */
.timeline {
  border-left: 1px solid var(--line);
  padding-left: 28px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.timeline-item { position: relative; }

.timeline-item::before {
  content: "";
  position: absolute;
  left: -33px;
  top: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--cool);
}

.timeline-item__meta {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-faint);
  margin-bottom: 4px;
}

.timeline-item h3 {
  font-size: 16px;
  margin-bottom: 2px;
}

.timeline-item__org {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.timeline-item ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-dim);
  font-size: 14.5px;
}
.timeline-item li { margin-bottom: 4px; }

/* ---------------------------------------------------------
   Projects
--------------------------------------------------------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.project-card:hover {
  border-color: var(--cool-dim);
  transform: translateY(-2px);
}

.project-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.project-card h3 {
  font-size: 15.5px;
  line-height: 1.3;
}

.project-card p {
  font-size: 13.5px;
  color: var(--text-dim);
  margin: 0;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
}

.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  color: var(--text-faint);
}

.tag--status {
  border-color: var(--hot-dim);
  color: var(--hot);
}

/* ---------------------------------------------------------
   Project detail page
--------------------------------------------------------- */
.project-detail {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 64px 24px 96px;
}

.back-link {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  display: inline-block;
  margin-bottom: 32px;
}
.back-link:hover { color: var(--cool); }

.project-detail__header h1 {
  font-size: clamp(26px, 4vw, 34px);
  margin-top: 12px;
}

.project-detail__date {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
  margin-bottom: 16px;
}

.project-detail__body {
  margin-top: 32px;
  color: var(--text-dim);
  font-size: 16px;
}

.project-detail__body h2 {
  font-size: 18px;
  margin-top: 2em;
}

.project-detail__body ul { padding-left: 20px; }
.project-detail__body li { margin-bottom: 8px; }
.project-detail__body img {
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin: 24px 0;
}
.project-detail__body code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-raised-2);
  padding: 2px 6px;
  border-radius: 3px;
}
.project-detail__body pre {
  background: var(--bg-raised-2);
  padding: 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  border: 1px solid var(--line);
}
.project-detail__body pre code { background: none; padding: 0; }

/* ---------------------------------------------------------
   Contact
--------------------------------------------------------- */
.contact-block {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: flex-start;
}

.contact-block p {
  max-width: 56ch;
}

/* ---------------------------------------------------------
   Footer
--------------------------------------------------------- */
.site-footer__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-faint);
}

.site-footer__links { display: flex; gap: 16px; }
.site-footer__links a:hover { color: var(--cool); }

/* ---------------------------------------------------------
   Responsive
--------------------------------------------------------- */
@media (max-width: 640px) {
  .site-nav__inner { flex-wrap: wrap; gap: 10px; padding: 14px 20px; }
  .site-nav nav { gap: 12px; font-size: 12px; }
  section { padding: 56px 20px; }
  .skills-grid { grid-template-columns: 1fr; }
  .site-footer__inner { flex-direction: column; gap: 10px; }
}
