/* ==================================================================
   Flute Festival Singapore
   World: the festival's own concert programme — ivory paper,
   powder-blue bands (sampled from the 2013/2014/2019 posters),
   charcoal ink, slate-blue rules, dotted-leader tables of contents.
   ================================================================== */

:root {
  --paper: #bdd8e6;        /* the festival's powder-blue band */
  --paper-deep: #a5c4d6;
  --paper-pale: #f7f6f2;   /* ivory programme paper */
  --white: #ffffff;
  --carmine: #1f4e68;      /* deep slate blue — rules & stamps */
  --carmine-deep: #163a4e;
  --ink: #23272c;          /* charcoal ink */
  --ink-soft: #33505f;     /* secondary on powder blue — tinted, never gray */
  --ink-soft-pale: #5a6672; /* secondary on ivory */
  --stage: #22272c;        /* the dark closing section */
  --stage-text: #ccdae4;
  --rule: #1f4e68;
  --didone: "Jost", "Century Gothic", "Futura", "Segoe UI", sans-serif;
  --grot: "Jost", "Century Gothic", "Futura", "Segoe UI", sans-serif;
  --script: "Great Vibes", "Segoe Script", cursive;
  --maxw: 1120px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scrollbar-color: var(--carmine) var(--paper-pale); }

body {
  background: var(--paper-pale);
  color: var(--ink);
  font-family: var(--grot);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.65;
  caret-color: var(--carmine);
}

::selection { background: var(--carmine); color: var(--paper-pale); }

::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: var(--paper-pale); }
::-webkit-scrollbar-thumb { background: var(--carmine); border: 3px solid var(--paper-pale); border-radius: 6px; }

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

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

