﻿/* ==========================================================================
   Sections: hero, projects, about, playground, memories, footer
   Every horizontal position/width is expressed in 12-column grid units:
     start of column i   calc(i * var(--pitch))
     n columns wide      calc(n * var(--pitch) - var(--gutter))
   Tablet/desktop (>= 768px) keep the Figma structure and scale with the grid.
   Mobile (< 768px) restacks content on columns 1–10.
   Vertical rhythm stays in px, as in Figma.
   ========================================================================== */

/* Hero ------------------------------------------------------------------- */
.hero__inner {
  /* Mobile: content on columns 1–10 */
  padding: 88px var(--pitch) 48px;
}

.hero__title {
  margin-bottom: -4px;
  font-weight: 400;
  line-height: 1.2;
}

.hero__greeting {
  color: var(--color-grey-1);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: var(--tracking-tight);
}

.hero__name,
.site-footer__name {
  color: var(--color-pink-02);
  font-size: clamp(32px, 3.75cqw, 48px); /* 48px at 1280 */
  white-space: nowrap;
}

.hero__name { letter-spacing: -0.0533em; } /* -2.56px @48 */

/* Shared element between pages; needs a box to be captured */
.hero__name {
  display: inline-block;
  view-transition-name: site-name;
}

.hero__tagline,
.hero__lead,
.hero__caption {
  color: var(--color-grey-1);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: var(--tracking-tight);
}

.hero__lead { margin-top: 48px; }
.hero__break { display: none; }

.hero__contact { margin-top: 48px; }
.hero__figure { margin-top: 48px; }
.hero__image { aspect-ratio: 308 / 234; }
.hero__caption { margin-top: 8px; }
.hero__caption strong { color: var(--color-green-01); }

@media (min-width: 768px) {
  .hero__inner {
    min-height: 480px;
    padding: 104px 0 48px var(--pitch);
  }
  .hero__intro { width: calc(5 * var(--pitch) - var(--gutter)); }   /* cols 1–5 */
  .hero__contact { margin-top: 95px; }
  .hero__figure {                                                    /* cols 9–11 */
    position: absolute;
    top: 152px;
    left: calc(9 * var(--pitch));
    width: calc(3 * var(--pitch) - var(--gutter));
    margin-top: 0;
  }
}

@media (min-width: 1200px) {
  .hero__break { display: inline; }
}

/* Projects --------------------------------------------------------------- */
.project-list {
  --rail-start: var(--pitch);
  margin-top: 32px;
}

.project-list > li { width: calc(9 * var(--pitch) - var(--gutter)); }

@media (min-width: 768px) {
  /* Three cards on columns 0–3, 4–7, 8–11: edge to edge, as in Figma */
  .project-list { --rail-start: 0px; }
  .project-list > li { width: calc(4 * var(--pitch) - var(--gutter)); }
  .project-card__meta { max-width: calc(3 * var(--pitch) - var(--gutter)); }
}

/* About ------------------------------------------------------------------ */
.about {
  display: grid;
  gap: 40px;
  margin-top: 32px;
  padding-inline: var(--pitch);
}

.experience--compact { margin-left: var(--pitch); }

@media (min-width: 768px) {
  .section--about { --footer-gap: 45px; }
  .about {
    /* columns 0 | 1–4 | 5–9 */
    grid-template-columns: var(--pitch) calc(4 * var(--pitch)) calc(5 * var(--pitch) - var(--gutter));
    gap: 0;
    padding-inline: 0;
  }
  .about__skills { grid-area: 1 / 1 / 2 / 3; width: calc(2 * var(--pitch) - var(--gutter)); }
  .about__tools { grid-area: 2 / 2; width: calc(2 * var(--pitch) - var(--gutter)); margin-top: 53px; }
  .about__experiences { grid-area: 1 / 3 / 3 / 4; }
}

/* Playground ------------------------------------------------------------- */
.canvas {
  display: flex;
  flex-direction: column;
  gap: 48px;
  margin-top: 42px;
  padding-block: 48px;
  background: var(--color-canvas);
}

.canvas__item {
  display: flex;
  flex-direction: column;
}

.canvas__frame {
  width: calc(6 * var(--pitch) - var(--gutter));
  margin-left: var(--pitch);
}

.canvas__comment {
  align-self: flex-end;
  width: min(240px, calc(9 * var(--pitch) - var(--gutter)));
  margin-top: -56px;
  margin-right: var(--pitch);
}

