:root {
  --bg: #101111;
  --panel: #151718;
  --panel-strong: #191c1e;
  --text: #f3f3f0;
  --muted: #9ba3aa;
  --soft: #c8cdd0;
  --line: #34393d;
  --line-bright: #dedede;
  --green: #00d75f;
  --green-soft: rgba(0, 215, 95, 0.14);
  --red: #ff5f56;
  --yellow: #ffbd2e;
  --shadow: rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(0, 215, 95, 0.08), transparent 26rem),
    var(--bg);
  color: var(--text);
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 16px;
  line-height: 1.65;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image: linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 100% 4px;
  opacity: 0.32;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.terminal-shell {
  width: min(100% - 32px, 1080px);
  margin: 42px auto;
  border: 1px solid var(--line);
  background: rgba(17, 18, 18, 0.9);
  box-shadow: 0 24px 80px var(--shadow);
}

.window-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 46px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(18, 20, 20, 0.92);
  backdrop-filter: blur(16px);
}

.window-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
}

.close {
  background: var(--red);
}

.minimize {
  background: var(--yellow);
}

.maximize {
  background: var(--green);
}

.window-title {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: none;
}

main {
  padding: 48px clamp(18px, 5vw, 64px) 64px;
}

.section {
  scroll-margin-top: 78px;
}

.hero {
  min-height: 70vh;
  display: grid;
  align-content: center;
  padding-bottom: 40px;
}

.prompt {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 0.92rem;
  font-weight: 700;
}

.prompt::after {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  margin-left: 5px;
  vertical-align: -2px;
  content: "";
  background: var(--green);
  animation: blink 1s steps(2, start) infinite;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.84rem;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 820px;
  margin: 0 0 20px;
  font-size: clamp(2.25rem, 5.4vw, 3.85rem);
  line-height: 1.1;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.45rem);
  line-height: 1.12;
}

h3 {
  margin: 0;
  line-height: 1.25;
}

.hero-copy {
  max-width: 760px;
  margin: 0;
  color: var(--soft);
  font-size: clamp(1rem, 1.6vw, 1.08rem);
}

.hero-actions,
.command-nav,
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-actions {
  margin-top: 28px;
}

.terminal-button,
.command,
.contact-links a {
  min-height: 42px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--green);
  font: inherit;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.terminal-button,
.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
}

.icon-link {
  align-items: center;
}

.brand-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: currentColor;
}

.command {
  padding: 0 12px;
}

.terminal-button:hover,
.terminal-button:focus-visible,
.command:hover,
.command:focus-visible,
.command.active,
.contact-links a:hover,
.contact-links a:focus-visible {
  outline: none;
  border-color: var(--green);
  background: var(--green-soft);
  transform: translateY(-1px);
}

.command-nav {
  margin-top: 24px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 0 0 64px;
}

