/* =========================================================
   Malermeisterbetrieb Michael Albert — one-pager
   Palette taken from the rainbow brush-bird in the logo.
   ========================================================= */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("assets/fonts/bricolage-latin.woff2") format("woff2");
  font-weight: 300 800;
  font-stretch: 100%;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("assets/fonts/fraunces-italic-latin.woff2") format("woff2");
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
}

:root {
  /* paper & ink */
  --paper: #f6f1e7;
  --paper-2: #ede5d5;
  --card: #fffdf8;
  --ink: #17151a;
  --ink-2: #4a4550;
  --line: rgb(23 21 26 / 0.14);

  /* brand spectrum — deep tones pass contrast with white text */
  --magenta: #b0207e;
  --violet: #5b2aa6;
  --blue: #2456c9;
  --teal: #0f8f95;
  --green: #2f7d32;
  --yellow: #f2b400;
  --orange: #c2560c;
  --red: #c8231c;

  --rainbow: linear-gradient(90deg, var(--magenta), var(--violet), var(--blue), var(--teal), var(--green), var(--yellow), var(--orange), var(--red));

  --font-sans: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-serif: "Fraunces", ui-serif, Georgia, serif;

  --gutter: clamp(1rem, 4vw, 3rem);
  --maxw: 1240px;
  --radius: 18px;
  --header-h: 72px;
  --ease-out: cubic-bezier(.2, .8, .2, 1);

  color-scheme: light;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.6;
  overflow-x: clip;
  /* fine paper grain */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

main { overflow-x: clip; } /* the tilted marquee is wider than the viewport */
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.05; font-weight: 750; letter-spacing: -0.02em; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
em { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; left: 1rem; top: -4rem; z-index: 100;
  background: var(--ink); color: var(--paper); padding: .6rem 1rem; border-radius: 8px;
  text-decoration: none; transition: top .2s;
}
.skip:focus { top: 1rem; }

.wrap { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }
.section { padding-block: clamp(4.5rem, 10vw, 9rem); position: relative; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .6rem;
  font-size: .8rem; font-weight: 650; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-2); margin-bottom: 1.2rem;
}
.eyebrow::before {
  content: ""; width: 2.2rem; height: .38rem; border-radius: 99px 40px 99px 30px;
  background: var(--rainbow);
}

.h2 { font-size: clamp(2.1rem, 1.3rem + 3.6vw, 4.4rem); margin-bottom: 1.5rem; }
.h2 em { display: block; color: var(--ink-2); }

/* ---------- scroll progress (rainbow brush line) ---------- */
.progress {
  position: fixed; inset: 0 0 auto; height: 4px; z-index: 60;
  background: var(--rainbow);
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
}
@supports ((animation-timeline: scroll()) and (animation-range: 0% 100%)) {
  @keyframes progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  .progress { animation: progress linear both; animation-timeline: scroll(root); }
}

