:root {
  color-scheme: dark;
  --bg: #090d0f;
  --surface: #10171a;
  --surface-strong: #151f23;
  --line: #243138;
  --text: #e4ece8;
  --muted: #92a29b;
  --accent: #35d28f;
  --accent-strong: #8ce8bd;
  --warning: #d8bc65;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.36);
  --radius: 8px;
  --max-width: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(53, 210, 143, 0.06), transparent 360px),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

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.3;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--accent-strong);
}

img,
svg {
  display: block;
  max-width: 100%;
}

code,
pre,
.brand,
.eyebrow {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(36, 49, 56, 0.75);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand__mark {
  color: var(--accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav a {
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.94rem;
  transition: color 180ms ease, background 180ms ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: rgba(53, 210, 143, 0.1);
  color: var(--text);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--text);
}

.section {
  padding: 84px 0;
}

.section--tight {
  padding-top: 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  align-items: center;
  gap: 56px;
  min-height: calc(100vh - 80px);
}

.page {
  min-height: 70vh;
}

.page-hero {
  max-width: 800px;
  padding-bottom: 40px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.84rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 22px;
  font-size: clamp(2.5rem, 8vw, 5.5rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 720px;
  font-size: clamp(2.35rem, 5.5vw, 4.4rem);
  line-height: 1.05;
}

.page-hero h1,
.article h1 {
  font-size: clamp(2.35rem, 6vw, 4.4rem);
}

h2 {
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  line-height: 1.12;
}

h3 {
  font-size: 1.1rem;
}

.hero__text,
.page-hero p,
.split p,
.article__intro {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

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

.button:hover {
  transform: translateY(-2px);
}

.button--primary {
  border-color: rgba(53, 210, 143, 0.75);
  background: var(--accent);
  color: #04100b;
}

.button--primary:hover {
  color: #04100b;
}

.button--ghost {
  background: rgba(16, 23, 26, 0.76);
  color: var(--text);
}

.terminal-card,
.contact-card,
.contact-form,
.post-card,
.post-row,
.project-card,
.skill-grid article,
.feature-list article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 23, 26, 0.82);
  box-shadow: var(--shadow);
}

.terminal-card {
  overflow: hidden;
}

.terminal-card--compact {
  align-self: start;
}

.terminal-card__bar {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-strong);
}

.terminal-card__bar span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--muted);
}

.terminal-card__bar span:nth-child(1) {
  background: #e86f6f;
}

.terminal-card__bar span:nth-child(2) {
  background: var(--warning);
}

.terminal-card__bar span:nth-child(3) {
  background: var(--accent);
}

.terminal-card pre {
  margin: 0;
  padding: 24px;
  overflow-x: auto;
  color: #c8f7df;
  font-size: 0.92rem;
}

.portrait-section {
  padding-top: 0;
}

.portrait-panel {
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
  align-items: center;
  gap: 32px;
}

.portrait-panel img {
  width: min(100%, 360px);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid rgba(53, 210, 143, 0.35);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  justify-self: center;
}

.terminal-card--profile {
  width: 100%;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.section-heading h2 {
  margin-bottom: 0;
}

.section-heading a,
.read-link,
.back-link {
  color: var(--accent);
  font-weight: 700;
}

.post-grid,
.skill-grid,
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

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

.post-card,
.project-card,
.skill-grid article,
.feature-list article {
  padding: 22px;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.post-card:hover,
.project-card:hover,
.feature-list article:hover {
  border-color: rgba(53, 210, 143, 0.48);
  background: rgba(21, 31, 35, 0.96);
  transform: translateY(-4px);
}

.post-meta {
  margin-bottom: 10px;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
}

.post-card p,
.post-row p,
.project-card p,
.skill-grid p,
.feature-list p,
.form-note {
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 32px;
}

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

.timeline {
  display: grid;
  gap: 12px;
  max-width: 760px;
  padding-left: 22px;
  color: var(--muted);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.filter-button {
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.filter-button:hover,
.filter-button.is-active {
  border-color: rgba(53, 210, 143, 0.65);
  background: rgba(53, 210, 143, 0.1);
  color: var(--text);
}

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

.post-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 24px;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.project-detail {
  display: grid;
  gap: 6px;
}

.project-detail h3 {
  margin-bottom: 0;
  color: var(--text);
  font-size: 0.92rem;
}

.project-detail ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.project-detail li + li {
  margin-top: 4px;
}

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

.status,
.tool-list span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--accent-strong);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.76rem;
  white-space: nowrap;
}

.tool-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.contact-form {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.contact-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #071012;
  color: var(--text);
  font: inherit;
  padding: 12px 14px;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(53, 210, 143, 0.16);
}

.contact-card {
  display: grid;
  gap: 10px;
  padding: 24px;
}

.contact-card a {
  color: var(--accent);
  font-weight: 700;
}

.article-page {
  padding: 64px 0 96px;
}

.article {
  max-width: 760px;
  margin: 0 auto;
}

.article h1 {
  margin-top: 20px;
}

.article h2 {
  margin-top: 42px;
}

.article p,
.article li {
  color: var(--muted);
  font-size: 1.05rem;
}

.article code {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 2px 6px;
  color: var(--accent-strong);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 30px 0 42px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.94rem;
}

.footer-links {
  display: flex;
  gap: 14px;
}

.footer-links a {
  color: var(--text);
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 560ms ease, transform 560ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

@media (max-width: 860px) {
  .site-shell {
    width: min(100% - 22px, var(--max-width));
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(9, 13, 15, 0.98);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    min-height: 42px;
  }

  .hero,
  .split,
  .contact-layout,
  .portrait-panel {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 58px;
  }

  .post-grid,
  .skill-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 56px 0;
  }

  .portrait-panel {
    gap: 22px;
    padding: 22px;
  }

  .portrait-panel img {
    width: min(100%, 280px);
  }

  .section-heading,
  .post-row,
  .site-footer {
    align-items: start;
    flex-direction: column;
  }

  .post-row {
    gap: 12px;
  }
}
