:root {
  --bg: #05070d;
  --bg-soft: #0c101a;
  --line: #1a2030;
  --text: #f3f6ff;
  --muted: #98a2b6;
  --accent: #5be9c9;
  --accent-soft: rgba(91, 233, 201, 0.16);
  --container: 1160px;
  --header-height: 74px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1000px 500px at 90% -20%, rgba(91, 233, 201, 0.1), transparent),
    radial-gradient(900px 600px at 0% 120%, rgba(77, 97, 255, 0.12), transparent),
    var(--bg);
  line-height: 1.65;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.35), transparent 95%);
  z-index: -1;
}

a {
  color: inherit;
}

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

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

.container {
  width: min(100% - 40px, var(--container));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 12px;
  padding: 8px 12px;
  background: #fff;
  color: #000;
  z-index: 100;
}

.skip-link:focus {
  top: 12px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  background: rgba(5, 7, 13, 0.7);
}

.header-inner {
  min-height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.brand {
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.14em;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  padding: 8px 13px;
  font-size: 0.78rem;
}

.site-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 11px;
  border-radius: 999px;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="true"] {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.hero-shell {
  min-height: calc(100vh - var(--header-height));
  display: grid;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 44px;
  padding: 72px 0;
}

.role-label,
.block-label {
  font-family: "JetBrains Mono", Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  font-size: 0.75rem;
}

.hero-left h1 {
  margin-top: 14px;
  font-size: clamp(3rem, 10vw, 7.2rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.hero-line {
  margin-top: 24px;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: clamp(1rem, 2vw, 1.36rem);
  color: var(--accent);
  min-height: 1.7em;
}

.hero-line::after {
  content: "|";
  animation: blink 1s steps(1, end) infinite;
}

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

.hero-intro {
  margin-top: 18px;
  color: var(--muted);
  max-width: 62ch;
}

.hero-cta {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #071012;
}

.btn-ghost {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
}

.disabled-link {
  opacity: 0.45;
  pointer-events: none;
}

.hero-right {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.01));
  border-radius: 24px;
  padding: 16px;
  align-self: center;
}

.portrait {
  width: 100%;
  aspect-ratio: 1 / 1.1;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-meta {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.93rem;
  display: grid;
  gap: 8px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  background: var(--accent);
  margin-right: 7px;
}

.section-block {
  padding: 96px 0;
  border-bottom: 1px solid var(--line);
}

.section-dark {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 65%);
}

.experience-card {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 14px;
}

.experience-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.experience-card h3 {
  font-size: 1.22rem;
}

.experience-meta {
  margin-top: 6px;
  color: var(--accent);
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 0.82rem;
}

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

.timeline-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.timeline-rail {
  position: relative;
  width: 26px;
  min-height: 100%;
}

.timeline-marker {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  display: block;
  margin: 6px auto 0;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(91, 233, 201, 0.12);
}

.timeline-line {
  position: absolute;
  top: 18px;
  bottom: -14px;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.14);
}

.timeline-item:last-child .timeline-line {
  display: none;
}

.timeline-card {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 14px;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.timeline-role {
  font-family: "JetBrains Mono", Consolas, monospace;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
}

.timeline-header h3 {
  margin-top: 4px;
  font-size: 1.22rem;
}

.timeline-meta-block {
  color: var(--muted);
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 0.8rem;
  text-align: right;
  display: grid;
  gap: 3px;
}

.timeline-card p {
  color: var(--muted);
}

.timeline-skills {
  color: #dbe7fb;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 0.83rem;
}

.block-grid {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 22px;
}

.block-grid h2 {
  font-size: clamp(1.8rem, 5vw, 3.15rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
}

.block-grid p {
  color: var(--muted);
  max-width: 72ch;
}

.block-grid p + p {
  margin-top: 12px;
}

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

.skill-columns article {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.02);
}

.skill-columns h3 {
  margin-bottom: 13px;
  font-size: 1.05rem;
}

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

.pill-list li {
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.85rem;
  color: #d9e2f5;
}

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

.projects-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.project-card {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  color: inherit;
  padding: 0;
  text-align: left;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.project-card:hover,
.project-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(91, 233, 201, 0.4);
}

.project-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.project-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.project-card-content {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.project-category {
  font-family: "JetBrains Mono", Consolas, monospace;
  color: var(--accent);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.project-card-content h3 {
  font-size: 1.12rem;
  line-height: 1.18;
}

.project-card-content p {
  color: var(--muted);
}

.project-view-btn {
  width: fit-content;
}

[data-open-all-projects],
.project-view-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
}

[data-open-all-projects]:hover,
.project-view-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.5);
}

