/* ============================================================
   Lahcen Bouya — portfolio
   One token layer, mobile-first, motion on transform/opacity only.
   ============================================================ */

/* ---------- 0. Fonts (self-hosted, one variable file per family) ---------- */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("assets/fonts/plus-jakarta-sans.woff2") format("woff2-variations"),
    url("assets/fonts/plus-jakarta-sans.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("assets/fonts/inter.woff2") format("woff2-variations"),
    url("assets/fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- 1. Tokens ---------- */
:root {
  /* surfaces */
  --ivory: #fae9d5;
  --ivory-2: #f7e3ce;
  --cream: #f4dec8;
  --cream-2: #ebd8c8;
  --brown: #3a2413;
  --brown-2: #2b1a0e;

  /* ink */
  --espresso: #302414;
  --ink-70: rgba(48, 36, 20, 0.72);
  --ink-55: rgba(48, 36, 20, 0.58);
  --ink-38: rgba(48, 36, 20, 0.38);
  --line: rgba(48, 36, 20, 0.13);
  --line-soft: rgba(48, 36, 20, 0.08);

  /* accents */
  --blue: #389ddd;
  --blue-ink: #2470bb;
  --blue-head: #2b86dd;
  --blue-deep: #1b5698;
  --cyan: #55cfff;

  /* glass */
  --glass: rgba(255, 255, 255, 0.42);
  --glass-2: rgba(255, 255, 255, 0.62);
  --glass-border: rgba(255, 255, 255, 0.72);
  --hair: rgba(48, 36, 20, 0.1);

  /* type */
  --font-display: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* shape */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 34px;
  --r-pill: 999px;

  /* elevation — layered and rare, never a generic drop shadow */
  --lift-1: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 12px 26px -20px rgba(48, 36, 20, 0.45);
  --lift-2: 0 1px 0 rgba(255, 255, 255, 0.75) inset, 0 26px 50px -32px rgba(48, 36, 20, 0.5);
  --lift-dark: 0 24px 60px -30px rgba(43, 26, 14, 0.6);

  /* layout */
  --gutter: clamp(1.25rem, 6.25vw, 5.625rem);
  --container: 1262px;
  --container-wide: 1340px;
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --header-h: 4.4rem;

  /* motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.32, 0.72, 0, 1);
  --t-fast: 140ms;
  --t-mid: 320ms;
  --t-slow: 620ms;
}

/* ---------- 2. Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--ivory);
  color: var(--espresso);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  font-feature-settings: "kern" 1, "liga" 1;
}

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

img {
  height: auto;
}

a {
  color: var(--blue-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.028em;
  line-height: 1.04;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
}

::selection {
  background: rgba(85, 207, 255, 0.4);
  color: var(--espresso);
}

:focus-visible {
  outline: 2px solid var(--blue-deep);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 200;
  background: var(--espresso);
  color: var(--ivory);
  padding: 0.7rem 1.1rem;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 0.9rem;
  transition: top var(--t-fast) var(--ease);
}

.skip-link:focus {
  top: 1rem;
}

/* ---------- 3. Layout helpers ---------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--wide {
  max-width: calc(var(--container-wide) + var(--gutter) * 2);
}

.container--bleed {
  max-width: none;
  padding-inline: 0;
}

.accent {
  color: var(--blue-ink);
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-55);
}

.rule {
  height: 1px;
  border: 0;
  margin: 0;
  background: var(--line);
}

/* ---------- 4. Buttons & pills (all eight states) ---------- */
.pill {
  --pill-bg: rgba(255, 255, 255, 0.66);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.62rem 1.05rem;
  border-radius: var(--r-pill);
  background: var(--pill-bg);
  border: 1px solid var(--glass-border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 8px 20px -16px rgba(48, 36, 20, 0.55);
  font-family: var(--font-body);
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--espresso);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--t-mid) var(--ease), background-color var(--t-mid) var(--ease),
    border-color var(--t-mid) var(--ease), box-shadow var(--t-mid) var(--ease), color var(--t-mid) var(--ease);
}

.pill .pill__icon {
  width: 1.05rem;
  height: 1.05rem;
  flex: none;
  color: var(--blue-ink);
  transition: transform var(--t-slow) var(--ease), color var(--t-mid) var(--ease);
}

.pill:hover {
  --pill-bg: rgba(255, 255, 255, 0.92);
  transform: translateY(-2px) scale(1.05);
  border-color: rgba(85, 207, 255, 0.85);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 16px 26px -18px rgba(28, 108, 170, 0.65),
    0 0 0 4px rgba(85, 207, 255, 0.14);
}

.pill:hover .pill__icon {
  transform: translateY(-1px) scale(1.14);
}

.pill:active {
  transform: translateY(0) scale(0.98);
  transition-duration: 90ms;
}

.pill:focus-visible {
  outline: 2px solid var(--blue-deep);
  outline-offset: 3px;
}

.pill[aria-pressed="true"] {
  --pill-bg: rgba(85, 207, 255, 0.22);
  border-color: rgba(56, 157, 221, 0.6);
  color: var(--blue-deep);
}

.pill[disabled],
.pill[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.pill--rotate .pill__icon {
  transform: rotate(0deg) scale(1);
}

.pill--rotate:hover .pill__icon {
  transform: rotate(-14deg) scale(1.16);
}

.pill--pulse:hover .pill__icon {
  animation: iconPulse 900ms var(--ease) infinite;
}

@keyframes iconPulse {
  0%,
  100% {
    transform: scale(1.12);
  }
  50% {
    transform: scale(1.26);
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.95rem 1.6rem;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--t-mid) var(--ease), background-color var(--t-mid) var(--ease),
    border-color var(--t-mid) var(--ease), box-shadow var(--t-mid) var(--ease), color var(--t-mid) var(--ease);
}

.btn--primary {
  background: linear-gradient(180deg, #4fb0ea 0%, var(--blue) 55%, #2f8bcc 100%);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 18px 34px -20px rgba(31, 95, 160, 0.9);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.45) inset, 0 24px 40px -20px rgba(31, 95, 160, 0.95),
    0 0 0 5px rgba(85, 207, 255, 0.18);
}

.btn--primary:active {
  transform: translateY(0) scale(0.985);
  transition-duration: 90ms;
}

.btn--ghost {
  background: var(--glass);
  border-color: var(--glass-border);
  color: var(--espresso);
}

.btn--ghost:hover {
  background: var(--glass-2);
  border-color: rgba(85, 207, 255, 0.8);
  transform: translateY(-2px);
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn[data-loading="true"] {
  cursor: progress;
  opacity: 0.85;
}

/* ---------- 5. Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-mid) var(--ease), background-color var(--t-mid) var(--ease);
}

.header[data-stuck="true"] {
  border-bottom-color: var(--line-soft);
  background: rgba(250, 233, 213, 0.88);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--espresso);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  margin-right: auto;
}

.brand__mark {
  width: 2rem;
  height: 2rem;
  color: var(--espresso);
  transition: transform var(--t-slow) var(--ease);
}

.brand:hover .brand__mark {
  transform: rotate(-6deg) scale(1.06);
}

.brand:active .brand__mark {
  transform: scale(0.96);
}

.nav {
  display: none;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 2.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav__link {
  position: relative;
  display: inline-block;
  padding: 0.35rem 0;
  color: var(--ink-70);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--t-mid) var(--ease);
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  border-radius: 2px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-mid) var(--ease);
}

.nav__link:hover,
.nav__link:focus-visible {
  color: var(--espresso);
}

.nav__link:hover::after,
.nav__link:focus-visible::after,
.nav__link[aria-current="true"]::after {
  transform: scaleX(1);
}

.nav__link[aria-current="true"] {
  color: var(--espresso);
  font-weight: 600;
}

.badge {
  display: none;
  align-items: center;
  gap: 0.9rem;
  padding: 0.5rem 1.2rem 0.5rem 0.75rem;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--glass-border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 10px 24px -20px rgba(48, 36, 20, 0.5);
}

.badge__star {
  width: 2rem;
  height: 2rem;
  color: var(--blue);
  filter: drop-shadow(0 0 6px rgba(85, 207, 255, 0.9));
}

.badge__lines {
  display: grid;
  line-height: 1.2;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink-55);
}

.badge__lines b {
  font-weight: 600;
  color: var(--ink-70);
}

.menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.55);
  color: var(--espresso);
  cursor: pointer;
  transition: background-color var(--t-mid) var(--ease), transform var(--t-mid) var(--ease);
}

.menu-btn:hover {
  background: #fff;
}

.menu-btn:active {
  transform: scale(0.95);
}

.menu-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

.mobile-nav {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--t-mid) var(--ease);
  overflow: hidden;
  border-top: 1px solid transparent;
}

.mobile-nav[data-open="true"] {
  grid-template-rows: 1fr;
  border-top-color: var(--line-soft);
}

.mobile-nav__inner {
  min-height: 0;
  overflow: hidden;
}

.mobile-nav ul {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0 1.1rem;
  display: grid;
  gap: 0.15rem;
}

.mobile-nav a {
  display: block;
  padding: 0.85rem 0.25rem;
  color: var(--espresso);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  border-bottom: 1px solid var(--line-soft);
}

.mobile-nav a[aria-current="true"] {
  color: var(--blue-ink);
}

/* ---------- 6. Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-bottom: 2rem;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: linear-gradient(180deg, var(--ivory) 0%, var(--ivory) 46%, var(--ivory-2) 100%);
}

.hero__art-frame {
  position: relative;
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
  order: 2;
}

.hero__portrait {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  will-change: transform;
}

/* a soft light that follows the pointer across the portrait */
.hero__glare {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: soft-light;
  background: radial-gradient(
    30% 26% at var(--mx, 62%) var(--my, 32%),
    rgba(255, 255, 255, 0.95) 0%,
    rgba(190, 235, 255, 0.35) 45%,
    rgba(190, 235, 255, 0) 72%
  );
  transition: opacity var(--t-slow) var(--ease);
}

.hero__art-frame:hover .hero__glare {
  opacity: 1;
}

/* the pale star that sits behind the portrait in the reference */
.decor-star {
  position: absolute;
  left: -8%;
  top: 8%;
  width: 40%;
  height: auto;
  color: rgba(255, 255, 255, 0.66);
  pointer-events: none;
  will-change: transform;
}

.hero__grid {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-block: 1.75rem 0;
}

.hero__copy {
  order: 1;
  max-width: 40rem;
}

.hero__title {
  font-size: clamp(2.2rem, 8.6vw, 3.8rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
}

.hero__title .hero__title-line {
  display: block;
}

.hero__title .hero__title-name {
  font-size: clamp(3rem, 13vw, 5.75rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.hero__title em {
  font-style: normal;
  color: var(--blue-head);
}

.cursor {
  display: inline-block;
  color: var(--blue-head);
  animation: blink 1.05s steps(1, end) infinite;
  margin-left: 0.02em;
}

@keyframes blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

.hero__lede {
  margin-top: 1.15rem;
  font-size: clamp(1rem, 2vw, 1.82rem);
  line-height: 1.32;
  color: var(--ink-70);
  max-width: 42rem;
}

.hero__claim {
  margin-top: clamp(1.2rem, 2.6vw, 2.1rem);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.3rem, 3.7vw, 2.75rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hero__claim em {
  font-style: normal;
  color: var(--blue-head);
}

.hero__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: clamp(1.5rem, 3.6vw, 3.2rem);
  padding: 0;
  list-style: none;
}

.hero__pills .pill {
  font-size: clamp(0.9rem, 1.2vw, 1.4rem);
  padding: 0.55rem 0.95rem;
}

.hero__pills .pill .pill__icon {
  width: 1.5rem;
  height: 1.5rem;
}

.hero__divider {
  margin-top: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: 0.5em;
  height: 2px;
}

/* ---------- 7. What I do ---------- */
.intro {
  position: relative;
  padding-block: clamp(1.6rem, 3vw, 2.6rem) clamp(2rem, 3.8vw, 3.4rem);
}

.intro__grid {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.intro__copy {
  position: relative;
  z-index: 2;
  max-width: 36rem;
}

.intro__title {
  font-size: clamp(2.1rem, 6.2vw, 3.8rem);
  line-height: 1.02;
}

.intro__title em {
  font-style: normal;
  color: var(--blue-head);
}

.intro__body {
  margin-top: 1.4rem;
  font-size: clamp(1rem, 1.62vw, 1.4rem);
  line-height: 1.42;
  color: var(--ink-70);
  max-width: 35rem;
}

.callout {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 1.75rem;
  padding: 0.95rem 1.4rem;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--hair);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 14px 30px -26px rgba(48, 36, 20, 0.7);
}

.callout svg {
  width: 1.1rem;
  height: 1.1rem;
  flex: none;
  color: var(--blue);
  filter: drop-shadow(0 0 5px rgba(85, 207, 255, 0.85));
}

.callout p {
  font-style: italic;
  font-size: clamp(0.92rem, 1.55vw, 1.35rem);
  color: var(--ink-70);
}

/* ---------- 8. Expertise strip ---------- */
.expertise {
  padding-block: 0 clamp(1.1rem, 1.4vw, 1.25rem);
}

.strip {
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.26));
  border: 1px solid var(--glass-border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.75) inset, 0 26px 60px -44px rgba(48, 36, 20, 0.75);
  padding: clamp(1.1rem, 1.7vw, 1.5rem) clamp(1.15rem, 3vw, 2.25rem);
}

.strip__inner {
  display: grid;
  gap: 1.5rem;
}

.strip__head {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.strip__title {
  font-size: clamp(1.6rem, 2.9vw, 2.3rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.strip__title span {
  display: block;
}

.strip__title em {
  font-style: normal;
  color: var(--blue-head);
  position: relative;
}

.strip__title em::after {
  content: "";
  position: absolute;
  left: 0;
  right: 22%;
  bottom: -0.28em;
  height: 3px;
  border-radius: 3px;
  background: var(--blue);
}

.strip__divider {
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: rgba(48, 36, 20, 0.18);
}

.strip__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.4rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.strip__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}

.strip__item svg {
  width: clamp(2.2rem, 3.2vw, 3.15rem);
  height: clamp(2.2rem, 3.2vw, 3.15rem);
  color: var(--blue-deep);
  transition: transform var(--t-slow) var(--ease), color var(--t-mid) var(--ease);
}

.strip__item:hover svg {
  transform: translateY(-3px) scale(1.08);
  color: var(--blue);
}

.strip__item span {
  font-size: clamp(0.9rem, 1.5vw, 1.34rem);
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink-70);
  max-width: 11rem;
}

/* ---------- 9. Projects ---------- */
.projects {
  padding-block: clamp(1.2rem, 1.6vw, 1.4rem) clamp(2rem, 3vw, 2.9rem);
}

.projects__head {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 3vw, 1.6rem);
  margin-bottom: clamp(1.1rem, 2.3vw, 1.75rem);
}

.projects__head hr {
  flex: 1;
  height: 1px;
  border: 0;
  background: var(--line);
}

.projects__title {
  font-size: clamp(1.7rem, 5.4vw, 3.25rem);
  text-align: center;
  line-height: 1.05;
}

.projects__title em {
  font-style: normal;
  color: var(--blue-head);
}

.cards {
  display: grid;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  aspect-ratio: 1.58;
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  background: var(--brown-2);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  isolation: isolate;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 20px 46px -34px rgba(48, 36, 20, 0.9);
  transition: transform var(--t-slow) var(--ease), box-shadow var(--t-slow) var(--ease),
    border-color var(--t-slow) var(--ease);
}

.card__media {
  position: relative;
  display: block;
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #0f1420;
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 900ms var(--ease);
}

.card__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 16, 27, 0) 34%, rgba(11, 16, 27, 0.62) 68%, rgba(11, 16, 27, 0.94) 100%);
}

.card__glare {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: overlay;
  background: radial-gradient(
    28% 46% at var(--mx, 50%) var(--my, 50%),
    rgba(170, 232, 255, 0.95) 0%,
    rgba(56, 157, 221, 0.35) 42%,
    rgba(56, 157, 221, 0) 70%
  );
  transition: opacity var(--t-mid) var(--ease);
}

.card__foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 1.2rem 1rem;
  background: linear-gradient(180deg, rgba(11, 16, 27, 0) 0%, rgba(11, 16, 27, 0.55) 26%, rgba(11, 16, 27, 0.88) 100%);
  color: #fff;
}

.card__title {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.85rem, 1.52vw, 1.5rem);
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.card__sub {
  display: block;
  margin-top: 0.2rem;
  font-size: clamp(0.78rem, 1.24vw, 1.2rem);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.86);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card__arrow {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: #fff;
  transition: transform var(--t-slow) var(--ease), background-color var(--t-slow) var(--ease),
    border-color var(--t-slow) var(--ease), color var(--t-slow) var(--ease);
}

.card__arrow svg {
  width: 1rem;
  height: 1rem;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-6px);
  border-color: rgba(85, 207, 255, 0.55);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 34px 60px -32px rgba(31, 95, 160, 0.85);
}

.card:hover .card__media img {
  transform: scale(1.1);
}

.card:hover .card__glare,
.card:focus-visible .card__glare {
  opacity: 1;
}

.card:hover .card__arrow,
.card:focus-visible .card__arrow {
  transform: rotate(45deg);
  background: var(--cyan);
  border-color: var(--cyan);
  color: var(--brown-2);
}

.card:active {
  transform: translateY(-2px) scale(0.995);
}

/* ---------- 10. Closing + waves ---------- */
.closing {
  position: relative;
  overflow: hidden;
  padding-top: clamp(1rem, 2vw, 1.5rem);
  padding-bottom: clamp(2.5rem, 6vw, 4rem);
  background: linear-gradient(180deg, var(--ivory-2) 0%, var(--ivory) 70%);
}

.closing__grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.closing__copy {
  position: relative;
  z-index: 2;
  order: 2;
}

.closing__title {
  font-size: clamp(1.9rem, 4.6vw, 4rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
  max-width: 62rem;
}

.closing__title em {
  font-style: normal;
  color: var(--blue-head);
}

.closing__banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.7rem, 1.8vw, 1.4rem);
  margin-top: clamp(0.6rem, 0.9vw, 0.75rem);
  max-width: 42rem;
}

