:root {
  --color-background: #111a2e;
  --color-surface: #17233b;
  --color-surface-raised: #25375a;
  --color-accent: #62d5b4;
  --color-text: #edf4f7;
  --color-text-muted: #b9c6d5;
  --color-border: rgba(237, 244, 247, 0.14);
  --content-width: 1200px;
  --nav-height: 4.5rem;
  --radius-small: 0.65rem;
  --radius-medium: 1rem;
  --radius-large: 1.5rem;
  --shadow-card: 0 1.25rem 3rem rgba(4, 10, 24, 0.24);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  margin: 0;
  color: var(--color-text);
  background: var(--color-background);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.6;
  overflow-x: clip;
}

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

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

h1,
h2,
h3,
h4 {
  line-height: 1.15;
}

#featured-projects,
.journey-section,
#about {
  width: min(100% - 2rem, var(--content-width));
  margin-inline: auto;
  padding-block: clamp(4.5rem, 9vw, 8rem);
}

.section-heading {
  max-width: 43rem;
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

.section-heading h2 {
  margin-bottom: 0.7rem;
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.04em;
}

.section-heading > p:last-child,
.chapter-description,
.archive-content,
.card-content > p:not(.project-type):not(.skill-label) {
  color: var(--color-text-muted);
}

.eyebrow,
.project-type,
.chapter-number {
  margin-bottom: 0.65rem;
  color: var(--color-accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#navbar {
  position: fixed;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: var(--nav-height);
  padding: 0.75rem max(1rem, calc((100% - var(--content-width)) / 2));
  border-bottom: 1px solid var(--color-border);
  background: rgba(17, 26, 46, 0.92);
  backdrop-filter: blur(1rem);
}

.brand {
  flex: 0 0 auto;
  color: var(--color-text);
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.brand::after {
  color: var(--color-accent);
  content: ".";
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.3rem 0.85rem;
}

#navbar a:not(.brand) {
  padding: 0.35rem 0.2rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 180ms ease;
}

#navbar a:not(.brand):hover {
  color: var(--color-accent);
}

a:focus-visible,
button:focus-visible {
  outline: 0.2rem solid var(--color-accent);
  outline-offset: 0.25rem;
}

#welcome-section {
  position: relative;
  display: grid;
  align-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding:
    calc(var(--nav-height) + clamp(3rem, 8vw, 7rem))
    max(1rem, calc((100% - var(--content-width)) / 2))
    clamp(3rem, 7vw, 6rem);
  overflow: hidden;
  isolation: isolate;
}

#welcome-section::before {
  position: absolute;
  z-index: -1;
  top: -16rem;
  right: -12rem;
  width: min(48vw, 40rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(98, 213, 180, 0.22), transparent 67%);
  content: "";
  filter: blur(0.4rem);
  pointer-events: none;
  animation: atlas-glow 10s ease-in-out infinite alternate;
}

@keyframes atlas-glow {
  to {
    transform: translate(-2rem, 3rem) scale(1.08);
  }
}

.welcome-content {
  position: relative;
  z-index: 1;
  width: min(100%, 47rem);
}

#welcome-section h1 {
  max-width: 16ch;
  margin-bottom: 1.25rem;
  font-size: clamp(2.8rem, 7vw, 5.7rem);
  letter-spacing: -0.065em;
}

.hero-statement {
  margin-bottom: 1rem;
  color: var(--color-accent);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 750;
}

.welcome-content > p:last-of-type {
  max-width: 60ch;
  color: var(--color-text-muted);
}

.hero-actions,
.card-actions,
.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-actions {
  margin-top: 1.8rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.button--primary {
  border-color: var(--color-accent);
  color: #0b1a23;
  background: var(--color-accent);
}

.button--primary:hover {
  border-color: #93e7cf;
  background: #93e7cf;
}

.button--secondary:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: rgba(98, 213, 180, 0.08);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  width: min(100%, var(--content-width));
  margin-top: clamp(2.75rem, 7vw, 5rem);
}

.stat-card {
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-medium);
  background: rgba(23, 35, 59, 0.76);
}

.stat-card strong,
.stat-card span {
  display: block;
}

.stat-card strong {
  color: var(--color-accent);
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  line-height: 1;
}

.stat-card span {
  margin-top: 0.35rem;
  color: var(--color-text-muted);
  font-size: 0.87rem;
}

