* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Size of ALL text on the page: 1 = original sizes, 2 = double, 1.5 = one and a half */
:root {
  --text-scale: 2;
  /* Hover "pop": how far buttons, nav links and skills lift up when hovered (all the same) */
  --hover-lift: 1px;
}

body {
  /* Helvetica everywhere; Arial is the stand-in on computers without Helvetica (most Windows PCs) */
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: #000000;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- Background ---------- */
/* Lavender page with big soft green glows. The glows sit on one tall layer that slides
   up SLOWER than the page as you scroll, so they drift past gently behind the content.
   The browser moves it by itself (no script) and never has to repaint it. */
html {
  /* --- Settings --- */
  --lavender: #c4b2fb;           /* base colour of the page */
  --lime: #86ff00;               /* bright green glows */
  --green: #a8e05a;              /* softer green glows */

  min-height: 100%;
  background-color: var(--lavender);
}

#background {
  /* --- Settings --- */
  --bg-travel: 300vh;            /* how far the glows move over the whole page scroll
                                    (lower = slower / less movement, 0 = standing still) */

  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100vh + var(--bg-travel));   /* one screen + the distance it travels */
  z-index: -1;
  pointer-events: none;
  /* One line per glow:  size (wide tall)  at  across  down-the-layer,  colour, fades out by
     Fade-out: lower % = smaller, tighter glow; higher % = bigger, softer glow */
  background-image:
    radial-gradient(65vmax 55vmax at 80% 8%,  var(--lime),  transparent 70%),
    radial-gradient(70vmax 60vmax at 15% 30%, var(--green), transparent 75%),
    radial-gradient(65vmax 55vmax at 85% 52%, var(--lime),  transparent 70%),
    radial-gradient(70vmax 60vmax at 20% 74%, var(--green), transparent 75%),
    radial-gradient(65vmax 55vmax at 75% 94%, var(--lime),  transparent 70%);
}

/* Scroll-driven: top of the page = layer at its start, bottom of the page = moved up by --bg-travel.
   Browsers without this feature simply show the glows standing still. */
@supports (animation-timeline: scroll()) {
  #background {
    animation-name: bg-drift;
    animation-duration: auto;
    animation-timing-function: linear;
    animation-fill-mode: both;
    animation-timeline: scroll(root);
  }
}

@keyframes bg-drift {
  to { transform: translateY(calc(-1 * var(--bg-travel))); }
}

/* "Reduce motion" setting: keep the glows still */
@media (prefers-reduced-motion: reduce) {
  #background { animation: none; }
}

/* ---------- Navigation box (Home, Projects, Info, Contact) ---------- */
#nav {
  /* --- Settings --- */
  --nav-x: 24px;                 /* distance from the RIGHT edge of the screen */
  --nav-y: 20px;                 /* distance from the top of the screen */
  --nav-opacity: 0.25;           /* glass tint: 0 = clear glass, 1 = solid */
  --nav-color: 255, 255, 255;    /* glass tint colour as R, G, B (white) */
  --nav-blur: 16px;              /* how blurry everything behind the box looks */
  --nav-gap: 24px;               /* space between the links */
  --nav-radius: 999px;           /* corner roundness: 999px = fully rounded pill, 0 = square */
  --nav-text: #000000;           /* link colour */
  --nav-hover: #86ff00;          /* link colour on hover: the lime from the background (softer green: #a8e05a) */

  position: fixed;
  right: var(--nav-x);
  top: var(--nav-y);
  z-index: 10;
  display: flex;
  gap: var(--nav-gap);
  padding: 16px 24px;            /* space between the links and the box edge */
  border-radius: var(--nav-radius);

  /* Frosted, matte glass */
  background: rgba(var(--nav-color), var(--nav-opacity));
  -webkit-backdrop-filter: blur(var(--nav-blur)) saturate(120%);   /* Safari */
  backdrop-filter: blur(var(--nav-blur)) saturate(120%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);                      /* gentle lift, no shine */
}

