/* beadyeye — built from the Figma design (1280px desktop frame).
   Sizes are written as multiples of --u (1px at 1280 wide) so the layout
   scales with the window like the design; text stays readable on phones. */

:root {
  --black: #000;
  --white: #fff;
  --grey: #d8d8d8;
  --grey-dark: #3a3a3a;
  --line-light: #d8d8d8;
  --line-dark: #d8d8d8;

  --u: calc(100vw / 1280);
  --gutter: max(16px, calc(18 * var(--u)));
  --bar: 61px;
  --ease: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; }

body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font-family: "Space Grotesk", system-ui, sans-serif;
  letter-spacing: -0.08em;
  -webkit-font-smoothing: antialiased;
  padding-bottom: var(--bar);
}

img { display: block; max-width: 100%; }
/* Videos here are all silent loops, nothing to click. Letting the cursor pass through them
   stops browsers (e.g. Edge on Windows) showing their own picture-in-picture and
   "enhance video" buttons on hover. Clicks still reach the circle or link underneath. */
video { pointer-events: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; letter-spacing: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
p { margin: 0; }

:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Logo ---------- */
.logo {
  display: block;
  width: max(80px, calc(112 * var(--u))); /* a touch smaller than the Figma logo */
  margin: 0 auto;
}
.logo svg { display: block; width: 100%; height: auto; }
.logo { color: var(--black); }
.pinned-header .logo,
.about .logo { color: var(--white); }

/* Blink: a top and bottom eyelid sweep in to meet in the middle, then open again. */
.logo .lid {
  fill: currentColor;
  transform-box: fill-box;
  transform: scaleY(0);
}
.logo .lid-top { transform-origin: 50% 0; }
.logo .lid-bottom { transform-origin: 50% 100%; }
.logo .lids.is-blinking .lid { animation: blink 0.26s cubic-bezier(0.45, 0, 0.25, 1); }
@keyframes blink {
  0% { transform: scaleY(0); }
  42% { transform: scaleY(1); }
  52% { transform: scaleY(1); }
  100% { transform: scaleY(0); }
}

.site-header {
  padding-top: max(16px, calc(24 * var(--u)));
  position: relative;
  z-index: 2;
}

/* ---------- Homepage first screen ---------- */
/* Fills the window above the fixed black bar. The carousel takes whatever
   height is left after the logo and project bar, and the circles size to fit it. */
.stage {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--bar));
  height: calc(100svh - var(--bar));
  min-height: 420px;
  padding-bottom: clamp(16px, 3vh, 32px);
}

/* ---------- Homepage carousel ---------- */
.carousel {
  container-type: size;
  flex: 1 1 auto;
  min-height: 0;
  --d: min(calc(652 * var(--u)), 100cqh);
  /* spacing: up to about 70% of each side circle shows, whatever the window size */
  --gap: max(calc(var(--d) * 0.05), calc(50vw - var(--d) * 1.2));
  --shift: 0;
  position: relative;
  margin-top: clamp(16px, 4vh, calc(47 * var(--u)));
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.slot img:not([src]) { visibility: hidden; } /* video-only circle */
.slot {
  position: absolute;
  top: calc((100cqh - var(--d)) / 2);
  left: 50%;
  width: var(--d);
  height: var(--d);
  margin-left: calc(var(--d) / -2);
  border-radius: 50%;
  overflow: hidden;
  background: #eee;
  transform: translateX(calc((var(--off) + var(--shift)) * (var(--d) + var(--gap))));
  -webkit-mask-image: -webkit-radial-gradient(white, black); /* keeps Safari clipping during transforms */
}
.slot > img,
.slot > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease-out);
  pointer-events: none;
  -webkit-user-drag: none;
}
.slot > video[hidden] { display: none; }
.slot:not(.is-focus) { cursor: pointer; }
.slot.is-focus:hover > img,
.slot.is-focus:hover > video { transform: scale(1.04); }