.closing__banner hr {
  flex: 1;
  height: 1px;
  border: 0;
  background: var(--line);
}

.closing__banner span {
  font-size: clamp(0.7rem, 1.45vw, 1.31rem);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-55);
  white-space: nowrap;
}

.closing__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: clamp(1.2rem, 2.2vw, 1.6rem);
}

.closing__art {
  position: relative;
  order: 1;
  width: 100%;
  max-width: 34rem;
  margin-inline: auto;
}

.closing__dragon {
  display: block;
  width: 100%;
  height: auto;
  will-change: transform;
}

.waves {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

/* ---------- 10b. Inner pages ---------- */
.page {
  padding-block: clamp(2.5rem, 6vw, 5rem) clamp(3rem, 7vw, 6rem);
}

.page--center {
  text-align: center;
}

.page--center .container {
  max-width: 46rem;
}

.page__title {
  margin-top: 0.7rem;
  font-size: clamp(2rem, 6vw, 3.4rem);
}

.page__lede {
  margin-top: 1rem;
  font-size: clamp(1rem, 1.5vw, 1.16rem);
  line-height: 1.7;
  color: var(--ink-70);
  max-width: 60ch;
}

.page section {
  margin-top: clamp(1.8rem, 4vw, 2.6rem);
  max-width: 62ch;
}

.page--center section {
  margin-inline: auto;
}

.page h2 {
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  letter-spacing: -0.02em;
}

.page section p {
  margin-top: 0.6rem;
  color: var(--ink-70);
  line-height: 1.72;
}

.page__note {
  margin-top: 2.4rem;
  font-size: 0.86rem;
  color: var(--ink-55);
}

/* ---------- 11. Footer ---------- */
.footer {
  position: relative;
  background: var(--brown-2);
  color: #f3e3d2;
  padding-block: clamp(2.75rem, 6vw, 4.5rem) 1.75rem;
}

.footer a {
  color: #ffd9a8;
}

.footer__grid {
  display: grid;
  gap: 2.5rem;
}

.footer__title {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  color: #fdf3e7;
}

.footer__lede {
  margin-top: 0.6rem;
  font-size: 0.94rem;
  line-height: 1.7;
  color: rgba(243, 227, 210, 0.74);
  max-width: 34ch;
}

.form {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.4rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(243, 227, 210, 0.7);
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.8rem 0.95rem;
  border-radius: var(--r-sm);
  border: 1px solid rgba(243, 227, 210, 0.24);
  background: rgba(255, 255, 255, 0.06);
  color: #fdf3e7;
  font-size: 0.95rem;
  transition: border-color var(--t-mid) var(--ease), background-color var(--t-mid) var(--ease),
    box-shadow var(--t-mid) var(--ease);
}

.field textarea {
  min-height: 6.5rem;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(243, 227, 210, 0.4);
}

.field input:hover,
.field textarea:hover {
  border-color: rgba(243, 227, 210, 0.42);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--cyan);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 4px rgba(85, 207, 255, 0.16);
}

