/* ХОРО — Bulgarian music study companion
   Art direction: shevitsa (Bulgarian embroidery) — linen cream ground,
   deep madder red, ink black, ochre gold. Stitched borders, woven bands. */

:root {
  --linen: #f5edda;
  --linen-deep: #ede1c4;
  --ink: #221a14;
  --red: #9e2b25;
  --red-bright: #c0392b;
  --gold: #c8912f;
  --green: #3e5d3a;
  --stitch: rgba(34, 26, 20, 0.55);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Archivo", -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  font-family: var(--sans);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(200,145,47,0.06), transparent 55%),
    var(--linen);
  color: var(--ink);
  line-height: 1.65;
  font-size: 17px;
}

.mono { font-family: var(--mono); }
em { font-family: var(--serif); font-size: 1.08em; }

/* ---------- embroidery band ---------- */
.embroidery-band {
  height: 34px;
  background-color: var(--red);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='68' height='34' viewBox='0 0 68 34'%3E%3Crect width='68' height='34' fill='%239e2b25'/%3E%3Cpath d='M17 3 L31 17 L17 31 L3 17 Z' fill='%23f5edda'/%3E%3Cpath d='M17 9 L25 17 L17 25 L9 17 Z' fill='%23221a14'/%3E%3Cpath d='M17 13 L21 17 L17 21 L13 17 Z' fill='%23c8912f'/%3E%3Cpath d='M51 3 L65 17 L51 31 L37 17 Z' fill='%23221a14'/%3E%3Cpath d='M51 9 L59 17 L51 25 L43 17 Z' fill='%23f5edda'/%3E%3Cpath d='M51 13 L55 17 L51 21 L47 17 Z' fill='%239e2b25'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 68px 34px;
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
}

/* ---------- nav ---------- */
#topnav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 28px;
  background: rgba(245, 237, 218, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--ink);
}
.brand { text-decoration: none; color: var(--ink); display: flex; align-items: baseline; gap: 10px; }
.brand-x { font-family: var(--serif); font-weight: 700; font-size: 26px; color: var(--red); letter-spacing: 2px; }
.brand-en { font-family: var(--mono); font-size: 13px; text-transform: uppercase; letter-spacing: 3px; }
.nav-links { display: flex; gap: 22px; flex-wrap: wrap; }
.nav-links a {
  text-decoration: none; color: var(--ink);
  font-size: 13.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.4px;
  border-bottom: 2px solid transparent; padding-bottom: 2px;
}
.nav-links a:hover { color: var(--red); border-bottom-color: var(--gold); }

