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

:root {
  --color-bg: #ffffff;
  --color-text: #000000;
  --color-heading: #2527D2;
  --color-border: #2527D2;
  --color-border-subtle: #fafafa;
  --color-btn-bg: #ffffff;
  --color-btn-text: #2527D2;
  --color-highlight-text: #0709A2;
  --color-link: #000000;

  --cols: 12;
  --col-width: calc(100% / var(--cols)); 

  --font-body: 'SuisseScreen', sans-serif;
  --font-ui: 'SuisseScreen', sans-serif;

  --max-w: 1200px;
  --body-text-max-width: 60ch;
  --body-text: clamp(1rem, 2.2vw, 1.2rem);
  --link-size: clamp(1rem, 1.0vw, 1.1rem);

  --shadow-cards:    0 4px 24px rgba(0,0,0,0.4),
                    inset 0 1px 0 rgba(255,255,255,0.8);
  --shadow:    none;
}

html, body {
  height: 100%;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
}



.nav-submenu a {
  color: var(--color-link);
  text-decoration: underline;
  cursor: pointer;
}

.nav-section a {
  color: var(--color-text);
  text-decoration: none;
  cursor: pointer;
}



a:hover {
  opacity: 0.65;
}

/* =============================================
   PAGE WRAPPER
   ============================================= */
.page {
  max-width: var(--max-w);
  min-height: 100vh;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  padding: 0 24px;
  margin: 0 auto;
}

.index-page .page-margin {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

.index-page .canvas {
  width: 100%;
  height: 100%;
  max-height: 1000px;
}

/* =============================================
   MAIN NAV — full width sticky, col 1–12
   ============================================= */

.main-nav {
  grid-column: 1 / 13;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  padding-top: 28px;
}
 
/* ---- Nav sections ---- */
.nav-section {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
 
/* Projects label + links 01–03 → col 1–3 */
.nav-section--projects  { grid-column: 1 / 4; }

#projects-toggle[aria-expanded="true"] {
  color: var(--color-heading);
}
 
/* Thesis → col 9–10 */
.nav-section--thesis    { grid-column: 9 / 11; }
 
/* About me → col 11–12, right-aligned */
.nav-section--about     { grid-column: 11 / 13; justify-self: end; text-align: right; }
.nav-section--about .nav-btn { align-self: flex-end; }
 
.nav-submenu {
  grid-column: 1 / 8;
  display: none;
  gap: 0;
  padding-top: 8px;
  grid-template-columns: repeat(2, auto);
  column-gap: calc(2 * var(--col-width));
}

@media (max-width: 700px) {
  .nav-submenu {
      grid-column: 1 / 13;
      grid-template-columns: 1fr;
  }
  .nav-section--projects {
    grid-column: 1 / 4;
  }
  .nav-section--thesis {
    grid-column: 5 / 9;
    justify-self: center;
    text-align: center
  }
  .nav-section--about{
    grid-column: 9 / 13;
  }
}

.nav-submenu.is-open {
  display: grid;
}

.nav-section__links--col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
 
.nav-section__links li a {
  font-size: var(--link-size);
  text-decoration: underline;
}
 
/* ---- Buttons row (below the links) ---- */
.nav-buttons {
  grid-column: 1 / 13;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  padding-top: 16px;
  padding-bottom: 16px;
}

.page-buttons {
  position: sticky;
  top: 32px;
  z-index: 99;
  margin-top: 8px;
}
 
/* Plain button (no border/background) — default */
.nav-btn {
  padding: 0;
  border: none;
  background: none;
  color: var(--color-text);
  font-family: var(--font-ui);
  font-size: var(--link-size);
  font-weight: bold;
  cursor: pointer;
  width: fit-content;
}
 
.nav-btn:hover {
  opacity: 0.65;
}

.page-nav {
  margin-top: 40px;
  grid-column: 1 / 13;
  position: sticky;
  top: 32px;
}

/* Bordered button variant */
.nav-btn--bordered {
  font-size: var(--body-text);  
  color: var(--color-highlight-text);
  padding: 8px 14px;
  border: 1.5px solid var(--color-border);
  background: var(--color-btn-bg);
  text-decoration: none;
  box-shadow: var(--shadow);
  font-weight: 550;
}
 
.nav-btn--bordered:hover {
  opacity: 1;
  background: var(--color-btn-text);
  color: #fff;
}
.nav-btn--title { grid-column: 1 / 10; }
.nav-btn--close { grid-column: 11 / 13; justify-self: end; }

/* =============================================
   MAIN CONTENT
   ============================================= */
main {
  grid-column: 1 / 13;}

.content {
  grid-column: 1 / 13;
  padding: 48px 0 80px 0;
}

.index_grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 32px;
  width: 100%;
  margin-top: 80px;
}