/* ---------- header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-inline: var(--gutter);
  transition: background-color .3s, box-shadow .3s, backdrop-filter .3s;
}
.site-header[data-scrolled] {
  background: rgb(246 241 231 / 0.86);
  backdrop-filter: blur(12px) saturate(1.3);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  box-shadow: 0 1px 0 var(--line);
}
.brand img { height: 56px; width: auto; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: clamp(.8rem, 2vw, 2rem); }
.site-nav a {
  text-decoration: none; font-weight: 600; font-size: .98rem; position: relative; padding-block: .3rem;
}
.site-nav a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 3px;
  border-radius: 99px 30px 99px 40px; background: var(--rainbow);
  transform: scaleX(0); transform-origin: 0 50%; transition: transform .35s var(--ease-out);
}
.site-nav a:hover::after, .site-nav a[aria-current="true"]::after { transform: scaleX(1); }
.nav-cta {
  background: var(--ink); color: var(--paper) !important; padding: .6rem 1.1rem !important;
  border-radius: 999px; transition: background-color .2s;
}
.nav-cta:hover { background: var(--magenta); }

.nav-toggle {
  display: none; width: 48px; height: 48px; border: 0; border-radius: 50%;
  background: var(--ink); cursor: pointer; place-items: center;
}
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
  display: block; width: 20px; height: 2px; background: var(--paper); border-radius: 2px;
  transition: transform .3s var(--ease-out), background-color .2s;
}
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: grid; position: relative; z-index: 2; }
  .site-nav {
    position: fixed; inset: 0; z-index: 1;
    background: var(--ink); color: var(--paper);
    display: grid; place-items: center;
    clip-path: circle(0 at calc(100% - var(--gutter) - 24px) calc(var(--header-h) / 2));
    transition: clip-path .6s var(--ease-out), visibility 0s .6s;
    visibility: hidden;
  }
  .site-nav.is-open {
    clip-path: circle(150% at calc(100% - var(--gutter) - 24px) calc(var(--header-h) / 2));
    transition: clip-path .6s var(--ease-out);
    visibility: visible;
  }
  .site-nav ul { flex-direction: column; gap: 1.2rem; }
  .site-nav a { font-size: clamp(2rem, 9vw, 3rem); font-weight: 750; }
  .nav-cta { background: var(--paper); color: var(--ink) !important; font-size: 1.4rem !important; margin-top: 1rem; display: inline-block; }
  .nav-open .nav-toggle { background: var(--paper); }
  .nav-open .nav-toggle__bars::before, .nav-open .nav-toggle__bars::after { background: var(--ink); }
  .nav-open { overflow: hidden; }
}

/* ---------- buttons ---------- */
.btn {
  --bg: var(--ink);
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 52px; padding: .85rem 1.6rem; border-radius: 999px;
  font: inherit; font-weight: 650; text-decoration: none; cursor: pointer;
  border: 2px solid var(--ink); transition: color .3s, transform .2s;
}
.btn:active { transform: translateY(1px); }
.btn--paint { background: var(--bg); color: var(--paper); }
.btn--paint::before {
  /* the paint that floods the button on hover */
  content: ""; position: absolute; inset: -30% -10%; z-index: -1;
  background: var(--rainbow);
  border-radius: 40% 60% 55% 45% / 60% 40% 60% 40%;
  transform: translateX(-105%) skewX(-12deg);
  transition: transform .6s var(--ease-out);
}
.btn--paint:hover::before, .btn--paint:focus-visible::before { transform: translateX(0) skewX(-12deg); }
.btn--paint span { text-shadow: 0 1px 2px rgb(0 0 0 / .35); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative; min-height: 100svh;
  display: grid; align-items: center;
  padding: calc(var(--header-h) + 2rem) var(--gutter) 5rem;
  overflow: hidden;
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }

.hero__swoosh {
  position: absolute; z-index: 0;
  right: -6vw; bottom: -4vh; width: min(78vw, 1100px); height: 88%;
  pointer-events: none;
}
.hero__swoosh path {
  stroke: var(--c); stroke-width: 22;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: draw 1.6s var(--ease-out) forwards;
  animation-delay: calc(.35s + var(--d));
  opacity: .92;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.hero__inner { position: relative; z-index: 2; width: min(100%, var(--maxw)); margin-inline: auto; }
.hero__title {
  font-size: clamp(3.2rem, 1rem + 10vw, 10.5rem);
  line-height: .9; letter-spacing: -0.045em; font-weight: 800;
  margin-bottom: 2rem;
}
.hero__title .line { display: block; }
.hero__title .dot { color: var(--magenta); }
.hero__title .line--accent em {
  display: inline-block; font-weight: 500; letter-spacing: -0.03em;
  font-size: .72em; padding: .06em .08em .12em 0;
  background: var(--rainbow); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__lead { max-width: 34rem; font-size: clamp(1.05rem, 1rem + .4vw, 1.3rem); color: var(--ink-2); margin-bottom: 2rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; }

.hero__hint {
  margin: 1.6rem 0 0;
  display: flex; align-items: center; gap: .6rem; white-space: nowrap;
  font-size: .85rem; color: var(--ink-2);
}
.hero__hint-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--magenta); animation: hue 6s linear infinite; }
@keyframes hue {
  0% { background: var(--magenta); } 16% { background: var(--violet); } 33% { background: var(--blue); }
  50% { background: var(--green); } 66% { background: var(--yellow); } 83% { background: var(--orange); } 100% { background: var(--magenta); }
}
@media (hover: none) { .hero__hint { display: none; } }

