:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-strong: #111827;
  --text: #142033;
  --muted: #647084;
  --line: #dbe2ec;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --amber: #c97718;
  --blue: #2563eb;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(37, 99, 235, 0.04) 1px, transparent 1px),
    var(--bg);
  background-size: 42px 42px;
}

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

button,
input,
textarea {
  font: inherit;
}

.site-shell {
  min-height: 100vh;
  overflow: hidden;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 32px));
  margin: 16px auto 0;
  padding: 12px;
  border: 1px solid rgba(219, 226, 236, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 7px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--surface-strong), var(--accent));
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.nav-area,
.site-nav,
.language-switcher {
  display: flex;
  align-items: center;
}

.nav-area {
  gap: 12px;
}

.site-nav {
  gap: 6px;
}

.site-nav a,
.filter-button,
.language-switcher a {
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  font-weight: 700;
  transition: 180ms ease;
}

.site-nav a {
  padding: 10px 13px;
}

.language-switcher {
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.language-switcher a {
  min-width: 38px;
  padding: 7px 8px;
  text-align: center;
  font-size: 0.78rem;
}

.site-nav a:hover,
.filter-button:hover,
.filter-button.active,
.language-switcher a:hover,
.language-switcher a.active {
  border-color: var(--line);
  color: var(--text);
  background: #ffffff;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

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

.section-band,
.section {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
  gap: 44px;
  align-items: center;
  min-height: calc(100vh - 92px);
  padding: 76px 0 56px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

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

h2 {
  margin-bottom: 14px;
  font-size: clamp(2rem, 4vw, 4.1rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.hero-copy,
.section-heading p,
.contact-copy p,
.timeline p,
.skill-card p,
.project-card p {
  color: var(--muted);
  line-height: 1.72;
}

.hero-copy {
  max-width: 690px;
  font-size: 1.12rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

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

.button.primary {
  border-color: var(--accent);
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 14px 34px rgba(15, 118, 110, 0.25);
}

.button.primary:hover {
  background: var(--accent-strong);
}

.button.secondary {
  background: #ffffff;
}

.button.full-width {
  width: 100%;
}

.hero-panel {
  position: relative;
  min-height: 500px;
}

.terminal-card {
  position: relative;
  z-index: 2;
  overflow: hidden;
  border: 1px solid #243041;
  border-radius: var(--radius);
  background: #0b1220;
  box-shadow: var(--shadow);
}

.terminal-top {
  display: flex;
  gap: 8px;
  padding: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.terminal-top span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ef4444;
}

.terminal-top span:nth-child(2) {
  background: #f59e0b;
}

.terminal-top span:nth-child(3) {
  background: #22c55e;
}

.terminal-card pre {
  margin: 0;
  padding: 28px;
  color: #d8f3dc;
  font-size: clamp(0.82rem, 2vw, 1rem);
  line-height: 1.8;
  white-space: pre-wrap;
}

.signal-grid {
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  align-items: end;
  width: 82%;
  height: 210px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

.signal-grid span {
  display: block;
  height: var(--h);
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--blue), var(--accent));
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(1180px, calc(100% - 32px));
  margin: -12px auto 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
}

.stats-strip div {
  padding: 24px;
  border-right: 1px solid var(--line);
}

.stats-strip div:last-child {
  border-right: 0;
}

.stats-strip strong,
.stats-strip span {
  display: block;
}

.stats-strip strong {
  margin-bottom: 6px;
  font-size: 1.8rem;
}

.stats-strip span {
  color: var(--muted);
}

.section {
  padding: 94px 0;
}

.section.muted {
  width: 100%;
  padding-right: max(16px, calc((100vw - 1180px) / 2));
  padding-left: max(16px, calc((100vw - 1180px) / 2));
  background: #eef3f7;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 34px;
}

.row-heading {
  display: flex;
  max-width: none;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

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

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.filter-button {
  padding: 10px 14px;
  background: #ffffff;
  cursor: pointer;
}

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

.skill-card,
.project-card,
.contact-form,
.timeline article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.skill-card {
  min-height: 280px;
  padding: 24px;
}

.card-kicker {
  display: inline-block;
  margin-bottom: 22px;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--accent-strong);
  background: #dff5f1;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.tag-list span {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: #fbfcfe;
  font-size: 0.82rem;
  font-weight: 700;
}

.project-card {
  overflow: hidden;
  transition: 220ms ease;
}

.project-card.hidden {
  display: none;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.11);
}

.project-visual {
  display: flex;
  align-items: end;
  min-height: 160px;
  padding: 18px;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(17, 24, 39, 0.92), rgba(15, 118, 110, 0.78)),
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(255, 255, 255, 0.22) 18px 19px);
}

.project-visual span {
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.project-body {
  padding: 22px;
}

.split {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 54px;
  align-items: start;
}

.compact {
  position: sticky;
  top: 112px;
}

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

.timeline article {
  padding: 22px;
}

.timeline span {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--amber);
  font-weight: 900;
}

.contact-section {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 52px;
  align-items: start;
}

.contact-meta {
  display: grid;
  gap: 12px;
  margin-top: 28px;
  color: var(--muted);
}

.contact-meta a {
  color: var(--accent-strong);
  font-weight: 800;
}

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

.form-row {
  display: grid;
  gap: 8px;
}

.form-row label {
  font-weight: 800;
}

.form-row input,
.form-row textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 13px 14px;
  color: var(--text);
  background: #fbfcfe;
  outline: none;
  transition: 160ms ease;
}

.form-row textarea {
  resize: vertical;
}

.form-row input:focus,
.form-row textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.1);
}