.project-code-link {
  width: fit-content;
  color: #dfe8f8;
  text-decoration: none;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  padding-bottom: 2px;
}

.project-code-link:hover {
  color: var(--accent);
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: 20px;
}

.modal.is-open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 5, 12, 0.78);
  backdrop-filter: blur(10px);
}

.modal-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 860px);
  max-height: min(86vh, 860px);
  overflow: auto;
  padding: 26px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #0b1220;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.modal-kicker {
  color: var(--accent);
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 10px;
}

.modal-dialog h3 {
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  line-height: 1.08;
  max-width: 18ch;
}

.modal-media {
  margin: 20px 0 16px;
}

.modal-video {
  width: 100%;
  max-height: min(60vh, 520px);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #03060d;
  margin-bottom: 12px;
}

.is-hidden {
  display: none !important;
}

.modal-video-shell {
  min-height: 320px;
  display: grid;
  place-content: center;
  gap: 10px;
  text-align: center;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    radial-gradient(circle at 50% 40%, rgba(91, 233, 201, 0.16), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  padding: 20px;
}

.modal-video-label {
  font-family: "JetBrains Mono", Consolas, monospace;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
}

.modal-video-shell p,
.modal-description,
.modal-demo-note {
  color: var(--muted);
}

.modal-description {
  margin-top: 12px;
  font-size: 1rem;
}

.modal-demo-note {
  margin-top: 10px;
  font-size: 0.92rem;
}

.all-projects-dialog {
  width: min(100%, 980px);
}

.all-projects-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.all-project-card {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  display: grid;
  gap: 8px;
}

.all-project-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.all-project-card h4 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
}

.all-project-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.all-project-card a {
  width: fit-content;
  text-decoration: none;
  color: #dfe8f8;
  font-size: 0.86rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.all-project-card a:hover {
  color: var(--accent);
}

.all-projects-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.contact-links {
  margin-top: 18px;
  display: grid;
  gap: 8px;
}

.contact-links a {
  display: inline-flex;
  width: fit-content;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  padding-bottom: 2px;
}

.contact-links a:hover {
  color: var(--accent);
}

.site-footer {
  padding: 24px 0 40px;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 980px) {
  .hero-layout,
  .block-grid,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .block-label {
    margin-bottom: 8px;
  }

  .project-card img {
    aspect-ratio: 16 / 9;
  }

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

@media (max-width: 760px) {
  .site-nav {
    display: none;
  }

  .hero-shell {
    min-height: auto;
  }

  .hero-layout {
    padding: 48px 0 58px;
  }

  .hero-left h1 {
    font-size: clamp(2.6rem, 16vw, 4.5rem);
  }

  .section-block {
    padding: 72px 0;
  }

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

  .timeline-item {
    grid-template-columns: 20px minmax(0, 1fr);
  }

  .timeline-card {
    padding: 18px;
  }

  .timeline-header {
    flex-direction: column;
  }

  .timeline-meta-block {
    text-align: left;
  }

  .project-card img {
    aspect-ratio: 16 / 10;
  }

  .all-projects-grid {
    grid-template-columns: 1fr;
  }

  .modal-dialog {
    padding: 20px;
  }

  .modal-video-shell {
    min-height: 240px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