.index_left {
  grid-column: span 6;
}

.index_right {
  grid-column: span 6;
}

/* Text starts at col 4, matching Projects nav position */
.content__inner {
  grid-column: 1 / 13;
  max-width: var(--body-text-max-width);
}
.content__inner_section {
  margin-bottom: 120px;
}

h1 {
  font-family: var(--font-ui);
  font-size: 40px;
  font-weight: bold;
  line-height: 1.1;
  color: var(--color-highlight-text);
  margin-bottom: 40px;
}
 
h2 {
  font-family: var(--font-ui);
  font-size: 24px;
  font-weight: bold;
  line-height: 1.2;
  margin: 56px 0 12px 0;
}

h3 {
  font-family: var(--font-ui);
  font-size: var(--body-text);  
  font-weight: bold;
  line-height: 1.3;
  margin: 40px 0 0 0;
}

p {
  margin-bottom: 16px;
  font-size: var(--body-text);

}

.card h3 {
  font-family: var(--font-ui);
  font-size: var(--body-text);  
  font-weight: bold;
  line-height: 1.3;
  color: var(--color-highlight-text);
}

.card p {
  font-size: 9px;  
  font-weight: 550;
  line-height: 1.7;
  color: var(--color-text);
}

.content__inner.narrator {
  color: var(--color-highlight-text);
}

.canvas {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  height: 100%;
  position: relative;
}

.canvas-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 2;
  max-width: 360px;
}

.canvas-cell {
  position: relative;
}

.canvas-cell .card {
  position: absolute;
}

.index-page .canvas {
  width: 100%;
  max-width: none;
}

.canvas-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}


.card {
  z-index: 1; /* cards sit above the lines */
}
/* =============================================
   FLOAT IMAGES
   Wrap the image + surrounding paragraphs in a
   .clearfix div so floats are contained.
   ============================================= */
.float-img {
  max-width: calc(6 * var(--col-width));
  height: auto;
  max-height: 80vh;
  filter: var(--shadow);
}

.float-img-horizontal {
  max-width: var(--body-text-max-width);
}

video.float-img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
 
.float-img--right {
  display: block;
  float: right;
  margin: 4px 0 24px 32px;
}
 
.float-img--left {
    display: block;
  float: left;
  margin: 4px 32px 24px 0;
}

@media (max-width: 700px) {
  .float-img,
  .float-img--right,
  .float-img--left {
    float: none;
width: min(100%, var(--body-text-max-width));
      max-height: 50vh;
    height: auto;
    max-width: var(--body-text-max-width);
    margin: 0 auto 24px 0;
    object-fit: contain;   /* or 'cover' to fill + crop */
    aspect-ratio: auto;    /* honours the image's intrinsic ratio */
  }
}

.float-text {
  display: block;
  height: auto;
  padding: 24px;
  box-shadow: var(--shadow);
}

.float-text--right {
  float: right;
  width: 100%;
  max-width: var(--body-text-max-width);
  margin: 4px 0 24px 100%;

}

.float-text--left {
  float: left;
  width: calc(5 * var(--col-width));
  margin: 4px 32px 24px 0;
}
 
