/* Components of the new design (Figma page "Design system"). */

/* ================= Tag ================= */
/* --tu is one "design pixel": 1px normally, smaller inside scaled-down cards. */
.tags { display: flex; flex-wrap: wrap; gap: calc(8 * var(--tu, 1px)); }
.tag {
  display: inline-flex;
  align-items: center;
  gap: calc(6 * var(--tu, 1px));
  padding: calc(6 * var(--tu, 1px)) calc(14 * var(--tu, 1px)) calc(6 * var(--tu, 1px)) calc(10 * var(--tu, 1px));
  border-radius: 999px;
  background: var(--tag-bg, var(--white));
  color: var(--black);
  font: 600 calc(12 * var(--tu, 1px))/calc(16 * var(--tu, 1px)) var(--font-tag);
  letter-spacing: .5px;
  text-transform: uppercase;
  white-space: nowrap;
}
.tag__icon { width: calc(15 * var(--tu, 1px)); height: calc(15 * var(--tu, 1px)); flex: none; }

/* ================= Project card ================= */
/* Cards scale as a whole, like the Figma cards scaled down for tablet and mobile.
   --u is one design pixel of the card: card width / design width. */
.pcard {
  --W: 514;        /* design width */
  --notch: 128;    /* size of the top-right notch area */
  --r: 20;         /* corner radius */
  --arrow: 75;     /* arrow circle */
  --arrow-c: 42.35;/* arrow centre from top and right */
  --icon: 28;
  --u: calc(100cqw / var(--W));
  --n: calc(var(--notch) * var(--u));
  --tu: var(--u);
  container-type: inline-size;
  position: relative;
  display: block;
  color: var(--text);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.pcard--featured { --W: 1060; }
.pcard--mini { --W: 337.33; --notch: 94.33; --r: 16; --arrow: 55; --arrow-c: 31.04; --icon: 20; }

.pcard__body {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-strong);
  border-radius: calc(var(--r) * var(--u));
  overflow: hidden;
  /* cut the notch out of the top-right corner */
  -webkit-mask:
    linear-gradient(#000 0 0) left top / calc(100% - var(--n) + 1px) 100% no-repeat,
    linear-gradient(#000 0 0) left bottom / 100% calc(100% - var(--n) + 1px) no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128' preserveAspectRatio='none'%3E%3Cpath d='M0 0C15.46 0 28 12.54 28 28V50C28 77.62 50.38 100 78 100H100C115.46 100 128 112.54 128 128H0Z'/%3E%3C/svg%3E") right .5px top .5px / var(--n) var(--n) no-repeat;
          mask:
    linear-gradient(#000 0 0) left top / calc(100% - var(--n) + 1px) 100% no-repeat,
    linear-gradient(#000 0 0) left bottom / 100% calc(100% - var(--n) + 1px) no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128' preserveAspectRatio='none'%3E%3Cpath d='M0 0C15.46 0 28 12.54 28 28V50C28 77.62 50.38 100 78 100H100C115.46 100 128 112.54 128 128H0Z'/%3E%3C/svg%3E") right .5px top .5px / var(--n) var(--n) no-repeat;
}
/* Drawn outside the masked body (so the full 1 px line shows) and on the same
   half-pixel offset as the mask, so the line covers the cut edge exactly. */
.pcard__line {
  position: absolute; z-index: 1;
  top: 0; right: 0;
  width: var(--n); height: var(--n);
  transform: translate(-.5px, .5px); /* a transform is not snapped to whole pixels */
  color: var(--border-strong);
  overflow: visible;
  pointer-events: none;
}

.pcard__media { position: relative; display: block; overflow: hidden; background: var(--neutral-100); }
.pcard__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pcard__img--alt { opacity: 0; transition: opacity .35s ease-out; background: var(--white); } /* white behind see-through hover images, as in Figma */

.pcard__info { display: flex; flex-direction: column; background: var(--white); }
.pcard__head { display: flex; flex-direction: column; gap: calc(5 * var(--u)); }
.pcard__year {
  font: 600 calc(16 * var(--u))/1 var(--font-text);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.pcard__title { font: 700 calc(32 * var(--u))/1 var(--font-title); }

/* small */
.pcard--small .pcard__media { height: calc(300 * var(--u)); }
.pcard--small .pcard__info { gap: calc(12 * var(--u)); padding: calc(24 * var(--u)) calc(28 * var(--u)) calc(32 * var(--u)); }

/* mini */
.pcard--mini .pcard__media { height: calc(220 * var(--u)); }
.pcard--mini .pcard__info { gap: calc(10 * var(--u)); padding: calc(18 * var(--u)) calc(20 * var(--u)) calc(22 * var(--u)); background: var(--beige); }
.pcard--mini .pcard__head { gap: calc(3 * var(--u)); }
.pcard--mini .pcard__year { font-size: calc(14 * var(--u)); text-transform: none; }
.pcard--mini .pcard__title { font: 700 calc(22 * var(--u))/1 var(--font-text); }

/* featured: text left, picture right */
.pcard--featured .pcard__body { flex-direction: row; height: calc(378 * var(--u)); background: var(--white); }
.pcard--featured .pcard__info {
  flex: 1 1 0;
  justify-content: space-between;
  gap: calc(40 * var(--u));
  padding: calc(32 * var(--u)) calc(40 * var(--u)) calc(36 * var(--u));
}
.pcard--featured .pcard__left { display: flex; flex-direction: column; align-items: flex-start; gap: calc(14 * var(--u)); }
.pcard--featured .pcard__title { font-size: calc(44 * var(--u)); }
.pcard--featured .pcard__media { flex: 0 0 calc(490 * var(--u)); }
.pcard__chip {
  padding: calc(6 * var(--u)) calc(16 * var(--u));
  border-radius: calc(20 * var(--u));
  background: var(--beige);
  font: 500 calc(16 * var(--u))/1.35 var(--font-text);
}
.pcard__desc { font: 400 calc(16 * var(--u))/calc(24 * var(--u)) var(--font-text); color: var(--text-muted); }

/* the round arrow in the notch */
.pcard__arrow {
  position: absolute;
  top: calc((var(--arrow-c) - var(--arrow) / 2) * var(--u));
  right: calc((var(--arrow-c) - var(--arrow) / 2) * var(--u));
  display: grid;
  place-items: center;
  width: calc(var(--arrow) * var(--u));
  height: calc(var(--arrow) * var(--u));
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  color: var(--black);
  transition: transform .35s var(--ease-out-back), background-color .35s, color .35s;
}
.pcard__arrow svg { width: calc(var(--icon) * var(--u)); height: calc(var(--icon) * var(--u)); }

@media (hover: hover) {
  .pcard:hover .pcard__arrow { transform: scale(1.12); background: var(--black); color: var(--white); }
  .pcard:hover .pcard__img--alt { opacity: 1; }
  .pcard--mini:hover .pcard__arrow { background: var(--black); color: var(--white); }
}
/* Touch screens: the hover look shows while a finger is on the card (also while scrolling) */
.pcard.is-touched .pcard__arrow { transform: scale(1.12); background: var(--black); color: var(--white); }
.pcard.is-touched .pcard__img--alt { opacity: 1; }
/* A tap opens the page right away: show the hover look instantly instead of mid-fade */
.pcard.is-tapped .pcard__arrow, .pcard.is-tapped .pcard__img--alt, .rmini.is-tapped { transition: none; }
.pcard:focus-visible { outline: none; }
.pcard:focus-visible .pcard__body { outline: 2px solid var(--phone-orange); outline-offset: 3px; }

/* ================= Logo marquee ================= */
.marquee {
  --ls: 1;          /* logo scale: 100 % desktop, 70 % tablet, 42 % mobile */
  --ms: var(--ls);  /* speed scale: the marquee moves at 30 px/s × this */
  --gap: 82px;
  --start: 41px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  padding: 50px 0;
  background: var(--bg-dark);
  overflow: hidden;
}
.marquee--tools { --gap: 73px; }
.marquee__label { color: var(--neutral-300); text-align: center; }
.marquee__viewport { width: 100%; overflow: hidden; touch-action: pan-y; cursor: var(--cursor-default, default); }
.marquee__track { display: flex; width: max-content; will-change: transform; }
.marquee__set { display: flex; align-items: center; gap: var(--fit-gap, calc(var(--gap) * var(--ls))); padding-right: var(--fit-gap, calc(var(--gap) * var(--ls))); }
.logo {
  display: block;
  flex: none;
  width: calc(var(--w) * 1px * var(--ls));
  height: calc(var(--h) * 1px * var(--ls));
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.logo--mask {
  background: var(--beige);
  -webkit-mask: var(--src) center / contain no-repeat;
          mask: var(--src) center / contain no-repeat;
}

@media (max-width: 1099px) {
  .marquee { --ls: .7; --start: 40px; gap: 24px; padding: 44px 0; }
}
@media (max-width: 699px) {
  .marquee { --ls: .42; --start: 16px; gap: 18px; padding: 28px 0; }
  .marquee__label { font-size: 12px; }
}
/* Companies on mobile: two rows of bigger logos, same speed as before (Pauline, 13 Nov 2026) */
.marquee__viewport--row { display: none; }
@media (max-width: 699px) {
  .marquee--companies { --ls: .62; --ms: .42; }
  .marquee--companies .marquee__viewport--wide { display: none; }
  .marquee--companies .marquee__viewport--row { display: block; }
  /* a bit more air under the label and between the two rows (Pauline, 16 Nov 2026): 18 → 26 px, 16 → 24 px */
  .marquee--companies { gap: 26px; }
  .marquee--companies .marquee__viewport--row + .marquee__viewport--row { margin-top: -2px; }
}

/* ================= Recommendation cards ================= */
.rcard {
  display: flex;
  flex-direction: column;
  gap: 30px;
  width: 440px;
  max-width: 100%;
  height: 707px;
  padding: 32px 36px;
  border-radius: var(--radius-card);
  background: var(--card, var(--tag-salmon));
  color: var(--black);
  transform: rotate(var(--tilt, 0deg));
}
.rcard__head { display: flex; align-items: center; gap: 16px; }
.rcard__who { display: flex; flex: 1 1 0; min-width: 0; flex-direction: column; gap: 2px; }
.rcard__name { font: 700 var(--fs-card-name)/1 var(--font-text); }
.rcard__role { font: 500 var(--fs-card-role)/1.35 var(--font-text); }
.rcard__logo {
  flex: none;
  width: calc(var(--w) * 1px);
  height: calc(var(--h) * 1px);
  background: var(--black);
  -webkit-mask: var(--src) center / contain no-repeat;
          mask: var(--src) center / contain no-repeat;
}
.rcard__highlight { font: 700 var(--fs-heading-h4)/1 var(--font-title); }
.rcard__text { flex: 1 1 0; min-height: 0; font: 400 var(--fs-body-md)/24px var(--font-text); }
.rcard__text p + p { margin-top: 24px; }
.rcard__tags { display: flex; align-items: center; gap: 8px; }
.rcard__in {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--black); color: var(--beige);
  font: 700 14px/1 var(--font-text); text-decoration: none;
}

.rmini {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  min-height: 232px;
  padding: 36px 32px 32px;
  border-radius: var(--radius-card);
  background: var(--card, var(--tag-salmon));
  color: var(--black);
  text-decoration: none;
}
.rmini__highlight { font: 700 28px/1.1 var(--font-title); }
.rmini__person { display: flex; align-items: flex-end; gap: 16px; }
.rmini .rcard__name { font: 700 var(--fs-label-strong)/1.35 var(--font-text); }
.rmini .rcard__role { font: 500 var(--fs-label-sm)/21px var(--font-text); opacity: 1; color: var(--text-muted); }
/* Hover: the bold card style from the About me page (2 px black border + hard 4 px shadow).
   Drawn with shadows so the card doesn't move or change size. */
.rmini { transition: box-shadow .2s ease-out; }
@media (hover: hover) {
  .rmini:hover { box-shadow: inset 0 0 0 2px var(--black), 0 4px 0 var(--black); }
}
.rmini.is-touched { box-shadow: inset 0 0 0 2px var(--black), 0 4px 0 var(--black); }
.rmini:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--black), 0 4px 0 var(--black); }
@media (max-width: 699px) { .rmini { padding: 28px 24px 24px; min-height: 0; } }

/* ================= Preview page (/components) ================= */
.pv { padding: 60px 120px; display: grid; gap: 28px; }
.pv__note { color: var(--text-muted); max-width: 60ch; }
.pv__row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.pv__row--top { align-items: flex-start; gap: 40px; padding: 20px 0; }
.pv__row--dark { background: var(--bg-dark); padding: 24px; border-radius: var(--radius-card); }
.pv__featured { max-width: 1060px; }
.pv__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; max-width: 1060px; }
.pv__grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; max-width: 1232px; }
.pv__mini { max-width: 337px; }
.pv-gap { height: 20px; background: var(--bg-dark); }
@media (max-width: 1099px) { .pv { padding: 48px 32px; } .pv__grid--3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 699px) {
  .pv { padding: 40px 16px; }
  .pv__grid, .pv__grid--3 { grid-template-columns: 1fr; }
  .pv__row--top { flex-direction: column; align-items: stretch; }
  .pv .rcard { width: 100%; height: auto; min-height: 524px; transform: none; }
}

/* Company logos are links (new tab). Over the whole companies banner the mouse becomes the
   Cursor label (Design system page), centred on the mouse, showing the nearest logo's name.
   Smaller than the Figma component (Pauline, 16 Nov 2026): 12 px text, 4 × 8 px padding. */
.logo-link { display: block; flex: none; }
.logo-link:focus-visible { outline: 2px solid var(--beige); outline-offset: 6px; border-radius: 4px; }
@media (hover: hover) and (pointer: fine) {
  .marquee--companies .marquee__viewport, .marquee--companies .marquee__viewport * { cursor: none; }
}
.cursor-label {
  position: fixed; z-index: 60; top: 0; left: 0;
  padding: 4px 8px; border-radius: 6px;
  background: var(--beige); color: var(--text);
  font: 600 12px/16px var(--font-text); letter-spacing: .12em; text-transform: uppercase;
  white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .15s;
}
.cursor-label.is-on { opacity: 1; }

/* Link to the live project (website, prototype or video) in the tags row of a project page.
   No colour: an outline pill with an ↗ arrow; on hover it fills dark, like the project card arrow
   (Pauline, 16 Nov 2026). */
.tag--link {
  --tag-bg: transparent;
  /* 1 px outline; same padding left and right (13 px + 1 px border = the 14 px of the tool tags) */
  padding: calc(5 * var(--tu, 1px)) calc(13 * var(--tu, 1px));
  border: 1px solid var(--black);
  text-decoration: none;
  transition: background-color .25s, color .25s, scale .25s var(--ease-out-back);
}
.tag--link .tag__icon { width: calc(11 * var(--tu, 1px)); height: calc(11 * var(--tu, 1px)); transition: rotate .25s ease-out; }
@media (hover: hover) {
  .tag--link:hover { background: var(--black); color: var(--white); }
  .tag--link:hover .tag__icon { rotate: 45deg; } /* ↗ turns to →, like the other buttons */
}
.tag--link:active { scale: .95; }
.tag--link:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; }

/* Pixel cursors (Design system: Cursors). cursor.js sets the three --cursor-* variables and
   recolours them on every click. :where() keeps these rules weak, so the round arrow cursor and
   the cursor label (cursor: none) still win where they take over. Mouse / trackpad only. */
:where(.has-pixel-cursor) { cursor: var(--cursor-default); }
:where(.has-pixel-cursor) :where(p, h1, h2, h3, h4, h5, h6, li, blockquote, figcaption, dt, dd, td, th, input, textarea, [contenteditable]) { cursor: var(--cursor-text); }
/* after the text rule, so text inside a link or button keeps the Pointer hand */
:where(.has-pixel-cursor) :where(a[href], button, [role="button"], summary, label[for], select),
:where(.has-pixel-cursor) :where(a[href], button, [role="button"], summary, label[for], select) * { cursor: var(--cursor-pointer); }
