/* Shared styles and home layout from Design System V1.2. */
@font-face {
  font-family: Manrope;
  src: url('../fonts/Manrope-VariableFont_wght.ttf') format('truetype');
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('../fonts/CormorantGaramond-Italic.ttf') format('truetype');
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #F8F7F4;
  --ink: #020D16;
  --blue: #123448;
  --muted: #526278;
  --white: #FFFFFF;
  --font: Manrope,Arial,sans-serif;
  --font-motto: 'Cormorant Garamond',Georgia,serif;
  --container-max: 1280px;
  --gutter: 64px;
  --header: 88px;
  --s4: 4px;
  --s8: 8px;
  --s12: 12px;
  --s16: 16px;
  --s24: 24px;
  --s32: 32px;
  --s40: 40px;
  --s48: 48px;
  --s64: 64px;
  --s80: 80px;
  --s96: 96px;
  --display: 4rem;
  --h1: 3rem;
  --h2: 1.5rem;
  --h3: 1.125rem;
  --subtitle: 1.5rem;
  --motto-size: 1.75rem;
  --portrait-home: 520px;
  --fade: 500ms;
  --portrait-fade: 700ms;
  --quick: 150ms;
  --transition: 200ms;
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable both-edges;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.8 var(--font);
}

.shell {
  width: min(var(--container-max),calc(100vw - 2*var(--gutter)),100%);
  margin-inline: auto;
  min-width: 0;
}

button,a {
  font: inherit;
}

button {
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
}

a {
  color: var(--blue);
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
}

[hidden] {
  display: none!important;
}

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

img {
  max-width: 100%;
  height: auto;
}

.skip {
  position: absolute;
  z-index: 5;
  top: 8px;
  left: 8px;
  transform: translateY(-200%);
  background: var(--white);
  padding: 8px 16px;
}

.skip:focus {
  transform: none;
}

.site-header {
  min-height: var(--header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s16);
  position: relative;
  z-index: 2;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--s32);
}

.site-nav a,.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  text-decoration: none;
  font-size: .875rem;
  line-height: 1.6;
  transition: color var(--transition);
}

.site-nav a[aria-current=page] {
  font-weight: 600;
  color: var(--ink);
}

.site-nav a:hover,.site-footer a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.language {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: .875rem;
  line-height: 1.6;
  flex: none;
}

.language button {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  color: var(--muted);
  transition: color var(--quick);
}

.language button[aria-pressed=true] {
  color: var(--blue);
  font-weight: 600;
}

.language button:hover {
  color: var(--ink);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  align-items: center;
  justify-content: flex-start;
  color: var(--blue);
}

.menu-toggle[aria-expanded=true] .hamburger,.menu-toggle[aria-expanded=false] .close {
  display: none;
}

main {
  flex: 1;
  padding-block: var(--s48) var(--s80);
}

h1,.h1 {
  font-size: var(--h1);
  line-height: 1.2;
  letter-spacing: -.04em;
  font-weight: 600;
  margin: 0;
}

h2,.h2 {
  font-size: var(--h2);
  line-height: 1.35;
  letter-spacing: -.02em;
  font-weight: 600;
  margin: 0;
}

h3,.h3 {
  font-size: var(--h3);
  line-height: 1.4;
  font-weight: 600;
  margin: 0;
}

.display {
  font-size: var(--display);
  line-height: 1.15;
  letter-spacing: -.045em;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.subtitle {
  font-size: var(--subtitle);
  line-height: 1.45;
  font-weight: 500;
  color: var(--blue);
}

.latin {
  font: italic 400 var(--motto-size)/1.2 var(--font-motto);
  color: var(--blue);
}

.body-copy {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--blue);
}

.secondary {
  font-size: .875rem;
  color: var(--muted);
}

.caption {
  font-size: .75rem;
  line-height: 1.6;
  color: var(--muted);
}

.eyebrow {
  font-size: var(--h3);
  line-height: 1.4;
  letter-spacing: normal;
  color: var(--blue);
  font-weight: 600;
  margin: 0 0 var(--s12);
}

