/*
Theme Name: Benjamin Abbott
Theme URI: https://benjaminabbott.co.uk/
Author: Benjamin Abbott
Author URI: https://benjaminabbott.co.uk/
Description: One-page portfolio for Benjamin Abbott, web and UX designer in Durham, North East England. 3D cairn hero, preloader, corner-reveal images, case study popups, smooth scrolling, custom cursor and light/dark modes.
Version: 1.1.0
Requires at least: 6.3
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: benjaminabbott
*/

/* Layout: a tracked-out name spanning the page (after the existing wordmark), then case studies as wide alternating rows on a cool blue-grey paper, one electric-blue accent (#2535E8). */
:root {
  --paper: #eeeff4;
  --surface: #f7f8fb;
  --ink: #12142a;
  --muted: #565a74;
  --rule: #cbcede;
  --accent: #2535e8;
  --accent-ink: #2535e8;
  --on-accent: #ffffff;

  --font-display: "Big Shoulders Display", "Arial Narrow", "Helvetica Neue Condensed", sans-serif;
  --font-body: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --step--1: 0.7313rem;
  --step-0: 0.9563rem;
  --step-1: 1.1813rem;
  --step-2: clamp(1.44rem, 1.08rem + 1.44vw, 2.025rem);
  --step-3: clamp(2.16rem, 1.44rem + 3.06vw, 3.6rem);
  --step-hero: clamp(2.52rem, 0.72rem + 9vw, 8.325rem);

  --gutter: clamp(18px, 4.5vw, 58px);
  --max: 1188px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d0e17; --surface: #151726; --ink: #e8e9f3; --muted: #9a9db8;
    --rule: #272a40; --accent: #2535e8; --accent-ink: #9aa3ff; --on-accent: #ffffff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0d0e17; --surface: #151726; --ink: #e8e9f3; --muted: #9a9db8;
  --rule: #272a40; --accent: #2535e8; --accent-ink: #9aa3ff; --on-accent: #ffffff;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.label {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Header */
.site-head {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(9px);
  border-bottom: 1px solid var(--rule);
}
.site-head .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding-block: 18px;
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: 0.32em;
  text-decoration: none;
  white-space: nowrap;
}
.site-nav { display: flex; align-items: center; gap: clamp(16px, 3.15vw, 40px); }
.site-nav a {
  font-size: 0.8438rem; font-weight: 500; text-decoration: none; color: var(--muted);
  transition: color .2s;
}
.site-nav a:hover { color: var(--ink); }
@media (max-width: 560px) { .site-nav a:not(.nav-contact):not(.linkedin) { display: none; } }
.nav-contact { color: var(--accent-ink) !important; }
.linkedin { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); text-decoration: none; transition: color .2s; }
.linkedin:hover { color: var(--accent-ink); }
.linkedin svg { display: block; flex: none; }
.site-foot .linkedin { font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.08em; text-transform: uppercase; }

/* Hero */
.hero { position: relative; overflow: clip; padding-block: clamp(50px, 9vw, 122px) clamp(65px, 9.9vw, 137px); }
.hero > .wrap { position: relative; z-index: 1; }
.hero-3d {
  position: absolute; left: 0; top: 0; z-index: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.hero-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 7.2px 22px; }
.status { display: inline-flex; align-items: center; gap: 7.2px; }
.status::before {
  content: ""; width: 7.2px; height: 7.2px; border-radius: 50%; background: var(--accent-ink);
  box-shadow: 0 0 0 3.6px color-mix(in srgb, var(--accent-ink) 22%, transparent);
}
.name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--step-hero);
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-right: -0.14em;
  animation: track 1.4s cubic-bezier(.2,.7,.1,1) both;
}
.name span { display: block; }
.name span + span { color: var(--accent-ink); }
@keyframes track { from { letter-spacing: -0.01em; } to { letter-spacing: 0.14em; } }

