/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/Inter-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/Inter-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/Inter-400-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/Inter-400-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin */
@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/Inter-700-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/Inter-700-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/Inter-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/Inter-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* ==========================================================================
   Klara Andreasson portfolio: shared stylesheet for every page
   ========================================================================== */

:root {
  --gutter: 3.4vw;                 /* page margin left/right */
  --gap: 11px;                     /* space between images on project pages */
  --gap-large: 30px;               /* space between images on the front page and Foto */

  --text: #000;
  --heading: #1d1d1d;
  --background: #fff;

  /* text sizes grow a little with the window, like on the old site */
  --size-small: 1rem;
  --size-normal: min(calc(0.6vw + 1rem), 27.52px);
  --size-heading: min(calc(0.72vw + 1rem), 29.824px);
  --size-logo: min(calc(0.84vw + 1rem), 32.128px);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: var(--size-small);
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; width: 100%; height: auto; }
video { aspect-ratio: 16 / 9; background: #000; }

h1, h2, h3 {
  margin: 0 0 2rem;
  color: var(--heading);
  font-size: var(--size-heading);
  font-weight: 700;
  line-height: 1.366;
}

p { margin: 1rem 0; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Header and menu
   -------------------------------------------------------------------------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2.9vw var(--gutter);
}

.site-title {
  font-size: var(--size-logo);
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
}

.site-nav { display: flex; gap: 2.3vw; }

.site-nav a {
  padding: 0.1em 0;
  font-size: var(--size-normal);
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) no-repeat 0 calc(100% - 0.1em) / 0 1px;
  transition: background-size 0.25s ease;
}
.site-nav a:hover,
.site-nav a[aria-current] { background-size: 100% 1px; }

/* the phone menu is opened by a hidden checkbox, no JavaScript needed */
.menu-toggle, .menu-button { display: none; }

/* --------------------------------------------------------------------------
   Project pages: text on the left, images and video on the right
   -------------------------------------------------------------------------- */
.project {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 6.6vw var(--gutter);
}

.project-text {
  position: sticky;
  top: 2rem;
  width: 32.8%;
  margin-left: 4.2%;
}
.project-text p { margin: 1rem 0; }
.project-text .tags { margin-bottom: 2rem; font-weight: 700; }

.project-media {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  width: 49.6%;
}
.project.wide .project-media { width: 58%; }   /* "wide": media column starts a bit further left */

/* two images side by side, cropped to the same shape */
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}
.pair img { height: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.pair.square img { aspect-ratio: 1; }
.pair.landscape img { aspect-ratio: 4 / 3; }
.pair.tall img { aspect-ratio: 2 / 3; }

/* --------------------------------------------------------------------------
   Front page: two columns of project thumbnails
   -------------------------------------------------------------------------- */
.thumbnails {
  display: flex;
  gap: var(--gap-large);
  padding: 0 var(--gutter) 6.6vw;
}
.thumbnails .column {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--gap-large);
}
.thumbnails .pair { gap: var(--gap-large); }

/* --------------------------------------------------------------------------
   Foto: rows of photos, cropped to the same height
   -------------------------------------------------------------------------- */
.photos {
  display: flex;
  flex-direction: column;
  gap: var(--gap-large);
  padding: 0 var(--gutter) 6.6vw;
}
.photo-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  grid-template-rows: 100%;
  gap: var(--gap-large);
  aspect-ratio: 2.45;
}
.photo-row:has(.wide) { aspect-ratio: 3; }
.photo-row img { height: 100%; object-fit: cover; }
.photo-row img.wide { grid-column: span 2; }  /* a landscape photo takes two places */

/* --------------------------------------------------------------------------
   CV
   -------------------------------------------------------------------------- */