.status {
  display: flex;
  align-items: center;
  gap: var(--s8);
  color: var(--blue);
  font-size: .75rem;
  line-height: 1.6;
  font-weight: 500;
}

.dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--blue);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s24);
  align-items: center;
}

.links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition);
}

.links a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s24);
  padding-block: var(--s24);
  font-size: .75rem;
  line-height: 1.6;
  color: var(--muted);
}

.site-footer a {
  font-size: inherit;
}

.site-footer a[aria-current=page] {
  font-weight: 600;
  color: var(--ink);
}

@keyframes appear {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Home layout */
.home {
  display: grid;
  grid-template-columns: minmax(0,1.35fr) minmax(0,1fr);
  grid-template-areas: 'identity portrait' 'motto portrait' 'links portrait';
  column-gap: clamp(32px,5vw,80px);
  align-content: center;
  align-items: center;
  padding-block: var(--s48);
}

.identity {
  grid-area: identity;
  min-width: 0;
}

.identity .status {
  margin: 0 0 var(--s24);
}

.identity .subtitle {
  margin: var(--s12) 0 0;
}

.home .portrait {
  display: block;
  grid-area: portrait;
  width: 100%;
  max-width: var(--portrait-home);
  justify-self: end;
  margin: 0;
  animation: appear var(--portrait-fade) ease both;
}

.home-motto {
  grid-area: motto;
  margin-top: var(--s40);
}

.latin {
  margin: 0;
}

.translation {
  margin: var(--s12) 0 0;
  font-size: .875rem;
  line-height: 1.6;
  color: var(--muted);
}

.home .links {
  grid-area: links;
  margin-top: var(--s40);
}

.identity,.home-motto,.home .links {
  animation: appear var(--fade) ease both;
}

@media(max-width:850px) {
  :root {
    --gutter: 32px;
    --display: 3rem;
    --h1: 2.5rem;
    --subtitle: 1.375rem;
    --motto-size: 1.625rem;
    --portrait-home: 360px;
  }
  main {
    padding-block: var(--s40) var(--s64);
  }
  .home {
    padding-block: var(--s40);
  }
}

@media(max-width:800px) {
  .home {
    grid-template-columns: minmax(0,1fr);
    grid-template-areas: 'identity' 'portrait' 'motto' 'links';
    text-align: center;
    justify-items: center;
    align-content: center;
    gap: 0;
  }
  .identity .status {
    justify-content: center;
    margin-bottom: var(--s16);
  }
  .home .portrait {
    justify-self: center;
    margin-top: var(--s32);
  }
  .home-motto {
    margin-top: var(--s32);
  }
  .home .links {
    justify-content: center;
    margin-top: var(--s24);
  }
}

@media(max-width:680px) {
  :root {
    --gutter: 24px;
    --display: 2.25rem;
    --h1: 2rem;
    --h2: 1.375rem;
    --subtitle: 1.125rem;
    --motto-size: 1.5rem;
    --header: 72px;
    --portrait-home: 280px;
  }
  main {
    padding-block: var(--s32) var(--s48);
  }
  .home {
    padding-block: var(--s24) var(--s32);
  }
  html:not(.js) .site-header {
    flex-wrap: wrap;
  }
  html:not(.js) .site-nav {
    flex-wrap: wrap;
    gap: var(--s16);
  }
  .site-footer {
    flex-direction: column;
    text-align: center;
    gap: var(--s8);
  }
  .site-footer a {
    justify-content: center;
  }
  .home .links {
    column-gap: var(--s24);
    row-gap: 0;
  }
}

@media(max-width:360px) {
  :root {
    --gutter: 16px;
  }
}

@media(min-width:801px) and (max-height:800px) {
  .home {
    padding-block: var(--s16);
  }
  .home-motto,.home .links {
    margin-top: var(--s24);
  }
  .home .portrait {
    max-width: min(var(--portrait-home),65vh);
  }
}

@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after {
    animation: none!important;
    transition: none!important;
  }
}

html:not(.js) .language {
  display: none;
}

.mobile-menu .menu-toggle {
  display: inline-flex;
}

