﻿/* ==========================================================================
   Mekadmim — editorial redesign (index-new.html)
   Black canvas, huge type, thin lines; colour comes from the brand teal
   and from the work itself.
   ========================================================================== */

:root {
  --bg: #0c0d0e;
  --bg-2: #131517;
  --fg: #f4f7f8;
  --muted: #8d9aa0;
  --line: rgba(255, 255, 255, 0.14);
  --teal: #51bacc;
  --teal-2: #9ed6e0;
  --mint: #7ef0c9;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --pad: clamp(1.25rem, 5vw, 5rem);
  --font: "Heebo", "Segoe UI", Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1.6;
  overflow-x: hidden;
}

img,
video {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p,
ol,
ul,
figure {
  margin: 0;
  padding: 0;
}

ol,
ul {
  list-style: none;
}

::selection {
  background: rgba(81, 186, 204, 0.4);
}

:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 4px;
}

/* ---------- progress ---------- */
.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 200;
  transform-origin: right center;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--mint), var(--teal));
}

/* ---------- buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 2.2rem;
  border-radius: 999px;
  background: var(--fg);
  color: #04161a;
  font-weight: 700;
  overflow: hidden;
  isolation: isolate;
  transition: translate 0.3s var(--ease), box-shadow 0.4s ease;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, var(--mint), var(--teal));
  transform: translateY(101%);
  transition: transform 0.5s var(--ease);
}

.btn::after {
  content: "\2190";
  font-weight: 400;
  transition: transform 0.35s var(--ease);
}

.btn:hover {
  box-shadow: 0 14px 40px -10px rgba(81, 186, 204, 0.7);
}

.btn:hover::before {
  transform: translateY(0);
}

.btn:hover::after {
  transform: translateX(-6px);
}

.btn-sm {
  padding: 0.55rem 1.3rem;
  font-size: 0.95rem;
}

.btn-lg {
  padding: 1.3rem 3rem;
  font-size: 1.25rem;
}

/* ---------- header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.1rem var(--pad);
  transition: background 0.4s ease, padding 0.4s var(--ease), backdrop-filter 0.4s ease;
}

.site-header.is-scrolled {
  background: rgba(12, 13, 14, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding-block: 0.7rem;
  box-shadow: 0 1px 0 var(--line);
}

.brand img {
  height: 2rem;
  width: auto;
}

.main-nav {
  display: flex;
  gap: 0.2rem;
  margin-inline-end: auto;
  margin-inline-start: 1.5rem;
}

.main-nav a {
  position: relative;
  padding: 0.4rem 0.9rem;
  font-size: 0.98rem;
  color: var(--muted);
  transition: color 0.25s ease;
}

.main-nav a::after {
  content: "";
  position: absolute;
  inset: auto 0.9rem 0.1rem 0.9rem;
  height: 1px;
  background: var(--teal);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease);
}

.main-nav a:hover,
.main-nav a.is-active {
  color: var(--fg);
}

.main-nav a:hover::after,
.main-nav a.is-active::after {
  transform: scaleX(1);
}

.menu-btn {
  display: none;
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  position: relative;
  cursor: pointer;
}

.menu-btn span {
  position: absolute;
  inset-inline: 0.8rem;
  height: 1.5px;
  background: var(--fg);
  transition: transform 0.35s var(--ease), top 0.35s var(--ease);
}

.menu-btn span:nth-child(1) { top: 1.05rem; }
.menu-btn span:nth-child(2) { top: 1.5rem; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { top: 1.27rem; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { top: 1.27rem; transform: rotate(-45deg); }

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.4rem;
  padding: 6rem var(--pad) 3rem;
  background: var(--bg);
  clip-path: circle(0 at 90% 4%);
  transition: clip-path 0.7s var(--ease), visibility 0s linear 0.7s;
  pointer-events: none;
  visibility: hidden;
}

.mobile-nav.is-open {
  clip-path: circle(150% at 90% 4%);
  pointer-events: auto;
  visibility: visible;
  transition: clip-path 0.7s var(--ease), visibility 0s;
}

.mobile-nav a {
  font-size: clamp(2rem, 9vw, 3.2rem);
  font-weight: 900;
  line-height: 1.25;
  border-bottom: 1px solid var(--line);
  padding-block: 0.6rem;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  align-items: center;
  gap: 1rem;
  padding: 5.5rem var(--pad) 1rem;
  overflow: hidden;
  overflow: clip;
}

.hero::before {
  content: "";
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  top: -20%;
  left: -15%;
  background: radial-gradient(circle, rgba(81, 186, 204, 0.22), transparent 62%);
  filter: blur(40px);
  pointer-events: none;
  animation: drift 20s ease-in-out infinite alternate;
}

@keyframes drift {
  to { transform: translate3d(8vw, 6vh, 0) scale(1.15); }
}

.hero-text {
  position: relative;
  z-index: 2;
  /* as wide as the headline, so the circle below can sit exactly under its middle */
  width: fit-content;
  max-width: 100%;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.6rem;
  color: var(--teal-2);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
}

.eyebrow::before {
  content: "";
  width: 2.2rem;
  height: 1px;
  background: var(--teal);
}