@media (min-width: 768px) {
  /* The canvas scales with the grid in both directions (480px tall at 1280),
     so the column-wide frames always fit. Vertical offsets: Figma px / 108. */
  .canvas {
    position: relative;
    display: block;
    width: calc(11 * var(--pitch));                                  /* cols 0–10 */
    height: calc(4.4444 * var(--pitch));
    padding: 0;
    overflow: hidden;
  }
  .canvas__item { display: contents; }
  .canvas__frame,
  .canvas__comment { position: absolute; margin: 0; }
  .canvas__frame { width: calc(2 * var(--pitch) - var(--gutter)); }
  .canvas__comment { width: 240px; }

  /* Frames sit on columns 1–2 and 6–7; comments hang off the frames'
     right edges exactly as offset in Figma (-25px and -46px). */
  .canvas__item--photobook .canvas__frame { top: calc(1.3333 * var(--pitch)); left: var(--pitch); }
  .canvas__item--photobook .canvas__comment { top: calc(2.4352 * var(--pitch)); left: calc(3 * var(--pitch) - var(--gutter) - 25px); }
  .canvas__item--font .canvas__frame { top: calc(0.8889 * var(--pitch)); left: calc(6 * var(--pitch)); }
  .canvas__item--font .canvas__comment { top: calc(0.7593 * var(--pitch)); left: calc(8 * var(--pitch) - var(--gutter) - 46px); }
}

/* Memories --------------------------------------------------------------- */
.memory-list {
  --rail-start: var(--pitch);
  align-items: center;
  margin-top: 48px;
}

.memory-list > .memory { width: calc(5 * var(--pitch) - var(--gutter)); }

@media (min-width: 768px) {
  .section--memories { --footer-gap: 114px; }
  .memory-list { margin-top: 109px; }
  .memory-list > .memory { width: calc(2 * var(--pitch) - var(--gutter)); }
}

/* About page ------------------------------------------------------------- */
/* Three bands: dark intro, light CV, dark handwritten notes. Figma frame is
   1280 wide, so 1 column = 108px (the pitch). Content that Figma sizes to a
   whole number of columns (216, 540, 648) uses n * pitch without the gutter. */

/* Intro: the portrait hangs below the dark band, so it stacks above the CV */
.cv-intro {
  position: relative;
  z-index: 1;
}

.cv-intro__inner { padding: 88px var(--pitch) 48px; }

.cv-intro__title {
  color: var(--color-pink-02);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: var(--tracking-label);
}

.cv-intro__text {
  display: flex;
  flex-direction: column;
  gap: 17px;
  margin-top: 24px;
  font-size: 14px;
  font-weight: 300;
  line-height: normal;
}

.cv-intro__cv { margin-top: 24px; }

.cv-intro__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 48px;
}

.cv-intro__aside .cv-link { max-width: calc(2 * var(--pitch) - var(--gutter)); }

.cv-intro__figure {
  position: relative;
  aspect-ratio: 275 / 367;                                           /* Figma frame: 275 × 367 */
  width: calc(5 * var(--pitch) - var(--gutter));
  overflow: hidden;
}

/* Figma crops the photo to 106.45% × 113.24% of the frame, anchored top left.
   Explicit width/height are needed: the width/height attributes would
   otherwise force the intrinsic 2000px height. */
.cv-intro__image {
  position: absolute;
  top: 0;
  left: 0;
  width: 106.45%;
  height: 113.24%;
}

/* CV: sidebar + staircase of entries */
.cv__inner {
  display: flex;
  flex-direction: column;
  gap: 80px;
  padding: 48px var(--pitch) 80px;
}

.cv__side,
.cv__main,
.cv__more {
  display: flex;
  flex-direction: column;
  gap: 80px;
}

.cv__side .info-block__list { color: var(--color-grey-1); }

/* Notes */
.cv-more__inner { padding: 48px var(--pitch) 80px; }

.cv-more__title {
  color: var(--color-pink-02);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: var(--tracking-label);
}

.cv-more__column,
.cv-more__pair {
  display: flex;
  flex-direction: column;
}

.cv-more__column { gap: 40px; margin-top: 40px; }
.cv-more__pair { gap: 16px; }

.cv-note {
  width: 100%;
  height: auto;
}

/* Figma stretches each note into its own frame; the ratios are the frames' */
.cv-note--norwegian { aspect-ratio: 2391 / 364; }
.cv-note--f1 { aspect-ratio: 2391 / 370; }
.cv-note--strip { aspect-ratio: 2391 / 85; }
.cv-note--tattoos { aspect-ratio: 2391 / 360; }
.cv-note--volleyball { aspect-ratio: 2391 / 597; }
.cv-note--black { aspect-ratio: 2391 / 128; }

