:root {
  --primary: #222222;
  --secondary: #7B7B7B;
  --tertiary: #F8F8F8;
  --tertiary-light: #F3F3F3;
  --tertiary-dark: #E0E0E0;
  --white: #FFFFFF;
  --black: #000000;
  --background-prominent: linear-gradient(135deg, rgba(110,168,255,0.15), rgba(180,139,255,0.1));
  --border-prominent: rgba(110,168,255,0.2);
  --glass-effect: linear-gradient(180deg, rgba(255,255,255, 1) 90%, rgba(255,255,255, 0) 100%);
  --horizontal-surround: clamp(40px, 10vmin, 80px);
  --vertical-surround: 56px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 300;
  color: var(--primary);
  background: var(--tertiary);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
  text-wrap: nowrap;
}

main {
  width: 100%;
  padding: 0;
  min-height: 100vh;
}

main > section {
  padding: 0 var(--vertical-surround);
  padding-top: var(--horizontal-surround);
  min-height: 100vh;
}
main > section:nth-child(2n) {
  background: var(--tertiary-light);
}
main > section.auto-height {
  min-height: auto;
  padding-bottom: var(--horizontal-surround);
}

main > section h2 {
  font-size: clamp(24px, 4vmin, 32px);
  font-weight: 400;
  color: var(--primary);
  margin-bottom: 0.5em;
}

main > section article p,
main > section header p,
main > section article li,
main > section footer {
  letter-spacing: 0.01em;
  line-height: 1.4em;
  transform: scaleY(0.9);
}

main > section article img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

img {
  filter: grayscale(0.8);
}

/* NAV section */
.nav {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--horizontal-surround);
  background-color: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  padding: 0 clamp(22px, 3vw, var(--vertical-surround));
  z-index: 10;
}
.nav::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  mask: var(--glass-effect);
  backdrop-filter: blur(10px);
  z-index: -1;
}

.logo {
  display: inline-flex;
  color: var(--primary);
  height: 15px;
  max-height: 15px;
  overflow: visible;
  font-size: 20px;
  position: relative;
  top: -8px;
}

.nav-links {
  display: flex;
  width: 100%;
  gap: clamp(12px, 4vw, 48px);
  font-size: clamp(13px, 1.5vw, 17px);
  font-weight: 400;
}
.nav-links a {
  opacity: 0.8;
  transition: font-weight .2s ease, opacity .2s ease;
  color: var(--white);
  mix-blend-mode: difference;
}
.nav-links a:hover {
  opacity: 1;
  font-weight: 500;
}

.cta {
  margin-left: auto;
  font-weight: 400;
  text-decoration: underline;
}

/* HERO section */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  overflow: hidden;
}

.hero-content {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.intro {
  margin-top: -3em;
  margin-bottom: auto;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 2vmin, 18px);
  letter-spacing: -0.04em;
}
.intro h1 {
  font-size: clamp(64px, 14vw, 128px);
  font-weight: 300;
  line-height: .9;
  color: var(--primary);
}
.intro h2 {
  display: inline;
  font-size: clamp(16px, 2vmax, 42px);
  font-weight: 300;
  margin: 0;
}
.intro h3 {
  font-size: clamp(12px, 1.5vmax, 24px);
  font-weight: 200;
  color: var(--secondary);
}

.portrait {
  position: absolute;
  top: auto;
  right: -40px;
  bottom: 0;
  width: auto;
  height:90svh;
  max-height: 90svh;
  max-width: 70vw;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  overflow: visible;
  z-index: 1;
  pointer-events: none;
}
.portrait img {
  width: auto;
  max-width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left bottom;
  filter: grayscale(1) brightness(1.15) contrast(1.15);
  display: block;
}

/* ABOUT section */
.about-content {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 5vw, 64px);
}

.about-content ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75em;
}
.about-content ul li {
  position: relative;
  padding-left: 1em;
}
.about-content ul li::before {
  content: "⁘";
  position: absolute;
  left: 0;
  top: -2px;
}

.about-content .stats {
  justify-content: center;
  margin: 0;
}