.hero-title {
  font-size: clamp(3.2rem, 9.2vw, 9rem);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.02em;
}

.hero-title .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
}

.hero-title .line > span {
  display: block;
  /* the words rest in their final place; the entrance only animates FROM below, so if an animation
     never runs on some phone (battery saver, old browser) the headline is still fully visible */
  animation: lineUp 1.1s var(--ease) both;
}

.hero-title .line:nth-child(2) > span { animation-delay: 0.12s; }
.hero-title .line:nth-child(3) > span { animation-delay: 0.24s; }

@keyframes lineUp {
  from { transform: translateY(110%); }
}

/* the gradient sits on the animated inner span itself: on iPhone/Safari a clipped gradient on the
   parent drops the text of a transformed child, which made the word disappear */
.hero-title .accent > span {
  color: var(--mint);
  background: linear-gradient(100deg, var(--teal-2), var(--mint) 55%, var(--teal));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2.2rem;
}

.scroll-cue {
  display: grid;
  place-items: center;
  width: clamp(4.4rem, 5.6vw, 5.8rem);
  height: clamp(4.4rem, 5.6vw, 5.8rem);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  color: var(--fg);
  transition: border-color 0.3s ease, background 0.3s ease, color 0.3s ease;
}

.scroll-cue svg {
  width: 40%;
  height: 40%;
  animation: bob 2s ease-in-out infinite;
}

@keyframes bob {
  50% { transform: translateY(4px); }
}

.scroll-cue:hover {
  border-color: var(--teal);
  background: var(--teal);
  color: #04161a;
}

.hero-visual {
  position: relative;
  z-index: 1;
  will-change: transform;
}

/* ---------- Living room + old CRT television ----------
   The interactive road/car scene runs on the TV screen. All sizes are
   percentages of .room so the whole scene scales together. */
.room {
  --wood: #3b2a20;
  --wood-hi: #5a4030;
  position: relative;
  width: 100%; /* stays inside the screen: nothing is cut at the left edge
  /* never taller than the screen: on big monitors the hero used to grow past one screen and leave a gap above the text */
  max-width: max(26rem, calc((100svh - 7rem) / 1.055));
  margin-inline-start: auto;
  margin-inline-end: 0;
  aspect-ratio: 1 / 1.055; /* headroom = the meow bubble + a little */
  overflow: hidden;
  background: radial-gradient(ellipse 70% 60% at 50% 40%, rgba(30, 40, 44, 0.75), rgba(23, 28, 31, 0) 75%);
  /* no card edges: the whole room dissolves into the hero background */
  -webkit-mask-image: radial-gradient(ellipse 54% 74% at 50% 58%, #000 50%, transparent 100%);
  mask-image: radial-gradient(ellipse 54% 74% at 50% 58%, #000 50%, transparent 100%);
}

/* wall details */
.room::before {
  content: "";
  position: absolute;
  inset: 0 0 20% 0;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.018) 0 2px, transparent 2px 22px);
  pointer-events: none;
}

/* In 3D the wall already has its own texture: the 2D stripe overlay would only show up as
   a see-through striped box around the TV area. */
.room.has-3d::before {
  display: none;
}

/* WebGL room (hero3d.js). Without it the SVG scene below stays visible. */
.hero-3d {
  display: none;
}

.room.has-3d .hero-3d {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.room.has-3d .room-scene {
  display: none;
}

/* Wide screens: the 3D wall fills the whole hero and the headline is a neon sign on it */
.hero.has-wall > .hero-3d {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 80%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 80%, transparent 100%);
}

.hero.has-wall::before {
  display: none;
}

.hero.has-wall .room {
  background: none;
  -webkit-mask-image: none;
  mask-image: none;
}

.hero.has-wall .hero-visual {
  pointer-events: none;
}

.hero.has-wall .hero-text {
  pointer-events: none;
}

.hero.has-wall .hero-text a,
.hero.has-wall .hero-text button {
  pointer-events: auto;
}

/* The headline keeps its original bold look, but now it reads as lettering fixed to the
   wall: it picks up a soft cast shadow and a faint highlight from the room's lights. */
.hero.has-wall .hero-title {
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.18), 0 10px 26px rgba(0, 0, 0, 0.55);
}

.hero.has-wall .hero-title .accent {
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.5));
}
/* the furniture keeps its original proportions, anchored to the bottom */
/* the old flat 2D room is only a fallback: hidden by default so it never flashes while the 3D scene loads */
.room-scene {
  opacity: 0;
  position: absolute;
  inset: auto 0 0 0;
  aspect-ratio: 1 / 0.92;
}

.room-floor {
  position: absolute;
  inset: auto 0 0 0;
  height: 20%;
  background: linear-gradient(180deg, #2a1d15, #1a120d);
  border-top: 3px solid #0a0706;
}

.room-floor::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.35) 0 1px, transparent 1px 11%);
}

