/*
  STYLES
  Mobile first: base rules are for phones, the media query at the
  bottom of each block adjusts for larger screens.
*/

:root {
  --black: #000;
  --white: #fff;
  --gray-1: #d4d4d4;   /* placeholder block */
  --gray-2: #a8a8a8;   /* alternate placeholder block */
  --gray-3: #5c5c5c;   /* About: list names not open */
  --blue: #1f3dff;     /* electric blue: links under the mouse, Snake dots */
  --pad: 16px;         /* distance of text from screen edges */
  --text: 13px;
  --big: 24px;         /* About: bio, contacts, list names */
}

@media (min-width: 768px) {
  :root {
    --pad: 24px;
    --text: 14px;
    --big: clamp(28px, 2.6vw, 44px);
  }
}

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

html, body {
  height: 100%;
  background: var(--black);
  color: var(--white);
  font-family: "Switzer", Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: var(--text);
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  /* No line with a single word left at the end of a paragraph */
  text-wrap: pretty;
}

body { overflow: hidden; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a { color: inherit; }

/* ---------- Slideshow ---------- */

.stage {
  position: fixed;
  inset: 0;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;   /* swipes and pinch are handled in main.js */
}

/* While pinching, the slide goes above the texts, like Instagram */
.stage.is-zooming { z-index: 3; }

/* A picture from a moving gallery, opened big (js/zoom.js) */
.zoom {
  position: fixed;
  inset: 0;
  z-index: 3;
  cursor: pointer;
}
/* The background fades in behind it, the picture is there from the start */
.zoom::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--zoom-bg, #fff);
  opacity: 0;
  transition: opacity 0.35s;
}
.zoom.is-open::before { opacity: 1; }
.zoom.is-closing { opacity: 0; transition: opacity 0.28s; }
/* Its title under it, like the captions; it comes in once the picture is there */
.zoom-title {
  position: fixed;
  margin: 0;
  font-size: var(--text);
  color: #000;
  opacity: 0;
  transition: opacity 0.3s 0.3s;
}
.zoom.is-open .zoom-title { opacity: 1; }
.zoom-item {
  position: fixed;
  display: block;
  object-fit: cover;
}

/* ---------- Tap hint: a dot flies around, lands and becomes a button ---------- */

.hint {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 4;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;     /* centered on its position */
  border-radius: 50%;
  background: var(--white);
  mix-blend-mode: difference;   /* white on dark images, black on light ones */
  pointer-events: none;
}

.hint.is-button {
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--white);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: auto;
  animation: hint-pop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

/* "Tap or scroll" needs a bit more room, on two lines */
.hint.is-button.is-wide {
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  padding: 0 8px;
  line-height: 1.2;
  text-align: center;
}

.hint.is-leaving { transition: opacity 0.3s; opacity: 0; pointer-events: none; }

@keyframes hint-pop {
  from { transform: scale(0.2); }
  to { transform: scale(1); }
}

/* Little pieces flying out when the dot lands */
.hint-spark {
  position: fixed;
  z-index: 4;
  width: 3px;
  height: 3px;
  margin: -1.5px 0 0 -1.5px;
  border-radius: 50%;
  background: var(--white);
  mix-blend-mode: difference;
  pointer-events: none;
  transition: transform 0.45s ease-out, opacity 0.45s ease-out;
}

.slide {
  position: absolute;
  inset: 0;
  visibility: hidden;
}

.slide.is-active,
.slide.is-leaving { visibility: visible; }   /* is-leaving: sliding out on desktop */

.media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;   /* edge to edge, crops to fill the screen */
}

/* Slide with the glass lens or the gallery: the canvas fills the slide */
.fx-holder { position: relative; }
.fx-holder canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: var(--gray-1);
  color: var(--black);
}

.placeholder.is-alt { background: var(--gray-2); }

.soon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--pad);
  text-align: center;
  background: var(--black);
  color: var(--white);
  cursor: default;
}

.soon a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Text over the slideshow ---------- */

/* White text inverted against whatever is behind it, so it stays readable */
.ui {
  position: fixed;
  z-index: 2;
  color: var(--white);
  mix-blend-mode: difference;
}

.brand {
  top: var(--pad);
  left: var(--pad);
}

/* "Even/Bold" goes back to the first Design slide. Same size and weight as
   the caption at the bottom. The slash is drawn: 15 degrees, centred on the
   capitals (as much above the E as below the line), as thick as the letters.
   Blue only under the mouse, like the other links; the slash always the
   colour of the letters */
