/* ==========================================================================
   MrMacaw: personal site
   ========================================================================== */

:root {
  --bg: #141113;
  --bg-deep: #0e0c0d;
  --surface: #1c181a;
  --surface-2: #241f21;
  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .14);
  --text: #f5f0f0;
  --muted: #a69c9e;  /* small labels, nav links */
  --soft: #cbc3c4;   /* supporting paragraphs: lighter than labels, a step below --text */
  --accent: #e5383b;
  --accent-soft: rgba(229, 56, 59, .14);
  --accent-deep: #8c0b12;
  --grad: linear-gradient(120deg, #ff6b6b 0%, #e5383b 45%, #a4161a 100%);

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --wrap: 1180px;
  --gutter: clamp(20px, 4vw, 40px);
  --radius: 22px;
  --header-h: 76px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.locked { overflow: hidden; }

/* Smooth scrolling (Lenis, started in main.js): it moves the page itself, so CSS smoothing is turned off */
html.lenis { scroll-behavior: auto; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-stopped { overflow: hidden; }
/* Keep the scrollbar's space when the panel locks scrolling, so the page behind doesn't shift sideways */
html { scrollbar-gutter: stable; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }

::selection { background: var(--accent); color: #fff; }

/* ---------- Scrollbar ---------- */

html { scrollbar-color: #3a3234 var(--bg); scrollbar-width: thin; } /* Firefox */
.panel-body { scrollbar-color: #3a3234 transparent; scrollbar-width: thin; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: #3a3234;
  border: 2px solid var(--bg);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
::-webkit-scrollbar-thumb:active { background: #c42a2d; }
::-webkit-scrollbar-corner { background: var(--bg); }
.panel-body::-webkit-scrollbar-track { background: transparent; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.display {
  font-weight: 900;
  font-stretch: 125%;
  text-transform: uppercase;
  letter-spacing: -.01em;
  line-height: .88;
}

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  margin: 0 0 28px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}
.skip:focus { top: 16px; }

/* ---------- Pills ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, .03);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease), box-shadow .3s var(--ease);
}
.pill:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
.pill:active { transform: scale(.95); transition-duration: .12s; }

/* ---------- Click ripple (spans injected by JS) ---------- */

.pill { position: relative; overflow: hidden; isolation: isolate; }

.ripple {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  background: rgba(229, 56, 59, .35);
  transform: translate(-50%, -50%) scale(0);
  animation: ripple .65s var(--ease) forwards;
  pointer-events: none;
}
.pill-accent .ripple { background: rgba(255, 255, 255, .35); }

@keyframes ripple {
  to { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}
.pill svg { width: 20px; height: 20px; }

.pill-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.pill-accent:hover { background: #f04a4d; border-color: #f04a4d; }

.pill-lg { padding: 16px 28px; font-size: 18px; }

/* Small label stacked above the handle, e.g. "Discord / @mrmacaws" */
.pill-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  line-height: 1.1;
  text-align: left;
}
.pill-text small {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Contact buttons get the same cursor-following light as the tiles */
.contact-links .pill::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(140px circle at var(--mx, 50%) var(--my, 50%), rgba(229, 56, 59, .28), transparent 70%);
  opacity: 0;
  transition: opacity .4s var(--ease);
  pointer-events: none;
}
.contact-links .pill:hover::before { opacity: 1; }
.pill-lg svg { width: 26px; height: 26px; }

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

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: background .4s var(--ease), border-color .4s var(--ease), backdrop-filter .4s, transform .5s var(--ease);
}
/* Hidden while scrolling down (main.js), back on scroll up */
.site-header.tucked { transform: translateY(-100%); }
.site-header.scrolled {
  background: rgba(20, 17, 19, .78);
  border-bottom-color: var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.brand-name {
  font-size: 20px;
  font-weight: 900;
  font-stretch: 125%;
  letter-spacing: -.02em;
  line-height: 1;
  transition: color .3s;
}
.brand:hover .brand-name,
.brand:focus-visible .brand-name { color: var(--accent); }

.nav {
  display: flex;
  align-items: center;
  gap: 34px;
}
.nav a:not(.pill) {
  position: relative;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  color: var(--muted);
  transition: color .3s;
}
.nav a:not(.pill):hover,
.nav a.active { color: var(--text); }

/* One underline shared by the links: main.js slides it to the hovered or active link */
.nav { position: relative; }
.nav-indicator {
  position: absolute;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  opacity: 0;
  pointer-events: none;
  transition: transform .5s var(--ease), width .5s var(--ease), opacity .3s var(--ease);
}

.menu-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.menu-toggle span {
  position: absolute;
  left: 13px;
  right: 13px;
  height: 2px;
  background: var(--text);
  transition: transform .35s var(--ease);
}
.menu-toggle span:first-child { top: 17px; }
.menu-toggle span:last-child { top: 24px; }
.menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

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

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 32px) 0 104px;
  overflow: hidden;
  isolation: isolate;
}
/* The only glow on the site: one soft, static light behind the hero title */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(50% 42% at 50% 56%, rgba(229, 56, 59, .10), transparent 72%);
  pointer-events: none;
}
/* Faint contour lines drawn by main.js; they drift very slowly behind everything */
.hero-contours {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-inner { text-align: center; }

.hero-kicker { color: var(--muted); margin-bottom: 26px; }

.hero-title {
  margin: 0;
  /* Capped by height too, so the buttons and scroll cue stay in view on short laptop screens */
  font-size: clamp(64px, min(17vw, 21vh), 220px);
  letter-spacing: -.02em;
}
.hero-title .line { display: block; overflow: hidden; padding: .02em 0; }
.hero-title .line:last-child .rise {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin: 28px 0 0;
  font-size: clamp(16px, 2.2vw, 26px);
  letter-spacing: .02em;
  line-height: 1.1;
}

.rise {
  display: inline-block;
  animation: rise 1.1s var(--ease) both;
  animation-delay: calc(var(--i, 0) * .12s + .1s);
}
.hero-cta.rise {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 34px;
}
.hero-cta .pill { justify-content: center; }

@keyframes rise {
  from { opacity: 0; transform: translateY(60%); }
  to   { opacity: 1; transform: none; }
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 32px;
  width: 26px;
  height: 42px;
  margin-left: -13px;
  border: 2px solid var(--line-strong);
  border-radius: 999px;
  transition: border-color .3s;
}
.scroll-cue:hover { border-color: var(--accent); }
.scroll-cue span {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--accent);
  animation: cue 1.8s var(--ease) infinite;
}
@keyframes cue {
  0%   { opacity: 0; transform: translateY(0); }
  30%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(14px); }
}
/* ---------- Blocks ---------- */

.block {
  position: relative;
  padding: clamp(80px, 10vw, 120px) 0;
  border-top: 1px solid var(--line);
}

.section-title {
  margin: 0 0 clamp(48px, 7vw, 80px);
  font-size: clamp(48px, 9.5vw, 128px);
}

/* ---------- About ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}

.statement {
  margin: 0;
  font-size: clamp(28px, 3.6vw, 46px);
  font-weight: 700;
  font-stretch: 110%;
  line-height: 1.15;
  letter-spacing: -.015em;
}
.statement .hl { color: var(--accent); }

.about-copy { color: var(--soft); padding-top: 8px; }
.about-copy p { margin: 0 0 1.1em; }
.about-copy p:first-child { color: var(--text); }

/* Stats sit under the statement: a big number with a short label beside it, no rules or columns */
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 28px clamp(40px, 5vw, 72px);
  margin-top: clamp(40px, 5vw, 64px);
}
.stat {
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat strong {
  font-size: clamp(52px, 5.6vw, 80px);
  font-variant-numeric: tabular-nums;
  padding-bottom: .06em;
}
.stat span {
  max-width: 8em; /* wraps the label onto two short lines */
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Projects: bento ---------- */

.bento {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  grid-template-rows: 250px 250px;
  grid-template-areas:
    "a b"
    "a d";
  gap: 18px;
}
.tile-a { grid-area: a; }
.tile-b { grid-area: b; }
.tile-d { grid-area: d; }

.tile {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  isolation: isolate;
  transition: border-color .4s var(--ease), background .4s var(--ease), transform .5s var(--ease), box-shadow .5s var(--ease);
}

/* Ambient light that follows the cursor (position set by JS via --mx / --my) */
.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(229, 56, 59, .13), transparent 70%);
  opacity: 0;
  transition: opacity .5s var(--ease);
  pointer-events: none;
}
.tile:hover::before { opacity: 1; }
.tile:hover,
.tile:focus-visible {
  border-color: rgba(229, 56, 59, .45);
  background: var(--surface-2);
  transform: translateY(-4px);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .8);
}
.tile:hover::before,
.tile:focus-visible::before { opacity: 1; }

.tile-num {
  position: absolute;
  top: 24px;
  left: 26px;
  font-size: 14px;
  letter-spacing: .06em;
  color: var(--accent);
}

/* Project logo, centred in the space between the number and the label */
.tile-logo {
  position: absolute;
  top: 46px;
  left: 24px;
  width: calc(100% - 48px);
  height: calc(100% - 142px);
  object-fit: contain;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .45));
  transition: transform .6s var(--ease);
  pointer-events: none;
}
.tile:hover .tile-logo,
.tile:focus-visible .tile-logo { transform: scale(1.05); }

