/* Baara Art Residency: home page.
   Colours come from the logo. Change them here and the whole page follows. */
:root {
  --paper: #fbf5ec;
  --sand: #f4e9da;
  --ink: #163f43;
  --muted: #36565a;
  --coral: #c4320f;        /* coral dark enough for text */
  --coral-paint: #f0643c;  /* brighter coral, decoration only */
  --orange: #f79421;
  --teal: #0a6a82;
  --serif: 'Instrument Serif', Georgia, serif;
  --hand: 'Caveat', 'Comic Sans MS', cursive;
  --sans: 'Jost', 'Trebuchet MS', sans-serif;
  --blob-a: 255px 18px 225px 18px / 18px 225px 18px 255px;
  --blob-b: 18px 225px 18px 255px / 255px 18px 225px 18px;
  --pad: clamp(20px, 4.5vw, 64px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
}
img, svg { max-width: 100%; }
h1, h2, h3, p, figure, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: var(--ink); }
a:hover { color: var(--coral); }
em { font-style: italic; }
:focus-visible { outline: 3px solid var(--coral-paint); outline-offset: 3px; }

.skip { position: absolute; left: -999px; top: 8px; padding: 10px 16px; background: var(--ink); color: var(--paper); z-index: 10; }
.skip:focus { left: 8px; }

.progress {
  position: fixed; top: 0; left: 0; z-index: 5;
  width: 100%; height: 6px;
  background: var(--coral-paint);
  border-radius: 0 6px 6px 0;
  transform: scaleX(var(--scroll, 0));
  transform-origin: 0 50%;
}

/* Header */
.site-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 32px; padding: 20px var(--pad);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 46px; width: auto; }
.brand span { font-family: var(--serif); font-style: italic; font-size: 34px; line-height: 1; }
.site-header nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 30px; font-size: 17px; }
.site-header nav a { padding: 12px 0; text-decoration: none; }

/* Shared pieces */
.section { padding: clamp(64px, 8vw, 104px) var(--pad); }
.sand { background: var(--sand); }
.wrap { max-width: 1192px; margin: 0 auto; }
.muted { color: var(--muted); }
.note { font-family: var(--hand); font-weight: 700; font-size: 32px; line-height: 1; }
.note-coral { color: var(--coral); }
.note-teal { color: var(--teal); }
.note-peach { color: #ffb38f; transform: rotate(-2deg); }
.accent { font-style: italic; color: var(--coral); }
.text-link { display: inline-block; padding: 12px 0; font-weight: 500; }
.link-btn {
  min-height: 44px; padding: 0; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 16px; font-weight: 500; color: var(--ink); text-decoration: underline;
}
.link-btn:hover { color: var(--coral); }

h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(38px, 4.2vw, 56px); line-height: 1.05; text-wrap: balance; }
h2.big { font-size: clamp(48px, 5.4vw, 72px); line-height: 1; }
h2.huge { font-size: clamp(64px, 7.2vw, 96px); line-height: 0.95; }
h3 { font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.08; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 54px; padding: 0 30px; border: 0; cursor: pointer;
  font: inherit; font-weight: 500; text-decoration: none;
  transition: transform 0.2s ease;
}
.btn:hover { transform: translateY(-3px) rotate(-1deg); }
.btn-solid { background: var(--ink); color: var(--paper); border-radius: var(--blob-a); }
.btn-solid:hover { color: var(--paper); }
.btn-line { border: 2px solid var(--ink); color: var(--ink); border-radius: var(--blob-b); }
.btn-sun { background: var(--orange); color: var(--ink); border-radius: var(--blob-b); }
.btn-sun:hover { color: var(--ink); }