a { color: var(--carmine); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; transition: color .18s; }
a:hover { color: var(--carmine-deep); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* ---------- The double rule — the house ornament ---------- */
.dbl-rule { border: 0; border-top: 3px solid var(--rule); position: relative; margin: 0; }
.dbl-rule::after { content: ""; position: absolute; left: 0; right: 0; top: 4px; border-top: 1px solid var(--rule); }

/* ---------- Navigation: the spine ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  border-bottom: 3px double var(--ink);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 12px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
}
.brand { display: flex; flex-direction: column; line-height: 1.1; text-decoration: none; }
.brand .b1 {
  font-family: var(--didone); font-size: 1.22rem; font-weight: 500;
  color: var(--ink); letter-spacing: 0.02em; white-space: nowrap;
}
.brand .b2 {
  font-family: var(--grot); font-size: 0.6rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.24em;
  color: var(--carmine); white-space: nowrap; margin-top: 2px;
}
.nav-links { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.nav-links a {
  font-size: 0.74rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink); text-decoration: none; padding: 6px 10px;
}
.nav-links a:hover { color: var(--carmine-deep); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; }
.nav-links a.active { color: var(--carmine); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; text-decoration-color: var(--carmine); }
.nav-toggle {
  display: none; background: none; border: 2px solid var(--ink);
  color: var(--ink); font-size: 1.15rem; padding: 3px 12px; cursor: pointer; font-family: var(--grot);
}
.nav-toggle:hover { background: var(--ink); color: var(--paper); }

/* ---------- Hero: the cover ---------- */
.hero {
  background: var(--paper);
  color: var(--ink);
  position: relative;
  border-bottom: 3px double var(--ink);
}
.hero-frame {
  max-width: calc(var(--maxw) + 40px); margin: 0 auto; padding: 30px 28px 44px;
}
.hero-plate {
  border: 3px solid var(--carmine); position: relative;
  padding: clamp(36px, 6vw, 76px) clamp(22px, 5vw, 64px);
  text-align: center;
}
.hero-plate::before {
  content: ""; position: absolute; inset: 7px;
  border: 1px solid var(--carmine); pointer-events: none;
}
.masthead-over {
  font-family: var(--grot); font-weight: 500; font-size: 0.72rem;
  letter-spacing: 0.34em; text-transform: uppercase; color: var(--carmine);
}
h1 {
  font-family: var(--didone); font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 4.6rem); line-height: 1.06;
  letter-spacing: 0.02em; margin: 16px 0 0; color: var(--ink);
  text-wrap: balance;
}
.hero-sub {
  font-family: var(--didone); font-style: italic; font-weight: 300;
  font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--ink-soft);
  max-width: 56ch; margin: 22px auto 0; line-height: 1.5;
}
.hero-actions { margin-top: 34px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* the drawn staff — the page's one authored motion */
.staff { width: min(360px, 70%); margin: 26px auto 0; display: block; overflow: visible; }
.staff path, .staff line {
  stroke: var(--ink); stroke-width: 1.5; fill: none;
  stroke-dasharray: 400; stroke-dashoffset: 400;
  animation: draw 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.staff .breath { stroke: var(--carmine); stroke-width: 2.2; animation-delay: .9s; }
.staff line:nth-child(2) { animation-delay: .08s; }
.staff line:nth-child(3) { animation-delay: .16s; }
.staff line:nth-child(4) { animation-delay: .24s; }
.staff line:nth-child(5) { animation-delay: .32s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .staff path, .staff line { animation: none; stroke-dashoffset: 0; }
}

/* ---------- Buttons: the stamp ---------- */
.btn {
  display: inline-block; padding: 12px 26px;
  border: 2px solid var(--carmine); color: var(--carmine);
  font-family: var(--grot); font-size: 0.76rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.14em; text-decoration: none;
  background: transparent; cursor: pointer;
  transition: background .18s, color .18s, box-shadow .18s, transform .18s;
}
.btn:hover { background: var(--carmine); color: var(--paper-pale); box-shadow: 2px 3px 0 rgba(35,39,44,.30); transform: translateY(-1px); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn.solid { background: var(--carmine); color: var(--paper-pale); }
.btn.solid:hover { background: var(--carmine-deep); color: var(--white); }
.btn.ghost { border-color: var(--ink); color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }

/* ---------- Sections: inner pages ---------- */
section { padding: 78px 0; }
section.tint { background: var(--paper); border-top: 3px double var(--ink); border-bottom: 3px double var(--ink); }
section.tint .sec-head p, section.tint .prose-note { color: var(--ink-soft); }

.sec-head { margin-bottom: 46px; max-width: 720px; }
.sec-head h2 {
  font-family: var(--didone); font-weight: 400; letter-spacing: 0.015em;
  font-size: clamp(1.8rem, 3.6vw, 2.7rem); line-height: 1.12;
  color: var(--ink); text-wrap: balance;
}
.sec-head .rule { margin-top: 18px; border: 0; border-top: 3px solid var(--rule); width: 84px; position: relative; }
.sec-head .rule::after { content: ""; position: absolute; left: 0; width: 84px; top: 4px; border-top: 1px solid var(--rule); }
.sec-head p { margin-top: 16px; color: var(--ink-soft-pale); font-size: 1.02rem; max-width: 62ch; }

.lead { font-family: var(--didone); font-size: 1.16rem; line-height: 1.6; font-weight: 400; }
.prose { max-width: 66ch; }
.prose p + p { margin-top: 1em; }
.prose-note { font-size: 0.88rem; color: var(--ink-soft-pale); }

.center { text-align: center; }

/* ---------- Grids ---------- */
.grid { display: grid; gap: 30px; }
.grid.g2 { grid-template-columns: 1fr 1fr; }
.grid.g3 { grid-template-columns: repeat(3, 1fr); }
.grid.g4 { grid-template-columns: repeat(4, 1fr); }
.split { display: grid; grid-template-columns: 5fr 7fr; gap: 48px; align-items: start; }
.split.rev { grid-template-columns: 7fr 5fr; }

/* ---------- Programme list: rows with dotted leaders ---------- */
.programme { border-top: 3px solid var(--rule); }
.prog-row {
  display: grid; grid-template-columns: 1fr auto; gap: 8px 28px; align-items: baseline;
  padding: 26px 0; border-bottom: 1px solid color-mix(in srgb, var(--ink) 22%, transparent);
}
.prog-row .t {
  grid-column: 1; grid-row: 1;
  font-family: var(--didone); font-weight: 500; font-size: 1.35rem; line-height: 1.25; letter-spacing: 0.01em;
}
.prog-row .d { grid-column: 1; grid-row: 2; font-size: 0.95rem; color: var(--ink-soft-pale); max-width: 58ch; }
.prog-row .a { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.prog-row:not(:has(.d)) .a { grid-row: 1; }
.leader { flex: 1; border-bottom: 2px dotted color-mix(in srgb, var(--ink) 45%, transparent); transform: translateY(-4px); }
.toc-line { display: flex; align-items: baseline; gap: 10px; }

/* ---------- Poster frames: mounted plates ---------- */
.poster-frame {
  display: block; background: var(--white); border: 1px solid color-mix(in srgb, var(--ink) 35%, transparent);
  padding: 10px; box-shadow: 3px 4px 0 color-mix(in srgb, var(--ink) 18%, transparent);
  transition: transform .2s, box-shadow .2s;
}
a.poster-frame:hover { transform: translate(-2px, -2px); box-shadow: 6px 8px 0 color-mix(in srgb, var(--carmine) 45%, transparent); }
.poster-frame img { width: 100%; aspect-ratio: 707/1000; object-fit: cover; }
.poster-frame.wide img { aspect-ratio: 3/2; }
.poster-frame.land img { object-fit: contain; background: var(--white); }
.carousel .slide img { background: var(--white); }
.poster-cap { margin-top: 12px; }
.poster-cap .t { font-family: var(--didone); font-weight: 500; font-size: 1.05rem; line-height: 1.3; }
.poster-cap .d { font-size: 0.78rem; letter-spacing: 0.04em; color: var(--ink-soft-pale); margin-top: 2px; }
.poster-cap .links { margin-top: 6px; font-size: 0.8rem; font-weight: 500; }
.poster-cap .links a { margin-right: 12px; }

/* ---------- Carousel ---------- */
.carousel { position: relative; width: min(430px, 82vw); aspect-ratio: 707/1000; margin: 0 auto; }
.carousel.wide { width: min(740px, 90vw); aspect-ratio: 3/2; }
.carousel .slide {
  position: absolute; inset: 0; opacity: 0; transition: opacity 1s ease;
  background: var(--white); border: 1px solid color-mix(in srgb, var(--ink) 35%, transparent);
  padding: 10px; box-shadow: 3px 4px 0 color-mix(in srgb, var(--ink) 18%, transparent);
}
.carousel .slide.on { opacity: 1; }
.carousel .slide img { width: 100%; height: 100%; object-fit: contain; }
.carousel.wide .slide img { object-fit: cover; }
.carousel-dots { display: flex; gap: 9px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.carousel-dots button {
  width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--ink);
  background: transparent; cursor: pointer; padding: 0; transition: background .15s;
}
.carousel-dots button:hover { background: var(--paper-deep); }
.carousel-dots button.on { background: var(--carmine); border-color: var(--carmine); }

/* ---------- Quote: the engraved epigraph ---------- */
.quote { margin: 30px 0; max-width: 60ch; }
.quote p {
  font-family: var(--didone); font-style: italic; font-weight: 300;
  font-size: 1.28rem; line-height: 1.55; color: var(--ink);
}
.quote p::before { content: "“"; color: var(--carmine); font-size: 1.6em; line-height: 0; vertical-align: -0.32em; margin-right: 2px; }
.quote cite {
  display: block; margin-top: 12px; font-style: normal; font-family: var(--grot);
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.18em; color: var(--carmine);
}

/* ---------- Notice plate (coming soon etc.) ---------- */
.plate {
  border: 3px solid var(--carmine); position: relative; padding: 44px clamp(24px, 5vw, 60px);
  text-align: center; background: var(--white);
}
.plate::before { content: ""; position: absolute; inset: 6px; border: 1px solid var(--carmine); pointer-events: none; }
.stamp {
  display: inline-block; font-family: var(--grot); font-weight: 600; font-size: 0.72rem;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--carmine);
  border: 2px solid var(--carmine); padding: 5px 14px; transform: rotate(-2deg);
  margin-bottom: 20px;
}

/* ---------- Cards → entries ---------- */
.card { border-top: 3px solid var(--rule); padding: 24px 0 8px; background: transparent; }
.card h3 { font-family: var(--didone); font-weight: 500; font-size: 1.4rem; margin-bottom: 8px; }
.card p { font-size: 0.95rem; color: var(--ink-soft-pale); }
section.tint .card p { color: var(--ink-soft); }

/* ---------- Video ---------- */
.video-frame {
  position: relative; aspect-ratio: 16/9; background: var(--stage);
  border: 1px solid var(--ink); box-shadow: 4px 5px 0 color-mix(in srgb, var(--ink) 20%, transparent);
  overflow: hidden; color: var(--stage-text);
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Footer: table des matières ---------- */
footer { background: var(--stage); color: var(--stage-text); padding: 70px 0 36px; }
footer a { color: var(--stage-text); text-decoration-color: color-mix(in srgb, var(--paper) 50%, transparent); }
footer a:hover { color: var(--paper); }
.foot-head {
  font-family: var(--didone); font-weight: 500; font-size: 1.5rem; letter-spacing: 0.02em; color: var(--paper);
  margin-bottom: 6px;
}
.foot-sub { font-size: 0.8rem; color: color-mix(in srgb, var(--stage-text) 75%, var(--stage)); max-width: 46ch; }
.sitemap { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 44px; margin: 40px 0 48px; }
.sitemap h4 {
  font-family: var(--grot); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.26em;
  text-transform: uppercase; color: var(--paper); margin-bottom: 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--paper) 35%, transparent); padding-bottom: 8px;
}
.sitemap ul { list-style: none; }
.sitemap li { display: flex; align-items: baseline; gap: 8px; margin-bottom: 9px; font-size: 0.9rem; }
.sitemap li .leader { border-bottom-color: color-mix(in srgb, var(--stage-text) 30%, transparent); }
.sitemap li .pg { font-family: var(--didone); font-style: italic; color: color-mix(in srgb, var(--stage-text) 70%, var(--stage)); font-size: 0.85rem; }
.foot-note {
  border-top: 1px solid color-mix(in srgb, var(--paper) 25%, transparent); padding-top: 22px;
  font-size: 0.78rem; color: color-mix(in srgb, var(--stage-text) 70%, var(--stage));
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}

/* ---------- Music dock ---------- */
.music-dock {
  position: fixed; left: 18px; bottom: 18px; z-index: 60;
  display: flex; align-items: center; gap: 11px;
  background: var(--paper); border: 2px solid var(--ink);
  padding: 8px 14px 8px 8px; box-shadow: 3px 4px 0 rgba(35,39,44,.28);
}
.music-dock button {
  width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--carmine);
  background: transparent; color: var(--carmine); font-size: 0.82rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background .15s, color .15s;
}
.music-dock button:hover { background: var(--carmine); color: var(--paper); }
.music-dock .m-title { font-family: var(--didone); font-style: italic; font-size: 0.82rem; color: var(--ink); line-height: 1.2; }
.music-dock .m-sub { font-size: 0.58rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.18em; color: var(--carmine); }
.music-dock.unavailable { display: none; }

/* ---------- Forms ---------- */
.form-shell iframe { width: 100%; border: 0; min-height: 640px; background: var(--white); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .nav-links a { font-size: 0.68rem; padding: 6px 7px; }
  .brand .b1 { font-size: 1.12rem; }
}
@media (max-width: 940px) {
  .grid.g3 { grid-template-columns: 1fr 1fr; }
  .grid.g4 { grid-template-columns: 1fr 1fr; }
  .split, .split.rev { grid-template-columns: 1fr; gap: 36px; }
  .sitemap { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--paper); flex-direction: column; gap: 0; align-items: stretch;
    padding: 8px 20px 16px; border-bottom: 3px double var(--ink);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 4px; border-bottom: 1px solid color-mix(in srgb, var(--ink) 18%, transparent); font-size: 0.78rem; }
  .nav-toggle { display: block; }
  .grid.g2, .grid.g3, .grid.g4 { grid-template-columns: 1fr; }
  section { padding: 56px 0; }
  .sitemap { grid-template-columns: 1fr; gap: 30px; }
  .prog-row { grid-template-columns: 1fr; }
  .prog-row .a { grid-row: auto; margin-top: 12px; }
  .music-dock { left: 10px; bottom: 10px; }
  .hero-frame { padding: 18px 16px 30px; }
}

/* ---------- contrast tuning on ochre surfaces ---------- */
.hero .masthead-over, .tint .stamp { color: var(--carmine-deep); border-color: var(--carmine-deep); }
.brand .b2 { color: var(--carmine-deep); }
.nav-links a.active { color: var(--carmine-deep); }
.music-dock .m-sub { color: var(--carmine-deep); }
section.tint .prog-row .d { color: var(--ink-soft); }
.quote.no-mark p::before { content: none; }

/* ---------- script accent: the early-festival copperplate, used once ---------- */
.script { font-family: var(--script); font-weight: 400; font-style: normal; letter-spacing: 0.01em; }
h2 .script { font-size: 1.35em; line-height: 1; color: var(--carmine); }
