:root {
  --bg: #020617;
  --panel: rgba(15, 23, 42, .78);
  --line: rgba(148, 163, 184, .18);
  --text: #f8fafc;
  --muted: #cbd5e1;
  --blue: #38bdf8;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at 32% 12%, rgba(14, 165, 233, .2), transparent 28%),
    radial-gradient(circle at 80% 18%, rgba(37, 99, 235, .26), transparent 26%),
    linear-gradient(135deg, #07111f, #020617 52%, #020617);
  color: var(--text);
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
  max-width: 1220px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(14px);
}

.brand {
  color: var(--blue);
  font-weight: 900;
  letter-spacing: .06em;
  text-decoration: none;
  font-size: 1.15rem;
}

nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: .95rem;
}

.nav-cv {
  border: 1px solid rgba(56, 189, 248, .55);
  border-radius: 8px;
  padding: 10px 14px;
}

main {
  max-width: 1220px;
  margin: 0 auto;
  padding: 24px;
}

.hero {
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  align-items: center;
  gap: 70px;
  padding: 28px 24px 36px;
}

.hero h1 {
  margin: 0 0 22px;
  font-size: clamp(2rem, 3.4vw, 3rem);
  line-height: 1.12;
  letter-spacing: -.035em;
  max-width: 620px;
}

.hero h1 span {
  display: block;
  color: var(--blue);
  font-size: .78em;
  margin-top: 10px;
  letter-spacing: -.025em;
}

.hero p {
  max-width: 650px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.buttons {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.buttons a {
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  border: 1px solid rgba(56, 189, 248, .45);
  border-radius: 8px;
  padding: 13px 18px;
  background: #02061773;
}

.buttons .primary {
  background: linear-gradient(135deg, #0ea5e9, #0369a1);
  border-color: #38bdf8;
}

.headshot {
  width: 100%;
  height: 390px;
  object-fit: cover;
  object-position: center 28%;
  border-radius: 22px;
  box-shadow: 0 0 55px #38bdf852;
  border: 1px solid rgba(56, 189, 248, .25);
}

.projects-section {
  border-top: 1px solid var(--line);
}

.lower-layout {
  display: grid;
  grid-template-columns: .9fr 1.35fr;
  gap: 14px;
  margin-top: 14px;
}

.left-stack {
  display: grid;
  grid-template-rows: auto auto;
  gap: 14px;
}

.panel,
.skills {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: inset 0 1px #ffffff08;
}

h2 {
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: .95rem;
  font-weight: 900;
}

.page-heading {
  padding: 36px 0 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.page-heading h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 3.4vw, 3rem);
  line-height: 1.12;
  letter-spacing: -.035em;
}

.page-heading p {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.projects-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}

.projects-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.projects-title h2 {
  margin: 0;
}

#projectCounter {
  color: var(--muted);
  font-size: .85rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.mini-buttons {
  display: flex;
  gap: 8px;
}

.mini-buttons button,
.image-arrow {
  background: #0f172ab8;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.mini-buttons button {
  width: 34px;
  height: 30px;
  font-size: 1.2rem;
}

.project-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #02061757;
  display: grid;
  grid-template-columns: .75fr 1.35fr;
  gap: 28px;
  align-items: center;
}

.project-image {
  position: relative;
  height: 420px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #020617;
  grid-column: 2;
  grid-row: 1 / span 5;
}

.project-image img,
.project-gallery img,
.cert-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.image-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 46px;
  font-size: 1.5rem;
  opacity: .78;
}

.image-arrow-left {
  left: 10px;
}

.image-arrow-right {
  right: 10px;
}

.project-card h3,
.timeline h3,
.skills-panel h3,
.project-list-card h3,
.cert-card h3 {
  margin: 16px 0 6px;
  font-size: 1.1rem;
}

.project-card p,
.about-panel p,
.timeline p,
.project-list-card p {
  color: var(--muted);
  line-height: 1.55;
  font-size: .94rem;
}

.tags,
.skills div {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0;
}

.tags span,
.skills span {
  border: 1px solid var(--line);
  background: #ffffff0a;
  color: var(--muted);
  border-radius: 7px;
  padding: 6px 10px;
  font-size: .82rem;
}

.project-card a,
.project-list-card a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 12px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 800;
  background: #38bdf81f;
  border: 1px solid rgba(56, 189, 248, .3);
  color: var(--blue);
  transition: .2s ease;
}

.project-card a:hover,
.project-list-card a:hover {
  background: #38bdf833;
}

.project-link-hidden {
  display: none !important;
}

.projects-grid {
  display: grid;
  gap: 18px;
}

.project-list-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel);
  box-shadow: inset 0 1px #ffffff08;
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 22px;
  align-items: start;
}

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

.project-gallery figure {
  height: 180px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #020617;
  margin: 0;
}

.project-list-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

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

.cert-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel);
  box-shadow: inset 0 1px #ffffff08;
}

.cert-image {
  height: 330px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #020617;
  overflow: hidden;
}

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

.timeline-item {
  display: grid;
  grid-template-columns: 1fr;
  padding-left: 60px;
  gap: 14px;
  align-items: start;
  position: relative;
}

.timeline-item-separate {
  margin-top: 8px;
}

.timeline-marker {
  position: absolute;
  left: 0;
  top: 0;
  bottom: -48px;
  width: 46px;
  display: flex;
  justify-content: center;
}

.dot {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #38bdf8, #0369a1);
  box-shadow: 0 0 20px #38bdf852;
  font-size: 1.05rem;
  z-index: 2;
}

.timeline-item-separate .dot {
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  box-shadow: 0 0 25px #60a5fa73, 0 0 50px #60a5fa33;
}

.timeline-line {
  position: absolute;
  top: 38px;
  bottom: -40px;
  width: 2px;
  background: linear-gradient(180deg, #38bdf8e6, #38bdf826);
}

.skills-panel {
  min-height: 220px;
}

.skill-groups {
  display: grid;
  gap: 14px;
}

.skills-panel h3 {
  color: var(--text);
}

footer {
  margin-top: 20px;
  padding: 40px 0 20px;
  border-top: 1px solid var(--line);
  text-align: center;
}

footer h2 {
  color: var(--blue);
}

footer p {
  color: var(--muted);
  line-height: 1.6;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin: 24px 0;
}

.footer-links a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 700;
}

.footer-copy {
  font-size: .85rem;
}

@media (max-width: 1050px) {
  .hero,
  .lower-layout,
  .project-card,
  .project-list-card {
    grid-template-columns: 1fr;
  }

  .project-image {
    grid-column: auto;
    grid-row: auto;
    height: 320px;
  }

  .headshot {
    max-width: 380px;
  }

  nav {
    display: none;
  }
}

@media (max-width: 720px) {
  main,
  header {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero {
    padding: 16px 0 28px;
    gap: 28px;
  }

  .hero h1 {
    font-size: 2.15rem;
    line-height: 1.05;
  }

  .skills {
    display: block;
  }

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

  .project-image {
    order: 1;
    height: 210px;
  }

  .project-card h3 {
    order: 2;
    margin-top: 12px;
    text-align: center;
  }

  .project-card p {
    order: 3;
    font-size: 1rem;
    line-height: 1.45;
  }

  .project-card .tags {
    order: 4;
  }

  .project-card a {
    order: 5;
  }

  .project-gallery,
  .cert-grid {
    grid-template-columns: 1fr;
  }

  .project-gallery figure {
    height: 210px;
  }

  .cert-image {
    height: 240px;
  }
}