.about-content .stat {
  align-items: center;
  gap: 0;
}

/* PROJECTS section */
.projects-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.projects-list > article {
  padding: 2em 0;
  border-bottom: 1px solid var(--secondary);
  display: flex;
  flex-direction: column;
  gap: 1em;
}
.projects-list > article:last-child {
  border-bottom: none;
}

.projects-list > article header,
.projects-list > article section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5em;
}

.projects-list > article h3 {
  font-weight: 400;
  letter-spacing: -0.04em;
  color: var(--primary);
  transform: scaleY(0.95);
}

.projects-list > article ul {
  list-style: none;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5em;
  padding: 0;
  margin: 0;
}

.projects-list > article ul li {
  border: solid 1px var(--border-prominent);
  border-radius: 5em;
  padding: 0.25em 0.75em;
  font-size: 0.8em;
  transform: none;
  line-height: 1.5em;
  background: var(--background-prominent);
  color: var(--primary);
  font-weight: 400;
}

.projects-list > article p {
  max-width: 70%;
}

.projects-list > article a {
  display: inline-flex;
  width: 2.5em;
  height: 2.5em;
  background: var(--primary);
  color: var(--tertiary);
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 400;
}
.projects-list > article a::before {
  content: "↗";
  display: inline;
}
.projects-list > article a:hover {
  background: var(--black);
  border: solid 1px var(--tertiary);
}

/* CONTACT section */
#contact {
  display: flex;
  flex-direction: column;
  gap: 2em;
  background-color: var(--tertiary-dark);
}

#contact article,
#contact footer {
  text-align: center;
}

#contact .grid-cards {
  list-style: none;
}

#contact .card {
  text-align: left;
  gap: 0.3em;
  background-color: var(--tertiary);
}

#contact a span {
  transform: scaleY(0.95);
}
#contact a span:first-child {
  font-size: 0.75em;
  color: var(--secondary);
  text-transform: uppercase;
}

/* STATS component */
.stats {
  display: flex;
  gap: 64px;
  margin-top: 2vh;
  margin-bottom: auto;
}
.stat {
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
  justify-content: flex-end;
  gap: clamp(4px, 1vh, 14px);
}
.stat-number {
  font-size: clamp(24px, 4vw, 96px);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--primary);
}
.plus,
.stat-suffix {
  vertical-align: top;
  color: var(--primary);
}

.plus { margin-right: 2px; }
.stat-suffix { margin-left: 2px; }
.stat-label {
  font-size: clamp(10px, 1.5vw, 36px);
  color: var(--secondary);
}

/* CARD component */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(0.5em, 1vw, 2em);
  padding: clamp(12px, 2vw, 24px);
  border-radius: 8px;
  box-shadow: 0px 0px 14px rgba(0,0,0,0.15);
}

.card .card-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--background-prominent);
  border: solid 1px var(--border-prominent);
  font-size: 16px;
  color: var(--primary);
  margin-bottom: 4px;
}

.card h3 {
  font-size: inherit;
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* GRID CARDS container */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin: 24px 0;
}

.grid-cards .card {
  transition: transform .2s ease, background .2s ease;
}
.grid-cards .card:hover {
  transform: translateY(-3px);
  background: var(--tertiary-light);
}
.grid-cards .card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), transparent 40%);
  border-radius: inherit;
}

.grid-cards .card h3 {
  transform: scaleY(0.95);
}
.grid-cards .card p {
  transform: scaleY(0.90);
}

/* RESPONSIVE */
@media (orientation: portrait) {
  .portrait {
    max-width: 100vw;
    right: 0;
  }
}

@media (orientation: portrait) and (max-width: 560px) {
  .hero-content {
    height: 30%;
    margin-bottom: auto;
    flex-direction: column-reverse;
  }

  .stats {
    margin-top: 0;
  }

  .intro {
    margin-top: 0;
  }

  .portrait > img {
    height: 70%;
    object-position: center bottom;
  }
}

@media (max-width: 768px) {
  .grid-cards,
  .about-content {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1600px) {
  .portrait {
    right: var(--vertical-surround);
  }
}