.field[data-invalid="true"] input,
.field[data-invalid="true"] textarea {
  border-color: #ff9d8a;
  box-shadow: 0 0 0 4px rgba(255, 157, 138, 0.14);
}

.field__error {
  font-size: 0.8rem;
  color: #ffb3a1;
  min-height: 0;
}

.field[data-invalid="true"] .field__error {
  min-height: 1.1rem;
}

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

.form__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
}

.form__status {
  font-size: 0.88rem;
  color: rgba(243, 227, 210, 0.8);
  min-height: 1.2rem;
}

.form__status[data-state="ok"] {
  color: #9ce6b4;
}

.form__status[data-state="error"] {
  color: #ffb3a1;
}

.faq {
  display: grid;
  gap: 0.5rem;
  margin-top: 1.2rem;
}

.faq details {
  border: 1px solid rgba(243, 227, 210, 0.18);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
  transition: border-color var(--t-mid) var(--ease), background-color var(--t-mid) var(--ease);
}

.faq details:hover {
  border-color: rgba(243, 227, 210, 0.34);
}

.faq details[open] {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(85, 207, 255, 0.4);
}

.faq summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.05rem;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: #fdf3e7;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  flex: none;
  margin-left: auto;
  width: 0.6rem;
  height: 0.6rem;
  border-right: 2px solid var(--cyan);
  border-bottom: 2px solid var(--cyan);
  transform: rotate(45deg);
  transition: transform var(--t-mid) var(--ease);
}

