:root {
  --bg: #080b0f;
  --bg-soft: #0d1218;
  --panel: #111820;
  --panel-strong: #151f2a;
  --line: rgba(214, 224, 235, 0.14);
  --line-strong: rgba(214, 224, 235, 0.24);
  --text: #f4f7fa;
  --muted: #a7b2bf;
  --faint: #8494a3;
  --blue: #78a6ff;
  --orange: #b25c2c;
  --green: #78d99e;
  --max: 1220px;
  --gutter: clamp(20px, 4vw, 44px);
  --radius: 8px;
  --mono: "SF Mono", Menlo, Consolas, ui-monospace, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(214, 224, 235, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(214, 224, 235, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, #07090d 0%, var(--bg) 55%, #0a0d12 100%);
  background-size: 42px 42px, 42px 42px, auto;
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(8, 11, 15, 0.9), transparent 24%, transparent 76%, rgba(8, 11, 15, 0.9)),
    linear-gradient(180deg, transparent, rgba(8, 11, 15, 0.72));
}

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

button {
  font: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  transform: translateY(-160%);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--text);
  color: var(--bg);
  font-weight: 800;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  min-height: 68px;
  border-bottom: 1px solid var(--line);
  padding: 0 var(--gutter);
  background: rgba(8, 11, 15, 0.82);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.site-header.is-scrolled {
  background: rgba(8, 11, 15, 0.94);
}

.brand {
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.98rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  justify-content: center;
  gap: clamp(14px, 2.2vw, 32px);
}

.nav a {
  position: relative;
  padding: 23px 0 21px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav a::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  background: var(--orange);
  transition: transform 160ms ease;
}

.nav a:hover,
.nav a.is-active {
  color: var(--text);
}

.nav a.is-active::after {
  transform: scaleX(1);
}

.header-actions,
.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 16px;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.button-primary {
  border-color: rgba(178, 92, 44, 0.8);
  background: var(--orange);
  color: #fff;
}

.button-ghost {
  background: rgba(244, 247, 250, 0.035);
  color: var(--text);
}

.button:hover {
  border-color: var(--blue);
}

.menu-button {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(214, 224, 235, 0.38);
  border-radius: 6px;
  background: rgba(244, 247, 250, 0.065);
  color: var(--text);
  cursor: pointer;
}

.menu-button span {
  display: block;
  width: 19px;
  height: 2px;
  margin: 0;
  background: currentColor;
  transition: transform 160ms ease;
}

.menu-button[aria-expanded="true"] span:first-child {
  transform: translateY(4px) rotate(45deg);
}

.menu-button[aria-expanded="true"] span:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

.mobile-nav {
  position: fixed;
  top: 68px;
  right: var(--gutter);
  left: var(--gutter);
  z-index: 40;
  display: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  background: rgba(13, 18, 24, 0.98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

.mobile-nav.is-open {
  display: grid;
}

.mobile-nav a {
  border-radius: 6px;
  padding: 13px 12px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mobile-nav a:hover {
  background: rgba(244, 247, 250, 0.06);
}

.section-shell {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: clamp(60px, 8vw, 104px) var(--gutter);
}

.hero {
  padding-top: clamp(58px, 10vw, 130px);
  padding-bottom: clamp(54px, 8vw, 92px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 410px);
  gap: clamp(28px, 5vw, 76px);
  align-items: end;
}

.hero h1 {
  max-width: 900px;
  margin: 0;
  color: var(--text);
  font-size: clamp(4.4rem, 12vw, 10.5rem);
  font-weight: 850;
  line-height: 0.88;
  letter-spacing: -0.055em;
}

.hero-line {
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(1.08rem, 1.6vw, 1.42rem);
}

.hero-sub {
  max-width: 620px;
  margin: 14px 0 0;
  color: var(--faint);
  font-size: clamp(0.95rem, 1.15vw, 1.05rem);
  line-height: 1.65;
}

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

.info-panel,
.timeline,
.project-card,
.compact-grid article,
.contact-list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(21, 31, 42, 0.86), rgba(13, 18, 24, 0.86));
}

.info-panel {
  padding: 10px 0;
}

.info-panel dl {
  margin: 0;
}

.info-panel div {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 18px 20px;
}

.info-panel div:last-child {
  border-bottom: 0;
}

.info-panel dt,
.section-heading span,
.timeline span,
.project-card span,
.compact-grid span {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.info-panel dd {
  margin: 0;
  color: var(--text);
  font-weight: 720;
}

.info-panel a,
.contact-list a,
.project-card a {
  color: var(--blue);
}

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

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

.section-heading h2 {
  margin: 8px 0 0;
  color: var(--text);
  font-size: clamp(2rem, 4.8vw, 4.8rem);
  font-weight: 820;
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.timeline {
  overflow: hidden;
}

.timeline article {
  display: grid;
  grid-template-columns: minmax(230px, 0.35fr) minmax(0, 0.65fr);
  gap: clamp(18px, 4vw, 52px);
  border-bottom: 1px solid var(--line);
  padding: 24px;
}

.timeline article:last-child {
  border-bottom: 0;
}

.timeline h3,
.project-card h3 {
  margin: 8px 0 0;
  color: var(--text);
  font-family: var(--mono);
  font-size: 1.03rem;
  line-height: 1.25;
}

.timeline p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.project-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.filter-button {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: rgba(244, 247, 250, 0.035);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: pointer;
}

.filter-button:hover,
.filter-button.is-active {
  border-color: rgba(120, 166, 255, 0.58);
  background: rgba(120, 166, 255, 0.12);
  color: var(--text);
}

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

.project-card {
  display: flex;
  flex-direction: column;
  min-height: 214px;
  padding: 18px;
  transition: border-color 160ms ease, transform 160ms ease, opacity 160ms ease;
}

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

.project-card:hover {
  transform: translateY(-2px);
  border-color: rgba(120, 166, 255, 0.5);
}

.project-card.featured {
  border-color: rgba(120, 166, 255, 0.28);
  background: linear-gradient(180deg, rgba(23, 37, 52, 0.94), rgba(13, 18, 24, 0.88));
}

.project-card p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.project-card footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 760;
}

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

.compact-grid article {
  min-height: 150px;
  padding: 20px;
}

.compact-grid p {
  margin: 14px 0 0;
  color: var(--muted);
}

.contact-section {
  padding-bottom: clamp(48px, 6vw, 80px);
}

.contact-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
}

.contact-list a {
  display: flex;
  align-items: center;
  min-height: 62px;
  border-left: 1px solid var(--line);
  padding: 16px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.contact-list a:first-child {
  border-left: 0;
}

.contact-list a:hover {
  background: rgba(120, 166, 255, 0.1);
  color: var(--blue);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: min(100%, var(--max));
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 24px var(--gutter) 38px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 760;
}

@media (max-width: 1080px) {
  .hero-grid,
  .timeline article {
    grid-template-columns: 1fr;
  }

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

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

  .contact-list a {
    border-top: 1px solid var(--line);
  }

  .contact-list a:nth-child(odd) {
    border-left: 0;
  }

  .contact-list a:first-child,
  .contact-list a:nth-child(2) {
    border-top: 0;
  }
}

@media (max-width: 880px) {
  .site-header {
    display: flex;
    justify-content: space-between;
  }

  .nav,
  .header-actions .button {
    display: none;
  }

  .header-actions {
    margin-left: auto;
  }

  .menu-button {
    display: flex;
  }

  .section-heading-row {
    display: grid;
    align-items: start;
  }

  .project-controls {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .section-shell {
    padding-top: 50px;
    padding-bottom: 50px;
  }

  .hero {
    padding-top: 54px;
  }

  .hero h1 {
    font-size: clamp(3.2rem, 18vw, 4.5rem);
    letter-spacing: -0.055em;
  }

  .hero-line {
    margin-top: 18px;
    font-size: 1rem;
  }

  .hero-actions,
  .project-controls {
    display: grid;
  }

  .button,
  .filter-button {
    width: 100%;
  }

  .info-panel div {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .project-grid,
  .compact-grid,
  .contact-list {
    grid-template-columns: 1fr;
  }

  .contact-list a,
  .contact-list a:nth-child(2) {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .contact-list a:first-child {
    border-top: 0;
  }

  .footer {
    display: grid;
  }
}

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