.form-row small {
  min-height: 18px;
  color: #b42318;
  font-size: 0.82rem;
}

.captcha-row {
  display: grid;
  gap: 8px;
}

.captcha-row label {
  font-weight: 800;
}

.captcha-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
}

.captcha-box span {
  color: var(--text);
  font-weight: 800;
}

.captcha-refresh {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: #ffffff;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 900;
}

.captcha-row input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 13px 14px;
  color: var(--text);
  background: #fbfcfe;
  outline: none;
}

.form-status {
  min-height: 22px;
  margin: 0;
  color: var(--accent-strong);
  font-weight: 800;
}

.form-status.error {
  color: #b42318;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
  color: var(--muted);
}

.site-footer a {
  color: var(--text);
  font-weight: 800;
}

@media (max-width: 920px) {
  .nav-area {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    display: none;
    width: min(320px, calc(100vw - 32px));
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: var(--shadow);
  }

  .nav-area.open {
    display: flex;
  }

  .site-nav,
  .language-switcher {
    width: 100%;
  }

  .site-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .language-switcher {
    justify-content: space-between;
  }

  .nav-toggle {
    display: block;
  }

  .hero,
  .split,
  .contact-section {
    grid-template-columns: 1fr;
  }

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

  .hero-panel {
    min-height: 420px;
  }

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

  .row-heading {
    display: block;
  }

  .filter-group {
    justify-content: flex-start;
    margin-top: 20px;
  }

  .compact {
    position: static;
  }
}

@media (max-width: 640px) {
  .site-header,
  .section-band,
  .section,
  .stats-strip,
  .site-footer {
    width: min(100% - 24px, 1180px);
  }

  .brand small {
    display: none;
  }

  .hero {
    padding-top: 42px;
  }

  h1 {
    font-size: clamp(2.6rem, 16vw, 4rem);
  }

  .hero-actions,
  .site-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .hero-panel {
    min-height: 360px;
  }

  .terminal-card pre {
    padding: 20px;
  }

  .signal-grid {
    width: 92%;
    height: 160px;
    gap: 8px;
  }

  .stats-strip,
  .skills-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .stats-strip div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .stats-strip div:last-child {
    border-bottom: 0;
  }

  .section {
    padding: 70px 0;
  }

  .section.muted {
    padding-right: 12px;
    padding-left: 12px;
  }
}