.brand-name { display: block; white-space: nowrap; letter-spacing: -.01em; }
.brand-name .slash {
  --h: .88em;
  --st: .085em;
  display: inline-block;
  height: var(--h);
  width: calc(var(--h) * .268 + var(--st));
  vertical-align: calc((.727em - var(--h)) / 2);
  margin: 0 .035em;
  background: currentColor;
  clip-path: polygon(calc(100% - var(--st)) 0, 100% 0, var(--st) 100%, 0 100%);
}

.sections {
  display: flex;
  gap: 12px;
}

.sections[hidden] { display: none; }

.sections button.is-active,
.sections button:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.title {
  bottom: var(--pad);
  left: var(--pad);
  right: var(--pad);
  text-align: left;
  pointer-events: none;
}

@media (min-width: 768px) {
  .title {
    right: auto;
    text-align: left;
  }
}

/* ---------- About ---------- */

/*
  The About sits under the slideshow. "Even Bold" adds "is-about" to the
  page: the slideshow slides up and the About comes in from below.
*/
.stage,
.about {
  transition: transform 0.8s cubic-bezier(0.65, 0, 0.35, 1);
}

.about {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--black);
  color: var(--white);
  transform: translateY(100%);
  visibility: hidden;
  transition: transform 0.8s cubic-bezier(0.65, 0, 0.35, 1), visibility 0s 0.8s;
}

.is-about .stage { transform: translateY(-100%); }
.is-about .about {
  transform: none;
  visibility: visible;
  transition: transform 0.8s cubic-bezier(0.65, 0, 0.35, 1);
}
.is-about .title { opacity: 0; }

.about a { color: inherit; text-decoration: none; }
.about a:hover { text-decoration: underline; text-underline-offset: 0.12em; text-decoration-thickness: 1px; }


/* Phones: black band under "Even Bold", so the
   text scrolls under them instead of mixing with them */
.about::before {
  content: "";
  position: sticky;
  top: 0;
  z-index: 1;
  display: block;
  height: calc(var(--pad) + 28px);
  background: var(--black);
}

.about-body { padding: 16px var(--pad) calc(var(--pad) * 3); }

/* Big text: bio, contacts, list names */
.about-big {
  font-size: var(--big);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

/* Words: the bio, under the line of the tabs */
.about-words { padding-top: 12px; }

/* Contacts: big, the VAT too */
.about-contact {
  padding-top: 12px;
  font-size: clamp(30px, 8.6vw, 150px);
  line-height: 1.02;
  letter-spacing: -0.03em;
}
/* "Contacts" top right, only on the projects: opens the contacts */
.contact-link {
  top: var(--pad);
  right: var(--pad);
}
.is-about .contact-link { visibility: hidden; }

/* Line breaks as written in about.js */
.about-note { line-height: 1.3; white-space: pre-line; }
.about-note a { text-decoration: underline; text-underline-offset: 2px; }

.about-tagline { margin-bottom: 8px; }
.about-bio p + p { margin-top: 0.5em; }

/* Words: the word under the mouse is selected like a vector in Figma */
.about-bio { position: relative; }
.pick {
  position: absolute; pointer-events: none; opacity: 0;
  border: 1px solid var(--blue); box-sizing: border-box;
  transition: left .09s, top .09s, width .09s, height .09s, opacity .12s;
}
.pick.is-on { opacity: 1; }
.pick i {
  position: absolute; width: 7px; height: 7px; box-sizing: border-box;
  background: #fff; border: 1px solid var(--blue);
}
.pick-base { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--blue); transition: top .09s; }
/* Hidden words: white like the others, blue under the mouse; pressed, a
   photo shows above them */
.about-bio .is-photo { cursor: pointer; -webkit-user-select: none; user-select: none; }
@media (hover: hover) { .about-bio .is-photo:hover { color: var(--blue); } }
.about-bio .is-photo.is-pressed { color: var(--blue); }
.word-photo { position: absolute; z-index: 2; display: block; height: auto; pointer-events: none; }
.pick-mark { display: inline-block; width: 0; height: 0; vertical-align: baseline; }
.pick-tl { left: -4px; top: -4px; }
.pick-tr { right: -4px; top: -4px; }
.pick-bl { left: -4px; bottom: -4px; }
.pick-br { right: -4px; bottom: -4px; }
.pick-size {
  position: absolute; left: 50%; top: calc(100% + 8px); transform: translateX(-50%);
  background: var(--blue); color: #fff; font-size: 11px; font-weight: 500;
  line-height: 1; letter-spacing: 0; padding: 4px 5px; border-radius: 3px; white-space: nowrap;
}

/* List names work as tabs: the open one is black, the others gray */
.about-tabs {
  display: flex;
  flex-wrap: wrap;
  column-gap: 0.25em;
  row-gap: 0.2em;   /* when the tabs go on two lines (phones): a bit of air */
  margin-bottom: 12px;
}