.mobile-menu .site-nav {
  display: none;
  position: absolute;
  top: 60px;
  left: 0;
  width: min(200px,100%);
  background: var(--white);
  padding: var(--s8);
  gap: 0;
  flex-direction: column;
  align-items: stretch;
  border-radius: 6px;
  box-shadow: 0 6px 24px #020D1618;
}

.mobile-menu .site-nav.open {
  display: flex;
  animation: appear var(--quick) ease both;
}

.mobile-menu .site-nav a {
  padding: 8px 14px;
}

/* Minimum width for primary links from audit 04.17.5. */
.site-nav a,.links a {
  min-inline-size: 44px;
}

/* Projects layout */
.projects {
  --crane: 560px;
  display: flex;
  flex-direction: column;
  gap: var(--s24);
  padding-block: var(--s48);
  animation: appear var(--fade) ease both;
}

.project-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--s16);
  margin-block: auto;
  min-width: 0;
}

.project-illustration {
  display: block;
  width: min(100%, var(--crane));
  height: auto;
}

.project-status {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.5;
  font-weight: 500;
  color: var(--blue);
}

@media (max-width: 850px) {
  .projects {
    --crane: 480px;
    padding-block: var(--s40) var(--s48);
  }
}

@media (min-width: 681px) and (max-height: 800px) {
  .projects {
    padding-block: var(--s24);
    gap: var(--s16);
  }

  .project-illustration {
    width: min(100%, var(--crane), max(240px, calc((100dvh - 350px) * 4 / 3)));
  }
}

@media (max-width: 680px) {
  .projects {
    --crane: 100%;
    padding-block: var(--s32) var(--s48);
    gap: var(--s32);
  }

  .project-content {
    margin-block: 0 auto;
  }

  .project-illustration {
    max-width: 480px;
  }

  .project-status {
    font-size: 1.125rem;
  }
}

/* About layout */
.about {
  --portrait-about: 250px;
  animation: appear var(--fade) ease both;
}

.about-inner {
  max-width: 850px;
  margin-inline: auto;
  min-width: 0;
}

.about-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, var(--portrait-about));
  gap: var(--s64);
  align-items: center;
  margin-bottom: var(--s32);
}

.about-intro {
  min-width: 0;
}

.about-greeting {
  overflow-wrap: anywhere;
  max-width: 500px;
}

.about .cv-status {
  display: flex;
  align-items: center;
  gap: var(--s8);
  margin: var(--s24) 0 0;
  font-size: .875rem;
  line-height: 1.6;
  color: var(--muted);
}

.cv-status svg {
  flex: none;
}

.about .portrait {
  display: block;
  width: 100%;
  max-width: var(--portrait-about);
  margin: 0;
  justify-self: end;
  animation: appear var(--portrait-fade) ease both;
}

.about-copy p {
  margin: 0 0 var(--s24);
}

.about-copy p:last-child {
  margin-bottom: 0;
}

@media (max-width: 850px) {
  .about {
    --portrait-about: 210px;
  }

  .about-hero {
    gap: var(--s32);
  }
}

@media (max-width: 680px) {
  .about {
    --portrait-about: 185px;
  }

  .about-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s24);
  }

  .about .portrait {
    justify-self: center;
  }

  .about .cv-status {
    margin-top: var(--s16);
  }
}

/* Legal notice and privacy policy */
.legal {
  animation: appear var(--fade) ease both;
}

.legal article {
  max-width: 760px;
  min-width: 0;
  color: var(--blue);
  font-size: 1rem;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.legal h1,
.legal h2,
.legal h3 {
  color: var(--ink);
}

.legal .date {
  font-size: .875rem;
  line-height: 1.6;
  color: var(--muted);
  margin: var(--s16) 0 var(--s24);
}

.legal p {
  margin: 0 0 var(--s16);
}

.legal section {
  margin-top: var(--s32);
}

.legal h2 {
  margin-bottom: var(--s16);
}

.legal h3 {
  margin: var(--s24) 0 var(--s12);
}

.legal section p:last-child {
  margin-bottom: 0;
}

.legal article a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color var(--transition);
}

.legal article a:hover {
  color: var(--ink);
}
