/* Bagpipe Lovers — club showcase (no framework) */
:root {
  --pine: #1a3a2a;
  --pine-deep: #0f2418;
  --moss: #2f5a40;
  --brass: #c4a35a;
  --brass-hot: #e0c070;
  --cream: #f3ecdc;
  --ink: #1c1710;
  --smoke: #6b6358;
  --mist: rgba(243, 236, 220, 0.92);
  --card: rgba(255, 250, 240, 0.9);
  --danger: #8b2e2e;
  --ok: #1f5c3a;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(15, 36, 24, 0.28);
  --font-display: "Fraunces", "Palatino Linotype", Palatino, serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
  --max: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(196, 163, 90, 0.18), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(47, 90, 64, 0.22), transparent 55%),
    linear-gradient(180deg, #efe6d2 0%, #e7dcc4 40%, #d9cfb5 100%);
  line-height: 1.55;
  min-height: 100vh;
}
img, video { max-width: 100%; height: auto; display: block; }
/* Body links only — never bleed pine onto dark chrome (header/footer) */
main a:not(.btn):not(.logo) {
  color: var(--moss);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
main a:not(.btn):not(.logo):hover { color: var(--pine-deep); }
.wrap { width: min(var(--max), calc(100% - 2rem)); margin-inline: auto; }
.skip {
  position: absolute; left: -999px; top: 0; background: var(--brass); color: var(--pine-deep);
  padding: .5rem 1rem; z-index: 100;
}
.skip:focus { left: 1rem; top: 1rem; }

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

/* Header — flex so mobile «Меню» stays a compact chip, not a stretched bar */
.top {
  position: sticky; top: 0; z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem .85rem;
  padding: .7rem 1.1rem;
  background: rgba(15, 36, 24, 0.92);
  backdrop-filter: blur(10px);
  color: var(--cream);
  border-bottom: 1px solid rgba(196, 163, 90, 0.35);
}
.logo {
  display: flex; align-items: center; gap: .65rem;
  color: var(--cream); text-decoration: none; font-weight: 700;
  min-width: 0; flex-shrink: 1;
  align-self: center;
  transition: color .15s ease;
}
.logo:hover, .logo:focus-visible {
  color: var(--brass-hot);
}
.logo:hover .logo-mark, .logo:focus-visible .logo-mark {
  border-color: var(--brass-hot);
  box-shadow: 0 0 0 3px rgba(224, 192, 112, 0.35);
  transform: scale(1.04);
}
/* Light disc on pine header — brass mark stays crisp; ring no longer “dissolves” */
.logo-mark {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--cream);
  border: 2px solid var(--brass);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  padding: 4px; object-fit: contain;
  flex-shrink: 0;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.logo-text {
  font-family: var(--font-display); letter-spacing: .02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1;
}
.nav {
  display: flex; flex-wrap: wrap; gap: .35rem .9rem;
  justify-content: center; flex: 1 1 auto;
  align-items: center; align-self: center;
}
.nav > a {
  color: rgba(243, 236, 220, 0.88); text-decoration: none; font-size: .95rem;
  display: inline-flex; align-items: center;
  height: 2.15rem;
  border: none;
  box-shadow: inset 0 -2px 0 transparent;
  line-height: 1;
  border-radius: 6px;
  padding-inline: .15rem;
  transition: color .15s ease, box-shadow .15s ease, background .15s ease;
}
.nav > a:hover, .nav > a.is-active {
  color: var(--brass-hot);
  box-shadow: inset 0 -2px 0 var(--brass);
  background: transparent;
}
.lang-switch {
  position: relative;
  z-index: 60;
  flex-shrink: 0;
  align-self: center;
}
.lang-switch-btn {
  list-style: none;
  color: var(--cream);
  background: rgba(243, 236, 220, 0.1);
  cursor: pointer;
  font: inherit;
  border: 1.5px solid rgba(196,163,90,.7);
  border-radius: 999px;
  box-sizing: border-box;
  height: 2.15rem;
  min-width: 3.6rem;
  padding: 0 .75rem 0 .6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  line-height: 1;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.lang-switch-btn::-webkit-details-marker { display: none; }
.lang-switch-btn::marker { content: ""; }
.lang-switch-btn:hover,
.lang-switch[open] .lang-switch-btn {
  background: rgba(196, 163, 90, 0.32);
  border-color: var(--brass-hot);
  color: var(--brass-hot);
}
.lang-flag-svg {
  display: block;
  width: 1.7rem;
  height: 1.15rem;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}
.lang-chevron {
  display: block;
  width: 11px;
  height: 7px;
  flex-shrink: 0;
  opacity: .9;
  transition: transform .15s ease;
}
.lang-switch[open] .lang-chevron {
  transform: rotate(180deg);
}
.lang-switch-menu {
  position: absolute;
  top: calc(100% + .45rem);
  right: 0;
  z-index: 70;
  margin: 0;
  padding: .45rem;
  list-style: none;
  min-width: 7rem;
  background: rgba(10, 24, 16, 0.98);
  border: 1px solid rgba(196, 163, 90, 0.45);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  display: none;
  gap: .25rem;
}
.lang-switch[open] .lang-switch-menu {
  display: grid;
}
.lang-option {
  color: var(--cream);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .02em;
  border-radius: 8px;
  padding: .6rem .7rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  transition: background .15s ease, color .15s ease;
}
.lang-option:hover {
  background: rgba(196, 163, 90, 0.28);
  color: var(--brass-hot);
}
.lang-option.is-active {
  background: var(--brass);
  color: var(--pine-deep);
}
.lang-option.is-active:hover {
  background: var(--brass-hot);
  color: var(--pine-deep);
}
.lang-option .lang-flag-svg {
  width: 1.55rem;
  height: 1.05rem;
}
.lang-code { line-height: 1; }
.top-actions {
  display: flex; gap: .45rem; flex-shrink: 0;
  align-items: center; align-self: center;
}
.top-actions .btn-sm {
  height: 2.15rem; padding: 0 .85rem;
  display: inline-flex; align-items: center;
}
.menu-btn {
  display: none;
  flex: 0 0 auto;
  width: 2.15rem;
  height: 2.15rem;
  align-items: center;
  justify-content: center;
  align-self: center;
  background: transparent;
  border: 1.5px solid var(--brass-hot);
  color: var(--cream);
  border-radius: 10px;
  padding: 0;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.menu-btn-bars {
  display: grid;
  gap: 4px;
  width: 1rem;
}
.menu-btn-bars span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .2s ease, opacity .2s ease;
  transform-origin: center;
}
.menu-btn:hover {
  background: rgba(196, 163, 90, 0.28);
  color: #fff6d8;
  border-color: #f5e2a8;
}
.menu-btn[aria-expanded="true"] {
  background: var(--brass);
  color: var(--pine-deep);
  border-color: var(--brass);
}
.menu-btn[aria-expanded="true"] .menu-btn-bars span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.menu-btn[aria-expanded="true"] .menu-btn-bars span:nth-child(2) {
  opacity: 0;
}
.menu-btn[aria-expanded="true"] .menu-btn-bars span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .4rem; border: 1px solid transparent; border-radius: 999px; cursor: pointer;
  background: linear-gradient(135deg, var(--brass-hot), var(--brass));
  color: var(--pine-deep); font-weight: 700; text-decoration: none;
  padding: .7rem 1.25rem; box-shadow: 0 8px 20px rgba(0,0,0,.18);
  transition: background .15s ease, color .15s ease, border-color .15s ease,
    box-shadow .15s ease, transform .15s ease;
}
.btn:hover {
  background: linear-gradient(135deg, #f0d48a, var(--brass-hot));
  color: var(--pine-deep);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }
.btn-ghost {
  background: rgba(243, 236, 220, 0.12);
  color: #fff8e8;
  border: 1.5px solid var(--brass-hot);
  box-shadow: none;
}
.btn-ghost:hover {
  background: rgba(224, 192, 112, 0.38);
  color: #fff;
  border-color: #f5e2a8;
  box-shadow: 0 0 0 1px rgba(245, 226, 168, 0.35);
  transform: none;
}
.btn-ghost.dark {
  color: var(--pine-deep);
  border-color: var(--moss);
  background: rgba(255, 252, 246, 0.65);
}
.btn-ghost.dark:hover {
  background: var(--pine);
  color: var(--cream);
  border-color: var(--pine);
}
.btn-sm { padding: .4rem .85rem; font-size: .88rem; }

/* Hero */
.hero {
  position: relative; min-height: min(92vh, 760px);
  display: grid; align-items: end; color: var(--cream); overflow: hidden;
}
.hero-media {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transform: scale(1.04);
  animation: heroDrift 18s ease-in-out infinite alternate;
}
.hero-veil {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(15,36,24,.35) 0%, rgba(15,36,24,.55) 45%, rgba(15,36,24,.88) 100%),
    radial-gradient(circle at 70% 20%, rgba(196,163,90,.25), transparent 45%);
}
.hero-copy {
  position: relative; z-index: 2;
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto 3.5rem;
  animation: rise .9s ease both;
}
.brand-eyebrow {
  font-size: .85rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--brass-hot); margin: 0 0 .6rem;
}
.hero h1 {
  font-family: var(--font-display); font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.05; margin: 0 0 .8rem; max-width: 14ch;
}
.lead { font-size: clamp(1.05rem, 2vw, 1.3rem); max-width: 42ch; color: rgba(243,236,220,.92); }
.cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.4rem; align-items: center; }
.cta .link {
  color: var(--brass-hot);
  text-decoration: none;
  font-weight: 700;
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.cta .link:hover {
  color: #f5e2a8;
  border-bottom-color: #f5e2a8;
}

@keyframes heroDrift { from { transform: scale(1.04) translateY(0); } to { transform: scale(1.1) translateY(-2%); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.section { padding: 4rem 0; }
.section h2 {
  font-family: var(--font-display); font-size: clamp(1.7rem, 3vw, 2.4rem);
  margin: 0 0 .6rem; color: var(--pine-deep);
}
.section-lead { color: var(--smoke); max-width: 58ch; margin: 0 0 1.5rem; font-size: 1.08rem; }
.grid-2 { display: grid; gap: 1.5rem; grid-template-columns: 1.1fr .9fr; align-items: center; }
.grid-3 { display: grid; gap: 1.1rem; grid-template-columns: repeat(3, 1fr); }
.grid-4 { display: grid; gap: 1rem; grid-template-columns: repeat(4, 1fr); }
.grid-gallery { display: grid; gap: .8rem; grid-template-columns: repeat(4, 1fr); }

.photo-frame {
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  background: #111; position: relative;
}
.photo-frame img, .photo-frame video { width: 100%; height: 100%; object-fit: cover; }
.photo-real { aspect-ratio: 4/3; }
.member-photo { aspect-ratio: 1; }
.chapter-photo { aspect-ratio: 5/4; }

.chapter-card, .member-card, .event-card, .panel {
  background: var(--card); border: 1px solid rgba(26,58,42,.12);
  border-radius: calc(var(--radius) + 2px); padding: 1rem;
  box-shadow: 0 10px 30px rgba(26,58,42,.08);
  transition: transform .25s ease, box-shadow .25s ease;
}
.chapter-card:hover, .member-card:hover, .event-card:hover {
  transform: translateY(-4px); box-shadow: var(--shadow);
}
.chapter-card h3, .member-card h3, .event-card h3 {
  font-family: var(--font-display); margin: .75rem 0 .25rem; color: var(--pine);
}
.muted { color: var(--smoke); font-size: .92rem; }
.credit { font-size: .8rem; margin-top: .45rem; }

.media-player, .media-video {
  width: 100%; border-radius: var(--radius); background: #111;
  box-shadow: var(--shadow);
}
.media-video { aspect-ratio: 16/9; }
.embed {
  position: relative; aspect-ratio: 16/9; border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); background: #000;
}
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.story-strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr);
  gap: .8rem; overflow-x: auto; padding-bottom: .5rem; scroll-snap-type: x mandatory;
}
.story-strip .photo-frame { scroll-snap-align: start; min-height: 180px; }