#nav a {
  color: var(--nav-text);
  font-weight: 700;
  font-size: calc(14px * var(--text-scale));
  text-transform: uppercase;
  display: inline-block;         /* needed so the link can move on click */
  transition: color 0.2s ease, transform 0.2s ease;   /* fade the colour, smooth lift */
}

#nav a:hover,
#nav a:focus-visible {           /* focus-visible: same effect for keyboard users */
  color: var(--nav-hover);
  transform: translateY(calc(-1 * var(--hover-lift)));   /* pops up, like the buttons */
}

/* Click effect: the text presses down 2px while the mouse button is held, then springs back */
#nav a:active {
  transform: translateY(2px);
  transition-duration: 0.08s;    /* quick press */
}

/* ---------- Shared section ---------- */
.section {
  position: relative;
  min-height: 100vh;
  padding: 80px 24px;
}

/* ---------- Landing ---------- */
#landing {
  isolation: isolate;            /* keeps the video behind the text but above the page background */
  overflow: hidden;
}

#landing-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;             /* fill the screen, cropping the edges if needed */
  z-index: -1;
}

/* Name is hidden from view but still read by search engines and screen readers */
#title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

#scroll-hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 700;
  font-size: calc(14px * var(--text-scale));
  text-transform: uppercase;
}

/* ---------- Logo bar (under the landing page) ---------- */
#logo-bar {
  /* --- Settings --- */
  --logo-height: 48px;           /* size of the logos (each logo's --s in index.html scales it to look balanced) */
  --logo-gap: 140px;             /* space between logos */
  --logo-bar-padding: 28px;      /* space above and below the logos */
  --logo-bar-bg: rgba(0, 0, 0, 0.55);   /* band colour: dark see-through so the white logos stand out */
  --logo-speed: 30s;             /* time for one full loop (higher = slower) */

  overflow: hidden;
  padding: var(--logo-bar-padding) 0;
  background: var(--logo-bar-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  /* Not interactive: just a stand-alone animation. The mouse goes straight through it
     (no hover pause, no picking up / highlighting / right-clicking the logos) */
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

.logo-track {
  display: flex;
  width: max-content;
  animation: logo-scroll var(--logo-speed) linear infinite;
}

.logo-set {
  display: flex;
  align-items: center;
  gap: var(--logo-gap);
  padding-right: var(--logo-gap);   /* same space between the end of one set and the next */
}

.logo-set img {
  display: block;
  height: calc(var(--logo-height) * var(--s, 1));
  width: auto;
}

/* Moves the strip left by exactly one set of logos, then repeats seamlessly.
   --set-width is measured by script.js, which also adds enough copies to fill the screen */
@keyframes logo-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-1 * var(--set-width, 50%))); }
}

/* "Reduce motion" setting: keep the logos still */
@media (prefers-reduced-motion: reduce) {
  .logo-track { animation: none; }
}

/* ---------- Projects ---------- */
.project {
  display: flex;
  align-items: center;
  gap: 40px;
}

.project-number {
  position: absolute;
  top: 80px;
  left: 24px;
  font-size: calc(14px * var(--text-scale));
  font-weight: 700;
}