.faq details[open] summary::after {
  transform: rotate(-135deg);
}

.faq summary:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: -3px;
}

.faq__answer {
  padding: 0 1.05rem 1.05rem;
  font-size: 0.9rem;
  line-height: 1.7;
  color: rgba(243, 227, 210, 0.76);
}

.footer__contact-list {
  display: grid;
  gap: 0.55rem;
  margin: 1.2rem 0 0;
  padding: 0;
  list-style: none;
}

.footer__contact-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: #fdf3e7;
  text-decoration: none;
  font-size: 0.92rem;
  transition: color var(--t-mid) var(--ease), transform var(--t-mid) var(--ease);
}

.footer__contact-list svg {
  width: 1.05rem;
  height: 1.05rem;
  color: var(--cyan);
  flex: none;
}

.footer__contact-list a:hover {
  color: #ffd9a8;
  transform: translateX(3px);
}

.footer__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: clamp(2rem, 4vw, 3rem);
  padding-top: 1.4rem;
  border-top: 1px solid rgba(243, 227, 210, 0.16);
  font-size: 0.82rem;
  color: rgba(243, 227, 210, 0.62);
}

.footer__bar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
}

.footer__bar a {
  color: rgba(243, 227, 210, 0.82);
  text-decoration: none;
}

.footer__bar a:hover {
  color: #ffd9a8;
  text-decoration: underline;
}

