/* ---------- Basics ---------- */
:root {
  --text: #000;
  --muted: #616161;
  --bg: #fff;
  --pad: 26px;
  --name-size: clamp(22px, 2.55vw, 46px);
  --nav-size: clamp(17px, 1.25vw, 22px);
  --body-size: clamp(17px, 1.3vw, 22px);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden; /* on desktop each pane scrolls on its own */
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, p { margin: 0; }

/* ---------- Two sections: text (68.75%) + images (31.25%, i.e. 25% wider than 25%) ---------- */
.split {
  display: grid;
  grid-template-columns: 68.75fr 31.25fr;
  height: 100vh;
  height: 100dvh;
}
.split.no-images { grid-template-columns: 1fr; }

.pane-text {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 22px var(--pad) var(--pad);
  overflow-y: auto;
  scrollbar-width: thin;
}

/* Name top left, links top right */
.site-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex: none;
}

.name {
  display: flex;
  flex-direction: column;
  font-size: var(--name-size);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.83;
}
.name span { display: inline-block; }

.nav { display: flex; gap: 33px; }
.nav a {
  font-size: var(--nav-size);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.3;
  transition: opacity 0.2s ease;
}
.nav a:hover { opacity: 0.6; }
/* The page you're on is a touch lighter */
.nav a[aria-current="page"] { color: #707070; }

.menu-btn { display: none; }

/* Text sits at the bottom left of the section */
.pane-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-top: 56px;
}

.blurb {
  max-width: 34em;
  font-size: var(--body-size);
  font-weight: 300;
  line-height: 1.4;
  letter-spacing: -0.02em;
}

.blurb strong { font-weight: 700; }
.blurb a {
  text-decoration: underline;
  text-decoration-thickness: 0.05em;
  text-underline-offset: 0.15em;
  transition: color 0.2s ease;
}
.blurb a:hover { color: #8a8a8a; }

/* ---------- Image section: vertical carousel, no padding ---------- */
.pane-media { position: relative; min-height: 0; overflow: hidden; }

/* Round chevron buttons floating at the top and bottom of the column (main.js wires them up) */
.scroll-btn {
  position: absolute;
  left: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-left: -22px;
  padding: 0;
  border-radius: 50%;
  /* frosted glass: see-through white, blurred and slightly brightened behind, with a faint rim */
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  color: #111;
  cursor: pointer;
  transition: opacity 0.25s ease, background 0.2s ease;
}
.scroll-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.scroll-btn:hover { background: rgba(255, 255, 255, 0.62); }
.scroll-btn:focus-visible { outline: 2px solid #111; outline-offset: 2px; }
.scroll-btn.up { top: 16px; }
.scroll-btn.down { bottom: 16px; }
/* an arrow fades out when there's nowhere further to go */
.scroll-btn.off { opacity: 0; pointer-events: none; }

/* Freeform: wheel, touch and mouse-drag (main.js) scroll it and it stops wherever you stop */
.pane-images {
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  overscroll-behavior: contain;
  cursor: grab;
  background: #e1e1e1;
}
.pane-images::-webkit-scrollbar { display: none; }
.pane-images.dragging { cursor: grabbing; user-select: none; }

.tile {
  position: relative;
  margin: 0;
}
.tile img { width: 100%; height: auto; -webkit-user-drag: none; }
/* Project pictures are cropped square so the column keeps an even rhythm */
.tile-square img { aspect-ratio: 1; object-fit: cover; }

/* Stand-in for photos still to come */
.tile-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  background: #d6d6d6;
  color: #9a9a9a;
  font-size: 13px;
  letter-spacing: 0.02em;
}

/* Small print in the bottom-left corner of a picture */
.disclaimer {
  position: absolute;
  left: 14px;
  bottom: 12px;
  max-width: calc(100% - 28px);
  font-size: clamp(10px, 0.75vw, 12px);
  color: #6e6e6e;
  letter-spacing: -0.005em;
  line-height: 1.3;
  pointer-events: none;
}

/* ---------- About ---------- */
/* Intro under the name on the left, work experience on the right, all in one screen.
   Sizes also scale with viewport height so it fits without scrolling. */
.about-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 4vw;
  align-content: start;
  padding-top: clamp(32px, 6vh, 56px);
  padding-bottom: 0;
}

.about-intro p {
  max-width: 19em;
  text-wrap: balance; /* evens out the lines so the last one is never a lone word */
  font-size: clamp(20px, min(1.9vw, 3.2vh), 32px);
  font-weight: 300;
  line-height: 1.3;
  letter-spacing: -0.03em;
}
.about-intro p strong { font-weight: 800; }

/* Laid out like the resume: big heading; bold title left + bold date right; light grey
   organisation line under it; paragraphs with bold key phrases */
.experience h2 {
  margin-bottom: clamp(12px, 2.4vh, 24px);
  font-size: clamp(26px, min(2.6vw, 4.2vh), 46px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}
.entry { margin-bottom: clamp(14px, 2.7vh, 34px); }
.entry:last-child { margin-bottom: 0; }
.entry-head,
.entry-sub { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.entry-head {
  font-size: clamp(15px, 2.1vh, 22px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.entry-sub {
  margin-bottom: clamp(7px, 1.2vh, 12px);
  color: #a0a0a0;
  font-weight: 400;
  font-size: clamp(11.5px, 1.5vh, 15px);
  line-height: 1.25;
}
.entry p {
  font-weight: 300;
  font-size: clamp(12.5px, 1.65vh, 17px);
  line-height: 1.35;
}
.entry p strong { font-weight: 700; }
/* a blank line between paragraphs, as on the resume */
.entry p + p { margin-top: 0.8em; }

/* ---------- 404 ---------- */
.not-found { justify-content: center; padding-top: 0; }
.not-found h1 {
  font-size: clamp(44px, 5.1vw, 92px);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 0.95;
  margin-bottom: 24px;
}
.not-found p { font-size: 22px; font-weight: 300; }
.not-found a { text-decoration: underline; }

/* ---------- Phones: sections stack, images run full width below the text ---------- */
@media (max-width: 720px) {
  :root { --pad: 18px; --name-size: 23px; --nav-size: 22px; }

  body { overflow: auto; }

  .split { display: block; height: auto; }

  .pane-text { overflow: visible; padding: 14px var(--pad) 40px; }
  .site-header { align-items: stretch; }

  .pane-body { padding-top: 64px; }

  .menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    aspect-ratio: 1;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
  }
  .menu-btn span {
    display: block;
    width: 26px;
    height: 2px;
    background: var(--text);
    transition: transform 0.25s ease, opacity 0.25s ease;
  }
  .menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: calc(-1 * var(--pad));
    right: calc(-1 * var(--pad));
    z-index: 5;
    flex-direction: column;
    gap: 0;
    padding: 8px var(--pad) 24px;
    background: var(--bg);
  }
  .nav.open { display: flex; }
  .nav a { font-size: 28px; padding: 8px 0; }

  .pane-media { overflow: visible; }
  .pane-images { height: auto; overflow: visible; cursor: auto; }
  .scroll-btn { display: none; }

  /* About: intro then experience, one under the other */
  .about-body { display: flex; flex-direction: column; gap: 48px; padding-top: 64px; }
  .about-intro p { font-size: 22px; }
  .experience h2 { font-size: 24px; margin-bottom: 20px; }
  .entry { margin-bottom: 32px; }
  .entry-head { font-size: 16px; }
  .entry-sub { font-size: 15px; }
  .entry p { font-size: 16px; }
}