.about-tabs button { color: var(--gray-3); }
.about-tabs button:hover,
.about-tabs button.is-active { color: var(--white); }

.about-list {
  border-top: 0.5px solid var(--white);
  min-height: var(--chapter, 0);   /* always room to bring the tabs up to the top */
}

.about-row {
  display: grid;
  grid-template-columns: 1fr;
  padding: 6px 0;
  border-bottom: 0.5px solid var(--white);
}

/* Video chapters: one video under the tabs */
.about-video {
  display: block;
  width: 100%;
  margin-top: 12px;
  background: #111;
}

.about-soon {
  padding: 6px 0;
  border-bottom: 0.5px solid var(--white);
  opacity: 0.5;
}

.about-row span:not(:first-child) { opacity: 0.5; }

/* Experience: client in white, period in gray under it */
.about-cell b,
.about-cell i { display: block; font-weight: 400; font-style: normal; }
.about-cell i { opacity: 0.5; }

@media (min-width: 768px) {
  .about::before { display: none; }
  /* The tabs start under "Even/Bold" */
  .about-body { padding-top: calc(var(--pad) + 40px); }

  /* Words: the bio in the right half, like before */
  .about-words { display: grid; grid-template-columns: repeat(4, 1fr); column-gap: var(--pad); }
  .about-words > * { grid-column: 3 / 5; }
  .about-words .about-note { grid-column: 2; }

  .about-row {
    grid-template-columns: 1fr 1fr 2fr;
    column-gap: var(--pad);
  }
  .about-row span:not(:first-child) { opacity: 1; }
  /* client + period on the left half, the role in the right half */
  .about-row.is-stacked { grid-template-columns: 1fr 1fr; }
}

/* ---------- Cursor ---------- */

/* A dot in place of the arrow (js/main.js): blue on white or black, white over pictures */
/* A see-through picture as the cursor too: on a Mac Chrome sometimes shows
   its own arrow again over links and buttons with "none" alone */
