/* ---------- Tokens ---------- */
:root {
  --cream: #f6f5ef;
  --maroon: #801735;
  --pink: #cc5c84;
  --black: #050505;
  --ink: #0f0f0f;
  --brown: #452020;
  --font: "Google Sans Flex", sans-serif;
}

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

html { -webkit-font-smoothing: antialiased; }

body {
  background: var(--black);
  color: var(--cream);
  font-family: var(--font);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.2;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--pink); }
img { display: block; max-width: 100%; }

.label {
  font-size: 15px;
  text-transform: capitalize;
  letter-spacing: -0.04em;
}

.page-title {
  font-size: 64px;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
  text-transform: capitalize;
}

/* ---------- Nav ---------- */
/* Header on every page: flat, translucent black, scrolls with the page */
.nav {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  height: 140px;
  padding: 47px clamp(20px, 3.5vw, 60px) 0;
  background: rgba(5, 5, 5, .5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.home-page .nav,
.about-page .nav { position: fixed; }
/* Other pages: header hides on scroll down, slides back in on scroll up */
.nav--auto { position: fixed; transition: transform .35s ease; }
.nav--hidden { transform: translateY(-100%); }
/* Coming-soon pages (Lyra): header floats over the sunrise with no dark bar */
.soon-page .nav { background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }

.nav__logo { position: relative; display: block; width: 52px; height: 52px; line-height: 0; }
.nav__logo img { position: absolute; inset: 0; width: 52px; height: 52px; transition: transform .6s ease, opacity .3s ease; }
.nav__logo:hover img { transform: rotate(90deg); }
.nav__logo-hover { opacity: 0; }
.nav__logo:hover .nav__logo-base { opacity: 0; }
.nav__logo:hover .nav__logo-hover { opacity: 1; }

/* Links and the mobile toggle sit on the logo's centre line */
.nav__links,
.nav__toggle { height: 52px; align-items: center; }
.nav__links { display: flex; gap: 34px; list-style: none; }
.nav__links li { display: flex; align-items: center; }
.nav__links .label { font-size: 18px; text-transform: none; letter-spacing: 0; color: var(--cream); transition: color .3s ease; }
.nav__links .label:hover,
.nav__toggle:hover { color: var(--pink); }

/* Text roll on hover: the label slides up and a copy slides in from below */
.roll { position: relative; display: inline-block; overflow: hidden; vertical-align: top; }
.roll span { display: block; transition: transform .35s cubic-bezier(.6, 0, .2, 1); }
.roll span + span { position: absolute; inset: 100% 0 auto 0; }
.roll:hover span,
.card:hover .roll span { transform: translateY(-100%); }

.nav__toggle {
  display: none;
  background: none;
  border: 0;
  color: var(--cream);
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
  transition: color .3s ease;
}

.menu {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  background: var(--black);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.menu a {
  color: var(--cream);
  font-size: 48px;
  font-weight: 500;
  letter-spacing: -0.06em;
  text-transform: capitalize;
  transition: color .3s ease;
}
.menu a:hover { color: var(--pink); }
.menu-open .menu { opacity: 1; pointer-events: auto; }

/* Floating icons around the edges, each with a speech bubble on hover */
.inspire { position: absolute; inset: 150px 0 40px; z-index: 1; }
.inspire__item {
  position: absolute;
  left: var(--x);
  top: var(--y);
  padding: 12px;
  border: 0;
  background: none;
  color: var(--maroon);
  cursor: pointer;
  translate: -50% -50%;
}
.inspire__icon {
  display: block;
  width: clamp(42px, 4.6vw, 76px);
  aspect-ratio: 1;
  background: currentColor;
  -webkit-mask: var(--src) center / contain no-repeat;
  mask: var(--src) center / contain no-repeat;
  transition: transform .35s cubic-bezier(.34, 1.56, .64, 1);
}
.inspire__item:hover,
.inspire__item:focus-visible { z-index: 5; animation-play-state: paused; color: var(--pink); }
.inspire__item:hover .inspire__icon,
.inspire__item:focus-visible .inspire__icon { transform: scale(1.2) rotate(-6deg); }
.inspire__item:focus:not(:focus-visible) { outline: none; }
.inspire__item::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  padding: 8px 14px;
  border-radius: 18px;
  background: var(--maroon);
  color: var(--cream);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 6px) scale(.9);
  transform-origin: bottom center;
  transition: opacity .2s ease, transform .25s cubic-bezier(.34, 1.56, .64, 1);
  pointer-events: none;
}
.inspire__item::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% - 2px);
  width: 12px;
  height: 12px;
  background: var(--maroon);
  opacity: 0;
  transform: translateX(-50%) rotate(45deg);
  transition: opacity .2s ease;
  pointer-events: none;
}
.inspire__item:hover::after,
.inspire__item:focus-visible::after,
.inspire__item.is-open::after { opacity: 1; transform: translate(-50%, 0) scale(1); }
.inspire__item:hover::before,
.inspire__item:focus-visible::before,
.inspire__item.is-open::before { opacity: 1; }
/* A wide, lazy drift so the icons wander around their spot */

@media (max-width: 809.98px) {
  .inspire { inset: 104px 0 34px; }
  .inspire__icon { width: 30px; }
  .inspire__item { left: var(--mx); top: var(--my); padding: 6px; }
}

/* Home page: full black, pink name and accents */
.home-page { background: var(--black); }
.home-page .inspire__item { color: var(--cream); }
.home-page .inspire__item:hover,
.home-page .inspire__item:focus-visible { color: var(--pink); }
.home-page .inspire__item::after,
.home-page .inspire__item::before { background: var(--cream); }
.home-page .inspire__item::after { color: var(--maroon); }

/* ---------- Shared section ---------- */
.section {
  display: flex;
  flex-direction: column;
  gap: 40px;
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
  padding: 160px clamp(20px, 3.5vw, 60px);
}

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

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.card { display: flex; flex-direction: column; gap: 12px; }
.card .label { transition: color .3s ease; }
.card:hover .label { color: var(--pink); }
.card__media { overflow: hidden; aspect-ratio: 16 / 10; background: #161616; border-radius: 4px; }
.card__media img,
.card__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .8s cubic-bezier(.2, .7, .2, 1);
}
.card:hover .card__media img,
.card:hover .card__media video { transform: scale(1.04); }

/* Subtitle fades in over the thumbnail on hover */
.card__media { position: relative; }
.card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 24px;
  background: linear-gradient(0deg, rgba(128, 23, 53, .85) 0%, rgba(128, 23, 53, .35) 45%, rgba(128, 23, 53, 0) 75%);
  color: var(--cream);
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .35s ease, transform .35s ease;
  pointer-events: none;
}
.card:hover .card__overlay,
.card:focus-visible .card__overlay { opacity: 1; transform: none; }

/* Coming soon: badge on the thumbnail, no link */
.card__soon { opacity: .6; }

/* Touch screens have no hover, so keep the subtitle visible */
@media (hover: none) {
  .card__overlay { opacity: 1; transform: none; font-size: 15px; padding: 16px; }
}

/* ---------- Home: selected work carousel ----------
   A pink panel that slides up over the pinned hero as you scroll. */