/* drag the row with the cursor */
@media (hover: hover) and (pointer: fine) {
  .carousel { cursor: grab; }
}
.carousel.is-dragging,
.carousel.is-dragging .slot { cursor: grabbing; }

/* ---------- Project bar under the carousel ---------- */
.project-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 var(--gutter);
  margin-top: clamp(16px, 4vh, calc(51 * var(--u)));
  min-height: 35px;
  flex: none;
}
.project-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 20px;
  letter-spacing: -0.08em;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.project-title.is-swapping { opacity: 0; transform: translateY(6px); }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 35px;
  padding: 0 11px 2px;
  border-radius: 150px;
  background: var(--black);
  color: var(--white);
  font-size: 24px;
  font-weight: 700;
  line-height: 20px;
  white-space: nowrap;
}
/* Hover: the label rolls up and out while an identical copy rolls in from below. */
.pill-mask {
  display: block;
  overflow: hidden;
  height: 26px;
  line-height: 26px;
  margin-top: 2px;
}
.pill-roll {
  display: block;
  position: relative;
  transition: transform 0.42s cubic-bezier(0.7, 0, 0.2, 1);
}
.pill-roll::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 100%;
}
.pill:hover .pill-roll,
.pill:focus-visible .pill-roll { transform: translateY(-100%); }

/* ---------- Divider + big email ---------- */
.rule {
  height: 0;
  border: 0;
  border-top: 1px solid var(--line-light);
  margin: 0 var(--gutter);
}
.home .rule { margin-top: calc(36 * var(--u)); }

.big-email {
  display: block;
  padding: calc(57 * var(--u)) 0;
  text-align: center;
  font-size: calc(138 * var(--u));
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.08em;
  white-space: nowrap;
  color: var(--grey);
  transition: color 0.4s ease;
}
.big-email:hover { color: var(--black); }
.big-email span { display: inline-block; }

/* ---------- About drawer (the black bar that opens) ---------- */
.about {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  height: var(--bar);
  background: var(--black);
  color: var(--white);
  border-radius: 30px 30px 0 0;
  overflow: hidden;
  transition: height 0.9s var(--ease), border-radius 0.9s var(--ease), opacity 0.5s ease;
}
.about.is-open {
  height: calc(100% - 20px);
  border-radius: 40px 40px 0 0;
}

.about-toggle {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: var(--bar);
  padding: 0 var(--gutter);
  font-size: 16px;
  font-weight: 500;
  line-height: 20px;
  text-align: left;
  background: var(--black); /* panel content scrolls underneath this row */
}

/* "About": bold, its capitals as tall as the plus (about.js sets the exact size).
   The line box is trimmed to the capitals so it centres exactly with the plus. */
.about-label {
  font-size: 23px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  text-box: trim-both cap alphabetic;
}

/* plus that turns into a minus */
.plus {
  position: relative;
  width: 16px;
  height: 16px;
  flex: none;
}
.plus::before,
.plus::after {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 16px;
  height: 2px;
  background: currentColor;
  transition: transform 0.6s var(--ease);
}
.plus::after { transform: rotate(90deg); }
.about.is-open .plus::after { transform: rotate(0deg); }

.about-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0s linear 0.4s;
}
.about.is-open .about-inner {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s ease 0.35s, visibility 0s;
}

/* A black band fading to clear across the top of the open panel: it sits above the text
   as it scrolls up, and behind "About beadyeye", the logo and the minus, so they stay
   readable. Solid down to just below the logo, then fades out. */
.about::after {
  --solid: max(var(--bar), calc(max(12px, calc(14 * var(--u))) + max(80px, calc(112 * var(--u))) * 0.373 + 14px));
  content: "";
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--solid) + 72px);
  background: linear-gradient(to bottom, var(--black) 0, var(--black) var(--solid), rgba(0, 0, 0, 0));
  pointer-events: none;
}

/* logo stays pinned at the top of the panel while the content scrolls */
.about > .logo {
  position: absolute;
  z-index: 3;
  top: max(12px, calc(14 * var(--u)));
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0s linear 0.4s;
}
/* the panel's logo fades in only once the panel has finished rising to the top */
.about.is-open.is-up > .logo {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease, visibility 0s;
}