.tile-label {
  position: absolute;
  left: 26px;
  right: 80px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tile-name { font-size: clamp(20px, 2.2vw, 28px); }
.tile-tag {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--muted);
}

.tile-arrow {
  position: absolute;
  right: 22px;
  bottom: 22px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  transition: background .4s var(--ease), border-color .4s var(--ease);
}
/* Two copies of the arrow: on hover the first slides out top-right and the second slides in from bottom-left */
.tile-arrow svg {
  position: absolute;
  inset: 0;
  width: 18px;
  height: 18px;
  margin: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .45s var(--ease);
}
.tile-arrow svg:last-child { transform: translate(-160%, 160%); }
.tile:hover .tile-arrow,
.tile:focus-visible .tile-arrow {
  background: var(--accent);
  border-color: var(--accent);
}
.tile:hover .tile-arrow svg:first-child,
.tile:focus-visible .tile-arrow svg:first-child { transform: translate(160%, -160%); }
.tile:hover .tile-arrow svg:last-child,
.tile:focus-visible .tile-arrow svg:last-child { transform: none; }

/* Pop-in for tiles */
.pop { opacity: 0; transform: translateY(30px) scale(.97); }
.pop.in {
  opacity: 1;
  transform: none;
  transition: opacity .8s var(--ease) var(--delay, 0s), transform .8s var(--ease) var(--delay, 0s),
              border-color .4s var(--ease), box-shadow .5s var(--ease);
}
.pop.in:hover,
.pop.in:focus-visible { transform: translateY(-4px); transition-delay: 0s; }
.pop.in:active { transform: translateY(-1px) scale(.985); transition-duration: .12s; }

