/* ==========================================================================
   Oleksandr Gerula — portfolio
   One stylesheet, no build step. Tokens first, then layout, then sections.

   Type and colour follow bajgartoffice.com:
   - display serif, light, tight tracking  -> Literata (stand-in for Rhymes Text Light)
   - text sans, 16/24, slightly tight      -> Geist   (stand-in for Saans)
   To switch to licensed Saans / Rhymes Text later, replace the @font-face
   sources below and adjust --font-sans / --font-serif only.
   ========================================================================== */

@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-latin-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Literata";
  src: url("../fonts/literata-latin-variable.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Literata";
  src: url("../fonts/literata-latin-variable-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Colour */
  --bg: #ffffff;
  --panel: #f5f5f5;
  --chip: #f6f6f6;
  --ink: #000000;
  --ink-soft: rgb(0 0 0 / 0.65);
  --ink-muted: #878787;
  --line: #ebebeb;
  --ok: #189e48;
  /* Text selection: a soft highlighter yellow that sits well with the black
     buttons; black text on it is 16.9:1. */
  --highlight: #fde68a;

  /* Type */
  --font-sans: "Geist", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Literata", Georgia, "Times New Roman", serif;
  --tracking-sans: -0.02em;
  --tracking-serif: -0.06em;
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-title: 1.5rem;  /* 24px project titles */
  --text-h2: clamp(2.25rem, 1.45rem + 2.5vw, 3.5rem);  /* 56px */
  --text-h1: clamp(2.5rem, 1.1rem + 4.4vw, 4.5rem);    /* 72px */

  /* Space */
  /* Side margins grow with the screen, as on rondesignlab.com:
     20px on small phones, ~102px at 1288px, ~115px at 1440px, 200px max. */
  --gutter: clamp(20px, calc(8.7378vw - 10.582px), 200px);
  --section: clamp(6rem, 4rem + 6vw, 10rem);
  --pill: 60px;

  /* Buttons and pills: 1.5x the original 40px, 18px text */
  --btn-h: 60px;
  --btn-pad-y: 18px;
  --btn-pad-x: 24px;
  --btn-text: 1.125rem;  /* 18px */
  --btn-gap: 12px;       /* between buttons in a row */
  --icon: 18px;
  --icon-gap: 12px;

  /* Glass, after Apple's iOS materials: translucent white over a strong
     blur that keeps the colours behind it vivid, a bright inner top edge
     and a soft shadow. Black text sits on top. */
  --glass-bg: rgb(255 255 255 / 0.55);
  --glass-filter: blur(24px) saturate(180%);
  --glass-edge:
    inset 0 1px 0 rgb(255 255 255 / 0.8),
    inset 0 0 0 1px rgb(0 0 0 / 0.06),
    0 8px 24px rgb(0 0 0 / 0.08);
}

/* --- Base ------------------------------------------------------------------ */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html {
  scroll-behavior: smooth;
}

/* Lenis (assets/js/smooth.js) takes over scrolling when it runs; these are its
   base styles. CSS smooth scrolling above stays as the no-JavaScript fallback. */
html.lenis,
html.lenis body {
  height: auto;
}

html.lenis {
  scroll-behavior: auto;
}

.lenis:not(.lenis-autoToggle).lenis-stopped {
  overflow: clip;
}

.lenis [data-lenis-prevent],
.lenis [data-lenis-prevent-wheel],
.lenis [data-lenis-prevent-touch] {
  overscroll-behavior: contain;
}

.lenis.lenis-smooth iframe {
  pointer-events: none;
}

/* Sections focused after an in-page link don't need a focus ring. */
[tabindex="-1"]:focus {
  outline: none;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 24px;
  letter-spacing: var(--tracking-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure,
blockquote {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 400;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

[hidden] {
  display: none !important;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

strong,
b {
  font-weight: 600;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

::selection {
  background: var(--highlight);
  color: var(--ink);
}

.wrap {
  padding-inline: var(--gutter);
}

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 100;
  padding: 8px 16px;
  border-radius: var(--pill);
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* --- Shared type ----------------------------------------------------------- */

.display {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: var(--text-h1);
  line-height: 1;
  letter-spacing: var(--tracking-serif);
  text-wrap: balance;
}

.display em {
  letter-spacing: -0.07em;
}

/* A single word set in the sans inside a serif line, as on the reference. */
.display .sans {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.972em;
  letter-spacing: -0.02em;
}

.section-title {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: var(--text-h2);
  line-height: 1.05;
  letter-spacing: var(--tracking-serif);
  text-wrap: balance;
}

.muted {
  color: var(--ink-muted);
}

/* --- Pills: buttons, nav, tags --------------------------------------------- */

/* Hover behaviour follows the reference: the pill tilts 2deg clockwise,
   an icon slides in on the left and widens it, outlined pills dim their
   label to 80%. Same on keyboard focus. Animations run regardless of the
   system "reduce motion" setting (the site owner's choice). */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.button,
.pill {
  --ease: cubic-bezier(0.3, 0.7, 0.2, 1);
  display: inline-flex;
  align-items: center;
  min-height: var(--btn-h);
  padding: var(--btn-pad-y) var(--btn-pad-x);
  border-radius: var(--pill);
  box-shadow: inset 0 0 0 1px rgb(2 2 2 / 0.1);
  font-size: var(--btn-text);
  line-height: 24px;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.35s var(--ease);
}

.button {
  background: var(--ink);
  color: var(--bg);
}

button.button,
button.pill {
  border: 0;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

button.pill {
  background: transparent;
  color: inherit;
}

button.button:disabled,
button.pill:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
}

.btn-icon {
  flex: none;
  width: 0;
  height: var(--icon);
  margin-right: 0;
  opacity: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: translateX(-4px);
  transition:
    width 0.3s var(--ease),
    margin-right 0.3s var(--ease),
    opacity 0.2s ease,
    transform 0.3s var(--ease);
}

.btn-label {
  transition: opacity 0.3s ease;
}

.button:focus-visible,
.pill:focus-visible {
  transform: rotate(2deg);
}

/* Dribbble / Behance pills: the brand's own icon (Simple Icons, CC0), in its
   brand colour, takes the place of the arrow. It slides in on hover exactly
   like the icons in the menu, so these pills move the same way. */
.btn-icon.brand-icon {
  fill: var(--brand, currentColor);
  stroke: none;
}

.button:focus-visible .btn-icon,
.pill:focus-visible .btn-icon {
  width: var(--icon);
  margin-right: var(--icon-gap);
  opacity: 1;
  transform: none;
}

.pill:focus-visible .btn-label {
  opacity: 0.8;
}

@media (hover: hover) {
  .button:hover,
  .pill:hover {
    transform: rotate(2deg);
  }


  .button:hover .btn-icon,
  .pill:hover .btn-icon {
    width: var(--icon);
    margin-right: var(--icon-gap);
    opacity: 1;
    transform: none;
  }

  .pill:hover .btn-label {
    opacity: 0.8;
  }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--btn-gap);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 8px 16px 8px 12px;
  border-radius: var(--pill);
  background: var(--chip);
  font-size: var(--text-sm);
  line-height: 14px;
  white-space: nowrap;
}

.tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dot, var(--ink));
}

/* --- Header ---------------------------------------------------------------- */

/* As on rondesignlab.com: the name and the status scroll away with the page,
   only the header buttons stay pinned at the top. Once the page is scrolled
   (header.js adds .is-scrolled) the pinned pills turn to iOS-style glass.
   Up to 1024px the nav moves into a full-screen glass menu behind a burger
   button on the right. */
.site-header .wrap {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding-block: 16px;
}

.site-nav ul,
.header-end .button {
  position: fixed;
  z-index: 50;
  top: 16px;
}

.site-nav ul {
  left: var(--gutter);
}

/* The pinned list no longer sizes its column, so hold the width the three
   pills take (446px with 18px text) to keep the centred name from sliding
   under them on narrow desktops. Update if the nav labels change. */
.site-nav {
  min-width: 27.875rem;
}

/* 1024–1200px: the bigger buttons leave no room for the status text next to
   the nav, so it shrinks to the green dot, as on phones. */
@media (min-width: 64.0625rem) and (max-width: 75rem) {
  .status {
    font-size: 0;
  }

  .status::before {
    width: 8px;
    height: 8px;
  }
}

.header-end .button {
  right: var(--gutter);
}

/* The pinned "Email me" leaves the row, so an invisible copy of the same
   size keeps the status in place. Keep the text in sync with the button. */
.header-end::after {
  content: "Email me";
  visibility: hidden;
  padding: var(--btn-pad-y) var(--btn-pad-x);
  font-size: var(--btn-text);
  line-height: 24px;
  white-space: nowrap;
}

.site-nav .pill,
.menu-toggle {
  transition:
    transform 0.35s var(--ease),
    background-color 0.3s ease,
    box-shadow 0.3s ease,
    -webkit-backdrop-filter 0.3s ease,
    backdrop-filter 0.3s ease;
}

.site-header.is-scrolled .site-nav .pill,
.site-header.is-scrolled .menu-toggle {
  background: var(--glass-bg);
  box-shadow: var(--glass-edge);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
}

.site-nav ul {
  display: flex;
  gap: var(--btn-gap);
}

.brand {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 1.75rem;
  line-height: 1;
  letter-spacing: -0.05em;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.header-end {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ok);
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

@media (max-width: 64rem) {
  .site-nav {
    display: none;
  }

  .site-header .wrap {
    grid-template-columns: 1fr auto;
  }

  .brand {
    text-align: left;
  }

  /* "Email me" moves into the menu; the burger takes its pinned spot and
     the invisible spacer shrinks to the burger's size. */
  .header-end .button {
    display: none;
  }

  .header-end::after {
    content: "";
    width: var(--btn-h);
    height: var(--btn-h);
    padding: 0;
  }
}

@media (max-width: 36rem) {
  .brand {
    font-size: 1.5rem;
  }

  .status {
    font-size: 0;
  }

  .status::before {
    width: 8px;
    height: 8px;
  }
}

/* Small phones (320–384px): keep the name and the burger on one line. */
@media (max-width: 24rem) {
  .site-header .wrap,
  .header-end {
    gap: 10px;
  }

  .brand {
    font-size: 1.25rem;
  }
}

/* --- Mobile menu (up to 1024px) ------------------------------------------- */

/* Burger on the right, pinned like the desktop buttons: two lines (the lower
   one shorter) that turn into a cross while the menu is open. */
.menu-toggle {
  display: none;
}

@media (max-width: 64rem) {
  .menu-toggle {
    position: fixed;
    z-index: 50;
    top: 16px;
    right: var(--gutter);
    display: inline-flex;
    justify-content: center;
    width: var(--btn-h);
    padding: 0;
  }
}

.menu-toggle-bars {
  position: relative;
  width: 20px;
  height: 12px;
}

.menu-toggle-bars span {
  position: absolute;
  right: 0;
  height: 1.5px;
  border-radius: 1px;
  background: currentColor;
  transition:
    top 0.35s var(--ease),
    width 0.35s var(--ease),
    transform 0.35s var(--ease);
}

.menu-toggle-bars span:first-child {
  top: 1px;
  width: 20px;
}

.menu-toggle-bars span:last-child {
  top: 9.5px;
  width: 13px;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bars span {
  top: 5.25px;
  width: 20px;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bars span:first-child {
  transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bars span:last-child {
  transform: rotate(-45deg);
}

.site-header .menu-toggle[aria-expanded="true"] {
  background: #fff;
}

/* Full-screen sheet of iOS-style glass with black text; items sit on the
   left, as on the reference, and rise in one after another. */
.site-menu {
  display: none;
}

@media (max-width: 64rem) {
  .site-menu {
    position: fixed;
    z-index: 45;
    inset: 0;
    display: block;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: rgb(255 255 255 / 0.62);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    backdrop-filter: blur(30px) saturate(180%);
    opacity: 0;
    visibility: hidden;
    transition:
      opacity 0.35s ease,
      visibility 0s linear 0.35s;
  }

  .site-menu.is-open {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
  }

  html.menu-open {
    overflow: hidden;
  }
}

.site-menu > .wrap {
  display: grid;
  align-content: start;
  min-height: 100%;
  padding-block: 16px 40px;
}

.site-menu-top {
  display: flex;
  align-items: center;
  height: var(--btn-h);
}

.site-menu-brand {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 1.75rem;
  line-height: 1;
  letter-spacing: -0.05em;
  text-decoration: none;
  white-space: nowrap;
}

@media (max-width: 36rem) {
  .site-menu-brand {
    font-size: 1.5rem;
  }
}

@media (max-width: 24rem) {
  .site-menu-brand {
    font-size: 1.25rem;
  }
}

.site-menu-links {
  display: grid;
  justify-items: start;
  margin-top: clamp(2.5rem, 6vh, 4rem);
}

.site-menu-links a {
  display: block;
  padding-block: 8px;
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(2rem, 10.5vw, 4rem);  /* "Recommendations" fits a 320px phone */
  line-height: 1.05;
  letter-spacing: var(--tracking-serif);
  text-decoration: none;
}

.site-menu-foot {
  display: grid;
  justify-items: start;
  gap: 20px;
  margin-top: 40px;
}

.site-menu .status {
  font-size: var(--text-base);
}

.site-menu .status::before {
  width: 6px;
  height: 6px;
}

.site-menu-links li,
.site-menu-foot {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.site-menu.is-open .site-menu-links li,
.site-menu.is-open .site-menu-foot {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.45s ease calc(0.08s + var(--i, 0) * 0.05s),
    transform 0.6s cubic-bezier(0.32, 0.72, 0, 1) calc(0.08s + var(--i, 0) * 0.05s);
}

/* --- Hidden "Play with me!" button under the name ------------------------- */

/* Appears right under the name on hover or keyboard focus as an outlined
   button (white so it stays readable over the page), and behaves like the
   other pills when pointed at: tilts 2deg and slides its icon in. */
.brand-wrap {
  position: relative;
  justify-self: center;
}

.play-pill {
  --play-x: -50%;
  position: absolute;
  z-index: 20;
  top: 100%;
  left: 50%;
  margin-top: 10px;
  background: var(--bg);
  opacity: 0;
  visibility: hidden;
  transform: translate(var(--play-x), -6px);
  transition:
    opacity 0.15s ease,
    transform 0.3s var(--ease),
    visibility 0s linear 0.15s;
}

/* Invisible bridge so the pointer can travel from the name to the button. */
.brand-wrap:hover::after {
  content: "";
  position: absolute;
  top: 100%;
  left: -16px;
  right: -16px;
  height: 14px;
}

.brand-wrap:hover .play-pill,
.brand-wrap:focus-within .play-pill {
  opacity: 1;
  visibility: visible;
  transform: translate(var(--play-x), 0);
  transition:
    opacity 0.15s ease,
    transform 0.35s var(--ease),
    visibility 0s;
}

/* The shared pill hover/focus tilt would drop the centring translate. */
.brand-wrap .play-pill:focus-visible {
  transform: translate(var(--play-x), 0) rotate(2deg);
}

@media (hover: hover) {
  .brand-wrap .play-pill:hover {
    transform: translate(var(--play-x), 0) rotate(2deg);
  }
}

@media (max-width: 64rem) {
  .brand-wrap {
    justify-self: start;
  }

  .play-pill {
    --play-x: 0px;
    left: 0;
  }
}

/* --- Section scaffolding --------------------------------------------------- */

.section {
  padding-top: var(--section);
  scroll-margin-top: 24px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
  margin-bottom: 48px;
}

.section-note a {
  color: var(--ink);
}

/* --- Hero ------------------------------------------------------------------ */

.hero {
  padding-top: clamp(3rem, 2rem + 4vw, 6rem);
}

.hero .display {
  max-width: 11.5em;
}

.hero-intro {
  max-width: 40rem;
  margin-top: 24px;
}

.hero .tags {
  margin-top: 24px;
}

.hero .actions {
  margin-top: 48px;
}

/* Headline and copy on the left, the portrait opposite on the right. */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 48px;
  align-items: start;
}

.hero-photo {
  overflow: hidden;
  background: var(--panel);
}

.hero-photo img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: 62% 40%;
}

@media (max-width: 52rem) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-photo img {
    aspect-ratio: 4 / 3;
  }
}

/* --- Clients --------------------------------------------------------------- */

.clients-caption {
  max-width: 52rem;
  margin-inline: auto;
  font-size: var(--text-sm);
  line-height: 17px;
  text-align: center;
}

.logos-track {
  margin-top: 40px;
}

.logos {
  --logo-gap: 64px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 40px var(--logo-gap);
}

.logos li {
  flex: none;
}

.logos img {
  filter: grayscale(1);
  opacity: 0.6;
}

@media (max-width: 36rem) {
  .logos {
    --logo-gap: 40px;
    row-gap: 32px;
  }
}

/* logos.js turns the row into a slow, endless marquee: enough copies side
   by side to fill the strip, shifted left by exactly one copy per loop. */
.logos-track.is-measuring .logos,
.logos-track.is-marquee .logos {
  flex-wrap: nowrap;
  width: max-content;
}

.logos-track.is-marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.logos-track.is-marquee .logos-inner {
  display: flex;
  width: max-content;
  animation: logos-marquee var(--marquee-duration, 60s) linear infinite;
}

.logos-track.is-marquee .logos {
  justify-content: flex-start;
  padding-right: var(--logo-gap);
}

.logos-track.is-marquee:hover .logos-inner {
  animation-play-state: paused;
}

@keyframes logos-marquee {
  to {
    transform: translateX(var(--marquee-shift, -50%));
  }
}

/* --- Work ------------------------------------------------------------------ */

/* Each case sits in its own card, after the "Explore featured public
   notebooks" cards on notebook.google: rounded 24px and a soft multicolour
   glow peeking out around the edges. It lies flat at rest (no shadow); a
   soft shadow fades in only on hover.
   Unlike the reference there is no white plate: the inside stays clear and
   only the glow outside the card shows. The card reaches out past the page
   margins by its own side padding, so the text and images inside stay on the
   same lines as the rest of the page. */
.project {
  --card-r: 24px;
  --card-pad-x: clamp(14px, 3.5vw, 48px);
  --card-pad-y: clamp(20px, 3.5vw, 48px);
  position: relative;
  isolation: isolate;
  margin-inline: calc(var(--card-pad-x) * -1);
  padding: var(--card-pad-y) var(--card-pad-x);
  border-radius: var(--card-r);
  box-shadow: 0 8px 16px rgb(0 0 0 / 0);
  transition: box-shadow 0.3s ease;
}

@media (hover: hover) {
  .project:hover {
    box-shadow: 0 8px 16px rgb(0 0 0 / 0.1);
  }
}

.project + .project {
  margin-top: clamp(2.5rem, 1.5rem + 2.5vw, 4rem);
}

/* The glow overflows the card by up to ~40px; keep it from widening the page
   on phones. */
#work {
  overflow-x: clip;
}

/* .project-glow is a frame 40px larger than the card whose middle (the card
   itself, same rounded corners) is masked out; inside it the blurred
   gradient is drawn over the card area, so only the part that spills
   outside stays visible. */
.project-glow {
  --halo: 40px;
  position: absolute;
  z-index: -1;
  inset: calc(var(--halo) * -1);
  padding: var(--halo);
  border-radius: calc(var(--card-r) + var(--halo));
  pointer-events: none;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box exclude,
    linear-gradient(#000 0 0);
}

/* Offsets and gradients copy the reference's four cards, in turn. */
.project-glow::before {
  content: "";
  position: absolute;
  inset:
    calc(var(--halo) + var(--glow-t))
    calc(var(--halo) + var(--glow-r))
    calc(var(--halo) + var(--glow-b))
    calc(var(--halo) + var(--glow-l));
  border-radius: var(--card-r);
  background: var(--glow);
  filter: blur(10px);
  opacity: 0.18;
}

.project:nth-of-type(4n + 1) .project-glow {
  --glow-t: -4px;
  --glow-b: 4px;
  --glow-l: -2px;
  --glow-r: 0px;
  --glow: conic-gradient(from 90deg at 48.46% 50%, #3186ff -57.57deg, #3186ff 0.08deg, #3186ff 88.47deg, #757cff 110.55deg, #9378ff 120.2deg, #f96bd6 131.39deg, #fc413d 143.35deg, #fc413d 151.46deg, #ff6b2b 164.1deg, #fec700 178.85deg, #ffdb0f 190.07deg, #88de42 203.31deg, #0ebc5f 214.62deg, #00af57 225.74deg, #3186ff 302.43deg, #3186ff 360.08deg);
}

.project:nth-of-type(4n + 2) .project-glow {
  --glow-t: -2px;
  --glow-b: -2px;
  --glow-l: 4px;
  --glow-r: -5px;
  --glow: conic-gradient(from 90deg at 48.46% 50%, #3186ff -40.88deg, #9378ff 5.33deg, #f96bd6 14.98deg, #fc413d 25.34deg, #fc413d 35.81deg, #ff6b2b 45.65deg, #fec700 54.85deg, #ffdb0f 62.95deg, #88de42 70.59deg, #0ebc5f 79.27deg, #00af57 86.59deg, #3186ff 119.76deg, #3186ff 216.78deg, #3186ff 319.12deg, #9378ff 365.33deg);
}

.project:nth-of-type(4n + 3) .project-glow {
  --glow-t: -4px;
  --glow-b: 4px;
  --glow-l: -2px;
  --glow-r: 0px;
  --glow: conic-gradient(from 90deg at 48.46% 50%, #3186ff -49.07deg, #3186ff 89.77deg, #3186ff 152.85deg, #9378ff 196.17deg, #f96bd6 204.23deg, #fc413d 212.42deg, #fc413d 218.61deg, #ff6b2b 225.43deg, #fec700 231.2deg, #ffdb0f 237.65deg, #88de42 243.27deg, #0ebc5f 248.99deg, #00af57 254.87deg, #3186ff 310.93deg, #3186ff 449.77deg);
}

.project:nth-of-type(4n + 4) .project-glow {
  --glow-t: 4px;
  --glow-b: -4px;
  --glow-l: 4px;
  --glow-r: -2px;
  --glow: conic-gradient(from 90deg at 48.46% 50%, #3186ff -36.67deg, #3186ff 43.75deg, #9378ff 83.48deg, #f96bd6 92.17deg, #fc413d 101.01deg, #fc413d 109.05deg, #fc413d 116.56deg, #ff6b2b 124.25deg, #fec700 132.38deg, #ffdb0f 140.92deg, #88de42 148.62deg, #0ebc5f 157deg, #00af57 165.98deg, #3186ff 208.31deg, #3186ff 323.33deg, #3186ff 403.75deg);
}

.project-head {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr) auto;
  gap: 16px 48px;
  align-items: start;
}

.project-head h3 {
  font-size: var(--text-title);
  line-height: 32px;
  letter-spacing: -0.01em;
}

.project-head h3 a {
  text-decoration: none;
}

.project-head h3 a:hover {
  text-decoration: underline;
}

.project-head .tags {
  margin-top: 16px;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.project-gallery a {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: 24px;
  overflow: hidden;
  background: var(--panel);
}

.project-gallery img {
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 8px 24px rgb(0 0 0 / 0.08);
}

.project-gallery a.cover {
  padding: 0;
}

.project-gallery a.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  box-shadow: none;
}

@media (max-width: 64rem) {
  .project-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .project-head > p {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 36rem) {
  .project-head {
    grid-template-columns: 1fr;
  }

  .project-head > p {
    grid-row: auto;
  }

  .project-head .button {
    justify-self: start;
  }
}

@media (max-width: 52rem) {
  .project-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .project-gallery a {
    padding: 12px;
  }
}

/* --- Experience ------------------------------------------------------------ */

.ledger li {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 5fr) minmax(0, 4fr);
  gap: 4px 32px;
  padding-block: 20px;
  border-top: 1px solid var(--line);
}

.ledger li:last-child {
  border-bottom: 1px solid var(--line);
}

.ledger-period {
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
  white-space: nowrap;
}

.ledger-org p,
.ledger-type {
  color: var(--ink-muted);
}

.ledger-type {
  display: block;
}

@media (max-width: 52rem) {
  .ledger li {
    grid-template-columns: 1fr;
  }

  .ledger-period {
    order: -1;
    font-size: var(--text-sm);
  }

  .ledger-role {
    margin-top: 8px;
  }
}

/* --- Skills ---------------------------------------------------------------- */

.skills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px 64px;
}

.skills h3 {
  margin-bottom: 12px;
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 18px;
}

.skills li {
  display: flex;
  gap: 6px;
}

.skills li::before {
  content: "→";
  flex: none;
}

.skills li + li {
  margin-top: 4px;
}

@media (max-width: 52rem) {
  .skills {
    grid-template-columns: 1fr;
  }
}

/* --- Recommendations ------------------------------------------------------- */

/* Metrics follow the reference: equal columns 64px apart, 16/24 text,
   18px between quote and attribution, 48px round mark 16px from the name. */
.quotes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 64px;
}

.quote {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}

.quote blockquote {
  hanging-punctuation: first;
}

.quote figcaption {
  display: flex;
  align-items: center;
  gap: 16px;
}

.quote-mark {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.quote figcaption .quote-mark[src$=".webp"] {
  box-shadow: inset 0 0 0 1px var(--line);
  background: var(--panel);
}

.quote-meta {
  display: grid;
}

.quote-context {
  color: var(--ink-muted);
}

@media (max-width: 64rem) {
  .quotes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 40rem) {
  .quotes {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

/* --- Contact --------------------------------------------------------------- */

.contact {
  padding-bottom: var(--section);
}

.contact .wrap {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px;
  align-items: start;
}

.contact-intro p {
  max-width: 26rem;
  margin-top: 24px;
}

.contact-intro .actions {
  margin-top: 24px;
}

.contact-links {
  max-width: 40rem;
}

.contact-links a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-block: 12px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.contact-links li:first-child a {
  border-top: 1px solid var(--line);
}

.contact-links a span:last-child {
  color: var(--ink-muted);
}

.contact-links a:hover span:first-child {
  text-decoration: underline;
}

@media (max-width: 52rem) {
  .contact .wrap {
    grid-template-columns: 1fr;
  }
}

/* --- Footer ---------------------------------------------------------------- */

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding-block: 24px;
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.site-footer a {
  color: var(--ink);
}

/* --- Case study page ------------------------------------------------------- */

.case {
  padding-top: clamp(2rem, 1rem + 3vw, 4rem);
  padding-bottom: var(--section);
}

.back-link {
  margin-bottom: 40px;
}

.case-title {
  max-width: 14em;
}

.case-lede {
  max-width: 40rem;
  margin-top: 24px;
}

.case .tags {
  margin-top: 24px;
}

.case-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.case-facts dt {
  color: var(--ink-muted);
}

@media (max-width: 52rem) {
  .case-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.case-cover {
  margin-top: 48px;
  background: var(--panel);
}

.case-cover img {
  width: 100%;
  max-height: 48rem;
  object-fit: cover;
}

.case-section {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 16px 48px;
  margin-top: clamp(4rem, 3rem + 3vw, 7rem);
}

.case-section h2 {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(2rem, 1.4rem + 1.8vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: var(--tracking-serif);
}

.case-copy {
  display: grid;
  gap: 16px;
  max-width: 40rem;
  color: var(--ink-soft);
}

.case-copy li {
  display: flex;
  gap: 6px;
}

.case-copy li::before {
  content: "→";
  flex: none;
  color: var(--ink);
}

.case-copy li + li {
  margin-top: 4px;
}

.case-section > figure,
.case-section > .gallery {
  grid-column: 1 / -1;
  margin-top: 32px;
}

@media (max-width: 52rem) {
  .case-section {
    grid-template-columns: 1fr;
  }
}

.shot {
  padding: clamp(12px, 2vw, 40px);
  background: var(--panel);
}

.shot img {
  width: 100%;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 8px 24px rgb(0 0 0 / 0.08);
}

.shot figcaption {
  margin-top: 16px;
  font-size: var(--text-sm);
  line-height: 18px;
  color: var(--ink-muted);
}

/* Device mockups that bring their own background */
.shot-plain {
  padding: 0;
  background: none;
}

.shot-plain img {
  box-shadow: none;
}

/* Very tall compositions (long Behance boards) are shown narrower so they
   don't take over the page. */
.shot-tall {
  max-width: 56rem;
  margin-inline: auto;
}

/* Two screenshots side by side on one grey panel; stacked on phones. */
.shot-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 32px);
  align-items: start;
}

.shot-row a,
.shot > a {
  display: block;
}

@media (max-width: 40rem) {
  .shot-row {
    grid-template-columns: 1fr;
  }
}

.case-copy strong {
  color: var(--ink);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.gallery .shot-wide {
  grid-column: 1 / -1;
}

@media (max-width: 52rem) {
  .gallery {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.case-next {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 24px 48px;
  align-items: end;
  margin-top: var(--section);
}

@media (max-width: 52rem) {
  .case-next {
    grid-template-columns: 1fr;
  }
}

/* --- 404 ------------------------------------------------------------------- */

.not-found {
  display: grid;
  gap: 24px;
  justify-items: start;
  padding-block: clamp(4rem, 3rem + 8vw, 10rem);
}

/* --- Right-click tooltip (copyright.js) ------------------------------------ */

/* Images can't be dragged out or long-pressed into "Save image" on iOS. */
img {
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

.copy-tip {
  position: fixed;
  z-index: 200;
  max-width: min(32rem, calc(100vw - 24px));
  padding: 10px 16px;
  border-radius: 20px;
  background: var(--ink);
  color: var(--bg);
  font-size: var(--text-sm);
  line-height: 20px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px) scale(0.96);
  transform-origin: top left;
  transition:
    opacity 0.18s ease,
    transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}

.copy-tip.is-visible {
  opacity: 1;
  transform: none;
}