/* Horizontal slider */
.project-media {
  flex: 1.4;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Strip layout: GIFs in a full-width row, text underneath */
.project--strip {
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
}

.project--strip .project-media {
  flex: none;
  width: auto;
  margin: 0 -24px;               /* run edge to edge past the section padding */
}

/* Space between each project's text and its footage */
.project--strip {
  gap: 12px;
}

/* Push each project's text + footage down together; the bottom margin
   keeps it from running into the next project */
.project--strip {
  /* Was 340px. The gap you see between projects = this margin + the empty space
     inside each full-screen section (which grows with screen height).
     This formula shrinks that total gap by 20% twice (to ~64% of the original) on any screen;
     max() stops it going negative on very tall screens. */
  margin-bottom: max(0px, calc(265px - 18vh));
}

.project--strip > * {
  position: relative;
  top: 180px;
}

/* ---------- Project text box (number, title, description) ----------
   Sits above the footage. flex: none stops the box stretching to fill the
   section, which was what left a big empty gap above the footage.
   --text-down: extra distance to move ONLY the text down, on its own
   (raise it to move the text lower; past ~12px it starts covering the footage). */
.project--strip .project-text {
  --text-down: 0px;
  order: -1;
  flex: none;
  top: calc(180px + var(--text-down));
}

/* Number, title and description sit together */
.project--strip .project-number {
  position: static;
  margin-bottom: 8px;
}

.slider {
  display: flex;
  gap: 16px;
  padding: 40px 24px;            /* vertical room so the slide shadows aren't clipped */
  margin: -40px 0;               /* cancel that room so the layout doesn't shift */
  overflow-x: auto;
  scrollbar-width: none;         /* hide scrollbar (Firefox) */
}

.slider::-webkit-scrollbar {
  display: none;                 /* hide scrollbar (Chrome/Edge) */
}

/* Grab and drag with the mouse (script.js): open hand over a row, closed hand while dragging */
.slider {
  cursor: grab;
  -webkit-user-select: none;     /* no text highlighting while dragging */
  user-select: none;
}

.slider.is-dragging {
  cursor: grabbing;
}

.slide {
  flex: 0 0 auto;
  height: 50vh;
  aspect-ratio: 5 / 3;           /* placeholder shape; script.js sets each frame to its footage's real shape */
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.30);
}

.slide img,
.slide video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-text {
  flex: 1;
}

.project-title {
  font-size: calc(48px * var(--text-scale));
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.project-desc {
  font-size: calc(20px * var(--text-scale));
  line-height: 1.5;
  /* Wide enough that a ~250-character description fits on about 2 lines
     (was 400px = 5 lines). Lower it for more, shorter lines */
  max-width: 1300px;
}

/* ---------- About blocks: "What I do" and "Work experience" ----------
   Shared layout: small label on the left, list on the right half,
   thin divider lines. Each block has its own settings below. */
.about-block {
  /* --- Shared settings --- */
  --about-text: #000000;               /* main text colour */
  --about-muted: rgba(0, 0, 0, 0.45);  /* the softer (grey) text colour */
  --about-line: rgba(0, 0, 0, 0.15);   /* divider line colour */
  --about-font: inherit;               /* same Helvetica as the rest of the page */
  --about-scale: 0.7;                  /* overall text size of both blocks: 1 = full size, 0.7 = 30% smaller */

  display: grid;
  grid-template-columns: 1fr 1fr;      /* label left half, list right half */
  column-gap: 40px;
  margin: 0 6vw;                       /* side margins */
  padding: 3vh 0 6vh;                  /* space above / below each block, scales with the screen */
  border-top: 1px solid var(--about-line);
  color: var(--about-text);
  font-family: var(--about-font);
}

.about-label {
  font-size: calc(clamp(14px, min(1.2vw, 2vh), 24px) * var(--about-scale) * var(--text-scale));
  font-weight: 700;
}

.about-block ul {
  list-style: none;
}

.about-block li {
  border-bottom: 1px solid var(--about-line);
}

/* ----- What I do: big uppercase skills, grey until hovered ----- */
#what-i-do {
  /* --- Settings --- */
  /* skill text size: grows with the screen (whichever of width/height is tighter),
     never smaller than 34px or bigger than 120px */
  --skill-size: clamp(34px, min(4.5vw, 6vh), 120px);
  --skill-text-opacity: 0.45;    /* how light the skills are until hovered (1 = full black) */
  --skill-bold: 5px;             /* how much thicker the letters get on hover (0 = no change) */
  --skill-bar: #86ff00;          /* hover bar colour: the lime from the background */
  --skill-bar-opacity: 0.6;      /* how solid the bar is (1 = solid, 0.3 = very see-through) */
  --skill-bar-pad: 6px;          /* how far the bar reaches past the row on the LEFT and RIGHT
                                    (top and bottom always fit the row, between the divider lines) */
  --skill-bar-glow: 8px;         /* soft glow around the bar's edges (0 = sharp edges) */
  --skill-glow-in: 0.2s;         /* time for the bar to appear when you hover a skill */
  --skill-glow-out: 0.4s;        /* time for the bar to fade away when you move off it (was 0.8s) */
}

