/* ==========================================================================
   Kala Vriksha Academy
   Editorial layout (big serif type, thick rules) in the ivory / burgundy / gold palette.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg: #ede3cb;
  --surface: #f4ecd8;
  --field: #fbf6e9;
  --ink: #2b1a16;
  --muted: #6a5648;
  --accent: #6e1730;
  --accent-ink: #f4ecd8;
  --gold: #9a7623;
  --line: #b9a57c;
  --error: #a1211a;
  --footer-bg: #5a1226;
  --footer-ink: #ede3cb;

  /* Colours the floating notes pick from (read by script.js) */
  --note-1: #6e1730;
  --note-2: #9a7623;
  --note-3: #1f5a5a;
  --note-4: #5b7a3a;

  --font-head: 'DM Serif Display', Georgia, serif;
  --font-body: 'Hanken Grotesk', system-ui, sans-serif;
  --radius: 2px;
  --header-offset: 132px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-offset);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: var(--header-offset);
  padding-inline: env(safe-area-inset-left) env(safe-area-inset-right);
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

[hidden] {
  display: none !important;
}

.wrap {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 48px);
}

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

.sprite {
  position: absolute;
}

.ic {
  flex: none;
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.2em;
}

#notes {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

main {
  position: relative;
  z-index: 1;
}

/* ---------- Logo: always a circle. LogoKV-HD.svg has the same gap around the artwork built in ---------- */
.logo {
  display: grid;
  flex: none;
  place-items: center;
  width: var(--d, 100px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px var(--gold);
}

.logo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 50%;
}

.logo--header {
  --d: var(--logo-size, 104px);
  transition: width 0.3s var(--ease);
}

.logo--hero {
  --d: min(clamp(240px, 42vh, 400px), 76vw);
}

.brand {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
}