.to-top {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: rgba(243, 227, 210, 0.82);
  text-decoration: none;
  transition: color var(--t-mid) var(--ease), transform var(--t-mid) var(--ease);
}

.to-top:hover {
  color: #ffd9a8;
  transform: translateY(-2px);
}

/* ---------- 12. Project dialog ---------- */
.dialog {
  width: min(92vw, 40rem);
  padding: 0;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--ivory);
  color: var(--espresso);
  box-shadow: 0 40px 90px -40px rgba(43, 26, 14, 0.7);
}

.dialog::backdrop {
  background: rgba(43, 26, 14, 0.5);
  backdrop-filter: blur(3px);
}

/* browsers without a native modal dialog: centre the same panel ourselves,
   the wide spread shadow paints the dimmed backdrop */
.dialog[data-fallback="true"] {
  position: fixed;
  inset: 0;
  z-index: 90;
  margin: auto;
  height: fit-content;
  max-height: 88dvh;
  overflow: auto;
  box-shadow: 0 0 0 100vmax rgba(43, 26, 14, 0.5), 0 40px 90px -40px rgba(43, 26, 14, 0.7);
}

.dialog__body {
  padding: clamp(1.4rem, 4vw, 2.2rem);
}

.dialog__kicker {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue-ink);
}