.has-dot,
.has-dot * { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1' height='1'/%3E") 0 0, none !important; }
.cursor {
  position: fixed;
  left: -6px;
  top: -6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.2s;
}
.cursor.is-on { opacity: 1; }
/* The dots pulled into "Even/Bold" (js/dots.js): over everything, melting
   like liquid. Blue ones as they are, white ones inverted like the cursor.
   The cursor dot is one of them, so it hides meanwhile */
.dots { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1001; }
.dots-liquid { filter: url(#dots-goo); }
.dots-white { mix-blend-mode: difference; }
.is-ringing .cursor { opacity: 0 !important; }
/* On plain white or black: electric blue, like the favicon */
.cursor.is-blue { background: var(--blue); mix-blend-mode: normal; }
/* Over a picture that opens big with a click (js/zoom.js): a ring */
.cursor { transition: opacity 0.2s, width 0.2s, height 0.2s, left 0.2s, top 0.2s, border-width 0.2s; box-sizing: border-box; border: 0 solid #fff; }
.cursor.is-zoom { width: 44px; height: 44px; left: -22px; top: -22px; border-width: 1.5px; background: transparent; }
.cursor.is-zoom.is-blue { border-color: var(--blue); }

/* Kind words: screenshots floating towards you (js/drift.js) */
.about-drift {
  position: relative;
  height: var(--chapter, 80vh);
  margin-top: 12px;
}
.about-drift canvas { display: block; width: 100%; height: 100%; }
.about-drift-intro {
  padding: 6px 0;
  border-bottom: 0.5px solid var(--white);
}
/* While the cursor dot is the "Click or scroll" button, the dot hides */
.is-hinting .cursor { opacity: 0; }
.about-drift { touch-action: pan-y; }

/* Life: photos and videos stacking up (js/stack.js) */
.about-stack {
  position: relative;
  height: var(--chapter, 80vh);
  margin-top: 12px;
  cursor: pointer;
  -webkit-touch-callout: none;   /* a long press must not open the phone's menu */
  -webkit-user-select: none;
  user-select: none;
}
.about-stack canvas { display: block; width: 100%; height: 100%; }

/* Kudos and Offline fill the whole screen: the pictures move behind the
   tabs and the sentence, from edge to edge */
.about-drift,
.about-stack {
  position: fixed;
  inset: 0;
  height: auto;
  margin: 0;
  z-index: 0;
}
.about:has(.about-drift, .about-stack) .about-tabs,
.about:has(.about-drift, .about-stack) .about-drift-intro { position: relative; z-index: 1; }
.about:has(.about-drift, .about-stack)::before { background: transparent; }
/* The line above the sentence: drawn by the sentence, so the pictures pass under it */
.about:has(.about-drift, .about-stack) .about-list { border-top: 0; }
.about:has(.about-drift, .about-stack) .about-drift-intro { border-top: 0.5px solid var(--white); }

/* Snake: the game under the tabs (js/snake.js) */
.about-snake {
  position: relative;
  height: var(--chapter, 80vh);
  margin-top: 12px;
  touch-action: none;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.about-snake canvas { display: block; width: 100%; height: 100%; }

/* Slides: a long press must not open the phone's image or video menu */
.stage img,
.stage video,
.stage canvas {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}
.stage video { pointer-events: none; }

/* Snake: score on the left, best on the right */
.about-score { display: flex; justify-content: space-between; }

/* Links and tabs under the mouse: electric blue (last, so it wins) */
@media (hover: hover) {
  .about a:hover,
  .about-tabs button:hover,
  .about-tabs button.is-active:hover,
  .soon a:hover { color: var(--blue); }
  /* "Contacts": out of the inverted colours while blue, so it stays blue */
  .contact-link:hover { mix-blend-mode: normal; color: var(--blue); }
  /* "Even/Bold" too, slash and all, only while under the mouse */
  .brand:hover { mix-blend-mode: normal; }
  .brand-name:hover { color: var(--blue); }
}

/* Text only for Google and screen readers (index.html) */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Eva B / Even Bold, Contacts, Click circle (js/clicker.js) ---------- */

/* "Eva B" and "Contacts" big top left and right; buttons keep the font */
button, input { font-family: inherit; }
/* As big as the Words, Contacts... tabs of the About */
.brand-name, .contact-link, .clicker { font-size: var(--big); letter-spacing: -0.03em; line-height: 1; }
@media (min-width: 768px) { .clicker { font-size: 40px; } }
.about::before { height: calc(var(--pad) + 36px); }
@media (min-width: 768px) { .about-body { padding-top: calc(var(--pad) + 64px); } }
.about-tabs { padding-top: 4px; }

/* Letters that open and close: shared letters stay */
.morph { display: inline-flex; align-items: baseline; white-space: pre; }
.morph .l { display: inline-block; white-space: pre; overflow: hidden; max-width: 1em;
  transition: max-width .6s cubic-bezier(.6,0,.2,1), opacity .4s, transform .6s cubic-bezier(.6,0,.2,1);
  transition-delay: calc(var(--i) * 45ms); }
.morph .l.in { max-width: 0; opacity: 0; transform: translateY(40%); }
.morph.is-b .l.in, .is-about .morph .l.in { max-width: 1em; opacity: 1; transform: none; }
.morph.is-b .l.out, .is-about .morph .l.out { max-width: 0; opacity: 0; transform: translateY(-40%); }
/* In the About the name always reads "Even Bold" */

/* The old small hint is not needed with the circle */
.hint, .hint-spark { display: none !important; }

/* Click circle, bottom right, as big as Eva B and Contacts.
   The ring is as thick as the letters */
.clicker { position: fixed; z-index: 3; right: var(--pad); bottom: var(--pad); width: 3.6em; height: 3.6em; border-radius: 50%;
  border: .075em solid #fff; color: #fff; background: none; display: flex; align-items: center; justify-content: center;
  mix-blend-mode: difference; cursor: pointer; transform: scale(0); }
.clicker span { display: block; }
.clicker.is-in { animation: pop-in .55s cubic-bezier(.34,1.45,.5,1) both; }
.clicker.is-out { animation: puff-out .45s cubic-bezier(.4,0,.2,1) both; pointer-events: none; }
.is-about .clicker { opacity: 0; pointer-events: none; transition: opacity .3s; }
/* With a mouse: the circle is the cursor, centred on it, smaller */
.clicker.is-cursor { position: fixed; right: auto; bottom: auto; margin: -1.8em 0 0 -1.8em; font-size: 22px; pointer-events: none; z-index: 1001; }
.clicker.is-cursor.is-away { visibility: hidden; }
.is-clickcursor .cursor { opacity: 0 !important; }
@media (hover: hover) { .clicker:hover { mix-blend-mode: normal; color: var(--blue); border-color: var(--blue); } }
@keyframes pop-in { from { transform: scale(.2); } to { transform: scale(1); } }
@keyframes puff-out { from { transform: scale(1); opacity: 1; } to { transform: scale(1.2); opacity: 0; } }

/* Little lines flying out, when it pops in and when it goes */
.click-line { position: fixed; z-index: 4; background: #fff; mix-blend-mode: difference; pointer-events: none; transform-origin: 50% 100%; transform: scaleY(0); }