/* ---------- hero ---------- */
.hero { text-align: center; }
.hero-inner { max-width: 880px; margin: 0 auto; padding: 72px 24px 64px; }
.hero-kicker {
  font-family: var(--mono); font-size: 13px; letter-spacing: 4px;
  text-transform: uppercase; color: var(--green); margin-bottom: 18px;
}
.hero-title {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(84px, 16vw, 176px);
  line-height: 0.95; color: var(--red);
  letter-spacing: 0.04em;
  text-shadow: 4px 4px 0 rgba(34,26,20,0.12);
}
.hero-sub {
  margin: 30px auto 0; max-width: 720px;
  font-size: 19px; line-height: 1.75;
}
.hero-ctas { margin-top: 36px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; cursor: pointer; text-decoration: none;
  font-family: var(--sans); font-weight: 700; font-size: 15px;
  letter-spacing: 0.6px;
  padding: 12px 26px; border: 2.5px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  user-select: none;
}
.btn:hover { transform: translate(-1px,-1px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-red { background: var(--red); color: var(--linen); }
.btn-dark { background: var(--ink); color: var(--linen); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn.big { font-size: 17px; padding: 14px 34px; }
.btn.is-on { background: var(--green); color: var(--linen); }

/* ---------- sections ---------- */
.section { padding: 72px 24px 80px; }
.section.alt { background: var(--linen-deep); }
.section-head { max-width: 860px; margin: 0 auto 44px; text-align: center; }
.section-num {
  display: inline-block; font-family: var(--serif); font-weight: 700; font-size: 22px;
  color: var(--linen); background: var(--red);
  width: 46px; height: 46px; line-height: 46px; border-radius: 50%;
  border: 2.5px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  margin-bottom: 18px;
}
.section-head h2 {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(32px, 5vw, 48px); line-height: 1.15;
  margin-bottom: 18px;
}
.section-lede { font-size: 17.5px; text-align: left; }

/* ---------- cards ---------- */
.card {
  background: var(--linen);
  border: 2.5px solid var(--ink);
  box-shadow: 6px 6px 0 rgba(34,26,20,0.9);
  padding: 28px;
  position: relative;
}
.card::after {
  content: ""; position: absolute; inset: 6px;
  border: 1.5px dashed var(--stitch);
  pointer-events: none;
}
.card > * { position: relative; z-index: 1; }
.card h3 { font-family: var(--serif); font-size: 27px; font-weight: 700; margin-bottom: 10px; }

/* ---------- rhythm section ---------- */
.dance-chips {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  max-width: 900px; margin: 0 auto 34px;
}
.chip {
  cursor: pointer; font-family: var(--mono); font-size: 13.5px; font-weight: 600;
  padding: 8px 16px; background: var(--linen); border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.1s ease;
}
.chip:hover { transform: translate(-1px,-1px); }
.chip.active { background: var(--red); color: var(--linen); }
.chip small { opacity: 0.75; font-weight: 400; }
.chip.active small { opacity: 0.9; }

.metro-panel { max-width: 900px; margin: 0 auto; }
.metro-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.dance-meta { font-family: var(--mono); font-size: 13px; color: var(--green); letter-spacing: 0.5px; }
.metro-formula { text-align: right; }
.formula { display: block; font-size: 34px; font-weight: 600; color: var(--red); line-height: 1.1; }
.formula-words { font-family: var(--serif); font-style: italic; font-size: 17px; }

.beat-row { display: flex; gap: 14px; align-items: stretch; margin: 8px 0 20px; min-height: 92px; }
.beat-group { display: flex; flex-direction: column; gap: 6px; flex-grow: 0; }
.beat-cells { display: flex; gap: 4px; height: 64px; }
.beat-cell {
  border: 2px solid var(--ink); background: var(--linen-deep);
  width: 34px; transition: background 0.05s linear, transform 0.05s linear;
}
.beat-cell.group-start { background: var(--red); }
.beat-cell.lit { background: var(--gold) !important; transform: scale(1.08); }
.beat-group-label { text-align: center; font-family: var(--mono); font-size: 14px; font-weight: 600; }
.beat-group-word { text-align: center; font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--green); }

.dance-desc { font-size: 16px; margin-bottom: 20px; }
.metro-controls { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.slider-label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; flex: 1; min-width: 260px; }
input[type="range"] { accent-color: var(--red); height: 28px; }
.check-label { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; cursor: pointer; }
input[type="checkbox"] { accent-color: var(--red); width: 17px; height: 17px; }

.teach-note {
  max-width: 860px; margin: 40px auto 0;
  background: rgba(200,145,47,0.13);
  border: 2px solid var(--ink);
  outline: 1.5px dashed var(--gold);
  outline-offset: -7px;
  padding: 20px 24px; font-size: 15.5px;
}

/* ---------- voice section ---------- */
.two-col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 34px;
  max-width: 1000px; margin: 0 auto;
}
.lab-card p { font-size: 15.5px; margin-bottom: 16px; }
.interval-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.ibtn {
  cursor: pointer; font-family: var(--mono); font-size: 15px; font-weight: 600;
  padding: 10px 14px; border: 2px solid var(--ink); background: var(--linen-deep);
  box-shadow: 3px 3px 0 var(--ink); min-width: 62px; text-align: center;
}
.ibtn small { display: block; font-size: 10.5px; font-weight: 400; letter-spacing: 0.3px; }
.ibtn.active { background: var(--gold); }
.ibtn:disabled { opacity: 0.45; cursor: not-allowed; }
.lab-hint { font-style: italic; font-family: var(--serif); font-size: 16px; margin-top: 16px; color: var(--green); }
.demo-controls { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.melody-notes { margin-top: 18px; font-size: 15px; letter-spacing: 1px; line-height: 2; }
.melody-notes .note-chip {
  display: inline-block; padding: 2px 8px; margin: 2px;
  border: 1.5px solid var(--ink); background: var(--linen-deep);
}
.melody-notes .note-chip.lit { background: var(--gold); }
.melody-notes .bar-sep { color: var(--red); font-weight: 600; margin: 0 6px; }

/* ---------- melody section ---------- */
.modes-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px; max-width: 1100px; margin: 0 auto;
}
.mode-card .note-strip { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.mode-note {
  font-family: var(--mono); font-size: 15px; font-weight: 600;
  border: 2px solid var(--ink); background: var(--linen-deep);
  padding: 7px 0; width: 44px; text-align: center;
}
.mode-note.lit { background: var(--gold); }
.mode-note.feature { background: var(--red); color: var(--linen); }
.mode-note.feature.lit { background: var(--gold); color: var(--ink); }
.mode-card p { font-size: 15px; margin-bottom: 14px; }
.mode-tag { font-family: var(--mono); font-size: 12px; color: var(--green); letter-spacing: 1px; text-transform: uppercase; }

/* ---------- regions ---------- */
.regions-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px; max-width: 1100px; margin: 0 auto;
}
.region-card .region-cyr { font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--red); }
.region-card p { font-size: 15px; margin-top: 10px; }
.region-motif { font-size: 24px; letter-spacing: 6px; color: var(--red); margin-bottom: 6px; }
.region-chips { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.region-chips span {
  font-family: var(--mono); font-size: 12px; padding: 4px 10px;
  border: 1.5px solid var(--ink); background: var(--linen-deep);
}

/* ---------- instruments ---------- */
.inst-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px; max-width: 1100px; margin: 0 auto;
}
.inst-card .inst-cyr { font-family: var(--serif); font-style: italic; color: var(--red); font-size: 16px; }
.inst-card p { font-size: 15px; margin-top: 10px; }
.inst-drone { margin-top: 12px; font-family: var(--mono); font-size: 12px; color: var(--green); }

