/* Colors and variables */

:root {
  --color-accent: #5eead4;
  --background-accent: rgba(45, 212, 191, 0.1);
  --color-highlight: #e2e8f0;
}

/* Accessibility — screen reader text */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Base styles — reset, page layout and typography */

html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Inter", sans-serif;
}

body {
  background: #0f172a;
  color: #94a3b8;
  padding: 4rem 2rem;
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 6rem;
}

p {
  line-height: 1.5rem;
}

p::selection,
h1::selection,
h2::selection,
h3::selection,
h4::selection,
h5::selection,
h6::selection {
  background: var(--color-accent);
  color: #0f172a;
}

/* Background and layers */

.underlay {
  position: fixed;
  background: #172554;
  inset: 0;
  opacity: 0.15;
}

header,
main,
/* Footer — credits and back to top */

footer {
  position: relative;
  z-index: 10;
}

/* Header — name, navigation and social links */

header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 300px;
}

header h1,
header h4,
.light-text {
  color: var(--color-highlight);
}

header a {
  text-decoration: none;
}

header h1 {
  font-weight: 600;
}

header h4 {
  font-weight: 400;
}

nav {
  display: none;
}

nav a {
  font-size: 0.9rem;
}

.social-link-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.social-link {
  font-size: 1.2rem;
  color: inherit;
  text-decoration: none;
}

.social-link:hover {
  color: var(--color-highlight);
  transition-duration: 200ms;
}

/* Main content — sections and sticky headings */

main {
  display: flex;
  flex-direction: column;
  gap: 6rem;
}

section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

section h2 {
  text-transform: uppercase;
  font-size: 1rem;
  font-weight: 500;
}

.sticky-header {
  position: sticky;
  top: 0;
  padding: 1rem 0;
}

.sticky-header h2 {
  position: relative;
  z-index: 2;
}

.sticky-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #101a31;
  opacity: 0.8;
}

/* About — introduction */

.about-contents {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.about-contents p {
  font-size: 1.1rem;
}

/* Shared text links */

.anchor-text {
  color: var(--color-highlight);
  text-decoration: none;
  transition-duration: 200ms;
}

.anchor-text:hover {
  color: var(--color-accent);
}

/* Experience and projects — cards and dates */

.experience-contents,
.projects-contents {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.experience-card,
.project-card {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.experience-card {
  gap: 0.5rem;
}

.project-card {
  gap: 1rem;
}

.card-column {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.experience-card .tenure {
  opacity: 0.7;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.experience-card p {
  font-size: 0.9rem;
}

.card-header h3 {
  font-weight: 400;
  font-size: 1rem;
}

.anchor-icon {
  padding-left: 0.5rem;
}

/* Tags — technologies and skills */

.tag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: var(--color-accent);
}

.tag {
  font-size: 0.8rem;
  border-radius: 0.5rem;
  padding: 0.25rem 0.5rem;
  background: var(--background-accent);
}

/* Projects — thumbnails, stars and archive link */

.project-image-container {
  max-width: 200px;
  overflow: hidden;
  display: grid;
  place-items: center;
  aspect-ratio: 16/9;
  order: 2;
  border: 1px solid rgba(94, 234, 212, 0.35);
  border-radius: 0.25rem;
}

.project-image-container img {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.project-stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.project-archive-link {
  position: relative;
  color: var(--color-highlight);
  text-decoration: none;
  transition-duration: 200ms;
  margin-right: auto;
}

.project-archive-link span {
  transition-duration: 200ms;
}

.project-archive-link:hover span {
  padding-left: 0.25rem;
}

.project-archive-link::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  bottom: 0;
  background: transparent;
  transition-duration: 200ms;
}

.project-archive-link:hover::after {
  background: var(--color-accent);
}

footer {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  justify-content: space-between;
  align-items: flex-start;
}

footer p {
  font-size: 0.9rem;
}

.scroll-to-top {
  text-decoration: none;
  color: var(--color-highlight);
  background: var(--background-accent);
  padding: 0 0.75rem;
  aspect-ratio: 1/1;
  display: grid;
  place-items: center;
  border-radius: 100%;
  overflow: hidden;
  transition-duration: 200ms;
}

.scroll-to-top:hover {
  opacity: 0.6;
}

/* Responsive styles — tablet (640px and up) */

@media (min-width: 640px) {
  .project-card,
  .experience-card {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .card-column {
    grid-column: span 3 / span 3;
  }

  .project-image-container {
    order: 0;
  }

  header {
    max-width: unset;
  }

  header h1 {
    font-size: 3rem;
  }

  header h4 {
    font-size: 1.4rem;
  }

  header p {
    max-width: 300px;
  }

  .social-link-container {
    gap: 1.5rem;
  }

  .social-link-container i {
    font-size: 1.5rem;
  }
}

/* Responsive styles — desktop (1024px and up) */

@media (min-width: 1024px) {
  .social-link-container {
    gap: 1.5rem;
  }

  .social-link-container i {
    font-size: 1.5rem;
  }
  body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
    padding: 6rem;
    padding-top: 0;
  }

  header {
    position: sticky;
    top: 0;
    margin-left: auto;
    height: 100vh;
    padding-bottom: 6rem;
  }

  header h1 {
    font-size: 3rem;
  }

  header h4 {
    font-size: 1.4rem;
  }

  header p {
    max-width: 300px;
  }

  nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
  }

  nav a {
    font-size: 1rem;
  }

  .social-link-container {
    gap: 1.5rem;
  }

  .social-link-container i {
    font-size: 1.5rem;
  }

  main {
    margin-right: auto;
  }

  header,
  main {
    padding-top: 6rem;
    max-width: 600px;
    width: 100%;
  }

  .sticky-header {
    display: none;
  }

  footer {
    grid-column: span 2 / span 2;
    flex-direction: row;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
  }
}