.room-frame {
  position: absolute;
  border: 4px solid var(--wood);
  background: linear-gradient(135deg, #1d2e33, #0f171a);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5), inset 0 0 0 3px #0b0e0f;
}

.room-frame.f1 { top: 7%; left: 7%; width: 16%; height: 20%; }
.room-frame.f2 { top: 11%; left: 26%; width: 10%; height: 13%; background: linear-gradient(135deg, #3b2f1e, #1c160d); }

.room-lamp {
  position: absolute;
  top: 0;
  right: 11%;
  width: 5px;
  height: 11%;
  background: linear-gradient(90deg, #4a4a4e, #77777c 50%, #3a3a3d);
}

.room-lamp::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  width: 52px;
  height: 22px;
  translate: -50% 0;
  border-radius: 52px 52px 4px 4px;
  background: #d9a45b;
  box-shadow: 0 0 80px 40px rgba(217, 164, 91, 0.2);
  animation: lampFlicker 7s ease-in-out infinite;
}

@keyframes lampFlicker {
  0%, 92%, 100% { opacity: 1; }
  94% { opacity: 0.75; }
  96% { opacity: 1; }
}

/* light spilling from the TV onto the wall and furniture */
.tv-glow {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 22%;
  bottom: 6%;
  background: radial-gradient(ellipse at 50% 55%, rgba(81, 186, 204, 0.32), rgba(81, 186, 204, 0.1) 45%, transparent 70%);
  filter: blur(18px);
  animation: tvPulse 3.2s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes tvPulse {
  to { opacity: 0.72; }
}

/* TV stand / shelf unit */
.stand {
  position: absolute;
  left: 14%;
  width: 84%;
  bottom: 7%;
  height: 29%;
  display: flex;
  flex-direction: column;
}

.stand-top {
  height: 14%;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, var(--wood-hi), var(--wood));
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5);
}

.stand-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2%;
  padding: 2.5% 2.5% 0;
  background: linear-gradient(180deg, #2c1f17, #20160f);
}

.stand-body span {
  position: relative;
  border-radius: 3px;
  background: linear-gradient(180deg, #2f2118, #261a12);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.35);
}

.stand-body span::after {
  content: "";
  position: absolute;
  top: 40%;
  left: 50%;
  width: 22%;
  height: 4px;
  translate: -50% 0;
  border-radius: 2px;
  background: #b79a6a;
}

.stand-legs {
  display: flex;
  justify-content: space-between;
  padding-inline: 4%;
  height: 8%;
}

.stand-legs i {
  width: 4%;
  background: #1b130d;
  border-radius: 0 0 3px 3px;
}

/* the television */
.tv {
  position: absolute;
  left: 18%;
  width: 76%;
  bottom: 34.5%;
}

.tv-antenna {
  display: block;
  width: 30%;
  margin: 0 auto -1px;
  overflow: visible;
  translate: 24% 0; /* leave room for the cat */
}

.tv-body {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 22%;
  gap: 3%;
  padding: 4.5%;
  aspect-ratio: 1.79 / 1;
  border-radius: 16px;
  background: linear-gradient(160deg, #6a4a35 0%, #4a3324 45%, #33231a 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.14), inset 0 -4px 10px rgba(0, 0, 0, 0.5),
    0 14px 24px rgba(0, 0, 0, 0.55);
}

.screen {
  position: relative;
  overflow: hidden;
  border-radius: 11% / 14%;
  background: #000;
  box-shadow: 0 0 0 4px #0b0907, inset 0 0 22px 6px rgba(0, 0, 0, 0.85),
    0 0 36px rgba(81, 186, 204, 0.45);
  cursor: pointer;
}

.crt {
  position: absolute;
  inset: 0;
  transform-origin: center;
  animation: crtOn 1.3s 0.5s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

@keyframes crtOn {
  0% { transform: scale(1, 0.004); filter: brightness(6); opacity: 0; }
  35% { transform: scale(1, 0.004); filter: brightness(6); opacity: 1; }
  70% { transform: scale(1, 1); filter: brightness(2.2); }
  100% { transform: scale(1, 1); filter: brightness(1); opacity: 1; }
}

.hero-canvas {
  display: none;
}

.has-canvas .hero-canvas {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.screen img.screen-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.has-canvas .screen-fallback {
  display: none;
}

/* CRT glass: scanlines, vignette, glare, flicker */
.screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.3) 0 1px, transparent 1px 3px);
  animation: crtFlicker 0.18s steps(2) infinite;
}

.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.16) 0%, transparent 32%),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.6) 100%);
}

@keyframes crtFlicker {
  50% { opacity: 0.82; }
}