.about-inner {
  padding-top: var(--bar);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* First screen of the panel: the bio sits at the bottom, with a gap below it
   the same height as the black bar. Scroll for the email, Instagram and copyright. */
.about-intro {
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100%;
  padding-bottom: var(--bar);
}
.about .about-intro + .rule { margin-top: 0; }

.about-statement {
  padding: 0 var(--gutter);
  font-size: min(calc(100 * var(--u)), 7.5vh, 80px); /* about.js sizes it to fit */
  line-height: 1.05;
  font-weight: 400;
  letter-spacing: -0.08em;
  transform: translateY(24px);
  transition: transform 0.9s var(--ease-out) 0.35s;
}
.about.is-open .about-statement { transform: none; }
/* each line of the bio breaks exactly where it does in the CMS text box */
.statement-line { display: block; width: max-content; white-space: nowrap; }

.about .rule { border-color: var(--line-dark); margin-top: min(calc(85 * var(--u)), 6vh); flex: none; }
.about .rule + .big-email + .rule { margin-top: 0; }
.about .big-email { flex: none; } /* same size as the homepage email */
.about .big-email { color: var(--grey-dark); }
.about .big-email:hover { color: var(--white); }

.about-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--bar);
  padding: 0 var(--gutter);
  font-size: 16px;
  font-weight: 500;
  flex: none;
}

body.drawer-open { overflow: hidden; }

/* ---------- Project page ---------- */
/* Parallax hero: it stays pinned while the page content slides up over it.
   As it's covered, the photo zooms in slightly and darkens (set by project.js). */
.hero {
  position: sticky;
  top: 0;
  z-index: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: #111;
  --cover: 0; /* 0 = fully visible, 1 = fully covered */
}
.hero > img,
.hero > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(calc(1 + var(--cover) * 0.08));
  will-change: transform;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #000;
  opacity: calc(var(--cover) * 0.45);
  pointer-events: none;
}
/* Project pages: the logo stays pinned at the top while the page scrolls.
   project.js switches it white over images and black over the white page. */
.pinned-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40; /* above the page content, below the About panel */
  pointer-events: none;
}
/* "Negative" logo: a white logo with the difference blend shows black over the white
   page and the inverse of whatever image or video it passes over, part by part. */
.pinned-header { mix-blend-mode: difference; }
.pinned-header .logo,
.pinned-header .logo.on-light { pointer-events: auto; color: var(--white); }

/* everything below the hero sits on top of it, on a solid background */
.project,
.project-end {
  position: relative;
  z-index: 1;
  background: var(--white);
}
.project {
  display: flow-root; /* keeps the heading's top margin inside the white background */
  padding: 0 var(--gutter);
}
.project h1,
.project-intro {
  font-size: max(34px, calc(60 * var(--u)));
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.08em;
  margin: 0;
}
.project h1 { margin-top: calc(53 * var(--u)); padding-top: 4px; }
.project-intro { color: var(--grey); margin-top: calc(11 * var(--u)); }
.project > .rule { margin: calc(47 * var(--u)) 0 0; }

.copy {
  font-size: 22px;
  line-height: 26px;
  font-weight: 300;
  letter-spacing: -0.06em;
  max-width: max(300px, calc(473 * var(--u)));
  /* pulls the text up so the top of the first title's letters lines up with the
     top of the image beside it (measured from the font by project.js) */
  margin-top: calc(var(--copy-trim, 0px) * -1);
}
.copy p + p { margin-top: 26px; }
/* titled sections: bold light-grey titles, light-weight black text, same size */
.copy-title { font: inherit; font-weight: 700; letter-spacing: inherit; color: var(--grey); margin: 0; }
.copy-section + .copy-section { margin-top: 26px; }

/* sections sit a gutter apart; the first one sits further below the divider */
.block { margin-top: var(--gutter); }
.project-blocks > .block:first-child { margin-top: max(24px, calc(44 * var(--u))); }