.canvas-cell .float-text {
  max-width: 200px;
  max-height: 500px;
  margin: 4px 4px 4px 4px;
}
/* Clears floats so the next section starts clean */
.test::after {
  content: '';
  display: table;
  clear: both;
}
/* =============================================
   UTILITY
   ============================================= */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

.index-page h1{
  font-size: clamp(2.4rem, 4vw, 2.8rem);
  color: var(--color-text);
  line-height: 1.15;
  margin: 0;
  text-align: center;
  margin-bottom: 16px;
}

.index-page h2{
  font-size: clamp(1.1rem, 2.5vw, 0.8rem);
  color: var(--color-heading);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
}

.index-page h3{
  font-size: clamp(1.2rem, 2.5vw, 0.9rem);
  color: var(--color-heading);
  line-height: 1.15;
  margin: 0;
}

.index-page p{
  font-size: 0.6rem;
  line-height: 1.4;
  color: var(--color-text);
  font-weight: 500;
  text-align: center;
}

.canvas-center p{
  font-size: clamp(1.0rem, 2.5vw, 1.2rem);
  color: var(--color-text);
  line-height: 1.15;
  margin: 0;
}

.card-field {
  position: relative;
  height: 40vh; /* tune to your content */
  width: 100%;
}

.card {
  position: absolute; /* already set */
  /* make sure this is also present: */
  position: relative; /* ← needed for the link's inset: 0 to work */
}

/* Image card wrapper */
.card-wrapper {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card-wrapper .card {
  pointer-events: auto;
}

.card--headline{
  display: inline-block;
  width: fit-content;
  box-shadow: var(--shadow-cards);
  padding: 8px 12px;
  background-color: #fff;
}

.card--text{
  box-shadow: var(--shadow-cards);
  padding: 8px 12px;
  background-color: #fff;
  max-width: 30%;
}

.card--image {
  max-width: 80%;
  overflow: hidden;
  background: none;
  border: none;
  filter: var(--shadow);
}

.card--image img {
  width: 100%;
  height: auto;   
  max-height: 25vh;
  object-fit: contain;
  display: block;
}

.card-headline {
  width: 100%;
  text-align: center;
  font-size: var(--body-text);
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.card-wrapper--headline-top {
  justify-content: flex-start;
}
.card-wrapper--headline-top .card-headline {
  order: -1;
  margin-bottom: 12px;
}
.card-wrapper--headline-bottom {
  justify-content: flex-end;
}
.card-wrapper--headline-bottom .card-headline {
  order: 1;
  margin-top: 12px;
}


.card-link {
  position: absolute;
  inset: 0;          /* stretches to all four edges */
  width: 100%;
  height: 100%;
  z-index: 2;        /* above card content */
}

@media (max-width: 700px) {
  .index-page .page-margin {
    max-width: none;
    padding: 0;
    max-height: none;
  }

  .canvas {
    display: flex;
    flex-direction: column;
    height: auto;
  }

  .index-page .canvas {
  max-height: none;
  }

  .canvas-center {
    position: static;
    transform: none;
    max-width: none;
    text-align: center;
    padding: 0 0 40px 0;
    width: 100%;
  }

  .canvas-cell {
    position: relative;
    height: 300px; /* enough room for overlapping cards */
    width: 100%;
  }

  /* cards keep position: absolute so they can overlap */
  .canvas-cell .card {
    position: absolute;
  }
    .canvas-cell {
    height: auto; /* let JS set it */
    overflow: visible;
    margin-bottom: 48px;
  }
  .card--image img {
    max-height: 35vh;
  }
  .index-page h1{
  font-size: 48px;
  color: var(--color-text);
  line-height: 1.15;
  margin: 0;
  text-align: left;
  margin-bottom: 16px;
  }
  .index-page p{
    font-size: 1rem;
    line-height: 1.4;
    color: var(--color-text);
    font-weight: 500;
    text-align: left;
  }
}