.skills-list li {
  position: relative;            /* the hover bar is placed against this row */
  isolation: isolate;            /* keeps the bar behind this row's text */
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  /* the 0.6 makes the skills 40% smaller than the rest of the doubled text */
  font-size: calc(var(--skill-size) * var(--about-scale) * var(--text-scale) * 0.6);
  text-transform: uppercase;
  line-height: 1.2;
}

/* The hover bar: sits behind the text, exactly the row's height, a little wider on the sides.
   Hidden until hovered; fades as one piece (bar + glow together). Fade-OUT speed: */
.skills-list li::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(-1 * var(--skill-bar-pad));
  right: calc(-1 * var(--skill-bar-pad));
  z-index: -1;
  background: var(--skill-bar);
  box-shadow: 0 0 var(--skill-bar-glow) var(--skill-bar);
  opacity: 0;
  pointer-events: none;          /* the hover area stays the row itself, no overlap */
  transition: opacity var(--skill-glow-out) ease-out;
}

/* The skill's text: grey (solid black faded with opacity) until hovered.
   On hover it turns black, gets bolder and lifts (only the words move, not the divider line).
   Bolder = an outline of --skill-bold around the letters, hidden (see-through) until hovered;
   it sits behind the letters, so they only grow outward and the word doesn't shift */
.skills-list li span {
  display: inline-block;
  opacity: var(--skill-text-opacity);
  -webkit-text-stroke: var(--skill-bold) transparent;
  paint-order: stroke fill;
  /* Moving off: the text goes straight back to grey and normal weight (no fade);
     only the bar fades out */
  transition: transform 0.2s ease;
}

.skills-list li:hover span {
  opacity: 1;                                              /* solid black */
  -webkit-text-stroke-color: var(--about-text);           /* bolder */
  transform: translateY(calc(-1 * var(--hover-lift)));   /* pops up, like the buttons */
  /* black and bold straight away (no fade); only the bar fades in */
}

/* Hover a skill: the whole row lights up as a glowing bar, like a selected layer in Photoshop
   (the title "What I do" stays as is) */
.skills-list li:hover::before {
  opacity: var(--skill-bar-opacity);
  transition-duration: var(--skill-glow-in);   /* fade-IN speed */
}

/* ----- Work experience: role / company / years in three columns ----- */
#work-experience {
  /* --- Settings --- */
  --exp-size: clamp(14px, min(1.4vw, 2.4vh), 28px);   /* text size, grows with the screen */
  margin-top: 2vh;
}

.experience-list li {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 8px 0;
  font-size: calc(var(--exp-size) * var(--about-scale) * var(--text-scale));
  font-weight: 700;
}

.exp-role {
  color: var(--about-muted);
}

/* ---------- Info / Credits ---------- */
#info {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

#info-title {
  font-size: calc(12vw * var(--text-scale) * 0.6 - 10px);   /* 0.6 = 40% smaller; "- 10px" = 10px smaller on screen */
  font-weight: 900;
  text-transform: uppercase;
  line-height: 0.9;
  margin-bottom: 60px;
}

/* Text box under the Info title */
#info-text {
  /* --- Settings --- */
  --info-text-size: 25px;        /* text size (before the page-wide --text-scale); was 20px, +5px here = +10px on screen */
  --info-text-width: 900px;      /* how wide the box can get before the text wraps (was 800px) */

  max-width: var(--info-text-width);
  margin-bottom: 60px;           /* space before the contact buttons */
  font-size: calc(var(--info-text-size) * var(--text-scale));
  line-height: 1.5;
}

/* Holder for the contact button row */
.info-columns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  /* The button row may use the whole width, so all four buttons fit on one line
     (the right half alone was too narrow at double text size, so Behance wrapped).
     The buttons stay right-aligned, so only the row's left end moves */
  margin-left: 0;
  /* Right edge lines up with the right edge of those lists (6vw from the screen edge) */
  margin-right: calc(6vw - 24px);
}