/* ---------- Services ---------- */

/* Open grid: no boxes, each service sits under a thin rule that turns red on hover */
.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 clamp(28px, 4vw, 56px);
}
.service {
  padding: 26px 0 44px;
  border-top: 1px solid var(--line-strong);
}
/* Keep the staggered scroll reveal and add a quick hover fade (one rule so neither overrides the other) */
.service.reveal {
  transition: opacity .9s var(--ease) var(--delay, 0s), transform .9s var(--ease) var(--delay, 0s), border-color .4s var(--ease);
}
.service:hover { border-top-color: var(--accent); }

.service-num {
  display: block;
  margin-bottom: 18px;
  font-size: 15px;
  color: var(--accent);
  letter-spacing: .04em;
}
.service h3 {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 800;
  font-stretch: 112%;
  letter-spacing: -.01em;
  line-height: 1.2;
}
.service p { margin: 0; color: var(--soft); font-size: 16px; }

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

.contact { background: var(--bg-deep); }
/* Big title on the left, details on the right; stacks on narrow screens */
.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: end;
}
.contact-title {
  margin: 0;
  font-size: clamp(64px, 10.5vw, 168px);
}
.contact-lede {
  max-width: 560px;
  margin: 0;
  color: var(--soft);
  font-size: 18px;
}
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 36px;
}

.socials {
  display: flex;
  gap: 12px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}
.social {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(255, 255, 255, .03);
  color: var(--muted);
  transition: color .3s var(--ease), background .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease);
}
.social svg { width: 22px; height: 22px; }
.social:hover { color: var(--text); border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
.social:active { transform: scale(.92); transition-duration: .12s; }

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

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-deep);
  font-size: 14px;
  color: var(--muted);
}

/* Copyright on the left, back-to-top on the right */
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 22px;
  padding-bottom: 22px;
}

/* Round back-to-top button (same arrow swap as the tiles) */
.to-top-icon {
  position: relative;
  display: block;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--text);
  transition: background .4s var(--ease), border-color .4s var(--ease);
}
.to-top-icon svg {
  position: absolute;
  inset: 0;
  width: 16px;
  height: 16px;
  margin: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .45s var(--ease);
}
.to-top-icon svg:last-child { transform: translateY(200%); }
.to-top:hover .to-top-icon,
.to-top:focus-visible .to-top-icon { background: var(--accent); border-color: var(--accent); }
.to-top:hover .to-top-icon svg:first-child,
.to-top:focus-visible .to-top-icon svg:first-child { transform: translateY(-200%); }
.to-top:hover .to-top-icon svg:last-child,
.to-top:focus-visible .to-top-icon svg:last-child { transform: none; }