.quirk {
  display: inline-block; background: rgba(196,163,90,.2); color: var(--pine);
  border-radius: 999px; padding: .25rem .7rem; font-size: .85rem; font-weight: 700;
  margin-bottom: .8rem;
}

/* Forms */
.section-form { padding-top: 2.5rem; }
.form-shell {
  display: grid; gap: 1.75rem; grid-template-columns: minmax(0, 28rem) minmax(0, 1fr);
  align-items: start;
}
.form-panel { min-width: 0; }
.form-panel h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  margin: 0 0 .5rem;
  color: var(--pine-deep);
}
.form-visual { min-height: 280px; position: sticky; top: 5.5rem; }

.form {
  display: grid; gap: 1rem;
  background: #fffcf6;
  padding: 1.35rem 1.35rem 1.5rem;
  border-radius: 18px;
  border: 1px solid rgba(26,58,42,.12);
  box-shadow: 0 14px 40px rgba(26,58,42,.08);
  max-width: 28rem;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem;
}
.field { display: grid; gap: .4rem; min-width: 0; }
.field label {
  font-weight: 700; font-size: .86rem;
  letter-spacing: .01em; color: var(--pine-deep);
}
.field input, .select-wrap select {
  font: inherit; width: 100%;
  padding: .78rem .9rem; border-radius: 12px;
  border: 1.5px solid rgba(26,58,42,.22);
  background: #fff;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input::placeholder { color: #9a9184; }
.field input:hover, .select-wrap select:hover {
  border-color: rgba(26,58,42,.4);
}
.field input:focus, .select-wrap select:focus {
  outline: none;
  border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(196,163,90,.28);
}
.field.is-invalid input,
.field.is-invalid .select-wrap select,
.field.is-invalid .phone-box {
  border-color: #c45a5a;
  box-shadow: 0 0 0 3px rgba(196,90,90,.15);
}
.field.is-valid input,
.field.is-valid .select-wrap select,
.field.is-valid .phone-box {
  border-color: #3d8f5f;
}
.field-error {
  margin: 0; font-size: .82rem; color: var(--danger); font-weight: 600;
}
.field-hint {
  margin: 0; font-size: .8rem; color: var(--smoke);
}
.field-hint-block {
  margin: -.35rem 0 .15rem;
  line-height: 1.4;
}

.select-wrap { position: relative; }
.select-wrap select {
  appearance: none;
  padding-right: 2.4rem;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--pine) 50%),
    linear-gradient(135deg, var(--pine) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 3px),
    calc(100% - 10px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.phone-box {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: stretch;
  border: 1.5px solid rgba(26,58,42,.22);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.phone-box:focus-within {
  border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(196,163,90,.28);
}
.phone-dial {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 3.6rem; padding: 0 .75rem;
  background: rgba(26,58,42,.06);
  border-right: 1px solid rgba(26,58,42,.12);
  font-weight: 700; color: var(--pine);
  font-variant-numeric: tabular-nums;
}
.phone-box input {
  border: 0 !important; box-shadow: none !important;
  border-radius: 0; background: transparent;
}
.phone-box input:focus { outline: none; }

.field textarea {
  font: inherit; width: 100%; min-height: 7rem; resize: vertical;
  padding: .78rem .9rem; border-radius: 12px;
  border: 1.5px solid rgba(26,58,42,.22);
  background: #fff; color: var(--ink);
  line-height: 1.45;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea:hover { border-color: rgba(26,58,42,.4); }
.field textarea:focus {
  outline: none;
  border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(196,163,90,.28);
}
.field.is-invalid textarea {
  border-color: #c45a5a;
  box-shadow: 0 0 0 3px rgba(196,90,90,.15);
}
.field.is-valid textarea { border-color: #3d8f5f; }

.form-note { font-size: .86rem; color: var(--smoke); margin: .15rem 0 0; line-height: 1.45; }
.btn-block { width: 100%; justify-content: center; margin-top: .15rem; padding: .85rem 1.25rem; }

.alert {
  padding: .9rem 1rem; border-radius: 12px; font-weight: 600; margin-bottom: 1rem;
}
.alert-err { background: #f6e0e0; color: var(--danger); border: 1px solid #e2b0b0; }
.alert-ok { background: #e3f2e9; color: var(--ok); border: 1px solid #b4d8c2; }

/* legacy label forms (contact etc. untouched) */
.form > label { display: grid; gap: .35rem; font-weight: 600; font-size: .95rem; }


.legal { max-width: 72ch; }
.legal h2 { margin-top: 2rem; }
.legal h1 { font-family: var(--font-display); }

.foot {
  margin-top: 3rem; background: var(--pine-deep); color: rgba(243,236,220,.88);
  padding: 2.2rem 0 1.4rem;
}
.foot a {
  color: var(--brass-hot);
  text-decoration: none;
  transition: color .15s ease;
}
.foot a:hover { color: #f5e2a8; }
.foot-inner { display: grid; gap: 1.2rem; grid-template-columns: 1.4fr 1fr 1fr; }
.foot-brand {
  display: flex; gap: .7rem; align-items: center;
  color: var(--cream); text-decoration: none;
  transition: color .15s ease;
}
.foot-brand:hover {
  color: var(--brass-hot);
}
.foot-brand:hover .logo-mark {
  border-color: var(--brass-hot);
  box-shadow: 0 0 0 3px rgba(224, 192, 112, 0.28);
}
.foot-list { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .35rem; }
.foot-copy { margin-top: 1.5rem; font-size: .85rem; color: rgba(243,236,220,.65); }

.reveal { opacity: 0; transform: translateY(16px); transition: .7s ease; }
.reveal.is-in { opacity: 1; transform: none; }

@media (max-width: 960px) {
  /* One chrome row: logo | langs | login+join | menu — both CTAs always visible */
  .top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    align-items: center;
    column-gap: .4rem;
    row-gap: .55rem;
    min-height: 3.4rem;
    padding: .65rem .75rem;
  }
  .logo { grid-column: 1; grid-row: 1; min-width: 0; }
  .lang-switch { grid-column: 2; grid-row: 1; }
  .top-actions {
    grid-column: 3;
    grid-row: 1;
    gap: .3rem;
  }
  .top-actions .btn-sm {
    height: 2rem;
    padding: 0 .7rem;
    font-size: .8rem;
  }
  .top-actions .btn-ghost {
    display: inline-flex;
  }
  .menu-btn {
    display: inline-flex;
    grid-column: 4;
    grid-row: 1;
    align-self: center;
    width: 2rem;
    height: 2rem;
  }
  .nav {
    grid-column: 1 / -1;
    grid-row: 2;
    display: none;
    width: 100%;
    position: static;
    background: rgba(10, 24, 16, 0.96);
    border: 1px solid rgba(196, 163, 90, 0.35);
    border-radius: 12px;
    padding: .75rem 1rem;
    flex-direction: column;
    align-items: stretch;
    gap: .15rem;
  }
  .nav.is-open { display: flex; }
  .nav > a {
    height: auto;
    padding: .7rem .4rem;
    border-bottom: 1px solid rgba(196, 163, 90, 0.18);
    box-shadow: none;
  }
  .nav > a:hover, .nav > a.is-active {
    background: rgba(196, 163, 90, 0.22);
    color: var(--brass-hot);
    box-shadow: none;
    border-radius: 8px;
  }
  .nav > a.is-active {
    box-shadow: inset 3px 0 0 var(--brass-hot);
  }
  .grid-2, .grid-3, .grid-4, .form-shell, .foot-inner { grid-template-columns: 1fr; }
  .grid-gallery { grid-template-columns: repeat(2, 1fr); }
  .field-row { grid-template-columns: 1fr; }
  .form { max-width: none; }
  .form-visual { position: static; min-height: 200px; }
}

@media (max-width: 420px) {
  .logo-text { display: none; } /* keep mark + CTAs + menu on one line */
  .lang-switch-btn {
    height: 2rem;
    min-width: 3.2rem;
    padding: 0 .6rem 0 .5rem;
  }
  .lang-flag-svg {
    width: 1.45rem;
    height: .98rem;
  }
  .top-actions .btn-sm {
    padding: 0 .55rem;
    font-size: .76rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important; transition: none !important; scroll-behavior: auto !important;
  }
}