.hero-main {
  display: grid; gap: 36px clamp(43px, 5.4vw, 86px);
  grid-template-columns: minmax(0, 1fr) minmax(252px, 306px);
  align-items: end;
  margin-block: clamp(29px, 4.5vw, 58px) clamp(40px, 5.4vw, 72px);
}
@media (max-width: 1100px) { .hero-main { grid-template-columns: minmax(0, 1fr); } }
.hero-copy { display: grid; gap: 25px; min-width: 0; padding-bottom: 0.36rem; }
.lede { font-size: clamp(1.26rem, 0.99rem + 0.9vw, 1.575rem); line-height: 1.25; font-weight: 500; letter-spacing: -0.01em; max-width: 22ch; }
.hero-copy p:not(.lede) { color: var(--muted); max-width: 46ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; padding-top: 7.2px; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 14px 23px; font-weight: 600; font-size: 0.8438rem; text-decoration: none;
  border: 1px solid var(--ink); border-radius: 899px; transition: background .2s, color .2s;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

/* Under the name: a short project index on the left, a smaller photo on the right */
.hero-foot {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(28px, 4vw, 58px); align-items: end;
  border-top: 1px solid var(--ink); padding-top: clamp(32px, 4.5vw, 58px);
}
.portrait { margin: 0; min-width: 0; }
.portrait img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: 60% var(--py, 32%); }
.hero-index { display: grid; gap: 14px; min-width: 0; }
.hero-index ul { list-style: none; margin: 0; padding: 0; display: grid; }
.hero-index a {
  display: grid; gap: 4px; padding-block: 14px; border-bottom: 1px solid var(--rule); text-decoration: none;
  font-family: var(--font-display); font-weight: 700; font-size: clamp(1.2rem, 0.9rem + 0.9vw, 1.6rem);
  text-transform: uppercase; letter-spacing: 0.05em; line-height: 1.05; transition: color .2s, padding-left .3s cubic-bezier(.16, 1, .3, 1);
}
.hero-index li:first-child a { border-top: 1px solid var(--rule); }
.hero-index a:hover { color: var(--accent-ink); padding-left: 8px; }
.hero-index small { font-family: var(--font-mono); font-weight: 400; }
@media (max-width: 700px) {
  .hero-foot { grid-template-columns: minmax(0, 1fr); }
  .hero-index { order: 2; }
  .portrait img { aspect-ratio: 4 / 3; }
}

/* Section heads */
section { scroll-margin-top: 76px; }
.section-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 43px;
  padding-bottom: 29px; margin-bottom: clamp(14px, 2.7vw, 29px);
  position: relative;
}
.section-head h2 {
  font-family: var(--font-display); font-weight: 800; font-size: var(--step-3);
  text-transform: uppercase; letter-spacing: 0.06em; line-height: 1;
}
.section-head p { color: var(--muted); max-width: 44ch; }

/* Work */
.work { padding-block: clamp(72px, 9.9vw, 144px); }
.project {
  display: grid; gap: clamp(32px, 5.4vw, 94px);
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: center;
  padding-block: clamp(50px, 7.2vw, 101px);
  border-bottom: 1px solid var(--rule);
}
.project:nth-of-type(even) { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.project:nth-of-type(even) .project-media { order: 2; }
@media (max-width: 820px) {
  .project, .project:nth-of-type(even) { grid-template-columns: minmax(0, 1fr); }
  .project:nth-of-type(even) .project-media { order: 0; }
}
/* Image pairs stretch to the full height of the row so no gap opens under them */
.project-media {
  display: grid; grid-template-columns: 2fr 1fr; gap: 16px; min-width: 0;
  align-self: stretch; min-height: clamp(252px, 28.8vw, 414px);
}
.project-media img { width: 100%; height: 100%; object-fit: cover; }
.project-media.single { grid-template-columns: minmax(0, 1fr); align-self: center; min-height: 0; }
.project-media.single img { aspect-ratio: 1 / 1; }
.project-media .frame { overflow: hidden; background: var(--surface); min-height: 0; }
.project-media .frame img { transition: transform .6s cubic-bezier(.2,.7,.1,1); }
.project:hover .frame img { transform: scale(1.03); }
.project-text { display: grid; gap: 27px; min-width: 0; }
.project-meta { display: flex; flex-wrap: wrap; gap: 7.2px 18px; }
.project h3 {
  font-family: var(--font-display); font-weight: 800; font-size: var(--step-3);
  text-transform: uppercase; letter-spacing: 0.04em; line-height: 0.95;
}
.brief {
  margin: 0; padding-left: 22px; border-left: 2px solid var(--accent-ink);
  font-size: var(--step-1); line-height: 1.4; max-width: 34ch;
}
.brief cite { display: block; margin-top: 13px; font-style: normal; }
.project-text > p { color: var(--muted); max-width: 52ch; }
.tags { display: flex; flex-wrap: wrap; gap: 9px; padding: 0; margin: 0; list-style: none; }
.tags li {
  font-family: var(--font-mono); font-size: 0.675rem; letter-spacing: 0.04em;
  padding: 5.4px 13px; border: 1px solid var(--rule); border-radius: 899px; color: var(--muted);
}
.read-more {
  justify-self: start; font-weight: 600; text-decoration: none; color: var(--accent-ink);
  border-bottom: 1px solid currentColor; padding-bottom: 2px;
}
.read-more span { display: inline-block; transition: transform .2s; }
.read-more:hover span { transform: translateX(3.6px); }

/* Process */
.process { padding-block: clamp(72px, 9.9vw, 144px); background: var(--surface); }
.steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(32px, 4.5vw, 65px);
  padding-top: clamp(32px, 4.5vw, 58px);
}
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .steps { grid-template-columns: minmax(0, 1fr); } }
.steps li { display: grid; gap: 14px; align-content: start; }
.steps .num {
  font-family: var(--font-display); font-weight: 800; font-size: 2.7rem; line-height: 1; color: var(--accent-ink);
  font-variant-numeric: tabular-nums;
}
.steps h3 { font-size: var(--step-1); font-weight: 600; }
.steps p { color: var(--muted); font-size: 0.8888rem; }