.cv-intro {
  display: flex;
  align-items: flex-start;
  padding: 6.6vw var(--gutter) 9vw;
  border-bottom: 1px solid var(--text);
  margin: 0 var(--gutter);
  padding-inline: 0;
}
.cv-intro .portrait { width: 16%; margin-left: 4.2%; }
.cv-intro .bio { width: 28.5%; margin-left: 4.2%; }
.cv-intro .bio p:first-child { margin-top: 0; }
.cv-intro .contact { width: 28.5%; margin-left: auto; margin-right: 8.4%; font-size: var(--size-normal); }
.cv-intro .contact p { margin: 0; }
.cv-intro .contact .plain { text-decoration: none; }

.cv-section {
  display: flex;
  margin: 0 var(--gutter);
  padding: 4.5vw 0;
  border-bottom: 1px solid var(--text);
  font-size: var(--size-normal);
}
.cv-section:first-of-type { margin-top: 0; }
.cv-section:last-child { border-bottom: 0; }
.cv-section > h2 { width: 25.2%; flex-shrink: 0; }
.cv-section > div { width: 66.4%; }
.cv-section p { margin: 0 0 1.9em; }
.cv-section h3 { margin: 0; color: var(--text); font-size: inherit; line-height: inherit; }
.cv-section ul { margin: 0 0 1.9em; padding: 0; list-style: none; }
.cv-section li::before { content: "• "; }
.cv-section > div > :last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  padding: max(110px, 11.7vw) var(--gutter);
  background: #000;
  color: #fff;
  font-size: var(--size-normal);
  text-align: center;
}
.site-footer p { margin: 1rem 0; }
.site-footer a { text-decoration: none; }

/* --------------------------------------------------------------------------
   Phones (767px and narrower)
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  :root {
    --gutter: 6vw;
    --size-normal: calc(min(0.6vh, 5.4px) + 1rem);
    --size-heading: calc(min(0.72vh, 6.48px) + 1rem);
    --size-logo: calc(min(0.6vh, 5.4px) + 1rem);
  }

  .site-header { padding: var(--gutter); }
  .site-title { position: relative; z-index: 2; }
  .site-nav { display: none; }

  .menu-button {
    display: block;
    position: relative;
    z-index: 2;
    width: 47px;
    height: 37px;
    cursor: pointer;
  }
  .menu-button::before, .menu-button::after {
    content: "";
    position: absolute;
    left: 6px; top: 17px;
    width: 35px; height: 2px;
    background: currentColor;
    transition: transform 0.25s ease;
  }
  .menu-button::after { transform: rotate(90deg); }
  .menu-toggle:checked ~ .menu-button::before { transform: rotate(45deg); }
  .menu-toggle:checked ~ .menu-button::after { transform: rotate(135deg); }
  .menu-toggle:checked ~ .site-nav {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.7em;
    background: var(--background);
  }
  .menu-toggle:checked ~ .site-nav a {
    font-size: calc(min(2.03vh, 18.3px) + 1rem);
    line-height: 1;
    background: none;
  }

  /* everything stacks in one column; images go edge to edge */
  .project { flex-direction: column; padding: 6.6vh 0; }
  .project-text { position: static; width: auto; margin: 0 var(--gutter) 1.5rem; }
  .project-media, .project.wide .project-media { width: 100%; }
  .pair { grid-template-columns: 1fr; }
  .pair img { aspect-ratio: auto; }

  .thumbnails, .photos { flex-direction: column; padding: 0 0 6.6vh; }
  .photo-row { display: flex; flex-direction: column; aspect-ratio: auto; }
  .photo-row img { height: auto; }

  .cv-intro { flex-direction: column; padding: 6.6vh 0; }
  .cv-intro .portrait { order: 1; width: 50%; margin: 2rem 0; }
  .cv-intro .bio { width: auto; margin: 0; }
  .cv-intro .contact { order: 2; width: auto; margin: 0; }
  .cv-section { flex-direction: column; padding: 2rem 0; }
  .cv-section > h2, .cv-section > div { width: auto; }
  .cv-section > h2 { margin-bottom: 0.5rem; }

  .site-footer { padding: 110px var(--gutter); }
}