/* ----- Contact buttons: rounded pills in a row ----- */
.contact-buttons {
  /* --- Settings --- */
  --pill-gap: 78px;              /* space between the buttons, side to side (was 28px) */
  --pill-row-gap: 28px;          /* space between rows, if the buttons wrap onto a second line */
  --pill-height: 54px;           /* minimum button height (was 44px) */
  --pill-text: 15px;             /* button text size */
  --pill-pad-y: 23px;            /* space above/below the text inside a button (was 18px) */
  --pill-pad-x: 37px;            /* space left/right of the text inside a button (was 32px) */
  --buttons-left: 50px;          /* move the whole row this far to the LEFT */
  --buttons-up: 50px;            /* move the whole row this far UP */

  position: relative;
  left: calc(-1 * var(--buttons-left));
  top: calc(-1 * var(--buttons-up));
  grid-column: 1 / -1;           /* use the full right half */
  display: flex;
  flex-wrap: wrap;               /* drop to a new line if the screen is narrow */
  justify-content: flex-end;     /* buttons sit at the right; use flex-start to put them back on the left */
  column-gap: var(--pill-gap);
  row-gap: var(--pill-row-gap);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: var(--pill-height);  /* grows with bigger text */
  padding: var(--pill-pad-y, 8px) var(--pill-pad-x, 22px);
  border-radius: 999px;          /* fully rounded */
  font-family: inherit;          /* same Helvetica as the rest of the page */
  font-size: calc(var(--pill-text) * var(--text-scale));
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

/* "Copied!" pop-up text above the email button (plain text, no box) */
.copy-email {
  position: relative;
}

.copied-tip {
  position: absolute;
  bottom: calc(100% + 8px);      /* just above the button */
  left: 50%;
  transform: translate(-50%, 4px);
  font-size: calc(13px * var(--text-scale));
  font-weight: 700;
  color: #000000;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.copied-tip.is-visible {         /* added by script.js for a moment after clicking */
  opacity: 1;
  transform: translate(-50%, 0);
}

.pill--light {                   /* white button, black text (the email) */
  background: #ffffff;
  color: #000000;
}

.pill--dark {                    /* black button, white text, thin outline */
  background: #000000;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Hover: the lime from the background, like the nav links */
.pill:hover,
.pill:focus-visible {
  background: #86ff00;
  color: #000000;
  transform: translateY(calc(-1 * var(--hover-lift)));   /* pops up */
}

/* Credit line, pinned to the bottom-left corner of the page
   (the Info section is the last thing on the page, so its corner is the page's corner) */
#copyright {
  /* --- Settings --- */
  --copyright-x: 24px;           /* distance from the left edge */
  --copyright-y: 20px;           /* distance from the bottom of the page */

  position: absolute;
  left: var(--copyright-x);
  bottom: var(--copyright-y);
  font-size: calc(12px * var(--text-scale) * 0.5);   /* 0.5 = half size */
  font-weight: 700;
  text-transform: uppercase;
}

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
  .project {
    flex-direction: column;
    justify-content: center;
  }

  .project-media {
    width: 100%;
    flex: none;
  }

  /* No push-down on phones: it's too much for a small screen */
  .project--strip {
    margin-bottom: 0;
  }

  .project--strip > *,
  .project--strip .project-text {
    top: 0;
  }

  .project-title {
    font-size: calc(32px * var(--text-scale));
  }

  .slide {
    height: 40vh;                /* same height for all; width follows each clip's shape */
  }

  .info-columns {
    grid-template-columns: 1fr;
    margin-left: 0;              /* phones: use the full width */
    margin-right: 0;
  }

  /* Phones: no shift, so the buttons can't slide off the edge of a small screen */
  .contact-buttons {
    left: 0;
    top: 0;
  }

  /* About blocks: label on top, list underneath */
  .about-block {
    grid-template-columns: 1fr;
    row-gap: 16px;
    margin: 0 24px;
  }

  #what-i-do {
    --skill-size: 26px;
  }
}