/* About */
.about { padding-block: clamp(72px, 9.9vw, 144px); }
.about-grid {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(40px, 6.3vw, 101px);
  padding-top: clamp(32px, 4.5vw, 58px);
}
@media (max-width: 820px) { .about-grid { grid-template-columns: minmax(0, 1fr); } }
.about-copy { display: grid; gap: 25px; font-size: var(--step-1); line-height: 1.5; max-width: 38ch; }
.about-copy p + p { color: var(--muted); font-size: var(--step-0); line-height: 1.6; max-width: 56ch; }
.facts { margin: 0; display: grid; gap: 0; align-content: start; }
.facts div {
  display: grid; grid-template-columns: 8.1rem minmax(0, 1fr); gap: 22px;
  padding-block: 20px; border-bottom: 1px solid var(--rule);
}
.facts div:first-child { border-top: 1px solid var(--rule); }
.facts dt { font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.facts dd { margin: 0; }

/* Contact */
.contact { background: var(--accent); color: var(--on-accent); padding-block: clamp(79px, 10.8vw, 158px); }
.contact .wrap {
  display: grid; gap: 58px clamp(43px, 7.2vw, 122px);
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: end;
}
@media (max-width: 820px) { .contact .wrap { grid-template-columns: minmax(0, 1fr); } }
.contact-main { display: grid; gap: 36px; min-width: 0; }
.services { list-style: none; margin: 0; padding: 0; display: grid; min-width: 0; }
.services-head { padding-bottom: 18px; }
.services li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 22px;
  padding-block: 22px; border-top: 1px solid color-mix(in srgb, var(--on-accent) 35%, transparent);
}
.services li:last-child { border-bottom: 1px solid color-mix(in srgb, var(--on-accent) 35%, transparent); }
.services strong { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.26rem, 0.9rem + 1.08vw, 1.71rem); text-transform: uppercase; letter-spacing: 0.05em; line-height: 1.1; }
.services span { font-size: 0.7875rem; opacity: .8; text-align: right; }
.contact .label { color: inherit; opacity: .8; }
.contact h2 {
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(2.34rem, 0.9rem + 6.3vw, 6.3rem); line-height: 1; letter-spacing: 0.04em; max-width: 12ch;
}
.contact p { max-width: 48ch; opacity: .9; }
.email-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 25px; }
.email {
  font-family: var(--font-mono); font-size: clamp(0.9rem, 0.72rem + 0.9vw, 1.2375rem);
  user-select: all; overflow-wrap: anywhere;
  text-decoration: none; border-bottom: 1px solid currentColor;
}
.copy-btn {
  font: 600 0.7875rem var(--font-body); color: var(--accent); background: var(--on-accent);
  border: 0; border-radius: 899px; padding: 12px 22px; cursor: pointer;
}
.copy-btn:focus-visible { outline-color: var(--on-accent); }