.dialog__title {
  margin-top: 0.5rem;
  font-size: clamp(1.5rem, 4vw, 2.1rem);
}

.dialog__text {
  margin-top: 0.9rem;
  font-size: 0.98rem;
  line-height: 1.72;
  color: var(--ink-70);
}

.dialog__facts {
  margin: 1.2rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.dialog__facts li {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.92rem;
  color: var(--ink-70);
}

.dialog__facts svg {
  width: 1rem;
  height: 1rem;
  flex: none;
  margin-top: 0.28rem;
  color: var(--blue);
}

.dialog__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.6rem;
}

.dialog__close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 2.4rem;
  height: 2.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--hair);
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: background-color var(--t-mid) var(--ease), transform var(--t-mid) var(--ease);
}

.dialog__close:hover {
  background: #fff;
  transform: rotate(90deg);
}

.dialog__close svg {
  width: 1rem;
  height: 1rem;
}

/* ---------- 13. Reveal (JS-driven; visible without JS) ---------- */
.reveal-ready {
  will-change: transform, opacity;
}

/* ---------- 14. Wider screens ---------- */
@media (min-width: 40rem) {
  .strip__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.9rem 1.2rem;
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (min-width: 56rem) {
  /* the artwork starts at the very top of the page, behind the header */
  .hero {
    overflow: visible;
    margin-top: calc(var(--header-h) * -1);
    padding-bottom: 0;
  }

  .hero__grid {
    display: block;
    padding-block: 0;
  }

  .hero__copy {
    position: relative;
    z-index: 2;
    padding-top: clamp(4.5rem, 14.4vw, 13rem);
    max-width: 42rem;
  }

  .hero__art-frame {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1;
    width: 52.2%;
    max-width: none;
    margin: 0;
  }

  .hero__divider {
    margin-top: clamp(2rem, 6vw, 5.4rem);
  }

  .intro__grid {
    display: block;
  }

  .intro__copy {
    max-width: 36rem;
  }

  .closing__grid {
    display: block;
  }

  .closing__copy {
    padding-top: clamp(2rem, 3.9vw, 3.5rem);
    max-width: 62rem;
  }

  /* the expertise panel and the project cards sit wider than the text column */
  .expertise .container,
  .projects .container {
    max-width: none;
    padding-inline: clamp(1.25rem, 3vw, 3rem);
  }

  /* the artwork and the water band are both pinned to the bottom of the
     section so they meet exactly, whatever the height of the copy */
  .closing {
    /* the artwork is exactly as tall as the section, so it meets the water
       band at the bottom edge with no seam */
    min-height: 22.2vw;
    padding-bottom: 0;
  }

  .closing__art {
    position: absolute;
    top: auto;
    bottom: 0;
    right: 0;
    z-index: 1;
    order: 0;
    width: 54.1%;
    max-width: 52rem;
    margin: 0;
  }

  .footer__grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 5rem);
  }
}