/* line-by-line entrance */
.js .hero__title .line, .js .hero__lead, .js .hero__actions, .js .hero__hint, .js .hero .eyebrow {
  opacity: 0; transform: translateY(0.4em);
  animation: rise .9s var(--ease-out) forwards;
}
.js .hero .eyebrow { animation-delay: .05s; }
.js .hero__title .line:nth-child(1) { animation-delay: .12s; }
.js .hero__title .line:nth-child(2) { animation-delay: .22s; }
.js .hero__title .line:nth-child(3) { animation-delay: .42s; }
.js .hero__lead { animation-delay: .6s; transform: translateY(1rem); }
.js .hero__actions { animation-delay: .72s; transform: translateY(1rem); }
.js .hero__hint { animation-delay: 1.6s; transform: none; }
@keyframes rise { to { opacity: 1; transform: none; } }

@media (max-width: 700px) {
  .hero { align-items: start; padding-top: calc(var(--header-h) + 3rem); }
  .hero__swoosh { width: 140vw; height: 46%; right: -30vw; bottom: 0; }
  .hero__swoosh path { opacity: .85; }
}

/* =========================================================
   MARQUEE
   ========================================================= */
.marquee {
  background: var(--ink); color: var(--paper);
  padding-block: 1.1rem; overflow: hidden;
  transform: rotate(-1.6deg) scale(1.03);
  margin-block: -1rem;
  position: relative; z-index: 3;
}
.marquee__track {
  display: flex; align-items: center; gap: 2rem; width: max-content;
  animation: marquee 38s linear infinite;
}
.marquee span { font-size: clamp(1.4rem, 1rem + 2vw, 2.6rem); font-weight: 750; letter-spacing: -0.02em; white-space: nowrap; }
.marquee span:nth-of-type(even) { font-family: var(--font-serif); font-style: italic; font-weight: 400; }
.marquee i {
  width: 1.1rem; height: 1.1rem; flex: none;
  border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%;
}
.marquee i:nth-of-type(6n+1) { background: var(--magenta); }
.marquee i:nth-of-type(6n+2) { background: var(--blue); }
.marquee i:nth-of-type(6n+3) { background: var(--teal); }
.marquee i:nth-of-type(6n+4) { background: var(--yellow); }
.marquee i:nth-of-type(6n+5) { background: var(--orange); }
.marquee i:nth-of-type(6n)   { background: var(--red); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* =========================================================
   INTRO + PROCESS
   ========================================================= */
.intro__grid {
  display: grid; gap: clamp(2.5rem, 6vw, 6rem);
  grid-template-columns: 1.25fr 1fr; align-items: end;
}
.intro__text p:last-child { color: var(--ink-2); max-width: 38rem; }

.stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2.2rem 1.5rem; }
.stat { display: grid; gap: .25rem; }
.stat__num {
  font-size: clamp(2.6rem, 1.8rem + 3vw, 4.2rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1;
  font-variant-numeric: tabular-nums;
  position: relative; justify-self: start; padding-bottom: .35rem;
}
.stat__num::after {
  /* brush stroke under each number */
  content: ""; position: absolute; left: -.1em; right: -.1em; bottom: 0; height: .28em; z-index: -1;
  background: var(--c); opacity: .9;
  border-radius: 60% 20% 70% 30% / 60% 40% 60% 40%;
  transform: rotate(-2deg); transform-origin: 0 50%;
  transition: transform .9s var(--ease-out) .25s;
}
.js .stat:not(.is-in) .stat__num::after { transform: scaleX(0) rotate(-2deg); }
.stat__label { color: var(--ink-2); font-size: .95rem; }

.process { margin-top: clamp(4rem, 9vw, 7rem); }
.process__title { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem); margin-bottom: 2rem; }
.process__steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem;
}
.process__steps li { position: relative; padding-top: 1.8rem; }
.process__steps li::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 10px;
  background: var(--c);
  border-radius: 8px 30px 6px 20px / 8px 6px 10px 4px;
  transform-origin: 0 50%;
  transition: transform 1s var(--ease-out) .15s;
}
.js .process__steps li:not(.is-in)::before { transform: scaleX(0); }
.process__n { font-family: var(--font-serif); font-style: italic; font-size: 1.1rem; color: var(--c); font-weight: 600; }
.process__steps h4 { font-size: 1.5rem; margin: .3rem 0 .6rem; }
.process__steps p { color: var(--ink-2); font-size: .98rem; margin: 0; }