.stroke { display: block; height: 20px; max-width: 100%; overflow: visible; }
.stroke path, .sprig path, .hero-art .draw { fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* Placeholders for photographs and artworks. Delete once real images are in. */
.ph {
  display: flex; align-items: flex-end;
  width: 100%; aspect-ratio: var(--ratio, 4 / 5);
  padding: 22px;
  background: var(--bg, #efe2d0);
  color: #36565a; font-size: 15px; text-align: left;
}
.ph-sand { --bg: #efe2d0; }
.ph img, .frame img, .polaroid img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Hero */
.hero {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 40px 56px;
  max-width: 1400px; margin: 0 auto;
  padding: clamp(24px, 4vw, 56px) var(--pad) 72px;
}
.hero-text { flex: 1 1 480px; max-width: 640px; display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }
.hero .note { font-size: 34px; }
h1 {
  display: flex; flex-wrap: wrap; gap: 0 0.24em;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(54px, 7.4vw, 112px); line-height: 0.95; letter-spacing: -0.01em;
}
.stroke-hero { width: min(380px, 80%); height: 24px; margin-top: -6px; }
.lead { max-width: 520px; font-size: 20px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 6px; }

.hero-art { flex: 1 1 380px; max-width: 620px; position: relative; aspect-ratio: 1 / 1; }
.hero-art .layer { position: absolute; inset: 0; }
.hero-art .layer svg { display: block; width: 100%; height: 100%; overflow: visible; }
.hero-art .coral { position: absolute; left: 4%; top: 12%; width: 92%; }
.hero-art .coral img { display: block; width: 100%; height: auto; transform: rotate(-3deg); }
.p1, .p2, .p3 { transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.p1 { transform: translate(calc(var(--px, 0) * -12px), calc(var(--py, 0) * -12px)); }
.p2 { transform: translate(calc(var(--px, 0) * 22px), calc(var(--py, 0) * 22px)); }
.p3 { transform: translate(calc(var(--px, 0) * -34px), calc(var(--py, 0) * -34px)); }

/* Tagline band */
.marquee { overflow: hidden; padding: 20px 0 28px; border-top: 1px solid #e6d8c6; border-bottom: 1px solid #e6d8c6; }
.marquee-track {
  display: flex; gap: 56px; width: max-content; padding-right: 56px;
  font-family: var(--serif); font-size: clamp(44px, 4.8vw, 68px); line-height: 1.1; white-space: nowrap;
  animation: marquee 38s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee .t1 { color: var(--coral-paint); }
.marquee .t2 { color: var(--teal); }
.marquee .t3 { color: var(--orange); }

/* Story and island: two columns */
.split { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 56px clamp(40px, 7vw, 96px); }
.copy { flex: 1 1 440px; max-width: 620px; display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }
.copy.narrow { flex-basis: 360px; max-width: 440px; gap: 20px; }

.tilt { transform: rotate(var(--r, 0deg)); transition: transform 0.35s ease, box-shadow 0.35s ease; }
.tilt:hover { transform: rotate(0deg) translateY(-8px); box-shadow: 0 22px 44px rgba(22, 63, 67, 0.22); }

.polaroid {
  flex: 0 1 400px; position: relative;
  padding: 16px 16px 64px; background: #fff;
  box-shadow: 0 14px 34px rgba(22, 63, 67, 0.18);
}
.polaroid .tape {
  position: absolute; top: -16px; left: 50%; width: 130px; height: 32px; margin-left: -65px;
  background: rgba(247, 148, 33, 0.4); transform: rotate(4deg);
}
.polaroid figcaption {
  position: absolute; left: 0; right: 0; bottom: 12px; text-align: center;
  font-family: var(--hand); font-weight: 500; font-size: 30px; line-height: 1.2;
}

/* Events */
.head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px 48px; margin-bottom: 48px; }
.title-group { display: flex; align-items: flex-end; gap: 28px; }
.sprig { width: 78px; height: 92px; flex: 0 0 auto; }
.aside { max-width: 460px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  min-height: 46px; padding: 0 22px; cursor: pointer;
  border: 2px solid var(--ink); border-radius: var(--blob-a);
  background: transparent; color: var(--ink);
  font: inherit; font-weight: 500;
  transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease;
}
.chip:hover { transform: translateY(-2px); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr)); gap: 28px; min-height: 380px; }
.card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  min-height: 380px; padding: 32px; background: #fff;
  box-shadow: 0 10px 28px rgba(22, 63, 67, 0.14);
}
.card[hidden] { display: none; }
.card.pop { animation: pop 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.card .when { font-family: var(--hand); font-weight: 700; font-size: 36px; line-height: 1; }
.card .meta { font-weight: 500; }
.card .text-link { margin-top: auto; }

/* Island photographs */
.blobs { flex: 2 1 480px; max-width: 700px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 28px; align-items: center; }
.blob-col { display: flex; flex-direction: column; gap: 28px; }
.blobs figure { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.blobs figcaption { font-family: var(--hand); font-weight: 500; font-size: 28px; line-height: 1.1; transform: rotate(var(--r, 0deg)); }
.blob { align-items: center; justify-content: center; text-align: center; padding: 36px; overflow: hidden; border-radius: 62% 38% 55% 45% / 48% 60% 40% 52%; transition: transform 0.4s ease; }
.blob-2 { border-radius: 45% 55% 40% 60% / 58% 42% 58% 42%; }
.blob-3 { border-radius: 55% 45% 60% 40% / 44% 56% 44% 56%; }
.blob:hover { transform: scale(1.04); }
.morph { animation: morph 12s ease-in-out infinite; }

/* Works */
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 36px; align-items: start; }
.work { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.frame {
  display: block; width: 100%; padding: 12px; margin: 0 0 16px; border: 0; cursor: pointer;
  background: #fff; font: inherit;
  box-shadow: 0 12px 30px rgba(22, 63, 67, 0.16);
  transform: rotate(var(--r, 0deg)); transform-origin: 50% 0;
}
.frame:hover, .frame:focus-visible { animation: sway 1.6s ease-in-out infinite; }
.frame.is-picked { outline: 3px solid var(--coral-paint); outline-offset: 4px; }
.work-title { font-family: var(--serif); font-style: italic; font-size: 28px; line-height: 1.15; }
.work-by { font-size: 16px; color: var(--muted); }

.panel {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 32px 56px;
  margin-top: 56px; padding: clamp(24px, 3vw, 40px); background: #fff;
  box-shadow: 0 14px 34px rgba(22, 63, 67, 0.16);
  animation: pop 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.panel[hidden] { display: none; }
.panel-intro { flex: 1 1 260px; max-width: 360px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.panel-intro h3 { font-size: 40px; line-height: 1.05; }
.panel-form { flex: 2 1 420px; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; }
.field { flex: 1 1 220px; display: flex; flex-direction: column; gap: 6px; }
.field.wide { flex-basis: 100%; }
.field label { font-size: 15px; }
.field input, .field textarea {
  width: 100%; padding: 0 16px; min-height: 52px;
  border: 2px solid var(--ink); border-radius: 4px;
  background: var(--paper); color: var(--ink); font: inherit;
}
.field textarea { padding: 12px 16px; resize: vertical; }
.status { flex-basis: 100%; min-height: 1.6em; font-weight: 500; }

/* Residency band */
.wave { display: block; width: 100%; height: 60px; margin-bottom: -1px; background: var(--sand); }
.wave path { fill: var(--ink); }
.deep { position: relative; overflow: hidden; background: var(--ink); color: var(--paper); padding: 56px var(--pad) 96px; }
.deep-inner { position: relative; max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.deep h2 { font-size: clamp(42px, 4.6vw, 60px); line-height: 1.02; }
.deep .soft, .deep label { color: #d5e3e2; }
.interest-form { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 12px; width: 100%; margin-top: 8px; }
.interest-form .field { flex: 1 1 280px; max-width: 420px; align-items: flex-start; }
.interest-form input {
  min-height: 54px; padding: 0 22px;
  border-color: var(--paper); border-radius: var(--blob-a);
  background: transparent; color: var(--paper);
}
.interest-form input::placeholder { color: #a9c4c4; }
.deep .status { color: #ffb38f; font-family: var(--hand); font-weight: 700; font-size: 32px; line-height: 1.1; }
.bubbles { position: absolute; inset: 0; pointer-events: none; }
.bubbles span { position: absolute; bottom: 0; border: 2px solid #9cc4c6; border-radius: 50%; animation: bubble 7s ease-in infinite; }

/* Footer */
.site-footer { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 32px 64px; padding: 64px var(--pad); }
.brand-block { display: flex; align-items: center; gap: 16px; }
.brand-block img { height: 64px; width: auto; }
.foot-name { font-family: var(--serif); font-size: 30px; line-height: 1.2; }
.contacts { font-size: 17px; }
.contacts a { display: inline-block; padding: 10px 0; }

/* Motion */
@keyframes rise { from { opacity: 0; transform: translateY(0.6em) rotate(3deg); } to { opacity: 1; } }
@keyframes fadeup { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; } }
@keyframes draw { from { stroke-dashoffset: 1; opacity: 0; } 8% { opacity: 1; } to { stroke-dashoffset: 0; opacity: 1; } }
@keyframes grow { from { clip-path: inset(100% 0 0 0); opacity: 0; } to { clip-path: inset(-10%); opacity: 1; } }
@keyframes floatA { 0%, 100% { transform: translate(0, 0) rotate(0deg); } 50% { transform: translate(10px, -14px) rotate(3deg); } }
@keyframes floatB { 0%, 100% { transform: translate(0, 0) rotate(0deg); } 50% { transform: translate(-12px, 10px) rotate(-4deg); } }
@keyframes morph { 0%, 100% { border-radius: 62% 38% 55% 45% / 48% 60% 40% 52%; } 50% { border-radius: 42% 58% 40% 60% / 60% 42% 58% 40%; } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes sway { 0%, 100% { transform: rotate(-2.4deg); } 50% { transform: rotate(2.4deg); } }
@keyframes pop { from { opacity: 0; transform: translateY(20px) scale(0.98); } to { opacity: 1; } }
@keyframes bubble { from { transform: translateY(0); opacity: 0; } 15% { opacity: 0.45; } to { transform: translateY(-280px); opacity: 0; } }

.w { display: block; opacity: 0; animation: rise 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) var(--d, 0s) forwards; }
.fade { opacity: 0; animation: fadeup 0.9s ease var(--d, 0s) forwards; }
.draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw var(--t, 1.5s) ease-out var(--d, 0s) forwards; }
.grow { animation: grow 1.9s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s both; }
.float-a { animation: floatA 9s ease-in-out infinite; }
.float-b { animation: floatB 11s ease-in-out infinite; }

/* Sections fade up as they scroll into view. script.js adds and removes .rv-pre. */
[data-reveal] { transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
.rv-pre { opacity: 0; transform: translateY(40px); }
.rv-pre .draw { animation-play-state: paused; }

@media (max-width: 640px) {
  body { font-size: 17px; }
  .site-header nav { gap: 0 20px; font-size: 16px; }
  .head-row { margin-bottom: 32px; }
  .work.drop { margin-top: 0; }
  .polaroid { flex-basis: 300px; }
}
@media (min-width: 641px) {
  .work.drop { margin-top: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .w, .fade { opacity: 1; }
  .draw { stroke-dashoffset: 0; }
  .rv-pre { opacity: 1; transform: none; }
}

/* ---------- Inner pages ---------- */

.site-header nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--coral-paint); text-decoration-thickness: 3px; text-underline-offset: 8px; }

.page-hero {
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
  max-width: 1320px; margin: 0 auto;
  padding: clamp(32px, 5vw, 72px) var(--pad) clamp(32px, 4vw, 56px);
}
.page-title { display: block; font-family: var(--serif); font-weight: 400; font-size: clamp(52px, 7vw, 104px); line-height: 0.98; letter-spacing: -0.01em; }
.page-hero .lead { margin-top: 10px; }
.tight-top { padding-top: clamp(24px, 3vw, 40px); }
.split.top { align-items: flex-start; }

.prose { gap: 18px; }
.prose p { max-width: 62ch; }
.prose h2 { margin-bottom: 6px; }

.statement { margin-top: 10px; max-width: 900px; }
.thirds { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 36px 48px; margin-top: 48px; }
.thirds h3 { margin-bottom: 8px; font-style: italic; color: var(--coral); }

.members { display: flex; flex-direction: column; gap: 48px; }
.member { display: flex; flex-wrap: wrap; align-items: center; gap: 32px 56px; }
.member .ph { flex: 0 1 300px; }
.member-text { flex: 1 1 360px; max-width: 560px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.arch { border-radius: 200px 200px 6px 6px; justify-content: center; }

.cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 48px; }
.more { display: flex; flex-wrap: wrap; gap: 0 32px; margin-top: 32px; }
.empty { color: var(--muted); }

.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 40px 32px; }
.person { display: flex; flex-direction: column; gap: 6px; text-decoration: none; }
.person .ph { margin-bottom: 10px; border-radius: 200px 200px 6px 6px; justify-content: center; overflow: hidden; transition: transform 0.35s ease; }
.person:hover .ph { transform: translateY(-8px) rotate(-1.5deg); }
.person-name { font-family: var(--serif); font-size: 30px; line-height: 1.1; }
.person-role { color: var(--muted); font-size: 16px; }

.ph.has-img { padding: 0; background: transparent; }
.profile-top { padding-top: clamp(32px, 5vw, 72px); }
.profile-top .polaroid { padding-bottom: 28px; }
.profile-top .page-title { font-size: clamp(44px, 5.6vw, 84px); }
.link-list { display: flex; flex-direction: column; align-items: flex-start; }
.big-links a { display: inline-block; padding: 10px 0; font-family: var(--serif); font-size: 30px; line-height: 1.2; }
.blobs.single { flex: 1 1 320px; max-width: 420px; display: block; }

.card-form { flex: 1 1 420px; max-width: 620px; padding: clamp(24px, 3vw, 40px); background: #fff; box-shadow: 0 14px 34px rgba(22, 63, 67, 0.16); }
.form-title { flex-basis: 100%; font-size: 36px; }

.signoff { margin-top: 10px; font-family: var(--serif); font-style: italic; font-size: clamp(28px, 3vw, 38px); line-height: 1.15; color: var(--coral); }
.byline { font-family: var(--hand); font-weight: 700; font-size: 28px; line-height: 1.1; color: var(--teal); }

/* ---------- Sample content and pictures ---------- */
.sample-bar { margin: 0; padding: 8px var(--pad); background: var(--ink); color: var(--paper); font-size: 15px; text-align: center; }
.credits { flex-basis: 100%; max-width: 900px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.blob.has-img { padding: 0; }