.site-foot .wrap {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px;
  padding-block: 36px;
}


/* Light / dark toggle in the header */
.theme-toggle {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center; padding: 0;
  color: var(--ink); background: transparent; border: 1px solid var(--rule); border-radius: 50%; cursor: pointer;
  transition: background-color .25s, color .25s, border-color .25s;
}
.theme-toggle:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.theme-toggle svg { grid-area: 1 / 1; transition: opacity .35s, rotate .5s cubic-bezier(.16, 1, .3, 1), scale .5s cubic-bezier(.16, 1, .3, 1); }
.theme-toggle[data-mode="dark"] .icon-moon, .theme-toggle[data-mode="light"] .icon-sun { opacity: 0; rotate: -90deg; scale: .5; }
.theme-toggle:not([data-mode]) .icon-moon { opacity: 0; }
/* Brief cross-fade while the theme switches */
html.theme-fade, html.theme-fade *, html.theme-fade *::before, html.theme-fade *::after {
  transition: background-color .45s ease, color .45s ease, border-color .45s ease, fill .45s ease !important;
}

/* Custom cursor: a dot that tracks the pointer and a ring that trails it; mouse and trackpad only */
.project-media[data-cursor] { cursor: pointer; }
html.has-cursor, html.has-cursor * { cursor: none !important; }
.cursor { position: fixed; inset: 0; z-index: 200; pointer-events: none; transition: opacity .3s; }
.cursor.is-hidden { opacity: 0; }
.cursor-dot, .cursor-ring {
  position: fixed; left: 0; top: 0; border-radius: 50%;
  translate: calc(var(--x, -100px) - 50%) calc(var(--y, -100px) - 50%);
}
.cursor-dot { width: 5.4px; height: 5.4px; background: var(--accent-ink); transition: scale .25s, background-color .3s; }
.cursor-ring {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1.5px solid var(--accent-ink);
  transition: width .45s cubic-bezier(.16, 1, .3, 1), height .45s cubic-bezier(.16, 1, .3, 1),
    background-color .3s, border-color .3s, scale .2s;
}
.cursor-label {
  font-family: var(--font-mono); font-size: 0.675rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--on-accent); opacity: 0; scale: .6; transition: opacity .25s, scale .35s cubic-bezier(.16, 1, .3, 1);
}
.cursor.is-link .cursor-ring { width: 54px; height: 54px; background: color-mix(in srgb, var(--accent-ink) 16%, transparent); }
.cursor.is-link .cursor-dot, .cursor.is-label .cursor-dot { scale: 0; }
.cursor.is-label .cursor-ring { width: 90px; height: 90px; background: var(--accent); border-color: var(--accent); }
.cursor.is-label .cursor-label { opacity: 1; scale: 1; }
.cursor.is-down .cursor-ring { scale: .82; }
/* On blue surfaces (contact, preloader) the cursor turns white */
.cursor.on-accent .cursor-dot { background: var(--on-accent); }
.cursor.on-accent .cursor-ring { border-color: var(--on-accent); }
.cursor.on-accent.is-link .cursor-ring { background: color-mix(in srgb, var(--on-accent) 20%, transparent); }
.cursor.on-accent.is-label .cursor-ring { background: var(--on-accent); }
.cursor.on-accent .cursor-label { color: var(--accent); }

/* Smooth scroll (Lenis): its own recommended rules */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: clip; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }

