/* ---------- tokens ---------- */
:root {
  --bg: #f4f6f2;
  --bg-alt: #e7ebe3;
  --text: #10140f;
  --text-muted: #55605a;
  --border: #ccd6c9;
  --accent: #00a339;
  --accent-strong: #00822d;
  --accent-soft: #d4f5df;
  --shadow: 0 1px 2px rgba(16, 20, 15, 0.06);

  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --container: 760px;
  --radius: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d0c;
    --bg-alt: #121513;
    --text: #d8ddd6;
    --text-muted: #7c8a80;
    --border: #223028;
    --accent: #00ff41;
    --accent-strong: #6bff8e;
    --accent-soft: rgba(0, 255, 65, 0.12);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  }
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
::selection { background: #32cd32; color: #0b0d0c; }
::-moz-selection { background: #32cd32; color: #0b0d0c; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
}
h1, h2, h3 { font-family: var(--font-mono); font-weight: 600; margin: 0; color: var(--text); }
p { margin: 0 0 1em; color: var(--text-muted); }
p:last-child { margin-bottom: 0; }
a { color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
svg { display: block; flex-shrink: 0; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: var(--bg); padding: 10px 16px; z-index: 200;
}
.skip-link:focus { left: 12px; top: 12px; }

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

/* ---------- matrix background ---------- */
#matrixBg {
  position: fixed; inset: 0; z-index: -1;
  width: 100%; height: 100%;
  pointer-events: none;
  opacity: 0.06;
}
@media (prefers-color-scheme: dark) {
  #matrixBg { opacity: 0.16; }
}

/* custom scrollbar */
* { scrollbar-color: var(--accent) var(--bg-alt); scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; max-width: 960px;
}
.logo {
  font-family: var(--font-mono); font-weight: 600; font-size: 14px;
  color: var(--accent); text-decoration: none; letter-spacing: -0.01em;
}
.logo-short { display: none; }
.nav-links { display: flex; gap: 22px; }
.nav-links a {
  font-size: 13.5px; text-decoration: none; color: var(--text-muted);
  position: relative; padding: 4px 0;
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 1px;
  background: var(--accent); transition: right 0.2s ease;
}
.nav-links a:hover::after { right: 0; }
.nav-links a.is-active { color: var(--accent); }
.nav-links a.is-active::after { right: 0; }

.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 4px;
  width: 34px; height: 34px; background: none; border: none; cursor: pointer;
}
.nav-toggle span { width: 20px; height: 2px; background: var(--text); }

/* ---------- hero / terminal window ---------- */
.hero {
  padding: 56px 24px 64px;
  min-height: calc(100vh - 60px);
  display: flex; flex-direction: column; justify-content: center;
}

.terminal-window {
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-alt); overflow: hidden;
  box-shadow: var(--shadow);
}
.terminal-titlebar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.terminal-dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }
.terminal-filename {
  margin-left: 8px; font-size: 12px; color: var(--text-muted);
}
.terminal-body { position: relative; padding: 22px 20px; }
.prompt-line { margin: 0 0 4px; font-size: 14px; color: var(--text-muted); }
.prompt-user { color: var(--accent); }
.prompt-path { color: var(--text-muted); }
.prompt-symbol { color: var(--accent); }
.prompt-output {
  margin: 0 0 14px; padding-left: 0; font-size: 15px; color: var(--text);
}
.prompt-output-strong {
  font-size: clamp(1.4rem, 4vw, 1.9rem); font-weight: 700; letter-spacing: -0.01em;
}
.avatar {
  position: absolute; top: 18px; right: 20px;
  width: var(--avatar-size); height: var(--avatar-size);
  border-radius: 50%; object-fit: cover;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 6px var(--accent-soft), 0 0 30px rgba(0, 255, 65, 0.25);
}
.cursor {
  display: inline-block; width: 8px; height: 1.1em; background: var(--accent);
  vertical-align: text-bottom; animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
}

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

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius); font-size: 13.5px; font-weight: 600;
  text-decoration: none; border: 1px solid transparent; transition: all 0.15s ease;
  font-family: var(--font-mono);
}
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-terminal {
  border-color: var(--accent); color: var(--accent);
  padding: 6px 14px; font-size: 13px; margin: 0 0 14px;
}
.btn-terminal:hover { background: var(--accent-soft); }

.award-highlight { color: var(--text); text-decoration: none; border-bottom: 1px dashed var(--border); }
.award-highlight:hover { color: var(--accent); border-bottom-color: var(--accent); }

.status-line {
  display: flex; align-items: center; gap: 9px; margin-top: 24px;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--text-muted);
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  animation: status-pulse 2.4s ease-out infinite;
}
@keyframes status-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); }
  70% { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .status-dot { animation: none; }
}

/* ---------- sections ---------- */
.section {
  padding: 60px 24px; border-top: 1px solid var(--border); scroll-margin-top: 60px;
  min-height: calc(100vh - 60px);
  display: flex; flex-direction: column; justify-content: center;
}
.section-head { margin-bottom: 26px; }
.section-index {
  display: block; font-family: var(--font-mono); font-size: 12.5px; color: var(--accent);
  letter-spacing: 0.03em; margin-bottom: 6px;
}
.section-command {
  margin: 0 0 10px; font-size: 13px; color: var(--text-muted);
}
.section h2 {
  font-size: 1.4rem; text-transform: uppercase; letter-spacing: 0.02em;
}
.section-body p { max-width: 62ch; }
.section-body p + p { margin-top: 1em; }

