/* =====================================================================
   Maikstrings — Interactive Circle of Fifths
   Glowing card on dark Maikstrings background. Dark modal with gold accents.
   ===================================================================== */

/* ----- Container ----- */
.cof-hero {
  position: relative;
  margin: 2rem auto;
  padding: 2rem 1rem;
  max-width: 1100px;
}
.cof-hero-intro {
  text-align: center;
  margin-bottom: 1.5rem;
}
.cof-hero-intro .eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--acc, #c8a96e);
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.cof-hero-intro h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  color: #fff;
  line-height: 1.15;
  margin-bottom: 0.6rem;
  font-weight: 900;
}
.cof-hero-intro h2 em {
  color: var(--acc, #c8a96e);
  font-style: normal;
}
.cof-hero-intro p {
  color: var(--mut, #8a8478);
  font-size: 0.94rem;
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ----- The glowing card itself ----- */
.cof-frame {
  position: relative;
  width: min(92vmin, 880px);
  margin: 0 auto;
  aspect-ratio: 1/1;
  border-radius: 24px;
  background: radial-gradient(ellipse at center, #1a1f28 0%, #0a0c10 78%);
  box-shadow:
    0 0 0 1px rgba(200, 169, 110, 0.18),
    0 30px 80px rgba(0, 0, 0, 0.6),
    inset 0 0 120px rgba(200, 169, 110, 0.06);
  overflow: hidden;
}
.cof-frame::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 24px;
  background: radial-gradient(ellipse at top, rgba(245, 205, 27, 0.18) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.cof-frame svg#circle-svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Light-mode override — keeps the glowing-card concept but lighter framing */
html.light-mode .cof-frame {
  background: radial-gradient(ellipse at center, #fffaf0 0%, #f5ecd9 80%);
  box-shadow:
    0 0 0 1px rgba(200, 169, 110, 0.4),
    0 20px 60px rgba(120, 90, 30, 0.18);
}
html.light-mode .cof-frame::before {
  background: radial-gradient(ellipse at top, rgba(245, 205, 27, 0.25) 0%, transparent 60%);
}

/* ----- Clickable sectors (transparent overlays on the SVG) ----- */
.sector {
  fill: rgba(255, 255, 255, 0);
  stroke: rgba(255, 255, 255, 0);
  cursor: pointer;
  transition: fill 160ms ease, filter 160ms ease;
}
.sector:hover {
  fill: rgba(255, 255, 255, 0.14);
  filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.55));
}
.sector.flash {
  fill: rgba(255, 255, 255, 0.30);
  filter: drop-shadow(0 0 22px rgba(255, 255, 255, 0.9));
}
html.light-mode .sector:hover {
  fill: rgba(200, 169, 110, 0.20);
  filter: drop-shadow(0 0 14px rgba(200, 169, 110, 0.55));
}
html.light-mode .sector.flash {
  fill: rgba(200, 169, 110, 0.35);
  filter: drop-shadow(0 0 22px rgba(200, 169, 110, 0.9));
}

/* ----- Hint below the card ----- */
.cof-hint {
  text-align: center;
  margin-top: 1.25rem;
  color: var(--mut, #8a8478);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}
.cof-hint strong {
  color: var(--acc, #c8a96e);
  font-weight: 600;
}

/* ----- Modal (dark Maikstrings theme with gold accents — refined) ----- */
.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 200;
  padding: 24px;
}
.modal.hidden { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 10, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.modal-card {
  position: relative;
  width: min(720px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background:
    radial-gradient(ellipse at top, rgba(200, 169, 110, 0.10) 0%, transparent 55%),
    linear-gradient(180deg, #181c24 0%, #0c0e13 100%);
  border: 1px solid rgba(200, 169, 110, 0.28);
  border-radius: 20px;
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.03),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4);
  padding: 26px 26px 22px;
  color: #e8e4dc;
}
/* Subtle decorative ornaments at corners */
.modal-card::before,
.modal-card::after {
  content: "";
  position: absolute;
  width: 60px;
  height: 60px;
  pointer-events: none;
  opacity: 0.4;
}
.modal-card::before {
  top: 14px;
  left: 14px;
  border-top: 1px solid var(--acc, #c8a96e);
  border-left: 1px solid var(--acc, #c8a96e);
  border-top-left-radius: 8px;
}
.modal-card::after {
  bottom: 14px;
  right: 14px;
  border-bottom: 1px solid var(--acc, #c8a96e);
  border-right: 1px solid var(--acc, #c8a96e);
  border-bottom-right-radius: 8px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 2;
  background: rgba(20, 24, 30, 0.6);
  color: var(--mut, #8a8478);
  border: 1px solid rgba(200, 169, 110, 0.25);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: all 200ms ease;
}
.modal-close:hover {
  color: #fff;
  border-color: var(--acc, #c8a96e);
  background: rgba(200, 169, 110, 0.12);
  transform: rotate(90deg);
}
body.modal-open { overflow: hidden; }

/* ----- Hero Title Block (dramatic, but compact) ----- */
.modal-title {
  text-align: center;
  margin: 2px 0 14px;
  padding-bottom: 14px;
  position: relative;
}
.modal-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200, 169, 110, 0.6), transparent);
}

.modal-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--acc, #c8a96e);
  font-size: 10.5px;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 2px;
  font-family: 'DM Sans', sans-serif;
}
.eyebrow-rule {
  display: inline-block;
  width: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--acc, #c8a96e));
}
.eyebrow-rule:last-child {
  background: linear-gradient(90deg, var(--acc, #c8a96e), transparent);
}

.modal-hero {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  line-height: 0.85;
  margin: 0;
}
.hero-letter {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 900;
  font-size: clamp(80px, 14vw, 108px);
  background: linear-gradient(180deg, #f0d68a 0%, #c8a96e 45%, #8a6e3a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  letter-spacing: -0.03em;
  filter: drop-shadow(0 4px 14px rgba(200, 169, 110, 0.28));
}
.hero-acc {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: clamp(34px, 6vw, 48px);
  color: var(--acc, #c8a96e);
  margin-top: clamp(10px, 2.4vw, 16px);
  margin-left: 3px;
  opacity: 0.85;
}
.modal-kind {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: clamp(16px, 2.6vw, 20px);
  color: var(--mut, #8a8478);
  font-weight: 400;
  margin-top: 2px;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.modal-meta {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0;
}
.meta-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  color: #b8b09e;
  background: rgba(200, 169, 110, 0.08);
  border: 1px solid rgba(200, 169, 110, 0.22);
  padding: 4px 10px;
  border-radius: 50px;
  letter-spacing: 0.02em;
  font-weight: 500;
}
.meta-badge strong {
  color: var(--acc, #c8a96e);
  margin-left: 4px;
  font-weight: 700;
}
.meta-badge-relative::before {
  content: "↔";
  color: var(--acc, #c8a96e);
  margin-right: 5px;
  font-weight: 700;
}

/* ----- Section structure ----- */
.modal-section {
  margin: 16px 0;
}
.section-head {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: 'DM Sans', sans-serif;
  margin: 0 0 9px;
  font-size: 11.5px;
  color: #d8d2c4;
  letter-spacing: 2.5px;
  font-weight: 700;
  text-transform: uppercase;
}
.head-rule {
  display: inline-block;
  width: 20px;
  height: 2px;
  background: linear-gradient(90deg, var(--acc, #c8a96e), rgba(200, 169, 110, 0.2));
  border-radius: 2px;
}
.section-head-sub {
  margin-left: 3px;
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--acc, #c8a96e);
  font-size: 13px;
}

/* ----- Cream content cards ----- */
.content-card {
  background-color: #fdf6e3;
  background-image: radial-gradient(ellipse at top, #fffbef 0%, #f5ecd9 100%);
  border: 1px solid rgba(200, 169, 110, 0.55);
  border-radius: 10px;
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 0 0 1px rgba(255, 255, 255, 0.25);
  padding: 10px 12px;
  position: relative;
}
.content-card + .content-card {
  margin-top: 8px;
}
.content-card-notation {
  padding: 6px 10px;
}

/* ----- Scale row ----- */
.scale-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}
.scale-step { text-align: center; }
.scale-degree {
  font-family: 'DM Sans', sans-serif;
  font-size: 9px;
  color: #8a7a5a;
  margin-bottom: 3px;
  letter-spacing: 2px;
  font-weight: 700;
}
.pill {
  display: inline-block;
  width: 100%;
  padding: 7px 0;
  background: #fffaf0;
  border: 1px solid rgba(120, 90, 40, 0.18);
  border-radius: 7px;
  font-weight: 700;
  font-size: 15px;
  color: #1a1208;
  font-family: 'Playfair Display', Georgia, serif;
  box-shadow: 0 1px 2px rgba(120, 90, 40, 0.08);
  transition: transform 200ms ease;
}
.pill-tonic {
  background:
    radial-gradient(ellipse at top, #ffe7a0 0%, #d4b878 35%, #a8884a 100%);
  color: #1a1208;
  border-color: rgba(120, 90, 30, 0.6);
  box-shadow:
    0 3px 10px rgba(168, 136, 74, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

/* ----- Notation card overrides ----- */
.notation { width: 100%; height: auto; display: block; }
.staff-line { stroke: #3a2e1a; stroke-width: 1.2; }
.ledger-line { stroke: #3a2e1a; stroke-width: 1.2; }
.staff-clef {
  font: 400 60px/1 'Times New Roman', serif;
  fill: #1a1208;
}
.notehead { fill: #1a1208; }
.notehead-tonic { fill: #a8884a; }
.accidental {
  font: 700 18px/1 'Times New Roman', serif;
  fill: #1a1208;
}

/* ----- Chord row & cards ----- */
.chord-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.chord-card {
  background-color: #fdf6e3;
  background-image: radial-gradient(ellipse at top, #fffbef 0%, #f5ecd9 100%);
  border: 1px solid rgba(200, 169, 110, 0.55);
  border-radius: 10px;
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  padding: 8px 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.chord-card-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 9px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: #8a7a5a;
  font-weight: 700;
  margin-bottom: 2px;
}
.chord-diagram {
  width: 160px;
  height: auto;
  background: transparent;
  border-radius: 0;
  padding: 0;
}
.chord-name {
  font: 900 22px/1 'Playfair Display', Georgia, serif;
  fill: #1a1208;
  letter-spacing: -0.02em;
}
.chord-caption {
  font: 500 9px/1 'DM Sans', sans-serif;
  fill: #6b6457;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.chord-fret { stroke: #6b5230; stroke-width: 1.2; }
.chord-string { stroke: #6b5230; stroke-width: 1.1; }
.chord-nut { fill: #1a1208; }
.chord-dot { fill: #1a1208; }
.chord-barre { fill: #1a1208; }
.chord-open { fill: none; stroke: #1a1208; stroke-width: 1.6; }
.chord-mute { fill: #1a1208; font: 700 16px/1 'DM Sans', sans-serif; }
.chord-fretlabel { fill: #8a6e3a; font: 700 12px/1 'Playfair Display', Georgia, serif; }

/* ----- Description with drop-cap ----- */
.desc-text {
  line-height: 1.55;
  color: #d8dde6;
  font-size: 13.5px;
  margin: 0;
  font-family: 'DM Sans', sans-serif;
  text-align: justify;
  hyphens: auto;
}
.desc-text strong {
  color: var(--acc, #c8a96e);
  font-weight: 600;
}
.dropcap {
  float: left;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 900;
  font-size: 44px;
  line-height: 0.85;
  color: var(--acc, #c8a96e);
  padding: 4px 8px 0 0;
  background: linear-gradient(180deg, #f0d68a 0%, #c8a96e 60%, #8a6e3a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ----- Mobile responsive ----- */
@media (max-width: 600px) {
  .cof-hero { padding: 1rem 0.5rem; }
  .cof-frame { width: min(95vmin, 480px); border-radius: 18px; }
  .modal { padding: 10px; }
  .modal-card {
    padding: 22px 16px 18px;
    border-radius: 16px;
  }
  .modal-card::before, .modal-card::after {
    width: 36px;
    height: 36px;
  }
  .modal-title { margin: 0 0 11px; padding-bottom: 11px; }
  .hero-letter { font-size: 80px; }
  .hero-acc { font-size: 32px; margin-top: 10px; }
  .modal-kind { font-size: 15px; margin-bottom: 6px; }
  .meta-badge { font-size: 10px; padding: 3px 9px; }
  .modal-section { margin: 14px 0; }
  .section-head { font-size: 10.5px; margin: 0 0 7px; gap: 7px; }
  .section-head-sub { font-size: 12px; }
  .content-card { padding: 8px 10px; border-radius: 8px; }
  .content-card-notation { padding: 4px 8px; }
  .content-card + .content-card { margin-top: 6px; }
  .scale-row { gap: 3px; }
  .pill { font-size: 12px; padding: 6px 0; border-radius: 6px; }
  .scale-degree { font-size: 8px; margin-bottom: 2px; }
  .chord-row { gap: 8px; }
  .chord-card { padding: 6px 4px 3px; border-radius: 8px; }
  .chord-card-label { font-size: 8.5px; margin-bottom: 1px; }
  .chord-diagram { width: 140px; }
  .desc-text { font-size: 13px; text-align: left; line-height: 1.5; }
  .dropcap { font-size: 38px; padding: 3px 7px 0 0; }
}

/* ----- Subtle entry animation ----- */
@keyframes cofFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
.cof-frame { animation: cofFadeIn 0.7s ease-out; }