#featured-projects {
  border-top: 1px solid var(--color-border);
}

.featured-grid,
.archive-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.project-tile {
  min-width: 0;
}

.featured-card,
.archive-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-medium);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.featured-card:hover,
.featured-card:focus-within,
.archive-card:hover,
.archive-card:focus-within {
  border-color: rgba(98, 213, 180, 0.58);
  box-shadow: 0 1.6rem 3.8rem rgba(4, 10, 24, 0.34);
  transform: translateY(-0.25rem);
}

.featured-card > img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-bottom: 1px solid var(--color-border);
  object-fit: cover;
}

.card-content,
.archive-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.35rem;
}

.card-content h3,
.archive-content h4 {
  margin-bottom: 0.65rem;
  font-size: 1.22rem;
}

.skill-label {
  margin-bottom: 0.85rem;
  color: var(--color-accent);
  font-size: 0.9rem;
  font-weight: 700;
}

.card-actions,
.project-actions {
  margin-top: auto;
  padding-top: 1.1rem;
}

.card-actions a,
.project-actions a {
  color: var(--color-accent);
  font-size: 0.88rem;
  font-weight: 800;
}

.card-actions a:hover,
.project-actions a:hover {
  color: #a4eed9;
}

.journey-section {
  padding-top: 2rem;
}

.chapter-block {
  position: relative;
  padding: 0 0 3.25rem 1.5rem;
}

.chapter-block::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0.25rem;
  width: 1px;
  background: linear-gradient(var(--color-accent), var(--color-border));
  content: "";
}

.chapter-block::after {
  position: absolute;
  top: 0.25rem;
  left: 0;
  width: 0.55rem;
  aspect-ratio: 1;
  border: 0.12rem solid var(--color-background);
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 0.16rem rgba(98, 213, 180, 0.28);
  content: "";
}

.chapter-header {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 1rem;
  align-items: start;
  margin-bottom: 1.4rem;
}

.chapter-header h3 {
  margin-bottom: 0.45rem;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
}

.chapter-number,
.chapter-description {
  grid-column: 1;
}

.chapter-count {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.archive-preview {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-raised);
}

.archive-preview img,
.project-preview-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-preview-fallback {
  display: grid;
  place-items: center;
  padding: 1rem;
  color: var(--color-text);
  background:
    linear-gradient(135deg, rgba(98, 213, 180, 0.2), transparent 55%),
    var(--color-surface-raised);
  font-weight: 800;
  text-align: center;
}

.featured-badge {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  color: #0b1a23;
  background: var(--color-accent);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.project-meta .project-type,
.skill-tag {
  margin: 0;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.69rem;
  letter-spacing: 0.04em;
}

.project-meta .project-type {
  color: var(--color-accent);
  background: rgba(98, 213, 180, 0.09);
}

.skill-tag {
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-weight: 700;
}

#about {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(16rem, 0.7fr);
  gap: clamp(2rem, 7vw, 6rem);
  align-items: center;
  border-top: 1px solid var(--color-border);
}

#about .section-heading {
  margin: 0;
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.skill-list li {
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text-muted);
  background: var(--color-surface);
  font-size: 0.88rem;
  font-weight: 700;
}

footer {
  width: min(100% - 2rem, var(--content-width));
  margin-inline: auto;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  text-align: center;
}

#profile-link {
  color: var(--color-accent);
  font-weight: 800;
}

#profile-link:hover {
  color: #a4eed9;
}

@media (max-width: 900px) {
  .featured-grid,
  .archive-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #about {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  :root {
    --nav-height: 5.25rem;
  }

  #navbar {
    align-items: flex-start;
    padding-block: 0.55rem;
  }

  .nav-links {
    gap: 0.1rem 0.55rem;
  }

  #navbar a:not(.brand) {
    padding-inline: 0.1rem;
    font-size: 0.8rem;
  }

  #welcome-section {
    padding-top: calc(var(--nav-height) + 4rem);
  }

  .featured-grid,
  .archive-grid,
  .stats {
    grid-template-columns: 1fr;
  }

  .chapter-block {
    padding-left: 1.25rem;
  }

  .chapter-header {
    grid-template-columns: 1fr;
  }

  .chapter-count {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
    margin-top: 0.4rem;
  }
}

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