/* channel-change static burst */
.crt-static {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1.4 -0.2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.screen.is-static .crt-static {
  opacity: 0.9;
  animation: staticShift 0.12s steps(3) infinite;
}

@keyframes staticShift {
  0% { background-position: 0 0; }
  33% { background-position: -60px 40px; }
  66% { background-position: 35px -80px; }
  100% { background-position: -20px 20px; }
}

/* ---------- the cat on top of the TV ---------- */
.cat {
  position: absolute;
  left: 1%;
  bottom: calc(100% - 3px);
  width: 46%;
  z-index: 2;
  pointer-events: none;
}

.cat svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.cat-all {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

.cat-fur {
  fill: #2b3135;
}

.cat-haunch {
  fill: #323a3f;
}

.cat-sock,
.cat-tail-tip {
  fill: #d9d4cc;
}

.cat-ear-in {
  fill: #c98a8a;
}

.cat-nose {
  fill: #d98e8e;
}

.cat-tail,
.cat-tail-tip {
  fill: none;
  stroke: #2b3135;
  stroke-width: 9;
  stroke-linecap: round;
  transition: stroke-width 0.15s ease;
}

.cat-tail-tip {
  stroke: #d9d4cc;
}

.eyes-calm path {
  fill: none;
  stroke: #0b0d0e;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.eyes-wide {
  opacity: 0;
}

.eyes-wide circle {
  fill: #d6f15a;
}

.eyes-wide ellipse {
  fill: #0b0d0e;
}

.cat-tongue {
  fill: #e98a9a;
  transform-box: fill-box;
  transform-origin: 50% 0;
  opacity: 0;
}

/* sitting: breathing, head dips to lick the tail, tongue flicks */
.cat-all {
  animation: catBreathe 3.4s ease-in-out infinite;
}

.cat-head {
  transform-box: view-box;
  transform-origin: 50px 62px;
  animation: catLick 3.6s ease-in-out infinite;
}

.cat-tongue {
  animation: catTongue 3.6s ease-in-out infinite;
}

.cat-tail-tip {
  animation: catTail 3.6s ease-in-out infinite;
}

@keyframes catBreathe {
  50% { transform: scale(1, 1.025); }
}

@keyframes catLick {
  0%, 12%, 100% { transform: rotate(-3deg); }
  28%, 74% { transform: rotate(-24deg); }
  40% { transform: rotate(-20deg); }
  52% { transform: rotate(-25deg); }
  64% { transform: rotate(-20deg); }
}

@keyframes catTongue {
  0%, 26%, 80%, 100% { opacity: 0; transform: scaleY(0.2); }
  34% { opacity: 1; transform: scaleY(1); }
  42% { opacity: 1; transform: scaleY(0.4); }
  50% { opacity: 1; transform: scaleY(1); }
  58% { opacity: 1; transform: scaleY(0.4); }
  66% { opacity: 1; transform: scaleY(1); }
  74% { opacity: 0; transform: scaleY(0.3); }
}

@keyframes catTail {
  0%, 100% { transform: translate(0, 0); }
  45% { transform: translate(-1px, -1.5px); }
  60% { transform: translate(0.5px, 0.5px); }
}

/* startled by the static: jump, puff the tail, wide eyes, land, settle */
.cat.is-scared .cat-all {
  animation: catJump 1s cubic-bezier(0.3, 0.7, 0.3, 1) both;
}

.cat.is-scared .cat-head {
  animation: none;
  transform: rotate(8deg);
}

.cat.is-scared .cat-tongue {
  animation: none;
  opacity: 0;
}

.cat.is-scared .eyes-calm {
  opacity: 0;
}

.cat.is-scared .eyes-wide {
  opacity: 1;
}

.cat.is-scared .cat-tail,
.cat.is-scared .cat-tail-tip {
  animation: none;
  stroke-width: 14;
}

@keyframes catJump {
  0% { transform: translateY(0) scale(1.06, 0.9); }
  22% { transform: translateY(-30%) scale(0.94, 1.14); }
  48% { transform: translateY(-22%) scale(0.98, 1.06); }
  76% { transform: translateY(0) scale(1.08, 0.88); }
  100% { transform: translateY(0) scale(1, 1); }
}

/* knob 2: a big stretch and a yawn */
.cat-mouth {
  fill: #6d2535;
  transform-box: fill-box;
  transform-origin: 50% 0;
  opacity: 0;
  transform: scaleY(0.1);
}

.cat.is-stretch .cat-all {
  animation: catStretch 2.2s ease-in-out both;
}

.cat.is-stretch .cat-head {
  animation: catYawnHead 2.2s ease-in-out both;
}

.cat.is-stretch .cat-tongue {
  animation: none;
  opacity: 0;
}

.cat.is-stretch .cat-mouth {
  animation: catYawnMouth 2.2s ease-in-out both;
}

@keyframes catStretch {
  0% { transform: scale(1, 1); }
  25% { transform: scale(1.16, 0.84); }
  55%, 70% { transform: scale(1.2, 0.8) skewX(-3deg); }
  100% { transform: scale(1, 1); }
}

@keyframes catYawnHead {
  0% { transform: rotate(-3deg); }
  25%, 70% { transform: rotate(14deg); }
  100% { transform: rotate(-3deg); }
}

@keyframes catYawnMouth {
  0%, 20%, 100% { opacity: 0; transform: scaleY(0.1); }
  35%, 65% { opacity: 1; transform: scaleY(1.15); }
}

/* screen click: leans in, curious, bats at the glass */
.cat-paw {
  transform-box: view-box;
  transform-origin: 48px 78px;
}

.cat.is-swat .cat-head {
  animation: catPeek 1.8s ease-in-out both;
}

.cat.is-swat .cat-tongue {
  animation: none;
  opacity: 0;
}

.cat.is-swat .eyes-calm {
  opacity: 0;
}

.cat.is-swat .eyes-wide {
  opacity: 1;
}

.cat.is-swat .cat-paw {
  animation: catSwat 1.8s ease-in-out both;
}

@keyframes catPeek {
  0%, 100% { transform: rotate(-3deg); }
  15%, 80% { transform: rotate(-30deg) translate(-3px, 4px); }
}

@keyframes catSwat {
  0%, 20%, 100% { transform: rotate(0); }
  32% { transform: rotate(42deg); }
  44% { transform: rotate(-8deg); }
  56% { transform: rotate(42deg); }
  68% { transform: rotate(-8deg); }
  78% { transform: rotate(0); }
}

/* control panel */
.tv-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 8% 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #1d1510, #130e0a);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.5);
}

.tv-brand {
  font-size: clamp(0.4rem, 0.9vw, 0.62rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #c9b79a;
}

.knob {
  position: relative;
  width: 56%;
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e6d7b9, #8f7a56 70%);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.6), inset 0 -2px 3px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.5s var(--ease);
}

.knob::after {
  content: "";
  position: absolute;
  top: 8%;
  left: 50%;
  width: 7%;
  height: 34%;
  translate: -50% 0;
  border-radius: 2px;
  background: #2b2016;
}

.knob:hover {
  filter: brightness(1.12);
}

.grille {
  width: 70%;
  height: 22%;
  background: repeating-linear-gradient(180deg, #060403 0 3px, transparent 3px 6px);
  border-radius: 3px;
}

.led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 8px var(--mint);
  animation: ledBlink 2.6s ease-in-out infinite;
}

@keyframes ledBlink {
  50% { opacity: 0.35; }
}

.tv-feet {
  display: flex;
  justify-content: space-between;
  padding-inline: 12%;
  height: 4px;
}

.tv-feet i {
  width: 9%;
  background: #120c08;
  border-radius: 0 0 4px 4px;
}

/* ---------- reveal ---------- */
.js .rv {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s ease, transform 1s var(--ease);
  transition-delay: var(--d, 0s);
}

.js .rv.is-in {
  opacity: 1;
  transform: none;
}

/* ---------- generic section ---------- */
section {
  padding: clamp(2.5rem, 5vw, 5rem) var(--pad);
  position: relative;
}

section + section {
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: clamp(1.5rem, 3vw, 3rem);
}

.section-title {
  font-size: clamp(2.6rem, 7vw, 6.5rem);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.section-title em {
  font-style: normal;
  color: var(--teal-2);
}

.section-label {
  font-size: clamp(1.6rem, 3.6vw, 3rem);
  font-weight: 900;
  color: inherit;
  letter-spacing: -0.01em;
  margin-bottom: clamp(1.4rem, 3vw, 2.6rem);
}

.lede {
  max-width: 26rem;
  color: var(--muted);
}

/* ---------- clients marquee ---------- */
.clients {
  padding-block: clamp(2.4rem, 4.5vw, 4.2rem);
  overflow: hidden;
  overflow: clip;
}

.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.marquee-track {
  display: flex;
  align-items: center;
  --logo-gap: clamp(1.4rem, 2.8vw, 3rem);
  gap: var(--logo-gap);
  width: max-content;
  animation: marquee 120s linear infinite;
}

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

.marquee + .marquee {
  margin-top: clamp(1.2rem, 2.5vw, 2.2rem);
}

/* every logo sits on an identical white card, so sizes read as one family */
.logo-card {
  position: relative;
  flex: none;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: clamp(11.9rem, 18.75vw, 16.9rem);
  height: clamp(6.25rem, 10vw, 9.25rem);
  padding: clamp(0.6rem, 1.2vw, 1.1rem) clamp(0.8rem, 1.6vw, 1.6rem);
}

/* small vertical line between neighbouring logos (centred in the gap) */
.logo-card::after {
  content: "";
  position: absolute;
  top: 50%;
  inset-inline-end: calc(var(--logo-gap) / -2);
  width: 1px;
  height: 42%;
  translate: 0 -50%;
  background: rgba(255, 255, 255, 0.3);
  pointer-events: none;
}

.logo-card img {
  /* logos cannot be dragged, selected or saved by right-click */
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  /* any colour -> flat white, like the McCann reference */
  filter: brightness(0) invert(1);
  opacity: 0.72;
  transition: opacity 0.4s ease;
}

.logo-card:hover img {
  opacity: 1;
}

.marquee-rev .marquee-track {
  animation-direction: reverse;
}

@keyframes marquee {
  to { transform: translateX(50%); }
}

/* ---------- services ---------- */
.service-list {
  border-top: 1px solid var(--line);
}

.service {
  position: relative;
  display: grid;
  grid-template-columns: 5rem 1.1fr 1fr;
  align-items: baseline;
  gap: 2rem;
  padding-block: clamp(1.8rem, 3.5vw, 3rem);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  transition: padding 0.5s var(--ease);
}

.service::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(270deg, rgba(81, 186, 204, 0.16), transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.service:hover::before {
  opacity: 1;
}

.service:hover {
  padding-inline-start: 1.2rem;
}

.service .num {
  color: var(--teal);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.service h3 {
  font-size: clamp(1.8rem, 4.2vw, 3.8rem);
  font-weight: 900;
  line-height: 1.1;
  transition: color 0.3s ease;
}

.service:hover h3 {
  color: var(--teal-2);
}

.service p {
  color: var(--muted);
  max-width: 34rem;
}

/* McCann-style contrast: this section flips to white with black type */
.services {
  background: #d9dcdd;
  color: #0c0d0e;
}

.services .section-title em {
  color: #1d8796;
}

.services .service-list,
.services .service {
  border-color: rgba(12, 13, 14, 0.16);
}

.services .service::before {
  background: linear-gradient(270deg, rgba(29, 135, 150, 0.14), transparent 70%);
}

.services .service .num {
  color: #0f5c68;
}

.services .service:hover h3 {
  color: #1d8796;
}

.services .service p {
  color: #4b565b;
}
/* ---------- work ---------- */
.work-grid {
  display: grid;
  /* 4 columns in a slightly narrower block: each tile is about a third smaller than the old 3-column tiles */
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(0.8rem, 1.6vw, 1.6rem);
  max-width: 92%;
  margin-inline: auto;
}

.work-item {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  background: var(--bg-2);
  aspect-ratio: 4 / 5;
}

.work-item:nth-child(4n + 2),
.work-item:nth-child(4n + 4) {
  margin-top: clamp(1.5rem, 4vw, 4rem);
}

.work-item img,
.work-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease), filter 0.6s ease;
}

.work-item:hover img,
.work-item:hover video {
  transform: scale(1.06);
}

.work-item figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 3rem 1.2rem 1.1rem;
  background: linear-gradient(0deg, rgba(12, 13, 14, 0.9), transparent);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.4s ease, transform 0.5s var(--ease);
}

.work-item figcaption span {
  font-size: 1.15rem;
  font-weight: 700;
}

.work-item figcaption span::before {
  content: "";
  display: inline-block;
  width: 1.4rem;
  height: 1px;
  margin-inline-end: 0.7rem;
  vertical-align: middle;
  background: var(--teal);
}

.work-item:hover figcaption,
.work-item:focus-within figcaption {
  opacity: 1;
  transform: none;
}

/* ---------- careers ---------- */
.job-list {
  border-top: 1px solid var(--line);
}

.job-list a {
  display: grid;
  grid-template-columns: 5rem 1fr auto;
  align-items: center;
  gap: 2rem;
  padding-block: clamp(1.3rem, 2.6vw, 2.2rem);
  border-bottom: 1px solid var(--line);
  transition: padding 0.5s var(--ease), color 0.3s ease, background 0.4s ease;
}

.job-list .num {
  color: var(--teal);
  font-weight: 700;
}

.job-list .job {
  font-size: clamp(1.5rem, 3.6vw, 3rem);
  font-weight: 900;
}

.job-list .go {
  font-size: 2rem;
  color: var(--teal);
  transition: transform 0.4s var(--ease);
}

.job-list a:hover {
  padding-inline: 1.2rem;
  color: var(--teal-2);
  background: linear-gradient(270deg, rgba(81, 186, 204, 0.12), transparent 70%);
}

.job-list a:hover .go {
  transform: translateX(-10px);
}

/* ---------- footer ---------- */
.site-footer {
  position: relative;
  padding: clamp(3rem, 6vw, 6rem) var(--pad) 2rem;
  border-top: 1px solid var(--line);
  overflow: hidden;
  overflow: clip;
}

.site-footer::before {
  content: "";
  position: absolute;
  width: 55vmax;
  height: 55vmax;
  inset: auto auto -35% -10%;
  background: radial-gradient(circle, rgba(81, 186, 204, 0.2), transparent 62%);
  filter: blur(40px);
  pointer-events: none;
}

.footer-cta {
  font-size: clamp(2.6rem, 8vw, 8rem);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin-bottom: 3rem;
}

.footer-cta em {
  font-style: normal;
  color: var(--mint);
  background: linear-gradient(100deg, var(--teal-2), var(--mint));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.footer-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: clamp(4rem, 8vw, 7rem);
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
}

.footer-grid h3 {
  margin-bottom: 1rem;
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.footer-grid a,
.footer-grid span {
  display: block;
  padding-block: 0.2rem;
}

.footer-grid a {
  width: fit-content;
  transition: color 0.25s ease, translate 0.3s var(--ease);
}

.footer-grid a:hover {
  color: var(--teal-2);
  translate: -4px 0;
}

.footer-bottom {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 4rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-bottom img {
  height: 1.6rem;
  width: auto;
  opacity: 0.8;
}

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .main-nav,
  .site-header > .btn-sm {
    display: none;
  }

  .menu-btn {
    display: block;
    margin-inline-start: auto;
  }

  .hero {
    padding-top: 5rem;
    gap: 0.5rem;
  }

  .hero-title {
    font-size: clamp(2.6rem, 7.4vw, 5.5rem);
  }

  .hero-actions {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .service {
    grid-template-columns: 3rem 1fr;
  }

  .service p {
    grid-column: 2;
  }

  .work-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 100%;
  }

  .work-item:nth-child(4n + 2),
  .work-item:nth-child(4n + 4) {
    margin-top: 0;
  }

  .work-item:nth-child(3n + 2) {
    margin-top: 2rem;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Phones only: stack the hero (text first, image below) */
@media (max-width: 700px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: clamp(3rem, 14vw, 5rem);
  }

  .hero-visual {
    width: 100%;
    max-width: 30rem;
    margin-inline: auto;
  }

  /* phones: the canvas is clipped to the room box, so give the meow bubble extra headroom */
  .room {
    aspect-ratio: 1 / 1.13;
  }

}

@media (max-width: 560px) {
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .work-item:nth-child(3n + 2) {
    margin-top: 0;
  }

  .work-item:nth-child(2n) {
    margin-top: 1.5rem;
  }

  .work-item figcaption {
    opacity: 1;
    transform: none;
  }

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

  .job-list a {
    grid-template-columns: 2.6rem 1fr auto;
    gap: 1rem;
  }
}

/* ---------- preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .js .rv {
    opacity: 1;
    transform: none;
  }
}

/* ---------- final touches ---------- */
/* campaign tiles: no captions at all, hover only zooms the picture */
.work-item figcaption {
  display: none;
}

/* careers: the line under the title sits below it, right-aligned (RTL), not pushed to the far side */
.careers .section-head {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 1.2rem;
}

.careers .lede {
  max-width: none;
  text-align: start;
}

/* one line on screens wide enough for it; it wraps normally on phones */
@media (min-width: 900px) {
  .careers .lede {
    white-space: nowrap;
  }
}

/* Careers flips to the soft grey (like the services section) with dark type */
.careers {
  background: #d9dcdd;
  color: #0c0d0e;
}

.careers .section-title em {
  color: #0f5c68;
}

.careers .lede {
  color: #4b565b;
}

.careers .job-list,
.careers .job-list a {
  border-color: rgba(12, 13, 14, 0.16);
}

.careers .job-list .num,
.careers .job-list .go {
  color: #0f5c68;
}

.careers .job-list a:hover {
  color: #0f5c68;
  background: linear-gradient(270deg, rgba(29, 135, 150, 0.12), transparent 70%);
}

/* "ready to speed up..." and the footer are one black block again */
.cta-band {
  border-top: 0;
  padding-block: clamp(3.5rem, 7vw, 7rem);
}

.site-footer {
  background: #070808;
  padding-top: clamp(2.5rem, 5vw, 4.5rem);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* the teal glow used to start exactly at the dividing line and made the area above it look like a
   separate black strip: the CTA and the footer are one uniform black block now */
.site-footer::before {
  display: none;
}

.site-footer .footer-grid {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

/* ---------- static dust: a very faint field of tiny dots, like the McCann reference ----------
   Only inside the sections below the hero. The header and the hero never get it. */
.clients::after,
.services::after,
.careers::after,
.cta-band::after,
.site-footer::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='7' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 30 -20.4'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 240px 240px;
  animation: dustShift 1.6s steps(1) infinite;
}

@keyframes dustShift {
  0% { background-position: 0 0; }
  25% { background-position: -37px 23px; }
  50% { background-position: 29px -41px; }
  75% { background-position: -19px -31px; }
}

@media (prefers-reduced-motion: reduce) {
  .clients::after,
  .services::after,
  .careers::after,
  .cta-band::after,
  .site-footer::after {
    animation: none;
  }
}

/* on the grey sections the light dots disappear, so they get dark dots, a little stronger */
.services::after,
.careers::after {
  opacity: 0.16;
  mix-blend-mode: normal;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='7' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 30 -20.4'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* footer social: bare icons, no circle (like the McCann reference) */
.social-links {
  display: flex;
  gap: 0.2rem;
  align-items: center;
}

.footer-grid .social-links a {
  display: grid;
  place-items: center;
  width: auto;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--fg);
  opacity: 0.85;
  transition: color 0.3s ease, opacity 0.3s ease, translate 0.3s var(--ease);
}

.footer-grid .social-links a svg {
  width: 1.5rem;
  height: 1.5rem;
}

.footer-grid .social-links a:hover {
  color: var(--teal-2);
  opacity: 1;
  translate: 0 -3px;
}

/* footer columns: the free space is split equally BETWEEN the three blocks, so the gap
   "social <-> site" is exactly the gap "site <-> contact" (before it was equal column widths,
   which made the gaps differ because the blocks have different widths) */
.footer-grid {
  grid-template-columns: repeat(3, max-content);
  /* grouped on the right (start side in RTL); identical gap between neighbouring blocks */
  justify-content: start;
  column-gap: clamp(3rem, 7vw, 8rem);
}

@media (max-width: 560px) {
  .footer-grid {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }
}
/* ---------- accessibility ---------- */
.skip-link {
  position: fixed;
  top: 0.6rem;
  inset-inline-start: 0.6rem;
  z-index: 300;
  padding: 0.8rem 1.2rem;
  background: #fff;
  color: #0c0d0e;
  font-weight: 700;
  border-radius: 0.4rem;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

main:focus {
  outline: none;
}

.motion-toggle {
  position: fixed;
  bottom: 3.2rem;
  left: 0.15rem;
  z-index: 250;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  color: #fff;
  background: rgba(12, 13, 14, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  cursor: pointer;
}

.motion-toggle svg {
  grid-area: 1 / 1;
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.motion-toggle .i-play,
.motion-toggle[aria-pressed="true"] .i-pause {
  display: none;
}

.motion-toggle[aria-pressed="true"] .i-play {
  display: block;
  fill: currentColor;
}

.motion-toggle:hover {
  background: #fff;
  color: #0c0d0e;
}
/* "stop animations" switch: freezes every CSS animation (JS loops check the same flag) */
html.motion-off *,
html.motion-off *::before,
html.motion-off *::after {
  animation-duration: 0.01ms !important;
  animation-delay: 0s !important;
  animation-iteration-count: 1 !important;
}

html.motion-off .marquee-track {
  transform: none !important;
}

/* ---------- accessibility statement page ---------- */
.legal {
  max-width: 48rem;
  margin: 0 auto;
  padding: clamp(7rem, 12vw, 10rem) var(--pad) clamp(3rem, 6vw, 5rem);
  line-height: 1.8;
}

.legal h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 900;
  line-height: 1.1;
}

.legal h2 {
  margin-top: 2.4rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.legal-date {
  margin-top: 0.6rem;
  color: #c3cbcd;
}

.legal ul {
  padding-inline-start: 1.4rem;
  list-style: disc;
}

.legal a {
  color: var(--teal-2);
  text-decoration: underline;
}

.site-footer .footer-bottom a {
  color: inherit;
  text-decoration: underline;
}

/* on phones the accessibility widget button is bigger, so the pause button sits higher */
@media (max-width: 700px) {
  .motion-toggle {
    bottom: 4.5rem;
    left: 0.9rem;
  }
}

/* statement page: compact type, strict right-to-left flow */
.legal {
  direction: rtl;
  text-align: right;
  font-size: 1rem;
  line-height: 1.7;
}

.legal h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
}

.legal h2 {
  margin-top: 1.8rem;
  font-size: 1.2rem;
}

.legal p,
.legal li {
  margin-top: 0.5rem;
}

/* statement page: tighter spacing */
.legal {
  padding-top: clamp(6rem, 9vw, 7.5rem);
  line-height: 1.55;
}

.legal h2 {
  margin-top: 1.2rem;
  margin-bottom: 0;
}

.legal p,
.legal li {
  margin-top: 0.25rem;
  margin-bottom: 0;
}

.legal ul {
  margin: 0;
}

.legal-date {
  margin-top: 0.3rem;
}

/* phones: leave room under the footer so the accessibility widget never covers the logo */
@media (max-width: 700px) {
  .site-footer {
    padding-bottom: 4.5rem;
  }
}

/* touch devices and phones: clipped-gradient text next to animated text can disappear on some phones
   (iPhone Safari especially), so these words use the plain brand colour there */
@media (hover: none), (pointer: coarse), (max-width: 700px) {
  .hero-title .accent > span,
  .footer-cta em {
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    -webkit-text-fill-color: currentColor;
    color: var(--mint);
  }
}

/* phones: the scene used to fade out heavily toward its edges, which made the whole hero look dark.
   A much softer fade keeps the room bright and still dissolves the card edges */
@media (min-width: 521px) and (max-width: 700px) {
  /* wider browser windows keep the compact centred room with a soft fade all around */
  .room {
    -webkit-mask-image: radial-gradient(ellipse 95% 92% at 50% 55%, #000 72%, transparent 100%);
    mask-image: radial-gradient(ellipse 95% 92% at 50% 55%, #000 72%, transparent 100%);
  }
}

@media (max-width: 520px) {
  /* the scene spans the full screen width (no side gutters, so no dark strips at the edges) and only fades
     out at the top and bottom, where it melts into the page. Same aspect ratio as before, so the framing
     (lamp, cat, TV) stays exactly the same, just a little larger. */
  .hero-visual {
    width: auto;
    max-width: none;
    margin-inline: calc(var(--pad) * -1);
  }

  .room {
    max-width: none;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 90%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 90%, transparent 100%);
  }
}

/* accessibility widget: its panel waits just below the screen, but on iPhone the home-bar safe area makes
   its top edge peek out and it looked like it had opened by itself. Hidden until it is really opened. */
body:not(.show-enable-toolbar) #enable-toolbar-content {
  visibility: hidden;
}

/* the round accessibility button lives inside that panel, so it has to stay visible on its own */
body:not(.show-enable-toolbar) #enable-toolbar-content #enable-toolbar-trigger {
  visibility: visible;
}

.room.fallback-2d .room-scene { opacity: 1; }

/* the 3D room fades in instead of popping */
.room.has-3d .hero-3d,
.hero.has-wall > .hero-3d { animation: heroFadeIn 0.8s ease-out both; }
@keyframes heroFadeIn { from { opacity: 0; } }
/* phones: the page background fades smoothly into the colour of the 3D wall, so there is no dark band with a hard edge\n   between the headline area and the room (no pinstripes up there) */
@media (max-width: 520px) {
  .hero {
    background: linear-gradient(180deg, #0c1214 0, #121b1e 35%, #192427 55%, #1a2528 100%);
  }
  .hero::before { opacity: 0.55; }
  /* pull the room up under the headline: much less empty space between the arrow and the cat */
  .hero { row-gap: 0; }
  .hero-visual { margin-top: -20vw; }
  .room {
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 24%, #000 90%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 24%, #000 90%, transparent 100%);
  }
}