/* ---------- projects ---------- */
.projects-grid { display: grid; gap: 18px; }
.project-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; background: var(--bg-alt);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.project-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -16px color-mix(in srgb, var(--text) 30%, transparent);
}
.project-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.project-top h3 { font-size: 1.05rem; display: flex; align-items: center; gap: 9px; text-transform: none; }
.project-icon { color: var(--accent); }
.badge {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.02em;
  text-transform: uppercase; padding: 4px 9px; border-radius: 4px;
  background: var(--border); color: var(--text-muted); white-space: nowrap;
}
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.project-desc { color: var(--text-muted); margin-bottom: 12px; font-size: 14px; }
.project-detail { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.project-preview {
  display: block; margin-bottom: 18px; overflow: hidden; text-decoration: none;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.project-preview:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft), 0 12px 28px -18px var(--accent);
}
.preview-chrome {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 12px; background: var(--bg-alt); border-bottom: 1px solid var(--border);
}
.preview-url {
  margin-left: 8px; font-size: 11.5px; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.project-preview img {
  display: block; width: 100%; height: auto;
  transition: transform 0.3s ease;
}
.project-preview:hover img { transform: scale(1.02); }
@media (prefers-reduced-motion: reduce) {
  .project-preview:hover img { transform: none; }
}

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.tag-list li {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted);
  border: 1px solid var(--border); padding: 3px 8px; border-radius: 4px;
}
.project-links { display: flex; gap: 18px; flex-wrap: wrap; }
.project-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; text-decoration: none; color: var(--text);
  border-bottom: 1px solid var(--border); padding-bottom: 2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.project-link:hover { color: var(--accent); border-color: var(--accent); }
.project-link-disabled {
  color: var(--text-muted); border-bottom-color: transparent; cursor: default;
  font-style: italic;
}
@media (prefers-reduced-motion: reduce) {
  .project-card:hover { transform: none; }
}

/* ---------- timeline ---------- */
.timeline { border-left: 1px solid var(--border); }
.timeline-item { position: relative; padding: 0 0 30px 26px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ""; position: absolute; left: -5px; top: 4px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.timeline-date {
  font-family: var(--font-mono); font-size: 12px; color: var(--accent);
  margin-bottom: 6px; letter-spacing: 0.01em;
}
.timeline-content h3 { font-size: 0.98rem; font-weight: 600; margin-bottom: 4px; text-transform: none; }
.org { font-weight: 400; color: var(--text-muted); }
.timeline-meta { font-size: 12.5px; color: var(--text-muted); margin-bottom: 8px; }
.timeline-content p:not(.timeline-meta) { font-size: 13.5px; }

/* ---------- education ---------- */
.edu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 30px; }
.edu-item h3 { font-size: 1rem; margin: 4px 0 6px; text-transform: none; }
.edu-item p { font-size: 13.5px; }

.awards-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--radius);
  border: 1px solid var(--border); text-decoration: none;
  font-size: 13.5px; font-weight: 600; color: var(--text);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.awards-link:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- awards page ---------- */
.awards-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.award-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: var(--bg-alt);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.award-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -16px color-mix(in srgb, var(--text) 30%, transparent);
}
@media (prefers-reduced-motion: reduce) {
  .award-card:hover { transform: none; }
}
.award-media {
  aspect-ratio: 4 / 3; background: var(--border);
  display: flex; align-items: center; justify-content: center;
}
.award-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.award-placeholder {
  font-family: var(--font-mono); font-size: 12px; color: var(--text-muted);
  text-align: center; padding: 0 20px;
}
.award-body { padding: 18px 20px; }
.award-body h3 { font-size: 0.98rem; margin: 4px 0 8px; text-transform: none; }
.award-body p:not(.timeline-date) { font-size: 13px; }
.award-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

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

/* ---------- contact ---------- */
.contact-links { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.contact-link {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text); font-size: 14px;
  width: fit-content; padding-bottom: 2px; border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.contact-link svg { color: var(--accent); }
.contact-link:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 26px 0; }
.footer-inner {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
  font-family: var(--font-mono); font-size: 12px; color: var(--text-muted);
}
.footer-social { display: flex; align-items: center; gap: 16px; }
.footer-social a { color: var(--text-muted); transition: color 0.15s ease; }
.footer-social a:hover { color: var(--accent); }

/* ---------- reveal animation ---------- */
.js .reveal { opacity: 0; transform: translateY(10px); transition: opacity 0.5s ease, transform 0.5s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .edu-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .logo-full { display: none; }
  .logo-short { display: inline; }
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute; top: 60px; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    flex-direction: column; gap: 0; padding: 8px 24px 16px;
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .nav-links a:last-child { border-bottom: none; }
  .hero { padding: 40px 24px 48px; }
  .section { padding: 44px 24px; }
}

/* ---------- print ---------- */
@media print {
  .site-header, .hero-actions, .status-line, .awards-link, .skip-link, .terminal-titlebar { display: none; }
  body { background: #fff; color: #000; }
  .section { border-top: 1px solid #ccc; padding: 24px 0; }
  a { color: #000; text-decoration: underline; }
  .project-card, .award-card, .terminal-window { border: 1px solid #ccc; box-shadow: none; }
}