.metrics article {
  min-height: 116px;
  padding: 0 0 0 16px;
  border-left: 2px solid var(--green);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.metrics strong {
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.3;
}

.metrics span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.terminal-panel {
  border: 1px solid var(--line-bright);
  padding: clamp(22px, 4vw, 34px);
}

.section + .section,
.terminal-panel + .section,
.section + .terminal-panel {
  margin-top: 64px;
}

.section-heading {
  margin-bottom: 26px;
}

.timeline {
  display: grid;
  gap: 30px;
}

.timeline-item {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.timeline-header p,
.timeline-header span,
.project-topline span,
.education-list span {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

ul {
  margin: 0;
  padding-left: 20px;
}

li {
  color: var(--soft);
  margin: 7px 0;
}

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

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

.project-card,
.stack-grid article,
.education-list article {
  border: 1px solid var(--line);
  background: var(--panel);
}

.project-card {
  min-height: 312px;
  display: flex;
  flex-direction: column;
  padding: 20px;
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.project-card:hover,
.project-card:focus-visible {
  outline: none;
  border-color: var(--green);
  background: var(--panel-strong);
  transform: translateY(-3px);
}

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

.project-card p,
.stack-grid p,
.contact-copy {
  color: var(--soft);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding: 0;
  list-style: none;
}

.tag-list li {
  margin: 0;
  border: 1px solid var(--line);
  color: var(--green);
  padding: 4px 8px;
  font-size: 0.78rem;
}

.project-hint {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.72rem;
}

.github-terminal {
  border: 1px solid var(--line);
  background: #0d1117;
  padding: clamp(16px, 3vw, 24px);
}

.github-output {
  display: grid;
  gap: 8px;
  color: var(--soft);
  font-size: clamp(0.88rem, 1.6vw, 1rem);
}

.github-output p {
  margin: 0;
}

.github-output strong,
.github-output [data-github-stat],
.ascii-bar {
  color: var(--green);
}

.terminal-muted {
  color: var(--muted);
}

.ascii-bar {
  display: inline-block;
  margin-left: 12px;
  letter-spacing: 0;
  white-space: nowrap;
}

.github-terminal-footer {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 22px;
}

.github-terminal-footer .terminal-button {
  flex: 0 0 auto;
}

.github-chart {
  flex: 1 1 auto;
  margin: 0;
  border: 1px solid var(--line);
  background: #0d1117;
  overflow-x: auto;
}

.github-chart img {
  display: block;
  width: 100%;
  min-width: 520px;
  height: auto;
  padding: 10px;
}

.stack-grid article {
  padding: 20px;
}

.stack-grid h3 {
  margin-bottom: 10px;
  color: var(--green);
}

.stack-grid p {
  margin: 0;
}

.education-list {
  display: grid;
  gap: 14px;
}

.education-list article {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
}

.education-list p {
  margin: 6px 0 0;
  color: var(--soft);
}

.contact-section {
  padding-bottom: 10px;
}

.contact-copy {
  max-width: 720px;
  margin: 0 0 22px;
}

.case-hero {
  min-height: 62vh;
}

.case-metrics {
  margin-top: -18px;
}

.case-copy {
  max-width: 860px;
  margin: 0;
  color: var(--soft);
  font-size: 1.02rem;
}

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

.selling-grid article {
  min-height: 190px;
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.selling-grid h3 {
  margin-bottom: 10px;
  color: var(--green);
}

.selling-grid p,
.case-result p:last-child {
  margin: 0;
  color: var(--soft);
}

.architecture-figure {
  margin: 0;
  border: 1px solid var(--line);
  background: #171818;
  overflow-x: auto;
}

.architecture-figure img {
  display: block;
  width: 100%;
  min-width: 820px;
  height: auto;
}

.architecture-figure figcaption {
  margin: 0;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}

.code-viewer {
  border: 1px solid var(--line);
  background: #0b0c0c;
}

.code-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid var(--line);
}

.code-tab {
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.84rem;
  cursor: pointer;
}

.code-tab:hover,
.code-tab:focus-visible,
.code-tab.active {
  outline: none;
  color: var(--green);
  background: var(--green-soft);
}

.code-pane {
  display: none;
  max-height: 520px;
  margin: 0;
  overflow: auto;
  padding: 20px;
  color: var(--soft);
  font-size: 0.9rem;
  line-height: 1.65;
  white-space: pre;
}

.code-pane.active {
  display: block;
}

.case-result {
  padding: 22px;
  border-left: 2px solid var(--green);
  background: var(--panel);
}

.case-result + .case-result {
  margin-top: 14px;
}

.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: rgba(18, 20, 20, 0.9);
  color: var(--green);
  font: inherit;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, border-color 160ms ease, background 160ms ease;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover,
.back-to-top:focus-visible {
  outline: none;
  border-color: var(--green);
  background: var(--green-soft);
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@media (max-width: 860px) {
  .terminal-shell {
    width: min(100% - 20px, 1080px);
    margin: 10px auto;
  }

  main {
    padding: 34px 18px 46px;
  }

  .hero {
    min-height: auto;
    padding: 30px 0 38px;
  }

  .metrics,
  .project-grid,
  .stack-grid,
  .selling-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 15px;
  }

  .window-title {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .metrics,
  .project-grid,
  .stack-grid,
  .selling-grid {
    grid-template-columns: 1fr;
  }

  .timeline-header,
  .education-list article,
  .project-topline,
  .github-terminal-footer {
    display: block;
  }

  .terminal-button,
  .command,
  .contact-links a,
  .code-tab {
    width: 100%;
    justify-content: center;
  }

  .code-tab {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

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