/* image left, text in the right-hand column, both starting at the same height */
.block-image-text {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gutter);
  align-items: start;
}
.block-image-text img, .block-image-text video { width: 100%; aspect-ratio: 613 / 654; object-fit: cover; }
.block-image-text .copy { max-width: none; }

/* full-width artwork, shown whole (not cropped) */
.block-graphic img, .block-graphic video { width: 100%; height: auto; }

/* three images across, uncropped (e.g. phone story mockups) */
.block-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gutter);
  align-items: start;
}
.block-trio img, .block-trio video { width: 100%; height: auto; }

/* crop: false — images keep their own shape instead of the design's crop */
.block.is-natural { align-items: start; }
.block.is-natural img, .block.is-natural video { aspect-ratio: auto; height: auto; object-fit: initial; }
.block-text {
  margin-top: calc(44 * var(--u));
  margin-left: calc(771 * var(--u));
}
.block-text + .block { margin-top: max(40px, calc(53 * var(--u))); }

.block-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gutter);
}
.block-pair img, .block-pair video { width: 100%; aspect-ratio: 613 / 654; object-fit: cover; }

.block-full img, .block-full video { width: 100%; aspect-ratio: 1245 / 652; object-fit: cover; }

.block-text-image {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gutter);
  align-items: start;
  margin-top: max(48px, calc(78 * var(--u)));
}
.block-text-image img, .block-text-image video { width: 100%; aspect-ratio: 614 / 441; object-fit: cover; }

/* padding, not margin: no see-through gap. --email-gap is set by about.js so this
   space matches the visible space between the line and the email below it. */
.project-end { padding-top: max(32px, calc(var(--email-gap, calc(80 * var(--u))) * 0.6)); }

/* Home / Next project, between the last images and the email */
.project-nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 0 var(--gutter) max(28px, calc(var(--email-gap, calc(80 * var(--u))) * 0.6));
  font-size: max(34px, calc(60 * var(--u)));
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.08em;
  white-space: nowrap;
}
.project-nav a { transition: color 0.3s ease; }
/* on hover they turn the same grey as the email */
@media (hover: hover) {
  .project-nav a:hover { color: var(--grey); }
}
.project-end .rule { margin: 0 var(--gutter); }