@media (max-width: 960px) {
  .intro__grid { grid-template-columns: 1fr; }
  .process__steps { grid-template-columns: 1fr 1fr; gap: 2.5rem 1.5rem; }
}
@media (max-width: 520px) {
  .process__steps { grid-template-columns: 1fr; }
}

/* =========================================================
   SERVICES — paint chips
   ========================================================= */
.services { background: var(--paper-2); }
.services::before {
  /* torn / brushed top edge */
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 40px;
  background: var(--paper);
  -webkit-mask: radial-gradient(28px 22px at 50% 0, #000 98%, transparent) 0 0 / 56px 40px repeat-x;
  mask: radial-gradient(28px 22px at 50% 0, #000 98%, transparent) 0 0 / 56px 40px repeat-x;
}
.section-head { max-width: 46rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head__lead { color: var(--ink-2); }

.chips {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: clamp(1rem, 2vw, 1.6rem);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}
.chip {
  position: relative; isolation: isolate; overflow: hidden;
  background: var(--card); border-radius: var(--radius);
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -28px rgb(23 21 26 / .35);
  display: flex; flex-direction: column;
  transition: transform .4s var(--ease-out), box-shadow .4s;
}
.chip::before {
  /* paint that floods from the swatch */
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--c);
  clip-path: circle(0 at 3.2rem 3.2rem);
  transition: clip-path .7s var(--ease-out);
}
.chip__swatch {
  margin: 1.4rem 1.4rem 0; width: 3.6rem; height: 3.6rem; border-radius: 42% 58% 52% 48% / 55% 45% 55% 45%;
  background: var(--c); display: grid; place-items: center;
  transition: transform .5s var(--ease-out), background-color .4s;
}
.chip__swatch svg { width: 60%; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chip__body { padding: 1.3rem 1.6rem 1.8rem; transition: color .35s; }
.chip__code { font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 650; color: var(--c); transition: color .35s; }
.chip h3 { font-size: clamp(1.5rem, 1.2rem + 1vw, 1.9rem); margin: .4rem 0 .7rem; }
.chip p { margin: 0; color: var(--ink-2); transition: color .35s; }

@media (hover: hover) {
  .chip:hover { transform: translateY(-6px) rotate(-.6deg); box-shadow: 0 1px 0 var(--line), 0 30px 50px -28px rgb(23 21 26 / .5); }
  .chip:hover::before { clip-path: circle(150% at 3.2rem 3.2rem); }
  .chip:hover .chip__swatch { transform: rotate(-12deg) scale(1.08); background: rgb(255 255 255 / .18); }
  .chip:hover .chip__body, .chip:hover p, .chip:hover .chip__code { color: #fff; }
}
/* colour strip along the bottom, like a real paint card */
.chip::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: var(--c);
}

/* =========================================================
   FARBSPIEL — house configurator
   ========================================================= */
.play__grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(2rem, 6vw, 6rem); align-items: center; }
.play__text > p { color: var(--ink-2); max-width: 32rem; }

.swatches { border: 0; margin: 2rem 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: .8rem; }
.swatches legend { font-weight: 650; font-size: .9rem; margin-bottom: .9rem; padding: 0; }
.swatch {
  width: 52px; height: 52px; border: 0; padding: 0; cursor: pointer;
  background: var(--s);
  border-radius: 46% 54% 50% 50% / 55% 48% 52% 45%;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / .12), 0 6px 14px -8px rgb(0 0 0 / .5);
  transition: transform .25s var(--ease-out), box-shadow .25s;
}
.swatch:nth-child(odd) { border-radius: 55% 45% 48% 52% / 45% 55% 45% 55%; }
.swatch:hover { transform: translateY(-3px) rotate(-6deg); }
.swatch[aria-pressed="true"] { box-shadow: inset 0 0 0 1px rgb(0 0 0 / .12), 0 0 0 3px var(--paper), 0 0 0 6px var(--ink); transform: scale(1.06); }
.swatch-name { font-size: .95rem; color: var(--ink-2); }
.swatch-name strong { color: var(--ink); }

.house { position: relative; margin: 0; }
.house svg { width: 100%; height: auto; overflow: visible; }
.house__shadow { fill: rgb(23 21 26 / .12); }
.house__texture path { stroke: rgb(0 0 0 / .045); stroke-width: 14; }
.house__roof { fill: none; stroke: var(--ink); stroke-width: 18; stroke-linejoin: round; stroke-linecap: round; }
.house__chimney { fill: var(--ink); }
.house__win rect, .house__win circle { fill: #cfe0ea; stroke: #fff; stroke-width: 6; }
.house__frame path { stroke: #fff; stroke-width: 4; }
.house__shutter rect { fill: var(--ink); opacity: .82; }
.house__door { fill: var(--magenta); }
.house__knob { fill: var(--yellow); }
.house__base { stroke: var(--ink); stroke-width: 6; stroke-linecap: round; }

.house__brush {
  /* a painter's brush, drawn in CSS */
  position: absolute; top: 0; left: 0; width: 44px; height: 110px;
  opacity: 0; pointer-events: none;
  transform: translate(var(--bx, 0), var(--by, 0)) rotate(-18deg);
  filter: drop-shadow(0 10px 10px rgb(0 0 0 / .25));
}
.house__brush::before { /* bristles */
  content: ""; position: absolute; left: 4px; right: 4px; bottom: 0; height: 36px;
  background: var(--wet, #efe8da);
  border-radius: 4px 4px 14px 14px / 4px 4px 18px 18px;
  box-shadow: inset 0 -6px 0 rgb(0 0 0 / .12);
}
.house__brush::after { /* ferrule + handle */
  content: ""; position: absolute; left: 50%; bottom: 34px; width: 36px; height: 76px; translate: -50% 0;
  background:
    linear-gradient(#b9b4ad, #e7e3de 40%, #9b958d) bottom / 100% 20px no-repeat,
    linear-gradient(90deg, #7b4a26, #a86a3a 50%, #7b4a26) top / 14px 58px no-repeat;
  border-radius: 8px 8px 3px 3px;
}
.house.is-painting .house__brush { opacity: 1; }

@media (max-width: 860px) {
  .play__grid { grid-template-columns: 1fr; }
  .house { max-width: 520px; width: 100%; margin-inline: auto; }
}

/* =========================================================
   MASTER
   ========================================================= */
.master { background: var(--ink); color: var(--paper); }
.master .eyebrow, .master p { color: rgb(246 241 231 / .72); }
.master .h2 em { color: rgb(246 241 231 / .72); }
.master__grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2.5rem, 6vw, 6rem); align-items: center; }

.master__photo { margin: 0; position: relative; }
.master__photo img {
  width: 100%; aspect-ratio: 4 / 3.4; object-fit: cover; object-position: 20% 50%;
  border-radius: 38% 62% 44% 56% / 34% 30% 70% 66%;
  box-shadow: 0 30px 60px -30px rgb(0 0 0 / .8);
}
.master__photo::before {
  /* a big painted blob behind the portrait */
  content: ""; position: absolute; inset: -6% -4% 4% 8%; z-index: -1;
  background: var(--rainbow);
  border-radius: 58% 42% 52% 48% / 44% 56% 44% 56%;
  opacity: .9; filter: blur(.5px);
  rotate: -8deg;
}
.master__photo { isolation: isolate; }
.master__photo figcaption {
  position: absolute; left: 6%; bottom: 4%;
  background: var(--paper); color: var(--ink);
  padding: .7rem 1.1rem; border-radius: 12px; line-height: 1.3; font-size: .9rem;
  rotate: -3deg; box-shadow: 0 12px 30px -12px rgb(0 0 0 / .5);
}
.master__photo figcaption strong { display: block; font-size: 1.05rem; }

.timeline { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 0; }
.timeline li {
  display: grid; grid-template-columns: 4.5rem 1fr; gap: 1rem; align-items: baseline;
  padding: 1rem 0; border-top: 1px solid rgb(246 241 231 / .14);
  font-size: 1.1rem; font-weight: 600;
}
.timeline li:last-child { border-bottom: 1px solid rgb(246 241 231 / .14); }
.timeline__year { font-family: var(--font-serif); font-style: italic; font-weight: 500; font-size: 1.3rem; color: var(--c); filter: brightness(1.6) saturate(1.1); }

@media (max-width: 900px) {
  .master__grid { grid-template-columns: 1fr; }
  .master__photo { max-width: 560px; }
}

/* =========================================================
   CONTACT
   ========================================================= */
.contact { overflow: hidden; }
.contact__bg {
  position: absolute; inset: 0; z-index: -1;
  background: url("assets/splash.webp") 70% 40% / cover no-repeat;
  opacity: .3; mix-blend-mode: multiply;
  -webkit-mask: linear-gradient(90deg, transparent 0 20%, #000 70%);
  mask: linear-gradient(90deg, transparent 0 20%, #000 70%);
}
.contact { isolation: isolate; }
.contact__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2.5rem, 6vw, 6rem); align-items: start; }
.contact__intro > p { color: var(--ink-2); max-width: 30rem; }

.contact__list { list-style: none; margin: 2.2rem 0 0; padding: 0; display: grid; gap: 1.4rem; }
.contact__label { display: block; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 650; color: var(--ink-2); margin-bottom: .2rem; }
.contact__list a, .contact__list address {
  font-style: normal; font-size: clamp(1.15rem, 1rem + .8vw, 1.6rem); font-weight: 650; text-decoration: none;
  overflow-wrap: anywhere;
}
.contact__list a {
  background: linear-gradient(var(--yellow), var(--yellow)) 0 88% / 0 .3em no-repeat;
  transition: background-size .4s var(--ease-out);
}
.contact__list a:hover { background-size: 100% .3em; }

.brief {
  background: var(--card); border-radius: 24px; padding: clamp(1.4rem, 3vw, 2.4rem);
  box-shadow: 0 1px 0 var(--line), 0 30px 60px -36px rgb(23 21 26 / .45);
  position: relative;
}
.brief__title { font-size: 1.7rem; margin-bottom: .4rem; }
.brief__note { font-size: .88rem; color: var(--ink-2); }

.brief__topics { border: 0; padding: 0; margin: 1.2rem 0 1.4rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.brief__topics legend { font-weight: 650; font-size: .92rem; margin-bottom: .7rem; padding: 0; }
.brief__topics label { position: relative; cursor: pointer; }
.brief__topics input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.brief__topics span {
  display: inline-block; padding: .45rem .9rem; border-radius: 999px;
  border: 2px solid var(--c); color: var(--c); font-weight: 650; font-size: .92rem;
  transition: background-color .2s, color .2s;
}
.brief__topics input:checked + span { background: var(--c); color: #fff; }
.brief__topics input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }

.field { display: grid; gap: .35rem; margin-bottom: 1rem; }
.field label { font-weight: 650; font-size: .92rem; }
.field input, .field textarea {
  font: inherit; color: inherit; width: 100%;
  background: var(--paper); border: 2px solid transparent; border-radius: 12px;
  padding: .8rem 1rem; transition: border-color .2s, background-color .2s;
}
.field textarea { resize: vertical; min-height: 7rem; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--blue); background: #fff; }
.field input:user-invalid { border-color: var(--red); }
.brief .btn { width: 100%; margin-top: .4rem; }
.brief__error { color: var(--red); font-weight: 600; font-size: .92rem; margin: .8rem 0 0; min-height: 1.2em; }

@media (max-width: 900px) {
  .contact__grid { grid-template-columns: 1fr; }
  .contact__bg { mask: linear-gradient(180deg, transparent 0 30%, #000 80%); -webkit-mask: linear-gradient(180deg, transparent 0 30%, #000 80%); }
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer { border-top: 1px solid var(--line); padding-block: 2.5rem; font-size: .9rem; color: var(--ink-2); }
.site-footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.2rem 2rem; }
.site-footer img { height: 56px; width: auto; }
.site-footer nav { display: flex; gap: 1.4rem; }
.site-footer a { text-decoration: none; font-weight: 600; color: var(--ink); }
.site-footer a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.site-footer p { margin: 0; }

/* =========================================================
   REVEAL ON SCROLL (progressive enhancement)
   ========================================================= */
.js .reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
  transition-delay: var(--delay, 0s);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* subtle parallax on the hero swoosh where scroll-driven animations exist */
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: exit)) {
    @keyframes swoosh-drift { to { translate: 0 -12%; rotate: -3deg; } }
    .hero__swoosh { animation: swoosh-drift linear both; animation-timeline: view(); animation-range: exit; }
  }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .hero__swoosh path { stroke-dashoffset: 0; }
  .marquee__track { animation: none; }
  .js .reveal { opacity: 1; transform: none; }
}