/* ---------- Reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: var(--delay, 0s);
}
.reveal.in { opacity: 1; transform: none; }

/* Headings slide up from behind a mask, line by line, like the hero title */
.reveal.mask { opacity: 1; transform: none; }
.mask .line { display: block; overflow: hidden; padding: .02em 0; }
.mask .line > span {
  display: inline-block;
  transform: translateY(105%);
  transition: transform 1.1s var(--ease);
}
.mask .line:nth-child(2) > span { transition-delay: .1s; }
.mask.in .line > span { transform: none; }


/* ---------- Project detail panel ---------- */

.panel {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
  opacity: 0;
  transition: opacity .45s var(--ease);
}
.panel[hidden] { display: none; }
.panel.open { opacity: 1; }
/* While the tile morphs into the panel (main.js), the morph handles the panel's fade */
.panel.instant { transition: none; }

/* Tile <-> panel morph (View Transitions): the box grows smoothly; each side is cropped, not stretched */
::view-transition-group(project) {
  animation-duration: .65s;
  animation-timing-function: var(--ease);
}
::view-transition-old(project),
::view-transition-new(project) {
  height: 100%;
  object-fit: cover;
  animation-duration: .4s;
}

.panel-art {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.panel-num {
  font-size: clamp(140px, 22vw, 340px);
  line-height: .8;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transform: translateY(30px);
  opacity: 0;
  transition: transform 1s var(--ease) .1s, opacity .8s var(--ease) .1s;
}
.panel.open .panel-num { transform: none; opacity: 1; }

.panel-logo {
  width: min(78%, 520px);
  max-height: 70%;
  object-fit: contain;
  filter: drop-shadow(0 30px 50px rgba(0, 0, 0, .5));
  transform: translateY(30px);
  opacity: 0;
  transition: transform 1s var(--ease) .1s, opacity .8s var(--ease) .1s;
}
.panel.open .panel-logo { transform: none; opacity: 1; }
.panel-art [hidden] { display: none; }

.panel-body {
  display: flex;
  align-items: center;
  overflow-y: auto;
  padding: 120px clamp(28px, 6vw, 96px);
}
.panel-content {
  max-width: 600px;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s var(--ease) .15s, transform .7s var(--ease) .15s;
}
.panel.open .panel-content { opacity: 1; transform: none; }

.panel-content h3 {
  margin: 0;
  /* Sized to the text column so long names like FRUITBLOCKS fit on one line */
  font-size: clamp(30px, 3.6vw, 56px);
  font-weight: 900;
  font-stretch: 125%;
  text-transform: uppercase;
  line-height: .9;
  letter-spacing: -.01em;
}
.panel-content .meta {
  margin: 18px 0 30px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
}
/* Up to three content-sized columns so the stats stay on one row; labels may wrap */
.panel-content .facts {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: start;
  gap: 18px clamp(18px, 3vw, 34px);
  line-height: 1.35;
  margin: 0 0 32px;
  padding: 0 0 30px;
  list-style: none;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.panel-content .facts strong {
  display: block;
  margin-bottom: 6px;
  font-size: clamp(17px, 1.9vw, 24px);
  line-height: 1.1;
  white-space: nowrap;
  font-weight: 900;
  font-stretch: 125%;
  letter-spacing: -.01em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.panel-content p { color: var(--soft); margin: 0 0 1.1em; }
.panel-content a { color: var(--accent); }

/* Back button: round arrow (same style as the tile arrows) plus a label */
.panel-back {
  position: absolute;
  top: clamp(18px, 3vw, 32px);
  left: var(--gutter);
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--muted);
  transition: color .3s var(--ease);
}
.panel-back-icon {
  position: relative;
  display: block;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(20, 17, 19, .6);
  color: var(--text);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background .4s var(--ease), border-color .4s var(--ease), transform .3s var(--ease);
}
.panel-back-icon svg {
  position: absolute;
  inset: 0;
  width: 20px;
  height: 20px;
  margin: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .45s var(--ease);
}
.panel-back-icon svg:last-child { transform: translateX(180%); }
.panel-back:hover,
.panel-back:focus-visible { color: var(--text); }
.panel-back:hover .panel-back-icon,
.panel-back:focus-visible .panel-back-icon { background: var(--accent); border-color: var(--accent); }
.panel-back:hover .panel-back-icon svg:first-child,
.panel-back:focus-visible .panel-back-icon svg:first-child { transform: translateX(-180%); }
.panel-back:hover .panel-back-icon svg:last-child,
.panel-back:focus-visible .panel-back-icon svg:last-child { transform: none; }
.panel-back:active .panel-back-icon { transform: scale(.92); transition-duration: .12s; }
/* Keyboard focus: a ring around the circle rather than a box around the whole button */
.panel-back:focus-visible { outline: none; }
.panel-back:focus-visible .panel-back-icon { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent); }

/* ---------- Loading screen ----------
   Only appears when the page is slow to get ready (the script in <head> adds .show-loader after
   0.6s; main.js clears it once the font has loaded, adding .loader-done so it lifts away like a
   curtain). The hero intro waits for it. */

.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--bg);
  opacity: 0;
  visibility: hidden;
  transition: opacity .5s var(--ease), visibility 0s .5s;
}
/* The same soft red light as the hero */
.loader::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(40% 34% at 50% 50%, rgba(229, 56, 59, .12), transparent 72%);
}
.show-loader .loader {
  opacity: 1;
  visibility: visible;
  transition: opacity .3s var(--ease);
}
.loader-done .loader {
  opacity: 1;
  transform: translateY(-100%);
  visibility: hidden;
  transition: transform .9s var(--ease), visibility 0s .9s;
}