/* images fade in as they load */
.fade-img { opacity: 0; transition: opacity 0.8s ease; }
.block-video { display: block; background: #f2f2f2; }
.fade-img.is-loaded { opacity: 1; }

/* ---------- First-visit loading animation (js/loader.js) ---------- */
html.first-load:not(.loader-on)::after { /* plain black until the animation is in place */
  content: "";
  position: fixed;
  inset: 0;
  z-index: 299;
  background: #000;
}
html.first-load body { overflow: hidden; }
html.first-load .stage .logo,
html.first-load .pinned-header .logo { visibility: hidden; } /* the flying logo lands here */
.loader { position: fixed; inset: 0; z-index: 300; }
.loader-bg { position: absolute; inset: 0; background: #000; }
.loader video { position: absolute; display: block; max-width: none; }
.loader-logo { position: absolute; transform-origin: 0 0; will-change: transform; }
.loader-logo svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

/* ---------- Page-to-page motion ---------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.8s ease, transform 0.9s var(--ease-out); }
.is-ready .reveal { opacity: 1; transform: none; }
.is-ready .reveal:nth-child(2) { transition-delay: 0.08s; }
.is-ready .reveal:nth-child(3) { transition-delay: 0.16s; }

/* homepage fades out while the circle bursts */
.home .site-header,
.home .project-bar,
.home main > .rule { transition: opacity 0.5s ease; }
/* keep the email's colour fade on hover (same as in the black panel) */
.home main > .big-email { transition: opacity 0.5s ease, color 0.4s ease; }
.home.is-leaving .site-header,
.home.is-leaving .project-bar,
.home.is-leaving main > .rule,
.home.is-leaving main > .big-email,
.home.is-leaving .about { opacity: 0; }
.home.is-leaving .slot:not(.is-focus) { opacity: 0; transition: opacity 0.5s ease, transform 0.8s var(--ease); }

/* Zoom transition: a round lens that grows from the circle to cover the screen.
   Only transforms animate, so the graphics card does the work. */
.burst {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 0.45s ease;
}
.lens {
  position: absolute;
  border-radius: 50%;
  overflow: hidden;
  transform-origin: 50% 50%;
  will-change: transform;
  -webkit-mask-image: -webkit-radial-gradient(white, black); /* Safari: keep the round clip while scaling */
}
.lens-inner {
  position: absolute;
  inset: 0;
  transform-origin: 50% 50%;
  will-change: transform;
}
.lens-media,
.burst-hero {
  position: absolute;
  display: block;
  max-width: none;
  object-fit: cover;
}
.burst-hero { opacity: 0; transition: opacity 0.45s ease; will-change: opacity; } /* own layer: fading it doesn't redraw the lens */

.burst-cover {
  position: fixed;
  inset: 0;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.4s ease;
  background: #111;
}
.burst-cover.is-on { opacity: 1; }
.burst-cover img,
.burst-cover canvas { display: block; width: 100%; height: 100%; object-fit: cover; }
.burst.show-hero .burst-hero { opacity: 1; }

/* ---------- Phones & small tablets ---------- */
@media (max-width: 700px) {
  /* phones: the bio's words run on, so it can be bigger (about.js sizes it to the space) */
  .statement-line { display: inline; width: auto; white-space: normal; }
  .statement-line + .statement-line::before { content: " "; }

  /* phones: project heroes are made 16:9, so show them full width at that shape
     rather than filling the tall screen (which would crop off both sides) */
  .hero { height: auto; aspect-ratio: 16 / 9; }

  /* phones: the homepage is one screen with no scrolling. From the bottom up:
     the black bar, the email, the project name and button, then the circle,
     centred in the space left below the logo. */
  .site-header { padding-top: 28px; }
  .home main {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--bar));
    height: calc(100svh - var(--bar));
    overflow: hidden;
  }
  .home .stage {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    padding-bottom: 0;
  }
  .carousel {
    flex: 1 1 auto;
    --d: min(78vw, 100cqh);
    --gap: 5vw;
    margin-top: 16px;
  }
  .project-bar { margin-top: 20px; }
  .project-title,
  .pill { font-size: 20px; }
  .home .rule { margin-top: 20px; flex: none; }
  .big-email { padding: 22px 0; font-size: 10.6vw; flex: none; }

  /* About panel: one screen too, with the email in exactly the same place as on the
     homepage and Instagram / copyright where the black bar was, so opening it is seamless */
  .about-intro {
    flex: 1 1 auto;
    min-height: 0;
    padding-bottom: 20px;
  }
  .about-statement { font-size: max(34px, 9.4vw); }
  .about .rule { margin-top: 0; }
  .about .big-email + .rule { display: none; }
  .about-footer { border-top: 1px solid var(--line-dark); }

  /* the panel's white logo sits exactly over the page's logo and is uncovered as the
     panel rises, so the logo turns white as the black passes over it */
  .about > .logo,
  .about.is-open.is-up > .logo {
    top: auto;
    bottom: var(--logo-bottom, calc(100% - 55px));
    opacity: 1;
    visibility: visible;
    transition: none;
  }

  .block-text { margin-left: 0; margin-top: 28px; }
  .block-pair,
  .block-image-text,
  .block-text-image { grid-template-columns: 1fr; }
  .block-image-text .copy { margin-top: 8px; }
  /* three-across rows become a sideways swipe on phones */
  .block-trio {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 68vw;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-left: calc(var(--gutter) * -1);
    margin-right: calc(var(--gutter) * -1);
    padding: 0 var(--gutter);
    scrollbar-width: none;
  }
  .block-trio::-webkit-scrollbar { display: none; }
  .block-trio img, .block-trio video { scroll-snap-align: center; }
  .block-text-image .copy { order: 2; }
}