@media (min-width: 68rem) {
  :root {
    --header-h: 5.25rem;
  }

  .nav,
  .badge {
    display: flex;
  }

  .menu-btn {
    display: none;
  }

  .mobile-nav {
    display: none;
  }

  .header__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 1.5rem;
  }

  .brand {
    font-size: 1.52rem;
    justify-self: start;
  }

  .brand__mark {
    width: 3.05rem;
    height: 3.05rem;
  }

  .nav {
    justify-self: center;
    /* sits the menu a touch left of the geometric centre, as on the reference */
    margin-inline-end: 2rem;
  }

  .nav__list {
    gap: 3.05rem;
  }

  .nav__link {
    font-size: 1.28rem;
  }

  .badge {
    justify-self: end;
  }

  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.9rem;
  }

  .strip__inner {
    grid-template-columns: auto 1px minmax(0, 1fr);
    align-items: center;
    gap: clamp(1.5rem, 3vw, 2.75rem);
  }

  .strip__head {
    padding-right: clamp(0.5rem, 1.5vw, 1.25rem);
  }

  .strip__divider {
    width: 2px;
    height: 4.5rem;
    align-self: center;
    border-radius: 2px;
  }

  .strip__list {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1rem;
  }

  .closing__grid {
    display: block;
  }
}

@media (min-width: 80rem) {
  .hero__copy {
    padding-top: clamp(8rem, 14.4vw, 13rem);
  }
}

/* ---------- 15. Reduced motion & print ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .cursor {
    opacity: 1;
  }
}

@media print {
  .header,
  .waves,
  .footer {
    display: none;
  }
}