@media (min-width: 768px) {
  .cv-intro__inner {
    min-height: 473px;
    padding: 120px 0 48px var(--pitch);
  }
  .cv-intro__text { width: calc(6 * var(--pitch)); }                 /* cols 1–6 */

  .cv-intro__aside {                                                 /* cols 10–11, touches the right edge */
    position: absolute;
    top: 240px;
    left: calc(10 * var(--pitch));
    margin-top: 0;
  }
  .cv-intro__aside .cv-link { max-width: calc(2 * var(--pitch)); }
  .cv-intro__figure { width: calc(2 * var(--pitch) - var(--gutter)); }

  .cv__inner {
    /* columns 0 | 1–3 | 4–9 */
    display: grid;
    grid-template-columns: var(--pitch) calc(3 * var(--pitch)) calc(6 * var(--pitch));
    gap: 0;
    padding: 80px 0;
  }
  .cv__side { grid-column: 2; width: calc(2 * var(--pitch)); }       /* cols 1–2 */
  .cv__main { grid-column: 3; }
  .cv__main > .info-block { width: calc(5 * var(--pitch)); }         /* cols 4–8 */
  .cv__more {
    width: calc(5 * var(--pitch));                                   /* cols 5–9, one column in */
    margin-left: var(--pitch);
  }

  .cv-more__inner {
    position: relative;
    min-height: 530px;
    padding: 80px 0 0 var(--pitch);
  }
  .cv-more__column {
    position: absolute;
    margin-top: 0;
    width: calc(4 * var(--pitch) - var(--gutter));
  }
  .cv-more__column--first { top: 147px; left: var(--pitch); }        /* col 1 */
  .cv-more__column--second { top: 284px; left: calc(6 * var(--pitch)); } /* col 6 */
}
/* Footer ----------------------------------------------------------------- */
.site-footer { background: var(--color-dark); }
.site-footer--light { background: var(--color-page); }
.site-footer--light .grid-lines { --line-color: var(--color-line); }

.site-footer__inner {
  padding: 48px var(--pitch);
  overflow: hidden;
}

.site-footer__name {
  line-height: 1.2;
  letter-spacing: var(--tracking-tight);
}

.site-footer__contact { margin-top: 32px; }

@media (min-width: 768px) {
  .site-footer__inner {
    min-height: 278px;
    padding: 48px 0 0;
  }
  .site-footer__contact {
    margin-top: 48px;
    margin-left: calc(4 * var(--pitch));                             /* col 4 */
  }
  .site-footer--col-3 .site-footer__contact { margin-left: calc(3 * var(--pitch)); } /* Figma 1728 frame: col 3 */
}

/* Board pages (memories, playground) -------------------------------------------------------- */
/* Figma frame is 1728 wide: x maps to 12-column units (--x), y to px at that
   width (--y) divided by the 1728 pitch (145.33px) so the board scales with
   the grid like the playground canvas. */
.board-page { background: var(--color-canvas); }
.board-page--memories { --board-h: 2331; }
.board-page--playground { --board-h: 1115; }

.board-page__header { padding: 24px var(--pitch) 0; }

.board-page__name {
  color: var(--color-pink-02);
  font-size: clamp(32px, 3.75cqw, 48px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: var(--tracking-tight);
  white-space: nowrap;
  view-transition-name: site-name;
  display: inline-block;
}

.board {
  display: flex;
  flex-direction: column;
  gap: 48px;
  padding: 64px var(--pitch) 80px;
}

.board-card { width: calc(8 * var(--pitch) - var(--gutter)); }

.board-card__image {
  width: 100%;
  aspect-ratio: var(--ar);
  object-fit: cover;
}

.board-card__image--genderex { object-position: 50% 46.5%; }   /* Figma crop: -100px of 215px overflow */
.board-card__image--placeholder { background: var(--color-dark-surface); }

.board-card figcaption {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.board-card__title {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: var(--tracking-label);
}

.board-card__date {
  color: var(--color-grey-1);
  font-size: 14px;
  line-height: 1.2;
}

@media (min-width: 768px) {
  .board-page__header { padding: 24px 0 0 var(--pitch); }

  /* Cards position against .board-page (the .container), so --y counts from the page top */
  .board-page { min-height: calc(var(--board-h) / 145.3333 * var(--pitch)); }
  .board { display: block; padding: 0; }

  .board-card {
    position: absolute;
    top: calc(var(--y) / 145.3333 * var(--pitch));
    left: calc(var(--x) * var(--pitch));
    width: calc(var(--w) * var(--pitch) - var(--gutter));
  }
}