/* Play: a pixel pot rattling on the stove */
.play {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 100vh;
  min-height: 100svh;
  padding: 140px 20px 80px;
  text-align: center;
}
.pot { width: clamp(160px, 18vw, 260px); overflow: visible; }
.pot__ink, .pot__steam rect { fill: var(--pink); }
.pot__gap { fill: var(--black); }
.pot__body, .pot__lid { transform-box: fill-box; transform-origin: 50% 100%; }
.pot__body { animation: pot-shake 1.6s ease-in-out infinite; }
.pot__lid { animation: pot-lid 1.6s ease-in-out infinite; }
.pot__steam rect { opacity: 0; animation: pot-steam 2.4s ease-out infinite; }
.pot__steam rect:nth-child(2) { animation-delay: .8s; }
.pot__steam rect:nth-child(3) { animation-delay: 1.6s; }
@keyframes pot-shake {
  0%, 45%, 100% { transform: none; }
  5%, 25% { transform: translateX(-.4px) rotate(-2deg); }
  15%, 35% { transform: translateX(.4px) rotate(2deg); }
}
@keyframes pot-lid {
  0%, 45%, 100% { transform: none; }
  8% { transform: translateY(-1.2px) rotate(-5deg); }
  18% { transform: translateY(0); }
  28% { transform: translateY(-1.4px) rotate(4deg); }
  38% { transform: translateY(0); }
}
@keyframes pot-steam {
  0% { opacity: 0; transform: translateY(0); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-4px); }
}
.play__title {
  margin-top: 24px;
  font-family: "Doto", monospace;
  font-size: clamp(28px, 4.4vw, 64px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: var(--cream);
}
.play__sub { font-size: clamp(16px, 1.4vw, 20px); color: rgba(246, 245, 239, .6); }
@media (prefers-reduced-motion: reduce) {
  .pot__body, .pot__lid, .pot__steam rect { animation: none !important; }
  .pot__steam rect { opacity: 1; }
}

/* Pinned content stays put while a .panel scrolls up over it (top is set in JS for tall content) */
body [data-pin] { position: sticky; top: 0; z-index: 0; }
.panel {
  position: relative;
  z-index: 1;
  padding: 24px clamp(20px, 3.5vw, 60px) 72px;
  background: var(--maroon);
  color: #fff;
}
.panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 48px;
}
.panel__title { font-size: clamp(18px, 1.6vw, 24px); font-weight: 500; letter-spacing: -0.02em; color: #fff; }
.panel__link { font-size: clamp(16px, 1.4vw, 20px); color: #fff; }
.panel__link:hover { color: var(--pink); }
.panel__arrow { display: inline-block; font-size: clamp(22px, 2vw, 30px); line-height: 1; transition: color .3s ease, transform .3s ease; }
.panel__arrow:hover { transform: translateX(6px); }
.selected__track { overflow: hidden; }
.selected__list { display: flex; width: max-content; gap: 20px; animation: selected-scroll 36s linear infinite; }
.selected__track:hover .selected__list { animation-play-state: paused; }
.selected__card { display: flex; flex-direction: column; gap: 12px; flex: 0 0 clamp(240px, 26vw, 360px); }
.selected__media { display: block; overflow: hidden; border-radius: 4px; }
.selected__media img,
.selected__media video { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform .7s cubic-bezier(.2, .7, .2, 1); }
.selected__card:hover .selected__media img,
.selected__card:hover .selected__media video { transform: scale(1.05); }
.selected__card .label { color: #fff; transition: color .3s ease; }
.selected__card:hover .label { color: var(--pink); }
@keyframes selected-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .selected__track { overflow-x: auto; }
  .selected__list { animation: none; width: auto; }
}

/* ---------- About ---------- */
.about { position: relative; overflow: hidden; }

.about__row { display: flex; align-items: flex-start; gap: 40px; }

.about__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: 0 80px 0 0;
}

.about__bio {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 500px;
  font-size: 24px;
  text-wrap: balance;
}

.about__contact { display: flex; gap: 15px; max-width: 435px; }
.about__contact > div { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.about__contact .muted { color: rgba(246, 245, 239, .65); font-weight: 500; text-transform: none; }
.about__contact a:hover { color: var(--pink); }

.about__image { width: 28%; aspect-ratio: .8; object-fit: cover; flex-shrink: 0; filter: grayscale(1); border-radius: 4px; }

/* CV: pink panel that slides up over the about content */
/* Sticky bottom keeps the header row peeking above the bottom of the screen until scrolled to.
   --cv-h is the panel's real height, measured in JS. */
.cv { --peek: 84px; position: sticky; bottom: calc(var(--peek) - var(--cv-h, 70vh)); min-height: 70vh; }
.cv { padding-top: 0; }
.cv .panel__head { justify-content: center; align-items: center; height: var(--peek); margin-bottom: 0; }
.cv .panel__title { cursor: pointer; }

/* Resume columns: Education, Experience, Honours, Skills */
.cv__grid { display: grid; grid-template-columns: 1fr 1.6fr 1fr 1.3fr; gap: 48px; margin-top: 32px; }
.cv__label {
  margin-bottom: 24px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .35);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .01em;
  color: rgba(255, 255, 255, .7);
}
.cv__item + .cv__item { margin-top: 28px; }
.cv__item h4 { font-size: clamp(17px, 1.3vw, 20px); font-weight: 500; letter-spacing: -0.01em; color: #fff; }
.cv__meta { margin-top: 4px; font-size: 14px; color: rgba(255, 255, 255, .7); }
.cv__item p:not(.cv__meta) { margin-top: 8px; font-size: 15px; line-height: 1.45; letter-spacing: 0; color: rgba(255, 255, 255, .88); }
@media (max-width: 1099.98px) { .cv__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 809.98px) { .cv__grid { grid-template-columns: 1fr; gap: 40px; } }


/* ---------- Project ----------
   Measured from the FEGO page design (1728px wide). */
.project-page {
  --pad: clamp(20px, 3.5vw, 60px);
  --p-ink: #f6f5ef;
  --p-muted: rgba(246, 245, 239, .6);
  --p-pink: #d9809f;
  background: var(--black);
  color: var(--p-ink);
  letter-spacing: -0.01em;
}

.project-hero { display: flex; flex-direction: column; gap: 45px; padding: 180px var(--pad) 0; }
.project-hero__titles { display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.project-title { font-size: 56px; font-weight: 500; letter-spacing: -0.03em; line-height: 1; }
.project-hero__subtitle { max-width: 380px; font-size: 18px; color: var(--p-muted); text-wrap: balance; }
.project-hero__media img,
.project-hero__media video { display: block; width: 100%; border-radius: 4px; }

/* Optional wordmark over the hero (Cue uses its own ABC Social font) */
@font-face {
  font-family: "ABC Social";
  src: url("assets/fonts/ABCSocialVariable-Trial.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
.project-hero__media { position: relative; }
.project-hero__word {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  font-family: "ABC Social", var(--font);
  font-size: clamp(72px, 15vw, 260px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #111110;
  pointer-events: none;
}

.overview {
  display: flex;
  justify-content: space-between;
  gap: 60px;
  padding: 80px var(--pad);
}
.overview__main { flex: 0 1 790px; }
.overview__side { flex: 0 0 380px; display: flex; flex-direction: column; gap: 50px; margin-right: clamp(0px, 4vw, 80px); }
.overview__label { margin-bottom: 12px; font-size: 18px; color: var(--p-muted); }
.overview__text { font-size: 18px; font-weight: 500; line-height: 1.33; text-wrap: pretty; }
.overview__text p + p { margin-top: 14px; }
/* Equal-size pills: every row matches the tallest, text centred in each */
.overview__tags { display: grid; grid-template-columns: repeat(2, 1fr); grid-auto-rows: 1fr; gap: 10px 13px; list-style: none; }
.overview__tags li {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(246, 245, 239, .1);
  font-size: 16px;
  text-align: center;
  text-transform: capitalize;
}
@media (min-width: 810px) { .overview__tags li { white-space: nowrap; } }
.overview__list { list-style: none; font-size: 18px; font-weight: 500; line-height: 1.33; }
.overview__value { font-size: 18px; font-weight: 500; }

/* Challenge / Solution stack under the Overview text in the left column */
.overview__block { margin-top: 48px; }

.gallery { display: flex; flex-direction: column; gap: 26px; padding: 0 var(--pad); }
.gallery__row--pair { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.gallery figure { overflow: hidden; border-radius: 4px; cursor: zoom-in; }
.gallery img,
.gallery video { display: block; width: 100%; height: auto; }
.gallery__row--pair img,
.gallery__row--pair video { height: 100%; aspect-ratio: 789 / 753; object-fit: cover; }
.gallery .video { cursor: inherit; }
.gallery__row--pair.is-natural { align-items: start; }
.gallery__row--pair.is-natural img { height: auto; aspect-ratio: auto; }
/* FEGO's image files have rounded white corners baked in: zoom slightly so the frame crops them off */
[data-project="fego"] .project-hero__media { overflow: hidden; border-radius: 4px; }
[data-project="fego"] .gallery img,
[data-project="fego"] .project-hero__media img { transform: scale(1.05); }

.outro { max-width: 920px; padding: 40px var(--pad) 0; font-size: 18px; font-weight: 500; line-height: 1.33; }

/* Footer: holds the previous / next cards (on project pages) and the site footer */
.project-foot {
  margin-top: 60px;
  padding: 60px 0 120px;
}

.pager { display: flex; justify-content: space-between; gap: 40px; padding: 0 var(--pad); }
.pager__card { display: flex; flex-direction: column; gap: 16px; width: min(380px, 100%); }
.pager__thumb { display: block; aspect-ratio: 380 / 182; overflow: hidden; border-radius: 4px; background: #161616; }
.pager__thumb img,
.pager__thumb video { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.pager__card:hover .pager__thumb img,
.pager__card:hover .pager__thumb video { transform: scale(1.04); }
.pager__row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.pager__caption { max-width: 200px; font-size: 18px; color: #e07aa0; text-transform: none; }
.pager__caption strong { font-weight: 500; color: #fff; }
.pager__card--next .pager__caption { text-align: left; }
.pager__btn {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 22px;
  padding: 8px 24px;
  border-radius: 999px;
  background: var(--p-pink);
  box-shadow: 0 2px 6px rgba(128, 23, 53, .2);
  color: #fff;
  font-size: 18px;
  transition: background .3s ease;
}
.pager__card:hover .pager__btn { background: #e597b3; }
.pager__btn svg { width: 15px; height: 17px; fill: #b83c6a; }
.pager__card--prev .pager__btn svg { transform: scaleX(-1); }

/* Site footer: flat pink, shared across every page */
.site-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 40px;
  padding: 40px var(--pad, clamp(20px, 3.5vw, 60px));
  background: var(--pink);
  color: #fff;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.site-footer__name { margin-bottom: 14px; color: #fff; }
.site-footer__cta { margin-bottom: 14px; color: var(--maroon); }
.site-footer__me { color: var(--maroon); }
.site-footer__ticker-text { display: inline-block; min-height: 1.2em; transition: opacity .3s ease; }
.site-footer__flower img { width: 140px; animation: footer-spin 14s linear infinite; }
@keyframes footer-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .site-footer__flower img { animation: none !important; } }
.site-footer__contact { justify-self: end; }
@media (min-width: 810px) { .site-footer__contact { margin-right: 35px; } }
.site-footer__contact ul { display: flex; gap: 30px; list-style: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

/* ABC Diatype (Dinamo) — TRIAL file: replace with a licensed copy before publishing */
@font-face {
  font-family: "ABC Diatype";
  src: url("assets/fonts/ABCDiatype-Bold-Trial.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

/* ---------- Coming soon (Lyra) ----------
   Colours sampled from the Lyra cover gradient. */
.soon-page { background: #8b7fb3; }
.soon {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  background: linear-gradient(180deg, #7f78ae 0%, #b493a6 30%, #eeb98f 62%, #f8c58c 100%);
  animation: soon-sky 2.4s ease-out both;
}

/* The sun: pale core, orange body, blue rim, like the cover */
.soon__sun {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: max(140vmin, 900px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%,
    #ffdc9c 0%, #fdb978 18%, #f68a52 38%, #f47b4a 50%, #e98a73 60%, #b6a6c8 66%, #9fb6ea 69%, #9fb6ea 70%, rgba(159, 182, 234, 0) 71%);
  translate: -50% 73%;
  animation: soon-rise 2.6s cubic-bezier(.2, .7, .2, 1) both, soon-breathe 6s 2.6s ease-in-out infinite;
}

.soon__text {
  position: absolute;
  inset: 0 0 auto;
  top: 30%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  color: #fff;
  text-align: center;
}
.soon__title {
  font-family: "ABC Diatype", var(--font);
  font-size: clamp(64px, 12vw, 180px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  text-shadow: 0 6px 40px rgba(127, 120, 174, .45);
  animation: soon-fade 1.4s .6s cubic-bezier(.2, .7, .2, 1) both;
}
.soon__tag { font-size: clamp(18px, 2vw, 26px); letter-spacing: .02em; }
.soon__sub {
  margin-top: -16px;
  font-size: clamp(15px, 1.4vw, 19px);
  opacity: .85;
  animation: soon-fade 1s 1.4s ease both;
}
.soon__tag span { display: inline-block; animation: soon-letter .6s cubic-bezier(.2, .7, .2, 1) both; }

.soon__back {
  position: absolute;
  left: 50%;
  bottom: 48px;
  translate: -50% 0;
  padding: 10px 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  color: #c4502a;
  font-size: 16px;
  transition: background .3s ease;
  animation: soon-fade 1s 2.6s ease both;
}
.soon__back:hover { background: #fff; }

@keyframes soon-sky { from { filter: brightness(.6) saturate(.8); } to { filter: none; } }
@keyframes soon-rise { from { translate: -50% 100%; } to { translate: -50% 73%; } }
@keyframes soon-breathe {
  0%, 100% { scale: 1; filter: brightness(1); }
  50% { scale: 1.035; filter: brightness(1.08); }
}
@keyframes soon-fade { from { opacity: 0; transform: translateY(24px); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes soon-letter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Lyra thumbnail: a small version of the coming-soon sunrise */
.mini-soon {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, #7f78ae 0%, #b493a6 30%, #eeb98f 62%, #f8c58c 100%);
}
.mini-soon__sun {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 130%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%,
    #ffdc9c 0%, #fdb978 18%, #f68a52 38%, #f47b4a 50%, #e98a73 60%, #b6a6c8 66%, #9fb6ea 69%, #9fb6ea 70%, rgba(159, 182, 234, 0) 71%);
  translate: -50% 100%;
  transition: scale .8s cubic-bezier(.2, .7, .2, 1);
}
.mini-soon.is-visible .mini-soon__sun {
  animation: mini-rise 2.4s cubic-bezier(.2, .7, .2, 1) both, soon-breathe 6s 2.4s ease-in-out infinite;
}
.card:hover .mini-soon__sun { scale: 1.06; }
@keyframes mini-rise { from { translate: -50% 100%; } to { translate: -50% 62%; } }

/* No observer support or reduced motion: show the risen sun */
@media (prefers-reduced-motion: reduce) {
  .mini-soon__sun { translate: -50% 62%; }
}

/* ---------- Cue layout ----------
   Palette, gradients and Cuey taken from the Cue app. */
.cue {
  --cue-cream: #f2f1ed;
  --cue-ink: #111110;
  --cue-coral: #e27f7f;
  --g-writing: linear-gradient(135deg, #e8a090, #c890a8, #7a8c42);
  --g-coding: linear-gradient(135deg, #e898b0, #c0a8d8, #7898d0);
  --g-marketing: linear-gradient(135deg, #c8b0e4, #e878b0, #e8d040);
  --g-research: linear-gradient(135deg, #7080d0, #b078c8, #e08eaa, #60a0b0);
  --g-design: linear-gradient(135deg, #98b8e4, #c0acdc, #e08878);
  --g-productivity: linear-gradient(135deg, #e8a848, #f0c878, #c4a8dc);
  --g-education: linear-gradient(135deg, #e098b0, #f0c4c8, #9880cc);
  --g-other: linear-gradient(135deg, #f0d0d0, #d09098, #a03060);
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 0 var(--pad) 26px;
  color: var(--cue-ink);
}
.cue > section { border-radius: 4px; overflow: hidden; }

.cue-chip {
  display: inline-block;
  padding: 7px 18px;
  border-radius: 999px;
  color: var(--cue-ink);
  font-size: 15px;
  white-space: nowrap;
}
.cue-chip--writing { background: var(--g-writing); }
.cue-chip--coding { background: var(--g-coding); }
.cue-chip--marketing { background: var(--g-marketing); }
.cue-chip--research { background: var(--g-research); }
.cue-chip--design { background: var(--g-design); }
.cue-chip--productivity { background: var(--g-productivity); }
.cue-chip--education { background: var(--g-education); }
.cue-chip--other { background: var(--g-other); }

.cue-head { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; max-width: 520px; }
.cue-head h2 { font-size: clamp(30px, 3.4vw, 48px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.02; }
.cue-head p { font-size: 17px; line-height: 1.4; opacity: .75; }

.cue-zoom { cursor: zoom-in; }
.cue-zoom img { display: block; width: 100%; }

/* Stage: lifestyle photos with a live Cuey */
.cue-stage { display: flex; flex-direction: column; gap: 26px; border-radius: 0 !important; }
.cue-stage__main { border-radius: 4px; overflow: hidden; }
.cue-stage__row { display: grid; grid-template-columns: 1.35fr 1fr; gap: 26px; }
.cue-stage__phone { border-radius: 4px; overflow: hidden; }
.cue-stage__phone img { height: 100%; object-fit: cover; }
.cue-hello {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 18px;
  padding: 36px;
  border-radius: 4px;
  background: var(--cue-cream);
}
.cue-bubble {
  max-width: 330px;
  padding: 22px 26px;
  border-radius: 14px;
  background: var(--cue-coral);
  font-size: 18px;
  line-height: 1.6;
}
.cue-hello__cuey { width: 150px; background: none; border: 0; transition: transform .2s ease; }
.cue-hello__cuey:hover { transform: scale(1.1); }
.cue-hello__cuey:active { transform: scale(.9); }
.cuey { display: block; width: 100%; overflow: visible; animation: cuey-float 3.5s ease-in-out infinite; }
.cuey.is-spinning { animation: cuey-spin .8s cubic-bezier(.45, 0, .55, 1); }
.cuey__pupil { transform-box: fill-box; transform-origin: center; animation: cuey-blink 5s ease-in-out 2s infinite; }
.cue-hint { position: absolute; top: 30px; left: 36px; font-size: 15px; opacity: .5; }
@keyframes cuey-float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-8px) rotate(2deg); } }
@keyframes cuey-spin { to { transform: rotate(360deg); } }
@keyframes cuey-blink { 0%, 44%, 56%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.07); } }

/* Light / dark: the panel follows the toggle */
.cue-theme { padding: 48px 56px 40px; background: var(--cue-cream); transition: background .5s ease, color .5s ease; }
.cue-theme[data-theme="dark"] { background: #000; color: #fff; }
.cue-theme__bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.cue-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px 10px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--cue-coral);
  color: var(--cue-ink);
  font: inherit;
  font-size: 16px;
}
.cue-toggle svg { width: 22px; height: 22px; }
.cue-toggle.is-spinning svg { animation: cuey-spin .45s cubic-bezier(.4, 0, .2, 1); }
.cue-devices { display: flex; align-items: flex-end; justify-content: center; gap: 2%; }
.cue-swap { display: grid; width: 70%; }
.cue-swap--phone { width: 21%; }
.cue-swap img { grid-area: 1 / 1; width: 100%; transition: opacity .5s ease; }
.cue-theme .is-dark,
.cue-theme[data-theme="dark"] .is-light { opacity: 0; }
.cue-theme[data-theme="dark"] .is-dark { opacity: 1; }

/* Walkthrough */
.cue-action { display: flex; flex-direction: column; align-items: flex-start; gap: 32px; }
.cue-action video { width: 100%; border-radius: 4px; }
.cue-live {
  align-self: center;
  padding: 14px 32px;
  border-radius: 999px;
  background: var(--cue-coral);
  color: var(--cue-ink);
  font-size: 18px;
  transition: transform .2s ease;
}
.cue-live:hover { transform: scale(1.05); }

/* Micro-interactions: live demos using the Cue app's own keyframes */
/* Sections whose heading sits straight on the black page above a full-width panel or grid */
.cue-outside { display: flex; flex-direction: column; gap: 40px; padding: 56px 0 0; background: none; color: #fff; border-radius: 0 !important; overflow: visible !important; }
.cue-outside > .cue-head,
.cue-outside > .cue-theme__bar { padding: 0; }
.cue-outside > .cue-theme:not([data-theme="dark"]),
.mi-tile { color: var(--cue-ink); }
.cue-outside > .cue-theme,
.cue-outside > .cue-action { border-radius: 4px; }
.mi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
/* Each interaction sits in its own frame, heading underneath */
.mi-tile {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 12px 12px 18px;
  border-radius: 4px;
  background: var(--cue-cream);
}
.mi-tile__stage {
  position: relative;
  display: grid;
  place-items: center;
  height: 230px;
  overflow: hidden;
  border-radius: 10px;
  background: transparent;
  transition: background .4s ease;
}
.mi-tile__name { padding: 0 6px; font-size: 17px; font-weight: 600; }
.mi button { background: none; border: 0; padding: 0; font: inherit; color: inherit; }
.mi button:focus:not(:focus-visible) { outline: none; }

@keyframes mi-blob-hover {
  0%   { transform: scale(1) rotate(0deg); }
  18%  { transform: scale(1.22, .82) rotate(-7deg); }
  42%  { transform: scale(.88, 1.2) rotate(15deg); }
  62%  { transform: scale(1.14, .93) rotate(-4deg); }
  80%  { transform: scale(1.03, 1.04) rotate(4deg); }
  100% { transform: scale(1.1) rotate(8deg); }
}
@keyframes mi-blob-click {
  0%   { transform: scale(1.1) rotate(8deg); }
  35%  { transform: scale(.78) rotate(0deg); }
  70%  { transform: scale(1.15) rotate(12deg); }
  100% { transform: scale(1.1) rotate(8deg); }
}
@keyframes mi-plus-spin { 50% { transform: rotate(90deg) scale(1.3); } 100% { transform: rotate(90deg) scale(1); } }

/* Add button */
.mi-blob { position: relative; width: 96px; height: 96px; }
.mi-blob__shape { display: block; width: 100%; height: 100%; color: #EE7A7E; }
.mi-blob__plus { position: absolute; inset: 0; display: grid; place-items: center; font-size: 52px; line-height: 1; color: #111110; }
.mi-blob:hover { animation: mi-blob-hover .52s cubic-bezier(.34, 1.56, .64, 1) forwards; }
.mi-blob:active { animation: mi-blob-click .38s cubic-bezier(.34, 1.56, .64, 1) forwards; }
.mi-blob:hover .mi-blob__plus { animation: mi-plus-spin .36s cubic-bezier(.34, 1.56, .64, 1) forwards; }

/* Theme toggle */
.mi-theme { display: grid; place-items: center; width: 86px; height: 86px; border-radius: 50%; background: #EE7A7E !important; color: #111110; }
.mi-theme svg { width: 38px; height: 38px; }
.mi-theme:hover { animation: mi-blob-hover .52s cubic-bezier(.34, 1.56, .64, 1) forwards; }
.mi-theme:active { animation: mi-blob-click .38s cubic-bezier(.34, 1.56, .64, 1) forwards; }
.mi-theme svg.is-spinning { animation: cuey-spin .45s cubic-bezier(.4, 0, .2, 1); }
.mi-tile.is-dark .mi-tile__stage { background: #000; }

/* Cuey */
.mi-cuey { width: 130px; transition: transform .2s ease; }
.mi-cuey:hover { transform: scale(1.12); }
.mi-cuey:active { transform: scale(.9); }
.mi .cuey.go-bounce { animation: mi-bounce .7s cubic-bezier(.34, 1.56, .64, 1); }
.mi .cuey.go-wiggle { animation: mi-wiggle .7s ease-in-out; }
.mi .cuey.go-squish { animation: mi-squish .55s cubic-bezier(.34, 1.56, .64, 1); }
.mi .cuey.go-dizzy  { animation: mi-dizzy .9s ease-in-out; }
.mi .cuey.go-spin   { animation: cuey-spin .8s cubic-bezier(.45, 0, .55, 1); }
@keyframes mi-bounce { 30% { transform: translateY(-26px) scale(.9, 1.1); } 55% { transform: translateY(5px) scale(1.08, .92); } 75% { transform: translateY(-10px) scale(.96, 1.04); } }
@keyframes mi-wiggle { 20% { transform: rotate(-16deg); } 40% { transform: rotate(16deg); } 60% { transform: rotate(-10deg); } 80% { transform: rotate(8deg); } }
@keyframes mi-squish { 20% { transform: scale(1.3, .7) translateY(10px); } 50% { transform: scale(.85, 1.22) translateY(-8px); } 75% { transform: scale(1.07, .93); } }
@keyframes mi-dizzy { 25% { transform: rotate(-22deg); } 50% { transform: rotate(22deg); } 75% { transform: rotate(-12deg); } }

/* Mood colours */
.mi-tile[data-mi="chips"] .mi-tile__stage { grid-template-rows: auto 1fr; gap: 10px; padding: 22px 12px 12px; }
.mi-tile[data-mi="chips"] .cuey { width: 110px; }
.mi-tile[data-mi="chips"] stop { transition: stop-color .65s ease; }
.mi-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.mi-chip {
  padding: 5px 14px !important;
  border-radius: 999px;
  color: #111110 !important;
  font-size: 13px !important;
  text-transform: capitalize;
  outline: 2px solid transparent;
  outline-offset: 1px;
  transition: outline-color .15s, transform .15s;
}
.mi-chip:hover { transform: translateY(-1px); }
.mi-chip.is-active { outline-color: #111110; }
.mi-chip--all { border: 1px solid rgba(17, 17, 16, .3) !important; }
.mi-chip--all.is-active { background: #EE7A7E !important; border-color: #EE7A7E !important; }
.mi-chip--writing { background: linear-gradient(135deg, #e8a090, #c890a8, #7a8c42) !important; }
.mi-chip--coding { background: linear-gradient(135deg, #e898b0, #c0a8d8, #7898d0) !important; }
.mi-chip--marketing { background: linear-gradient(135deg, #c8b0e4, #e878b0, #e8d040) !important; }
.mi-chip--research { background: linear-gradient(135deg, #7080d0, #b078c8, #e08eaa, #60a0b0) !important; }
.mi-chip--design { background: linear-gradient(135deg, #98b8e4, #c0acdc, #e08878) !important; }
.mi-chip--productivity { background: linear-gradient(135deg, #e8a848, #f0c878, #c4a8dc) !important; }
.mi-chip--education { background: linear-gradient(135deg, #e098b0, #f0c4c8, #9880cc) !important; }
.mi-chip--other { background: linear-gradient(135deg, #f0d0d0, #d09098, #a03060) !important; }

/* Card gradient */
.mi-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 84%;
  height: 156px;
  padding: 16px;
  border-radius: 6px;
  background-image: linear-gradient(45deg, #e8a848, #f0c878, #c4a8dc, #e8a848);
  background-size: 200% 200%;
  background-position: 50% 50%;
  color: #111110;
  transition: transform .2s, background-position 1.2s ease-out;
}
.mi-card:hover { transform: translateY(-3px); }
.mi-card strong { font-size: 14px; }
.mi-card span { font-size: 12px; line-height: 1.45; }
.mi-card em { align-self: flex-start; margin-top: auto; padding: 2px 9px; border: 1px solid rgba(0, 0, 0, .6); border-radius: 999px; font-size: 11px; font-style: normal; }

/* Custom cursor */
.mi-tile[data-mi="cursor"] .mi-tile__stage { cursor: none; }
.mi-cursor__hint { font-size: 14px; opacity: .45; }
.mi-cursor {
  position: absolute;
  top: 50%;
  left: 70%;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #000;
  translate: -50% -50%;
  pointer-events: none;
  transition: scale .08s ease;
}
.mi-cursor.is-down { scale: .6; }

/* Close */
.mi-close { width: 64px; height: 64px; font-size: 40px !important; line-height: 1; transition: transform .22s cubic-bezier(.34, 1.56, .64, 1); }
.mi-close:hover { transform: rotate(20deg); }
.mi-close.is-spinning { animation: mi-close-spin .35s cubic-bezier(.22, 1, .36, 1); }
@keyframes mi-close-spin { from { transform: rotate(0deg); } to { transform: rotate(180deg); } }

/* Copy prompt */
.mi-ghost {
  padding: 9px 22px !important;
  border: 1px solid rgba(17, 17, 16, .6) !important;
  border-radius: 999px;
  font-size: 15px !important;
  transition: background .15s, color .15s, border-color .15s, transform .25s cubic-bezier(.34, 1.56, .64, 1);
}
.mi-ghost:hover { background: #111110 !important; color: #fff !important; }
.mi-ghost:active { transform: scale(.88); }
.mi-ghost.is-copied { background: #CAFFD2 !important; color: #111110 !important; border-color: #CAFFD2 !important; }

@media (max-width: 1199.98px) { .mi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 809.98px) {
  .cue > section.cue-outside { padding: 32px 0 0; }
  .cue-outside > .cue-head,
  .cue-outside > .cue-theme__bar { padding: 0; }
  .cue-outside > .cue-theme { padding: 28px 18px; border-radius: 4px; }
  .cue-action video { border-radius: 4px; }
  .mi-grid { gap: 12px; }
}

@media (hover: none), (max-width: 809.98px) { .cue-hint { display: none; } }

.cue-gallery-title { padding: 40px var(--pad) 26px; font-size: clamp(30px, 3.4vw, 48px); font-weight: 600; letter-spacing: -0.03em; }

@media (max-width: 809.98px) {
  .cue > section:not(.cue-stage) { padding: 32px 22px; border-radius: 4px; }
  .cue-stage__row { grid-template-columns: 1fr; }
  .cue-hello { padding: 28px 22px; min-height: 380px; }
  .cue-theme__bar { flex-direction: column; align-items: flex-start; }
}

/* ---------- Book of Sands layout ----------
   Matches the Book of Sand site itself: black canvas, white ink, Fira Mono text,
   Respira for display, Yarndings 12 ornaments and 1.5px outlines. */
@font-face {
  font-family: "Respira";
  src: url("assets/fonts/Respira-Black-Trial.otf") format("opentype");
  font-weight: 900;
  font-display: swap;
}
.sand {
  --sand-canvas: #000;
  --sand-ink: #fff;
  --sand-mono: "Fira Mono", monospace;
  --sand-display: "Respira", serif;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 0 var(--pad) 26px;
  font-family: var(--sand-mono);
  letter-spacing: 0;
}
.sand-yarn { font-family: "Yarndings 12", serif; font-weight: 900; }

/* Film: the intro animation, full width on black */
.sand-film { overflow: hidden; border-radius: 4px; background: #000; }
.sand-film video { display: block; width: 100%; }

/* Hand-tracking explainer */
.sand-hands {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 56px;
  padding: 88px 56px 72px;
  border-radius: 6px;
  background: var(--sand-canvas);
  color: var(--sand-ink);
}
.sand-hands__head { display: flex; flex-direction: column; align-items: center; gap: 26px; max-width: 820px; text-align: center; }
/* Kicker sitting on the white page above the frame */
.sand-title {
  font-family: var(--sand-display);
  font-size: clamp(54px, 8.5vw, 138px);
  font-weight: 900;
  line-height: 105.24%;
  letter-spacing: -0.05em;
}
.sand-hands__lead { max-width: 640px; font-size: 1.1rem; line-height: 1.7; }

/* Hand skeleton: black lines and dots over the white camera canvas, as the site draws it */
.sand-hand { display: block; overflow: visible; }
.sand-hand line { stroke: #000; stroke-width: 1; stroke-linecap: round; }
.sand-hand circle { fill: #000; }

/* Camera window */
.sand-cam { display: flex; flex-direction: column; align-items: center; gap: 18px; width: 100%; }
.sand-cam__screen { position: relative; width: min(100%, 820px); aspect-ratio: 16 / 9; border: 1.5px solid var(--sand-ink); background: var(--sand-canvas); }
.sand-cam__label { position: absolute; top: 22px; left: 26px; font-size: .85rem; }
.sand-cam__btn {
  position: absolute;
  left: 50%;
  bottom: 18px;
  translate: -50% 0;
  padding: .55rem 1.4rem;
  border: 1.5px solid var(--sand-ink);
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
}
.sand-cam__feed {
  position: absolute;
  right: 20px;
  bottom: 20px;
  display: grid;
  place-items: center;
  width: 200px;
  height: 150px;
  max-width: 34%;
  max-height: 40%;
  border: 1.5px solid var(--sand-ink);
  background: var(--sand-ink);
  overflow: hidden;
}
.sand-cam__feed .sand-hand { width: auto; height: 86%; }
.sand-cam__note { max-width: 560px; font-size: .95rem; line-height: 1.6; text-align: center; }

/* Gestures: each card styled like the site's floating passage cards */
.sand-gestures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; width: 100%; }
.sand-gesture { display: flex; flex-direction: column; border: 1.5px solid var(--sand-ink); background: var(--sand-canvas); }
.sand-gesture__stage {
  display: grid;
  grid-template-columns: 1fr auto 1.1fr;
  align-items: center;
  gap: 12px;
  height: 240px;
  padding: 20px;
  border-bottom: 1.5px solid var(--sand-ink);
}
.sand-gesture__hands {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2px;
  height: 100%;
  border: 1.5px solid var(--sand-ink);
  background: var(--sand-ink);
  min-width: 0;
  overflow: hidden;
}
.sand-gesture__hands .sand-hand { width: 90%; height: auto; max-height: 86%; }
.sand-gesture[data-gesture="two"] .sand-gesture__hands .sand-hand { width: 48%; }
.sand-gesture[data-gesture="two"] .is-b { transform: scaleX(-1); }
.sand-gesture__arrow { font-size: 1.1rem; }
.sand-gesture__result { position: relative; display: grid; place-items: center; height: 100%; }
.sand-gesture__text { display: flex; flex-direction: column; gap: 10px; padding: 26px 24px 28px; font-size: .95rem; line-height: 1.6; }
.sand-gesture__text h3 { font-family: var(--sand-display); font-size: 40px; font-weight: 900; line-height: 105.24%; letter-spacing: -0.05em; }
.sand-gesture__mode { font-size: .75rem; font-weight: 600; text-transform: uppercase; }

/* Mini scatter: cards drift; an open hand freezes them and brings one forward */
.sand-scatter { position: relative; width: 100%; height: 100%; }
.sand-card {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 36%;
  padding: 6px;
  background: var(--sand-canvas);
  border: 1.5px solid var(--sand-ink);
  animation: sand-drift 3.4s ease-in-out infinite alternate;
  animation-delay: calc(var(--n) * -.6s);
  transition: opacity .5s ease, transform .5s ease;
}
.sand-card i { display: block; height: 2px; background: var(--sand-ink); }
.sand-card i:nth-child(3) { width: 60%; }
@keyframes sand-drift { to { translate: 6px -8px; } }
.is-focus .sand-card { animation-play-state: paused; opacity: 0; }
.is-focus .sand-card--focus { z-index: 2; opacity: 1; transform: translate(-4%, 12%) scale(1.5); }

/* Mini cube: black faces with white 1.5px edges, like the site's cube */
.sand-cube { width: 76px; height: 76px; perspective: 400px; }
.sand-cube__body { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; }
.sand-cube__face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 12px;
  background: var(--sand-canvas);
  border: 1.5px solid var(--sand-ink);
  backface-visibility: hidden;
}
.sand-cube__face i { display: block; height: 2px; background: var(--sand-ink); }
.sand-cube__face i:nth-child(3) { width: 55%; }
.sand-cube__face--front { transform: translateZ(38px); }
.sand-cube__face--back { transform: rotateY(180deg) translateZ(38px); }
.sand-cube__face--right { transform: rotateY(90deg) translateZ(38px); }
.sand-cube__face--left { transform: rotateY(-90deg) translateZ(38px); }
.sand-cube__face--top { transform: rotateX(90deg) translateZ(38px); }
.sand-cube__face--bottom { transform: rotateX(-90deg) translateZ(38px); }

/* Try it: the site's control button */
.sand-live {
  padding: .8rem 2rem;
  border: 1.5px solid var(--sand-ink);
  background: transparent;
  color: var(--sand-ink);
  font-size: .85rem;
  font-weight: 600;
  text-transform: uppercase;
  transition: all .4s ease-out;
}
.sand-live:hover { background: var(--sand-ink); color: var(--sand-canvas); }
.sand-live__note { margin-top: -38px; font-size: .95rem; line-height: 1.6; }

@media (max-width: 1099.98px) {
  .sand-gestures { grid-template-columns: 1fr; max-width: 560px; }
}
@media (max-width: 809.98px) {
  .sand-hands { padding: 48px 20px; gap: 40px; }
  .sand-cam__label { top: 12px; left: 14px; font-size: .7rem; }
  .sand-cam__feed { right: 10px; bottom: 10px; }
  .sand-cam__btn { display: none; }
  .sand-live__note { margin-top: -26px; }
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 40px;
  background: rgba(15, 15, 15, .9);
  cursor: zoom-out;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ---------- Tablet ---------- */
@media (max-width: 1199.98px) {
  .about__text { padding: 0 20px 0 0; }
}

/* ---------- Mobile ---------- */
@media (max-width: 809.98px) {
  .nav__links { display: none; }
  .nav__toggle { display: block; }

  .page-title { font-size: 48px; }

  .work-grid { grid-template-columns: 1fr; }

  .about__row { flex-direction: column-reverse; }
  .about__image { width: 100%; max-width: 440px; }
  .about__bio { font-size: 20px; }

  .nav { height: 110px; padding-top: 30px; }
  .project-hero { padding-top: 130px; gap: 28px; }
  .project-hero__titles { flex-direction: column; align-items: flex-start; gap: 14px; }
  .project-title { font-size: 44px; }
  .project-hero__media img { border-radius: 4px; }
  .overview { flex-direction: column; gap: 40px; padding: 50px var(--pad); }
  .overview__main, .overview__side { flex-basis: auto; }
  .overview__side { margin-right: 0; }
  .overview__side { gap: 32px; }
  .gallery, .gallery__row--pair { gap: 14px; }
  .gallery__row--pair { grid-template-columns: 1fr; }
  .gallery figure { border-radius: 4px; }
  .project-foot { padding: 40px 0 80px; }
  .pager { flex-direction: column; gap: 48px; }
  .pager__card { width: 100%; }
  .site-footer { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .site-footer__flower { order: -1; }
  .site-footer__contact { justify-self: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01s !important;
    animation-delay: 0s !important;
    transition: none !important;
  }
}

/* ---------- Home (original) ---------- */
.hero { position: relative; height: 100vh; height: 100svh; }
.hero__block {
  position: absolute;
  top: 10.2%;
  left: 0;
  width: 100%;
  height: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 46px;
  padding: 20px;
  background: var(--black);
  overflow: hidden;
}
.hero__name {
  font-family: "Doto", sans-serif;
  font-size: 78px;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  color: var(--cream);
  text-wrap: balance;
}
.hero__name span {
  display: inline-block;
  opacity: 0;
  filter: blur(10px);
  transform: translateY(10px) scale(.95);
  animation: blur-in .9s cubic-bezier(.2, .7, .2, 1) forwards;
}
.hero__name span:nth-child(2) { animation-delay: .15s; }
.hero__name span:nth-child(3) { animation-delay: .3s; }
@keyframes blur-in { to { opacity: 1; filter: blur(0); transform: none; } }
@media (max-width: 1199.98px) {
  .hero__block { top: 5%; height: 96%; }
}
@media (max-width: 809.98px) {
  .hero__block { top: 6.6%; height: 93%; }
  .hero__name { font-size: 45px; }
}
.hero__intro {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: -16px;
  text-align: center;
  color: var(--cream);
  font-size: clamp(16px, 1.5vw, 22px);
  line-height: 1.3;
  opacity: 0;
  filter: blur(10px);
  transform: translateY(10px) scale(.95);
  animation: blur-in .9s .5s cubic-bezier(.2, .7, .2, 1) forwards;
}
.hero__intro p { font-weight: 500; }
/* The changing word in "A ___ designer", with a blinking caret while it types */
.hero__word { color: var(--pink); }
.hero__caret {
  display: inline-block;
  width: .08em;
  height: .9em;
  margin-left: .06em;
  vertical-align: -.1em;
  background: var(--pink);
  animation: hero-caret 1s steps(2) infinite;
}
@keyframes hero-caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .hero__caret { display: none; } }

/* Floating icons on the home maroon block: cream icons, cream bubbles */
.hero .inspire { inset: 70px 0 50px; }
.hero__name, .hero__intro { position: relative; z-index: 2; }
.hero .inspire__item { color: var(--cream); }
.hero .inspire__item:hover,
.hero .inspire__item:focus-visible { color: #f6a9c4; }
.hero .inspire__item::after,
.hero .inspire__item::before { background: var(--cream); }
.hero .inspire__item::after { color: var(--maroon); font-weight: 500; }
@media (max-width: 809.98px) {
  .hero .inspire { inset: 50px 0 30px; }
}
/* Whole home page is maroon: the block fills the screen behind the header */
.home-page .hero__block { top: 0; height: 100%; padding-top: 140px; }
/* Home hierarchy: the name on top, the intro sentence at the bottom of the block */
.home-page .hero__block {
  align-items: stretch;
  padding: 140px clamp(20px, 3.5vw, 60px) clamp(18px, 2.4vw, 40px);
}
.home-page .hero__intro {
  align-items: flex-start;
  gap: 2px;
  margin: 0;
  text-align: left;
  font-size: clamp(16px, 1.5vw, 24px);
  line-height: 1.25;
  color: #fff;
  animation-delay: 0s;
}
.home-page .hero__name {
  text-align: left;
  white-space: nowrap;
}
.home-page .hero__name span:nth-child(1) { animation-delay: .2s; }
.home-page .hero__name span:nth-child(2) { animation-delay: .35s; }
.home-page .hero__name span:nth-child(3) { animation-delay: .5s; }
/* Icons float in the open space above the text */
@media (max-width: 809.98px) {
  .home-page .hero__block { padding-top: 110px; }
}
/* Name back in the dotted pixel face, still filling the width */
.home-page .hero__name {
  margin-left: -0.04em;
}
/* Name back in the original dotted pixel face (Doto), all caps, in pink */
.home-page .hero__name {
  font-family: "Doto", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 7.4vw;
  letter-spacing: -0.05em;
  word-spacing: -0.25em;
  line-height: .9;
  color: var(--pink);
  margin-top: clamp(16px, 3vw, 48px);
}
/* Caption sitting in the middle of the floating icons */
.inspire__caption {
  position: absolute;
  text-align: center;
  color: rgba(246, 245, 239, .6);
  font-size: clamp(15px, 1.25vw, 19px);
  font-weight: 500;
  line-height: 1.35;
  pointer-events: none;
}
.inspire__caption { text-wrap: balance; }
/* Bottom-aligned with the description sentence, not floating above it */
.home-page .hero .inspire { inset: 140px 0 clamp(16px, 2.6vw, 40px); }
/* Phones: name stacks big over three lines; folder sits above the intro text instead of on it */
@media (max-width: 809.98px) {
  .home-page .hero__name { font-size: 15vw; white-space: normal; line-height: .95; }
}

/* Pink logo peeking out from behind the folder's top-left corner, slightly turned */
.inspire__logo {
  position: absolute;
  right: calc(var(--edge) + var(--bw) * .54);
  bottom: calc(var(--bw) * .2);
  z-index: 0;
  width: calc(var(--bw) * 1);
  max-width: none;
  rotate: -10deg;
  pointer-events: none;
  user-select: none;
}
.home-page .hero .inspire { transition: opacity .4s ease, visibility .4s; }
.home-page .hero .inspire.is-hidden { opacity: 0; visibility: hidden; }
/* Icons stay still */
.inspire__item { animation: none; }

/* ---------- Cardboard box of inspirations ---------- */
.inspire__caption { top: auto; }

.box {
  position: absolute;
  bottom: 0;
  width: var(--bw);
}
.box__back, .box__front, .box__inside { position: absolute; inset: 0; width: 100%; height: 100%; }
.box__back { z-index: 1; }
.box__front { z-index: 3; pointer-events: none; }
.box svg { overflow: visible; }

/* Icons in the box: slightly smaller, tilted, tucked behind the front */
.inspire__item { touch-action: none; transition: rotate .5s cubic-bezier(.2, .9, .25, 1.2); }
.inspire__item.is-front { z-index: 1; }
.inspire__item.is-out { z-index: 4; }
.inspire__item.is-dragging { z-index: 10 !important; cursor: grabbing; }
.inspire__item.is-dragging .inspire__icon { transform: scale(1.15); }
.inspire__item.is-dragging::after,
.inspire__item.is-dragging::before { opacity: 0 !important; }

/* Filled icons: coloured fill under a dark pixel outline */
.hero .inspire__icon {
  position: relative;
  background: none;
  -webkit-mask: none;
  mask: none;
}
.hero .inspire__icon::before,
.hero .inspire__icon::after {
  content: "";
  position: absolute;
  inset: 0;
}
.hero .inspire__icon::before {
  background: var(--fill, #f7c1d3);
  -webkit-mask: var(--fsrc) center / contain no-repeat;
  mask: var(--fsrc) center / contain no-repeat;
}
.hero .inspire__icon::after {
  background: #1f0a10;
  -webkit-mask: var(--src) center / contain no-repeat;
  mask: var(--src) center / contain no-repeat;
}
.inspire__item.is-boxed:hover .inspire__icon { transform: translateY(-6px) scale(1.1); }
/* Icons hidden inside the folder: click the folder to pull them out */
.box { cursor: pointer; transition: transform .25s cubic-bezier(.34, 1.56, .64, 1); }
.box:hover { transform: translateY(-4px); }
.box:focus-visible { outline: 2px solid var(--cream); outline-offset: 8px; }
.box svg { pointer-events: none; }
.box__inside { z-index: 2; }
.inspire__item.is-boxed { pointer-events: none; }
.inspire__item.is-boxed .inspire__icon { transition: transform .35s cubic-bezier(.34, 1.56, .64, 1); }
/* Hovering the folder lets the tops peek out */
.box:hover .inspire__item.is-boxed .inspire__icon { transform: translateY(-85%); }
.box:hover .inspire__item.is-front .inspire__icon { transform: translateY(-60%); }
/* The caption appears once the folder has been clicked; until then only the hint shows */
.inspire__lead { display: block; color: #fff; opacity: 0; transform: translateY(8px); transition: opacity .5s ease, transform .5s ease; }
.inspire.is-opened .inspire__lead { opacity: 1; transform: none; }
/* Pixel-art folder to match the icons */
.box { aspect-ratio: 40 / 30; filter: none; }
.inspire__caption { bottom: calc(var(--bw) * .75 + 20px); }
/* "Click folder" written on the front of the folder */
.box__label {
  position: absolute;
  z-index: 5;
  translate: 0 -50%;
  text-align: center;
  font: 700 calc(var(--bw) * .075) / 1 "Doto", monospace;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  pointer-events: none;
  transition: opacity .3s ease;
}
/* Folder tucked into the bottom-right corner, caption and reset link with it */
.inspire { --edge: clamp(20px, 3.5vw, 60px); }
.box { left: auto; right: var(--edge); translate: none; }
.inspire__caption { left: auto; right: var(--edge); translate: none; width: max(var(--bw), 260px); }
/* Bigger icons */
.hero .inspire__icon { width: clamp(58px, 6vw, 100px); }
.inspire__item.is-boxed .inspire__icon { width: clamp(48px, 4.6vw, 76px); }

/* Click the folder: icons rise out of the top, then they can be dragged out */
.inspire__item.is-boxed { transition: top .55s cubic-bezier(.3, 1.5, .5, 1), left .55s ease, rotate .55s ease; }
.inspire.is-opened .inspire__item.is-boxed { pointer-events: auto; cursor: grab; }
.inspire.is-opened .box:hover .inspire__item.is-boxed .inspire__icon { transform: none; }
.inspire.is-opened .inspire__item.is-boxed:hover .inspire__icon { transform: translateY(-6px) scale(1.08); }
.inspire.is-opened .box__label { opacity: 0; }
.inspire.is-opened .box:hover { transform: none; }
.inspire__drag { display: block; margin-top: 6px; color: #8c8c8c; opacity: 0; transition: opacity .5s ease .2s; }
.inspire.is-opened .inspire__drag { opacity: 1; }
.inspire__caption { transition: bottom .5s ease; }
.inspire { --bw: clamp(220px, 26vw, 400px); }
/* Leave room for the risen icons above the folder */
.inspire.is-opened .inspire__caption { bottom: calc(var(--bw) * .88 + 20px); }

/* "Click" in a tilted bubble on the folder's top-right */
.box__label {
  left: auto;
  right: 10%;
  top: 44%;
  display: flex;
  justify-content: flex-end;
  rotate: 12deg;
  color: #fff;
  font-size: calc(var(--bw) * .07);
}
.box__bubble {
  padding: .45em .8em .4em;
  border-radius: 999px;
  background: #fcc0df;
  color: var(--maroon);
  white-space: nowrap;
}
/* Logo behind the folder spins slowly, like the footer flower */
.inspire__logo { animation: footer-spin 20s linear infinite; }
@media (prefers-reduced-motion: reduce) { .inspire__logo { animation: none; } }
/* Intro sits just under the name */
.home-page .hero__block { justify-content: flex-start; gap: 32px; }
@media (max-width: 809.98px) { .home-page .hero .inspire { inset: 110px 0 40px; } }
/* Caption stays in front of the spinning logo */
.inspire__caption { z-index: 6; }
/* Folder layer sits above the name so dragged-out icons land in front of it;
   only the folder and the icons themselves catch clicks */
.home-page .hero .inspire { z-index: 3; pointer-events: none; }
.home-page .hero .box,
.home-page .hero .inspire > .inspire__item { pointer-events: auto; }