.logo--footer {
  --d: 140px;
  margin-bottom: 20px;
  box-shadow: 0 0 0 3px var(--footer-ink);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.25s var(--ease),
    background-color 0.25s,
    color 0.25s,
    box-shadow 0.25s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn--primary:hover {
  box-shadow: 0 8px 18px rgba(110, 23, 48, 0.28);
}

.btn--ghost {
  border-color: var(--ink);
  color: var(--ink);
}

.btn--ghost:hover {
  background: var(--ink);
  color: var(--bg);
}

.btn--sm {
  padding: 9px 18px;
  font-size: 0.95rem;
}

.btn--block {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.65;
  cursor: progress;
  transform: none;
}

/* ---------- Header (fixed) ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  border-bottom: 2px solid var(--ink);
  background: var(--bg);
  transition: box-shadow 0.3s;
}

@supports (background: color-mix(in srgb, red, blue)) {
  .site-header {
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}

.site-header.is-scrolled {
  --logo-size: 72px;
  box-shadow: 0 6px 24px rgba(43, 26, 22, 0.16);
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 12px;
  position: relative;
  transition: padding 0.3s var(--ease);
}

.is-scrolled .bar {
  padding-block: 8px;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 32px);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 100;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition:
    transform 0.2s var(--ease),
    background-color 0.2s;
}

.nav-toggle:hover {
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-1px);
}

.nav-toggle .ic {
  width: 22px;
  height: 22px;
}

.nav-link {
  padding-bottom: 2px;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
  font-weight: 500;
  text-decoration: none;
  transition: background-size 0.3s var(--ease);
}

.nav-link:hover {
  background-size: 100% 2px;
}

/* ---------- Hero ---------- */
.hero {
  padding: clamp(24px, 5vw, 64px) 0 clamp(56px, 8vw, 104px);
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.tagline {
  width: 100%;
  max-width: 90ch;
  margin-top: 18px;
  color: var(--ink);
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  overflow-wrap: break-word;
  text-align: center;
  text-wrap: balance;
}

.motto {
  margin-top: 28px;
  font-family: var(--font-head);
  font-size: clamp(2.4rem, 7vw, 5.2rem);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.02em;
}

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

.line > span {
  display: block;
}

.line--em {
  color: var(--accent);
  font-style: italic;
}

.location {
  margin-top: 26px;
  color: var(--muted);
  font-weight: 500;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 32px;
}

/* ---------- Sections ---------- */
.section {
  padding-block: clamp(40px, 6vw, 88px);
}

.section > .wrap::before {
  content: '';
  display: block;
  height: 4px;
  margin-bottom: clamp(24px, 4vw, 44px);
  background: var(--ink);
}

h2 {
  font-family: var(--font-head);
  font-size: clamp(2.2rem, 4.8vw, 3.8rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.split {
  display: grid;
  grid-template-columns: 4fr 8fr;
  gap: clamp(20px, 3vw, 36px) clamp(24px, 5vw, 72px);
}

.split::before {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.section-body p + p {
  margin-top: 1.1em;
}

.lead {
  font-size: clamp(1.25rem, 2.2vw, 1.65rem);
  line-height: 1.45;
}

.section-head--wide {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 32px;
}

.hint {
  color: var(--muted);
  font-weight: 500;
}

.eyebrow {
  display: block;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---------- Objectives ---------- */
.objectives {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 4vw, 48px);
  margin-top: clamp(24px, 4vw, 40px);
  list-style: none;
}

.objectives li {
  padding-top: 18px;
  border-top: 1px solid var(--ink);
}

.objectives p {
  margin-top: 12px;
  font-size: 1.1rem;
}

/* ---------- Categories ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 3vw, 32px);
  margin-top: clamp(24px, 4vw, 40px);
}

.category {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.3s var(--ease),
    box-shadow 0.3s var(--ease),
    background-color 0.3s,
    color 0.3s;
}

.category:hover {
  transform: translate(-3px, -3px);
  box-shadow: 6px 6px 0 var(--ink);
}

.category-media {
  display: block;
  aspect-ratio: 4 / 5;
  margin: 16px 16px 0;
  overflow: hidden;
  border: 2px solid var(--gold);
  border-radius: 50% 50% 0 0 / 34% 34% 0 0;
  background: #fff;
}

.category-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.category:hover .category-media img {
  transform: scale(1.05);
}

.category-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  gap: 6px;
  padding: 18px 20px 22px;
}

.category-title {
  font-family: var(--font-head);
  font-size: 2rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.category-styles {
  overflow-wrap: anywhere;
  color: var(--muted);
}

.category-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  color: var(--accent);
  font-weight: 600;
}

.category-cta .eq {
  display: none;
}

.category[aria-pressed='true'] {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 6px 6px 0 var(--ink);
}

.category[aria-pressed='true'] .category-styles,
.category[aria-pressed='true'] .category-cta {
  color: var(--accent-ink);
}

.category[aria-pressed='true'] .ic--play {
  display: none;
}

.category[aria-pressed='true'] .eq {
  display: inline-flex;
}

.eq {
  align-items: flex-end;
  gap: 3px;
  height: 16px;
}

.eq i {
  display: block;
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: currentColor;
  transform: scaleY(0.4);
  transform-origin: bottom;
}

.stage {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: clamp(20px, 4vw, 40px);
  margin-top: clamp(24px, 4vw, 36px);
  padding: clamp(18px, 3vw, 32px);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
}

.stage-media img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 2px solid var(--gold);
  border-radius: 50% 50% 0 0 / 34% 34% 0 0;
  background: #fff;
}

.stage h3 {
  font-family: var(--font-head);
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  font-weight: 400;
  line-height: 1.1;
}

.stage-styles {
  margin-top: 4px;
  color: var(--accent);
  font-weight: 600;
}

.player {
  width: 100%;
  max-width: 560px;
  margin: 18px 0;
}

.player audio {
  display: block;
  width: 100%;
  accent-color: var(--accent);
}

.player-note {
  color: var(--muted);
  font-style: italic;
}

/* ---------- Contact ---------- */
.contact-head {
  max-width: 640px;
  margin-inline: auto;
  text-align: center;
}

.contact-head p {
  margin-top: 14px;
  color: var(--muted);
}

.form-card {
  max-width: 820px;
  margin: clamp(24px, 4vw, 40px) auto 0;
  padding: clamp(22px, 4vw, 44px);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 8px 8px 0 var(--accent);
}

.form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 22px;
}

.field {
  min-width: 0;
}

.field--wide {
  grid-column: 1 / -1;
}

label,
legend {
  display: block;
  margin-bottom: 6px;
  font-size: 0.95rem;
  font-weight: 600;
}

.req {
  color: var(--accent);
}

input[type='text'],
input[type='email'],
input[type='tel'],
input[type='number'],
select,
textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

textarea {
  resize: vertical;
}

select {
  padding-right: 40px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none' stroke='%232b1a16' stroke-width='2'%3E%3Cpath d='M1 1.5l6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 14px center;
  background-repeat: no-repeat;
}

input:focus,
select:focus,
textarea:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(110, 23, 48, 0.18);
}

.is-invalid input:not([type='checkbox']):not([type='radio']),
.is-invalid select,
.is-invalid textarea {
  border-color: var(--error);
}

.field-hint {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.85rem;
}

.field-error {
  display: block;
  min-height: 0;
  margin-top: 4px;
  color: var(--error);
  font-size: 0.85rem;
  font-weight: 500;
}

fieldset {
  border: 0;
}

.subchoice {
  padding-left: 16px;
  border-left: 3px solid var(--gold);
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  position: relative;
  margin: 0;
  font-weight: 500;
  cursor: pointer;
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip span {
  display: inline-block;
  padding: 10px 20px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--field);
  transition:
    background-color 0.2s,
    border-color 0.2s,
    color 0.2s;
}

.chip:hover span {
  border-color: var(--accent);
}

.chip input:checked + span {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.chip input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.is-invalid .chip span {
  border-color: var(--error);
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  font-weight: 500;
  cursor: pointer;
}

.consent-row input {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.success {
  padding: clamp(12px, 3vw, 28px);
  text-align: center;
}

.success:focus {
  outline: 0;
}

.success-mark {
  display: inline-grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 1.8rem;
}

.success h3 {
  font-family: var(--font-head);
  font-size: clamp(1.7rem, 3.4vw, 2.2rem);
  font-weight: 400;
  line-height: 1.15;
}

.success p {
  margin-top: 10px;
  color: var(--muted);
}

.success p strong {
  color: var(--ink);
}

.success .btn {
  margin-top: 24px;
}

.contact-list {
  display: grid;
  grid-template-columns: 0.9fr 2fr 1.1fr;
  gap: 20px 32px;
  max-width: 820px;
  margin: clamp(28px, 5vw, 48px) auto 0;
  list-style: none;
}

.contact-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 10px;
  padding-top: 14px;
  border-top: 2px solid var(--ink);
}

.contact-list .ic {
  grid-row: 1 / 3;
  margin-top: 3px;
  color: var(--accent);
}

.contact-label {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.contact-list a {
  overflow-wrap: break-word;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}

.contact-list a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding: clamp(40px, 6vw, 64px) 0 calc(26px + env(safe-area-inset-bottom));
  background: var(--footer-bg);
  color: var(--footer-ink);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.3fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

.footer-grid p {
  max-width: 38ch;
  font-size: 0.95rem;
  opacity: 0.82;
}

.footer-grid h4 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.footer-grid ul {
  list-style: none;
}

.footer-grid li {
  margin-bottom: 8px;
}

.footer-grid li a {
  overflow-wrap: break-word;
  font-size: 0.95rem;
  opacity: 0.85;
  text-decoration: none;
  transition: opacity 0.2s;
}

.footer-grid li a:hover {
  opacity: 1;
  text-decoration: underline;
}

.social {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.footer-grid .social a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(237, 227, 203, 0.4);
  border-radius: 50%;
  opacity: 1;
  transition:
    background-color 0.25s,
    color 0.25s,
    transform 0.25s var(--ease);
}

.footer-grid .social a:hover {
  background: var(--footer-ink);
  color: var(--footer-bg);
  text-decoration: none;
  transform: translateY(-3px);
}

.legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(237, 227, 203, 0.18);
  font-size: 0.82rem;
  opacity: 0.7;
}

.legal .ic {
  margin-right: 6px;
}

/* ---------- Motion (only for visitors who allow it) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .logo--hero {
    animation: float 7s ease-in-out infinite;
  }

  .logo--hero::after {
    content: '';
    position: absolute;
    inset: -3px;
    border: 2px solid var(--gold);
    border-radius: 50%;
    opacity: 0;
    animation: ping 3.6s ease-out infinite;
  }

  .line > span {
    animation: rise 0.9s var(--ease) both;
  }

  .line:nth-of-type(2) > span {
    animation-delay: 0.1s;
  }

  .line:nth-of-type(3) > span {
    animation-delay: 0.2s;
  }

  .line:nth-of-type(4) > span {
    animation-delay: 0.3s;
  }

  .category[aria-pressed='true'] .eq i {
    animation: eq 1s ease-in-out infinite;
  }

  .category[aria-pressed='true'] .eq i:nth-child(2) {
    animation-delay: -0.7s;
  }

  .category[aria-pressed='true'] .eq i:nth-child(3) {
    animation-delay: -0.35s;
  }

  .category[aria-pressed='true'] .eq i:nth-child(4) {
    animation-delay: -0.9s;
  }

  .stage:not([hidden]) {
    animation: fade-up 0.5s var(--ease);
  }

  .js .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition:
      opacity 0.8s ease,
      transform 0.8s var(--ease);
  }

  .js .reveal.is-visible {
    opacity: 1;
    transform: none;
  }

  @keyframes float {
    50% {
      transform: translateY(-10px);
    }
  }

  @keyframes ping {
    0% {
      opacity: 0.7;
      transform: scale(1);
    }
    100% {
      opacity: 0;
      transform: scale(1.26);
    }
  }

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

  @keyframes eq {
    50% {
      transform: scaleY(1);
    }
  }

  @keyframes fade-up {
    from {
      opacity: 0;
      transform: translateY(14px);
    }
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 2px solid var(--ink);
    box-shadow: 0 12px 24px rgba(43, 26, 22, 0.15);
    padding: 0 clamp(20px, 5vw, 48px);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition:
      max-height 0.35s var(--ease),
      opacity 0.25s var(--ease),
      padding 0.35s var(--ease);
  }

  .nav.is-open {
    max-height: 300px;
    opacity: 1;
    pointer-events: auto;
    padding-block: 16px 24px;
  }

  .nav-link {
    display: block;
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    font-size: 1.15rem;
    font-weight: 600;
  }

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

  .stage {
    grid-template-columns: 180px 1fr;
  }
}

@media (max-width: 720px) {
  :root {
    --header-offset: 104px;
  }

  .site-header {
    --logo-size: 76px;
  }

  .site-header.is-scrolled {
    --logo-size: 60px;
  }

  .objectives,
  .category-grid,
  .contact-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .category {
    flex-direction: row;
  }

  .category-title {
    font-size: 1.6rem;
  }

  .category-body {
    justify-content: center;
    padding: 14px 16px;
  }

  .category-media {
    flex: 0 0 38%;
    align-self: flex-start;
    margin: 14px 0 14px 14px;
  }

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

  .stage-media {
    display: none;
  }

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

  .footer-grid > div:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .form,
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

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

/* ---------- Background music button ---------- */
.music-toggle {
  position: fixed;
  bottom: calc(16px + env(safe-area-inset-bottom));
  left: calc(16px + env(safe-area-inset-left));
  z-index: 55;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(43, 26, 22, 0.2);
  transition:
    transform 0.25s var(--ease),
    background-color 0.25s,
    color 0.25s;
}

.music-toggle:hover {
  transform: translateY(-2px);
}

.music-toggle .ic {
  width: 22px;
  height: 22px;
}

.music-toggle[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

/* ---------- Gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: clamp(10px, 2vw, 20px);
  margin-top: clamp(24px, 4vw, 40px);
}

.tile {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition:
    transform 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}

.tile:hover {
  transform: translate(-3px, -3px);
  box-shadow: 5px 5px 0 var(--ink);
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.tile:hover img {
  transform: scale(1.05);
}

.tile-video {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: var(--ink);
  color: var(--accent-ink);
}

.tile-video .ic {
  width: 44px;
  height: 44px;
}

.tile-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(43, 26, 22, 0.78);
  color: #fff;
}

.tile-badge .ic {
  width: 16px;
  height: 16px;
}

.tile-label {
  position: absolute;
  inset: auto 0 0;
  padding: 26px 12px 10px;
  background: linear-gradient(transparent, rgba(43, 26, 22, 0.82));
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
}

.gallery-empty {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin-top: clamp(24px, 4vw, 40px);
  padding: clamp(32px, 6vw, 64px) 20px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.gallery-empty .logo {
  --d: 88px;
}

.gallery-empty p {
  max-width: 44ch;
}

/* Lightbox: a small centred popup (native <dialog>) */
.lightbox {
  position: fixed;
  width: min(92vw, 780px);
  max-width: none;
  height: fit-content;
  max-height: 90dvh;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  background: #1e0e0e;
  color: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.lightbox::backdrop {
  background: rgba(30, 14, 14, 0.72);
}

.lb-stage {
  display: grid;
  place-items: center;
  padding: 18px 18px 6px;
}

.lb-stage img,
.lb-stage video {
  max-width: 100%;
  max-height: min(64vh, 560px);
  object-fit: contain;
  border-radius: var(--radius);
}

.lb-caption {
  min-height: 12px;
  padding: 6px 20px 18px;
  text-align: center;
}

.lb-caption strong {
  display: block;
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 400;
}

.lb-caption span {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.92rem;
}

.lb-btn {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s;
}

.lb-btn:hover {
  background: var(--accent);
}

.lb-btn:focus-visible {
  outline-color: #fff;
}

.lb-close {
  top: 10px;
  right: 10px;
}

.lb-prev,
.lb-next {
  top: 42%;
  transform: translateY(-50%);
}

.lb-prev {
  left: 10px;
}

.lb-next {
  right: 10px;
}

.lb-btn .ic {
  width: 20px;
  height: 20px;
}

/* ---------- Form additions ---------- */
.form-status {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.form-status[role='alert'] {
  color: var(--error);
  font-weight: 600;
}

.stage-placeholder {
  display: grid;
  gap: 6px;
  margin: 18px 0;
  padding: 16px 18px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

/* ---------- Sending spinner and success animation ---------- */
.btn.is-busy .ic {
  display: none;
}

.btn.is-busy::before {
  content: '';
  width: 1.1em;
  height: 1.1em;
  border: 2px solid rgba(244, 236, 216, 0.35);
  border-top-color: var(--gold);
  border-right-color: var(--accent-ink);
  border-radius: 50%;
}

.success-mark {
  position: relative;
}

.success-mark::after {
  content: '';
  position: absolute;
  inset: -7px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .btn.is-busy::before {
    animation: kva-spin 0.8s linear infinite;
  }

  .success:not([hidden]) .success-mark {
    animation: kva-pop 0.6s var(--ease) both;
  }

  .success:not([hidden]) .success-mark::after {
    animation: kva-ring 1.2s var(--ease) 0.25s 2;
  }

  .success:not([hidden]) .success-mark path {
    stroke-dasharray: 24;
    stroke-dashoffset: 24;
    animation: kva-draw 0.5s ease-out 0.35s forwards;
  }

  .success:not([hidden]) h3,
  .success:not([hidden]) p,
  .success:not([hidden]) .btn {
    animation: kva-rise 0.6s var(--ease) both;
  }

  .success:not([hidden]) h3 {
    animation-delay: 0.45s;
  }

  .success:not([hidden]) p {
    animation-delay: 0.6s;
  }

  .success:not([hidden]) .btn {
    animation-delay: 0.8s;
  }
}

@keyframes kva-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes kva-pop {
  0% {
    transform: scale(0.4);
    opacity: 0;
  }
  70% {
    transform: scale(1.1);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

@keyframes kva-ring {
  0% {
    transform: scale(0.9);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

@keyframes kva-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes kva-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Screen-reader-only text ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