/* Case study popups */
.is-case-open { overflow: hidden; }
.case {
  width: min(100% - 2 * var(--gutter), 1008px); max-width: none;
  max-height: calc(100% - 43px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  margin: auto; padding: 0; border: 0; border-radius: 18px;
  background: var(--paper); color: var(--ink);
  overflow: hidden; overscroll-behavior: contain;
}
.case[open] { display: flex; flex-direction: column; animation: case-in .7s cubic-bezier(.16, 1, .3, 1); }
.case.closing { animation: case-out .35s cubic-bezier(.7, 0, .84, 0) forwards; }
.case::backdrop { background: color-mix(in srgb, var(--ink) 55%, transparent); backdrop-filter: blur(5.4px); }
.case[open]::backdrop { animation: fade-in .5s ease; }
.case.closing::backdrop { animation: fade-in .35s ease reverse forwards; }
@keyframes case-in { from { opacity: 0; transform: translateY(72px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes case-out { to { opacity: 0; transform: translateY(54px) scale(.97); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.case-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px clamp(18px, 3.6vw, 43px); border-bottom: 1px solid var(--rule);
}
.case-close {
  display: inline-flex; align-items: center; gap: 7.2px;
  font: 600 0.7875rem var(--font-body); color: var(--ink); background: transparent;
  border: 1px solid var(--rule); border-radius: 899px; padding: 8.1px 14px; cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.case-close:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.case-scroll { overflow-y: auto; padding: clamp(25px, 4.5vw, 58px) clamp(18px, 3.6vw, 43px) clamp(32px, 4.5vw, 58px); display: grid; gap: clamp(29px, 4.5vw, 50px); }
.case h2 {
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(2.34rem, 1.26rem + 4.5vw, 4.95rem); line-height: .92; letter-spacing: 0.04em;
}
.case-cover { margin: 0; border-radius: 11px; overflow: hidden; background: var(--surface); }
.case-cover img { width: 100%; aspect-ratio: 16 / 9; max-height: 70vh; object-fit: cover; }
.case-body { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(25px, 4.5vw, 65px); align-items: start; }
@media (max-width: 820px) { .case-body { grid-template-columns: minmax(0, 1fr); } }
.case-body .brief { max-width: none; display: grid; gap: 13px; }
.case-body .brief p { margin: 0; }
.case-copy { display: grid; gap: 18px; color: var(--muted); }
.case-copy p { max-width: 60ch; }
.case-links { display: flex; flex-wrap: wrap; gap: 11px; padding-top: 3.6px; }
.case-links a { font-size: 0.7875rem; }
.case-links small { font-weight: 400; opacity: .7; }
.case-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 600px) { .case-gallery { grid-template-columns: minmax(0, 1fr); } }
.case-gallery figure { margin: 0; display: grid; gap: 9px; }
.case-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 11px; background: var(--surface); }
.case-foot { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding-top: 22px; border-top: 1px solid var(--rule); }
.case-next { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink); text-align: right; display: grid; gap: 3.6px; }
.case-next strong { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; font-size: clamp(1.44rem, 1.08rem + 1.35vw, 2.16rem); line-height: 1; transition: color .2s; }
.case-next:hover strong { color: var(--accent-ink); }

/* Scroll motion: only content that starts below the fold is held back, and only while JS runs */
.section-head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--ink); transform-origin: left;
  transition: transform 1.6s cubic-bezier(.77, 0, .18, 1);
}
.section-head.rv-pre::after { transform: scaleX(0); }
.rv-up {
  transition: opacity 1s ease, transform 1.4s cubic-bezier(.16, 1, .3, 1);
  transition-delay: var(--rv-delay, 0ms);
}
.rv-up.rv-pre { opacity: 0; transform: translateY(108px) rotate(3deg) scale(.94); transform-origin: left top; }
.rv-title {
  transition: opacity .9s ease, transform 1.5s cubic-bezier(.16, 1, .3, 1);
  transform-origin: left bottom;
  transition-delay: var(--rv-delay, 0ms);
}
.rv-title.rv-pre { opacity: 0; transform: translateY(90%) skewY(9deg); }
/* Corner clip reveal (after hobro.digital): images grow out of one corner as they enter,
   shrink into another as they leave, and round their corners on hover */
.clip-reveal {
  --clip-top: 0%; --clip-right: 0%; --clip-bottom: 0%; --clip-left: 0%; --clip-radius: 0px;
  clip-path: inset(var(--clip-top) var(--clip-right) var(--clip-bottom) var(--clip-left) round var(--clip-radius));
}
.clip-reveal.clip-ready { transition: clip-path 1s cubic-bezier(.25, .46, .45, .94); } /* hobro uses GSAP's power1.out over 1s */
.clip-reveal:hover, .project:hover .clip-reveal { --clip-radius: 27px; }
.steps .num { display: inline-block; transform-origin: left bottom; transition: transform 1.2s cubic-bezier(.34, 1.56, .64, 1) calc(var(--rv-delay, 0ms) + 250ms); }
.steps li.rv-pre .num { transform: scale(.2) rotate(-20deg); }
.scroll-progress {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
  background: var(--accent-ink); transform-origin: left; transform: scaleX(var(--sp, 0));
}

/* Preloader: shown only when its script runs, then zooms through into the page */
.preloader { display: none; }
.is-loading body { overflow: hidden; }
.is-loading .name { animation-play-state: paused; }
.preloader {
  position: fixed; inset: 0; z-index: 100;
  place-items: center;
  padding: calc(22px + env(safe-area-inset-top, 0px)) var(--gutter) calc(22px + env(safe-area-inset-bottom, 0px));
  background: var(--accent); color: var(--on-accent);
  transform-origin: 50% 50%;
}
.is-loading .preloader, .preloader.leaving { display: grid; }
.preloader-inner { width: 100%; height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.preloader .label { color: inherit; opacity: .8; }
.preloader-word {
  place-self: center; display: flex; overflow: hidden;
  font-family: var(--font-display); font-weight: 800; font-size: clamp(1.44rem, 0.9rem + 2.7vw, 2.7rem); letter-spacing: 0.32em;
  margin-right: -0.32em;
}
.preloader-word span {
  display: inline-block; transform: translateY(105%); opacity: 0;
  transition: transform .5s cubic-bezier(.2,.8,.2,1), opacity .5s;
}
.preloader-word span.in { transform: none; opacity: 1; }
.preloader-meter { width: 100%; display: grid; gap: 11px; }
/* The count rides the bar from the left edge to the right edge */
.preloader-track { position: relative; height: clamp(2.7rem, 1.98rem + 3.6vw, 5.4rem); }
.preloader-count {
  position: absolute; bottom: 0; left: calc(var(--p, 0) * 100%);
  transform: translateX(calc(var(--p, 0) * -100%));
  font-family: var(--font-display); font-weight: 800; line-height: .8; white-space: nowrap;
  font-size: clamp(2.7rem, 1.98rem + 3.6vw, 5.4rem); font-variant-numeric: tabular-nums;
}
.preloader-count small { font-size: .45em; margin-left: .06em; opacity: .75; }
.preloader-bar {
  height: 14px; border-radius: 899px; overflow: hidden;
  background: color-mix(in srgb, var(--on-accent) 22%, transparent);
}
.preloader-bar span {
  display: block; height: 100%; background: var(--on-accent); border-radius: inherit;
  transform-origin: left; transform: scaleX(var(--p, 0));
}
.preloader-row { display: flex; justify-content: space-between; align-items: baseline; gap: 11px; }
.preloader.leaving {
  pointer-events: none;
  animation: zoom-through .95s cubic-bezier(.7, 0, .2, 1) forwards;
}
@keyframes zoom-through {
  0% { transform: scale(1); opacity: 1; }
  55% { opacity: 1; }
  100% { transform: scale(9); opacity: 0; }
}
.site-arrive .site-head, .site-arrive main, .site-arrive .site-foot {
  animation: arrive .95s cubic-bezier(.7, 0, .2, 1) both;
  transform-origin: 50% 20vh;
}
@keyframes arrive { from { transform: scale(.86); opacity: .2; } to { transform: scale(1); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .preloader.leaving { display: none; }
  html { scroll-behavior: auto; }
}

/* WordPress: keep the sticky header below the admin bar when logged in */
.admin-bar .site-head { top: calc(32px + env(safe-area-inset-top, 0px)); }
@media (max-width: 782px) { .admin-bar .site-head { top: calc(46px + env(safe-area-inset-top, 0px)); } }

/* WordPress: other pages and posts (index.php) */
.entry-list { padding-block: clamp(72px, 10vw, 144px); display: grid; gap: clamp(48px, 7vw, 96px); }
.entry { display: grid; gap: 20px; max-width: 70ch; }
.entry h1, .entry h2.entry-title {
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  font-size: var(--step-3); letter-spacing: 0.04em; line-height: 1;
}
.entry h2.entry-title a { text-decoration: none; }
.entry h2.entry-title a:hover { color: var(--accent-ink); }
.entry-content { display: grid; gap: 1em; color: var(--muted); }
.entry-content h2, .entry-content h3 { color: var(--ink); margin-top: .5em; }
.entry-content img { height: auto; border-radius: 12px; }
.entry-content a { color: var(--accent-ink); }
.entry-meta { color: var(--muted); }
.pagination { display: flex; gap: 16px; }