/* The macaw rises from behind a mask line, like the hero title */
.loader-mark {
  position: relative;
  display: block;
  overflow: hidden;
  padding: 4px;
}
.loader-mark img {
  display: block;
  width: clamp(88px, 9vw, 120px);
  height: auto;
  transform: translateY(110%);
}
.show-loader .loader-mark img { animation: loader-rise .9s var(--ease) forwards; }
.loader-done .loader-mark img { transform: none; }
@keyframes loader-rise { to { transform: none; } }

/* Thin progress line along the bottom edge; fills over the 4s maximum wait */
.loader-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
}
.show-loader .loader-progress { animation: loader-progress 4s cubic-bezier(.2, .7, .3, 1) forwards; }
.loader-done .loader-progress { transform: none; }
@keyframes loader-progress { to { transform: scaleX(1); } }

.is-loading .rise { animation-play-state: paused; }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .about-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; gap: 36px; }
  .contact-title { font-size: clamp(64px, 14vw, 140px); }
  .service-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  :root { --header-h: 68px; }

  .menu-toggle { display: block; }
  .hero-kicker { font-size: 11px; letter-spacing: .12em; }
  .hero-cta.rise { flex-direction: column; align-items: stretch; max-width: 320px; margin: 32px auto 0; }
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px var(--gutter) 28px;
    background: rgba(20, 17, 19, .96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .35s var(--ease), transform .35s var(--ease), visibility .35s;
  }
  .nav.open { opacity: 1; transform: none; visibility: visible; }
  .nav a:not(.pill) {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
    font-size: 22px;
    font-weight: 800;
    font-stretch: 115%;
    color: var(--text);
  }
  .nav-indicator { display: none; }
  .nav .pill { justify-content: center; margin-top: 20px; padding: 14px; font-size: 16px; }


  /* Label under the number so both stats fit side by side */
  .stats { gap: 24px 48px; }
  .stat { flex-direction: column; align-items: flex-start; gap: 8px; }

  .bento {
    grid-template-columns: 1fr;
    grid-template-rows: 260px 220px 220px;
    grid-template-areas: "a" "b" "d";
    gap: 14px;
  }

  .service-grid { grid-template-columns: 1fr; }
  .service { padding-bottom: 36px; }

  .panel { grid-template-columns: 1fr; grid-template-rows: 38vh 1fr; }
  .panel-art { border-right: 0; border-bottom: 1px solid var(--line); }
  .panel-num { font-size: 130px; }
  .panel-content h3 { font-size: clamp(26px, 8vw, 44px); }
  .panel-back-label { display: none; }
  .panel-art { padding: 64px 20px 20px; } /* keeps the logo clear of the back button */
  .panel-body { align-items: flex-start; padding: 36px var(--gutter) 60px; }

  .pill-lg { padding: 14px 22px; font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001s !important;
    transition-delay: 0s !important;
  }
}

/* ---------- Cursor ----------
   Plain CSS cursors: drawn by the browser like the system cursor, so no lag.
   Kept at the end so it overrides the `cursor: pointer` rules above. */

html {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M4 3 19.5 10.6 12.4 12.6 9.4 19.8Z' fill='%23f5f0f0' stroke='%23141113' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") 4 3, auto;
}
a, button, .tile, .pill, .social, .menu-toggle {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M4 3 19.5 10.6 12.4 12.6 9.4 19.8Z' fill='%23e5383b' stroke='%23141113' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") 4 3, pointer;
}