/* ---------- listen ---------- */
.listen-list { max-width: 860px; margin: 0 auto 44px; display: flex; flex-direction: column; gap: 20px; }
.listen-item { display: flex; gap: 20px; align-items: baseline; }
.listen-item .num {
  font-family: var(--serif); font-weight: 700; font-size: 30px; color: var(--red); min-width: 40px; text-align: right;
}
.listen-item h4 { font-size: 18px; font-weight: 700; }
.listen-item h4 a { color: var(--ink); text-decoration-color: var(--gold); text-underline-offset: 3px; }
.listen-item h4 a:hover { color: var(--red); }
.listen-item p { font-size: 15px; }
.path-card { max-width: 860px; margin: 0 auto; }
.path-list { margin: 14px 0 0 22px; display: flex; flex-direction: column; gap: 14px; font-size: 15.5px; }

/* ---------- field-recording sample players ---------- */
.sample-block { max-width: 860px; margin: 34px auto 0; display: flex; flex-direction: column; gap: 18px; }
.sample-block-title {
  font-family: var(--serif); font-weight: 700; font-size: 25px; text-align: center;
  margin-bottom: 2px;
}
.splayer {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--linen);
  border: 2.5px solid var(--ink);
  box-shadow: 5px 5px 0 rgba(34,26,20,0.85);
  padding: 16px 18px;
}
.section.alt .splayer { background: var(--linen); }
.splayer.compact { margin-top: 16px; padding: 12px 14px; box-shadow: 3px 3px 0 rgba(34,26,20,0.85); }
.sp-btn {
  cursor: pointer; flex-shrink: 0;
  width: 46px; height: 46px; border-radius: 50%;
  border: 2.5px solid var(--ink); background: var(--red); color: var(--linen);
  font-size: 15px; font-weight: 700; line-height: 1;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.1s ease;
}
.sp-btn:hover { transform: translate(-1px,-1px); }
.sp-btn:active { transform: translate(1px,1px); box-shadow: 1px 1px 0 var(--ink); }
.sp-btn.is-on { background: var(--green); }
.splayer.compact .sp-btn { width: 38px; height: 38px; font-size: 13px; }
.sp-body { flex: 1; min-width: 0; }
.sp-title { font-weight: 700; font-size: 15.5px; line-height: 1.4; }
.splayer.compact .sp-title { font-size: 13.5px; }
.sp-note { font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--green); margin-top: 3px; }
.sp-track {
  margin-top: 10px; height: 10px; cursor: pointer;
  background: var(--linen-deep); border: 1.5px solid var(--ink);
}
.sp-prog {
  height: 100%; width: 100%; background: var(--gold);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.2s linear;
}
.sp-credit { margin-top: 8px; font-family: var(--mono); font-size: 11px; }
.sp-credit a { color: rgba(34,26,20,0.65); text-decoration: none; border-bottom: 1px dotted rgba(34,26,20,0.4); }
.sp-credit a:hover { color: var(--red); }

/* ---------- footer ---------- */
footer { background: var(--linen); }
.footer-inner { text-align: center; padding: 52px 24px 60px; }
.footer-logo { height: 74px; margin-bottom: 20px; }
.footer-credit { font-family: var(--serif); font-size: 19px; }
.footer-fine { margin-top: 10px; font-size: 13.5px; color: rgba(34,26,20,0.75); }
.footer-fine a { color: var(--red); }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .nav-links { display: none; }
}
@media (max-width: 760px) {
  .two-col { grid-template-columns: 1fr; }
  .beat-row { overflow-x: auto; padding-bottom: 8px; }
  .beat-cell { width: 24px; }
  .metro-formula { text-align: left; }
  .listen-item { flex-direction: column; gap: 4px; }
  .listen-item .num { text-align: left; }
}
