/* =========================================================
   Table of contents TC
   ========================================================= */

/* =========================================================
   Fonts
   ========================================================= */
@font-face {
    font-family: 'Poppins';
    src:
      url('../fonts/Poppins-Regular.woff2') format('woff2'),
      url('../fonts/Poppins-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Poppins';
    src:
      url('../fonts/Poppins-Medium.woff2') format('woff2'),
      url('../fonts/Poppins-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* =========================================================
   Reset
   ========================================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

img, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

ul { 
  list-style: none; 
}

/* =========================================================
   Global styles
   ========================================================= */
body {
  /* Typography */
  font-family: 'Poppins', system-ui, sans-serif;

  /* Color */
  background: var(--off-white);
  color: var(--primary-brand);

  /* Rendering */
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

h1, h2 {
  font-weight: 500;
}

p {
  text-wrap: pretty;
}

p + p {
  margin-top: 1rem;
}

::selection {
  background: var(--placeholder); /* Selected text */
  color: var(--black); /* Global text color */
}

/* =========================================================
   Tokens
   ========================================================= */
:root {
  /* Breakpoints */
  --bp-sm: 40rem; /* 640px, phone to tablet */
  --bp-md: 64rem; /* 1024px, tablet to desktop */
  --bp-lg: 80rem; /* 1280px, desktop to widescreen */

  /* Color */
  --white: oklch(1 0 0);
  --black: oklch(0 0 0);
  --off-white: oklch(0.95 0 0);
  --primary-brand: #3b3b3b;
  --secondary-brand: oklch(24% 0 272);
  --selection: oklch(1 0 0);
  --placeholder: oklch(60% 0.15 140);

  /* Tracking */
  --tracking-tight: -0.025em;
  --tracking-tighter: -0.05em;

  /* Defines rounded corners for imagery containers */
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
}

/* =========================================================
   Site layout
   ========================================================= */
.container {
  max-width: 160rem; /* 2560px */
  margin: 0 auto;
  padding-inline: 1rem;
}

@media (min-width: 40rem) { 
  .container { padding-inline: 4rem; } 
}

@media (min-width: 64rem) { 
  .container { padding-inline: 6rem; } 
}

@media (min-width: 80rem) { 
  .container { padding-inline: 10rem; } 
}

/* =========================================================
   Site header
   ========================================================= */
.site-header {
  /* Positioning */
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;

  /* Box model */
  width: 100%;
  height: 4.5rem;

  /* Flex box */
  display: flex;
  align-items: center;

  /* Stylization */
  background: oklch(0.95 0 0 / 0.9);
  backdrop-filter: blur(1.5rem) saturate(180%);
  -webkit-backdrop-filter: blur(1.5rem) saturate(180%);
}

@media (min-width: 64rem) { 
  .site-header { height: 5rem; }
}

.site-header .container {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  /* Positioning */
  position: relative;
  z-index: 2;

  /* Box model */
  display: block;
  width: 2.5rem;

  /* Stylization */
  fill: #031273; 
}

@media (min-width: 64rem) {
  .logo { width: 3rem; } 
}

.site-header:has(.primary-nav.active) .logo { 
  fill: var(--white); 
}

.logo svg { 
  width: 100%;
  height: auto;
}

/* =========================================================
   Primary nav
   ========================================================= */
.primary-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh; /* dvh handles mobile browser Chrome */
  background: #031273;
  color: var(--white);
  padding: 7.5rem 1rem 1rem;
  overflow-y: auto;
}

@media (min-width: 40rem) { 
  .primary-nav { 
    padding: 7.5rem 4rem 1rem;
  } 
}

/* Toggled open via the hamburger button */
.primary-nav.active { 
  display: block; 
}

.primary-nav__list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
}

.primary-nav__list a {
  font-size: 3rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: var(--tracking-tight);
  position: relative;
}

@media (min-width: 40rem) { 
  .primary-nav__list a { 
    font-size: 4rem; 
    line-height: 1;
  }
}

/* Underline effect on hover */
.primary-nav__list a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s ease;
}

.primary-nav__list a:hover::after { 
  transform: scaleX(1);
}

/* Responsive desktop adjustment */
@media (min-width: 64rem) {
  .primary-nav {
    display: block;
    position: static;
    width: auto;
    height: auto;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 0;
    border-top: 0;
    overflow: visible;
  }

  .primary-nav__list {
    flex-direction: row;
    align-items: center;
    gap: 2.5rem;
  }

  .primary-nav__list a { 
    font-size: 1.25rem; 
    color: var(--primary-brand);
  }
}

/* =========================================================
   Mobile nav toggle (hamburger)
   ========================================================= */
.nav-toggle {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0.5rem;
  margin: -0.5rem; /* keep the visual size while expanding the tap target */
  color: var(--primary-brand);
  cursor: pointer;
  position: relative;
  z-index: 2;
}

.nav-toggle__bars {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 1.75rem;
  height: 1.125rem;
}

.nav-toggle__bars span {
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.2s ease;
  transform-origin: center;
}

/* Active hamburger transformation */
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(1) {
  transform: translateY(calc(0.5625rem - 1px)) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(2) { 
  opacity: 0; 
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(3) {
  transform: translateY(calc(-0.5625rem + 1px)) rotate(-45deg);
}

/* Turn the X white when the menu is open */
.site-header:has(.nav-toggle[aria-expanded="true"]) .nav-toggle {
  color: var(--white);
}

/* Hide hamburger on desktop */
@media (min-width: 64rem) { .nav-toggle { 
  display: none; } 
}

/* Respect towards reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .primary-nav,
  .primary-nav__list a,
  .nav-toggle__bars span,
  .primary-nav__list a::after {
    transition: none !important;
  }
}

/* =========================================================
   Main content
   ========================================================= */
main { 
  min-height: 100vh;
  padding-top: 5rem;
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  min-height: 4rem;
  overflow-x: hidden;
}

/* Responsive container adjustments */
@media (min-width: 40rem) { .hero { min-height: 6rem; } }
@media (min-width: 64rem) { .hero { min-height: 10rem; } }
@media (min-width: 80rem) { .hero { min-height: 12rem; } }

.hero__text {
  position: relative;
  z-index: 2;
}

.hero h1 {
  font-size: 3rem;
  line-height: 1;
  letter-spacing: var(--tracking-tighter);
  margin: 2.5rem 0 2.5rem -0.075em;
}

@media (min-width: 40rem) {
  .hero h1 { 
    font-size: 3.5rem; 
    margin: 3rem 0 3rem -0.075em;
  }
}

@media (min-width: 64rem) {
  .hero h1 {
    font-size: 4rem;
    margin: 3.5rem 0 3.5rem -0.075em;
  }
}

@media (min-width: 80rem) {
  .hero h1 {
    font-size: 4.5rem;
    margin: 4rem 0 4rem -0.075em;
  }
}

/* =========================================================
   Index: Selected projects
   ========================================================= */
.projects-section { 
  margin-top: 1rem;
}

@media (min-width: 64rem) { 
  .projects-section { margin-top: 2rem; }
}

.projects-section__heading {
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: var(--tracking-tight);
  margin: 0 0 1.25rem -0.125rem;
}

@media (min-width: 40rem) {
  .projects-section__heading {
    font-size: 1.8rem;
  }
}

@media (min-width: 64rem) {
  .projects-section__heading {
    font-size: 2rem;
    margin: 0 0 1.5rem -0.125rem;
  }
}

@media (min-width: 80rem) {
  .projects-section__heading {
    font-size: 2.2rem;
    margin: 0 0 2rem -0.125rem;
  }
}

/* Override / extend project-card from base stylesheet */
.projects-section .project-card.desktop-only { 
  display: block; 
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 40rem) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

@media (min-width: 64rem) {
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
}

@media (min-width: 80rem) {
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

/* =========================================================
   Project and About: Intro text
   ========================================================= */
.project-title {
  display: relative;
}

h1.title {
  font-size: 3rem;
  line-height: 1;
  letter-spacing: -0.025em;
  letter-spacing: var(--tracking-tighter);
  margin: 2.5rem 0 1rem;
}

@media (min-width: 64rem) {
  h1.title {
    font-size: 4.5rem;
    letter-spacing: var(--tracking-tighter);
    margin: 3rem 0 2.5rem;
  }
}

.project-content {
  display: grid;
  grid-template-columns: 1fr;
  padding: 0 0 2rem;
}

@media (min-width: 64rem) {
  .project-content {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 2.5rem;
    padding: 0 0 2rem;
  }
}

@media (min-width: 80rem) {
  .project-content { gap: 3rem; }
}

.project-content__summary {
  grid-column: 1 / -1;
}

@media (min-width: 64rem) {
  .project-content__summary {
    grid-column: 2 / span 5;
  }
}

.tagline {
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  margin: 0 0 0.5rem;
  color: var(--black);
}

@media (min-width: 64rem) {
  .tagline {
    font-size: 1.25rem;
    line-height: 1.625;
  }
}

.lead {
  font-size: 1rem;
  line-height: 1.4;
  color: var(--black);
}

@media (min-width: 64rem) {
  .lead {
    font-size: 1.2rem;
    line-height: 1.4;
  }
}

/* =========================================================
   Project: Media blocks
   ========================================================= */
.media-block { margin-bottom: 1rem; }

@media (min-width: 64rem) { .media-block { margin-bottom: 5rem; } }

.media-block figure {
  border-radius: var(--radius-md);
  overflow: hidden;
}

@media (min-width: 64rem) { .media-block figure { border-radius: var(--radius-lg); } }

.media-block figure > div { width: 100%; }

.media-block img {
  width: 100%;
  display: block;
}

.caption {
  color: var(--white);
  font-size: 0.875rem;
  max-width: 56rem;
  margin-top: 1.25rem;
  margin-bottom: 2rem;
}

@media (min-width: 64rem) { .caption { font-size: 1.125rem; } }

/* =========================================================
   Projects and About: Content text
   ========================================================= */
.content-text {  
  color: var(--primary-brand);
  margin-top: 2rem;
  margin-bottom: 3rem;
}

@media (min-width: 64rem) {
  .content-text {
    margin-bottom: 5rem;
  }
}

.content-text p {
  font-size: 1rem;
  color: var(--black);
}

@media (min-width: 64rem) {
  .content-text p {
    font-size: 1.2rem;
    line-height: 1.5;
  }
}

.content-text a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

h2.section {
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: var(--tracking-tight);
  line-height: 1.25;
  margin-bottom: 0.6rem;
}

@media (min-width: 64rem) {
  h2.section {
    font-size: 2.25rem;
    margin-left: -0.1rem;
  }
}

/* Offset "Prototyping" section (starts in third column on desktop) */
.content-offset {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 64rem) {
  .content-offset {
    grid-template-columns: repeat(5, 1fr);
    gap: 2.5rem;
  }
  .content-offset > * { grid-column: 3 / span 3; }
}

/* Max-width narrow section (for body copy with prototyping links) */
.content-narrow {
  max-width: 64rem;
  margin: 0 auto;
}

/* =========================================================
   More projects
   ========================================================= */
.more-projects {
  background: oklch(92.494% 0.00011 271.152);
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.more-projects h2.heading-large {
  font-size: 1.875rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: var(--tracking-tight);
  margin-bottom: 1.25rem;
}

@media (min-width: 64rem) {
  .more-projects h2.heading-large {
    font-size: 3rem;
    margin-bottom: 2.5rem;
    margin-left: -0.125rem;
  }
}

.project-card {
  display: block;
  min-width: 0;
  margin-bottom: 1.5rem;
}

@media (min-width: 64rem) {
  .project-card {
    margin-bottom: 2rem;
  }
}

.project-card__media {
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 0.625rem;
}

@media (min-width: 64rem) {
  .project-card__media {
    border-radius: var(--radius-lg);
    margin-bottom: 1.25rem;
  }
}

.project-card__media > div { transition: transform 0.3s ease-in-out; }

.project-card:hover .project-card__media > div { transform: scale(1.05); }

.project-card:active .project-card__media > div {
  transform: scale(1);
  transition-duration: 0.15s;
}

.project-card h3 {
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: var(--tracking-tight);
}

@media (min-width: 64rem) {
  .project-card h3 {
    font-size: 1.5rem;
    line-height: 1.2;
  }
}

.project-card p {
  display: none;
}

@media (min-width: 80rem) {
  .project-card p {
    display: block;
    font-size: 1rem;
    line-height: 1.2;
    color: var(--black);
    font-size: 1rem;
    line-height: 1.4;
  }
}

/* Third project card for desktop */
.project-card.desktop-only {
  display: none;
}

@media (min-width: 64rem) { .project-card.desktop-only { 
  display: block; }
}

/* =========================================================
   Footer
   ========================================================= */
footer {
  padding: 2rem 0 2rem;
  background: linear-gradient(to bottom, #020b47, #020b47);
  box-sizing: border-box;
}

@media (min-width: 40rem) { footer {
  padding: 3rem 0 3rem; } 
}

@media (min-width: 64rem) { footer {
  padding: 4rem 0 4rem; } 
}

@media (min-width: 80rem) { footer {
  padding: 5rem 0 5rem; } 
}

#contact { 
  scroll-margin-top: 4rem;
}

@media (min-width: 64rem) { #contact { 
  scroll-margin-top: 6rem; }
}

.contact {
  margin-bottom: 4rem;
  box-sizing: border-box;
}

@media (min-width: 64rem) { #contact { 
  scroll-margin-top: 6rem; }
}

/* Call-to-action */
.contact-label {
  color: var(--white);
  font-size: 1.125rem;
}

@media (min-width: 64rem) {
  .contact-label {
    font-size: 1.25rem;
    line-height: 1.625;
  }
}

/* Email address link */
.contact-email {
  font-size: 1.5rem;
  font-weight: 500;
  margin-top: 0.5rem;
  line-height: 1;
  color: var(--white);
  letter-spacing: var(--tracking-tight);
  margin-bottom: 2rem;
}

.contact-email:hover { color: var(--primary-brand); }

@media (min-width: 64rem) {
  .contact-email {
    font-size: 3rem;
    letter-spacing: var(--tracking-tighter);
    margin-bottom: 2rem;
    margin-left: -0.25rem;
  }
}

/* Copy email address button */
.copy-email {
  appearance: none;
  border: 1px solid var(--white);
  color: var(--white);
  background: transparent;
  padding: 4px 1rem 5px;
  border-radius: 999px;
  font-size: 1.125rem;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
  font: inherit;
  line-height: inherit;
}

@media (min-width: 64rem) {
  .copy-email {
    padding: 1px 1rem 3px;
    font-size: 1.25rem;
    line-height: 1.625;
  }
}

.copy-email:hover {
  background: var(--white);
  color: var(--primary-brand);
}

.copy-email:active { transform: scale(0.95); }

.copy-email svg {
  display: inline-block;
  margin-left: 0.25rem;
  vertical-align: -2px;
}

/* Social icons */
.socials {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 64rem) { .socials {
  margin-bottom: 2.5rem; }
}

.socials a {
  display: block;
  color: var(--white);
  transition: transform 0.15s ease;
}

.socials a:hover {
  transform: scale(1.05); 
}

.socials a:active {
  transform: scale(1);
}

.socials svg {
  fill: currentColor;
}

/* Copyright line */
.copyright {
  color: var(--white);
  font-size: 0.875rem;
}

@media (min-width: 64rem) {
  .copyright {
    font-size: 1rem;
  }
}