.patternsBanner .icon,
.patternsBanner .icon svg {
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  min-height: 48px !important;
  max-width: 48px !important;
  max-height: 48px !important;
}

.wrap, .hero, .header.bannerHeader, .hero.hero-grid.hero-grid-patterns {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.patternsBanner {
  margin-bottom: 0 !important;
  box-shadow: 0 4px 18px rgba(20, 30, 60, 0.13);
  background: linear-gradient(135deg, #141629 0%, #1f2440 40%, #162f3d 100%);
  overflow: hidden;
  width: 100%;
  max-width: 1320px;
  margin-left: auto;
  margin-right: auto;
  min-height: 120px;
  align-items: center;
  display: flex;
  flex-direction: row;
  gap: 12px;
  padding: 16px 20px;
  position: relative;
  border-radius: 24px;
  margin-bottom: 18px;
}

.patternIcon {
  position: relative;
  z-index: 2;

  width: 62px;
  height: 62px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.patternIcon svg {
  width: 100%;
  height: 100%;
}

.brandText {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}


/* Ensure Patterns banner matches Keys banner layering */
.hero.hero-grid.hero-grid-patterns {
  background: none;
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  isolation: isolate;
  border: none;
  box-shadow: none;
}
/* Static dotbeat strip for hero visuals */
.dotbeat-strip {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 0 auto 18px auto;
  max-width: 220px;
  padding: 18px 0;
}

.dotbeat-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 28% 22%, #fff3b9, #f0c45b 72%);
  opacity: 0.92;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.72), 0 10px 22px rgba(7,14,30,0.5);
  display: inline-block;
}

.dotbeat-dot.strong {
  width: 22px;
  height: 22px;
  background: radial-gradient(circle at 30% 24%, #ffe3a0, #d69425 78%);
  box-shadow: 0 0 0 2px rgba(255,248,219,0.76), 0 0 20px rgba(240,196,91,0.3);
}

:root {
  --bg-top: #33466f;
  --bg-bottom: #41577d;
  --panel: #132746;
  --panel-border: rgba(255, 255, 255, 0.18);
  --shell-bg: transparent;
  --shell-border: rgba(214, 223, 238, 0.14);
  --card-bg: rgba(14, 29, 57, 0.9);
  --card-border-soft: rgba(255, 255, 255, 0.12);
  --inset-bg: rgba(12, 24, 48, 0.92);
  --inset-border: rgba(148, 163, 184, 0.26);
  --text: #f5f7fb;
  --muted: #b9c0cf;
  --gold: #e2b95f;
  --gold-bright: #f0c45b;
  --card-hover: rgba(240, 196, 91, 0.08);
  --line: rgba(255, 255, 255, 0.08);
  --beat-line: rgba(185, 192, 207, 0.28);
  --beat-line-strong: rgba(185, 192, 207, 0.5);
  --active-glow: rgba(240, 196, 91, 0.34);
}
.patternIcon {
  position: relative;
  z-index: 2;
  width: 62px;
  height: 62px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.patternIcon svg {
  width: 100%;
  height: 100%;
}

/* Light panel/card for dramatic effect */
.panel-light {
  background: linear-gradient(180deg, rgba(32,54,94,0.92) 0%, rgba(24,42,77,0.88) 100%) !important;
  border: 1px solid rgba(214,223,238,0.14) !important;
  color: inherit !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.04) !important;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 24px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(111, 87, 255, 0.1), transparent 30%),
    radial-gradient(circle at top right, rgba(90, 170, 220, 0.08), transparent 24%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

.wrap {
  max-width: 1320px;
  margin: 0 auto;
}

.nav {
  margin-bottom: 14px;
  box-shadow: 0 4px 18px rgba(20, 30, 60, 0.13);
  padding: 14px 0;
  background: none !important;
}

.nav-inner {
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.nav-logo {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  white-space: nowrap;
}

.logo-dot {
  color: var(--text);
}

.logo-beat {
  color: var(--gold);
}

.logo-tm {
  display: inline-block;
  margin-left: 1px;
  font-size: 13px;
  color: var(--text);
  opacity: 0.9;
  vertical-align: text-top;
  transform: translateY(-0.14em);
}

.nav-links {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 14px;
  color: var(--muted);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
  font-weight: 600;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  outline: none;
}

.nav-link.active {
  color: var(--text);
  background: linear-gradient(180deg, rgba(240, 196, 91, 0.18), rgba(240, 196, 91, 0.08));
  border-color: rgba(240, 196, 91, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 20px rgba(15, 23, 42, 0.16);
}

.wordmark-inline {
  display: inline-block;
  white-space: nowrap;
  line-height: 1;
  text-transform: none;
  letter-spacing: -0.03em;
}

.hero,
.controls-panel,
.pattern-card,
.related-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border-soft);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.hero {
  --hero-scene-width: min(50vw, 520px);
  --hero-scene-right: 44px;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 28px;
  margin-bottom: 18px;
  padding: 34px 38px 36px;
  border-radius: 24px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at top left, rgba(111, 87, 255, 0.1), transparent 30%),
    radial-gradient(circle at top right, rgba(90, 170, 220, 0.08), transparent 24%),
    linear-gradient(180deg, #33466f 0%, #41577d 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.hero-grid {
  background:
    radial-gradient(circle at top left, rgba(111, 87, 255, 0.1), transparent 30%),
    radial-gradient(circle at top right, rgba(90, 170, 220, 0.08), transparent 24%),
    linear-gradient(180deg, #33466f 0%, #41577d 100%);
}

.hero-copy,
.hero-visual {
  position: relative;
  z-index: 2;
}

.hero-copy {
  max-width: 760px;
  flex: 1 1 58%;
}

/* Match banner width to .wrap and center it */
.hero-ambient-lines span {
  position: absolute;
  left: 120px;
  right: -20px;
  height: 1px;
  background: rgba(214, 223, 238, 0.12);
}

.hero-ambient-lines span:nth-child(1) { top: 56px; }
.hero-ambient-lines span:nth-child(2) { top: 96px; }
.hero-ambient-lines span:nth-child(3) { top: 136px; }
.hero-ambient-lines span:nth-child(4) { top: 176px; }

.hero-visual {
  width: min(100%, var(--hero-scene-width));
  margin-right: var(--hero-scene-right);
  margin-left: 0;
  padding: 8px 0 0;
  flex: 0 1 34%;
}

.hero-visual-label {
  margin-bottom: 6px;
  color: var(--gold-bright);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.hero-visual-grid {
  --grid-columns: 8;
  --grid-rows: 3;
  position: relative;
  min-height: 184px;
  padding: 14px 0 12px;
  border-radius: 24px;
  background: transparent;
  border: none;
  overflow: hidden;
}

.hero-visual-grid::after {
  display: none;
}

.hero-visual-grid::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent calc((100% / var(--grid-columns)) - 1px),
      rgba(255, 255, 255, 0.06) calc((100% / var(--grid-columns)) - 1px),
      rgba(255, 255, 255, 0.06) calc(100% / var(--grid-columns))
    ),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 100% 100%, 100% calc(100% / var(--grid-rows));
}

.hero-grid-nut {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 3px;
  background: linear-gradient(180deg, rgba(255, 229, 167, 0.95), rgba(240, 196, 91, 0.65));
  box-shadow: 0 0 18px rgba(240, 196, 91, 0.18);
  border-radius: 50%;
}

.hero-grid-marker {
  position: absolute;
  width: 16px;
  height: 16px;
  left: calc(((var(--marker-col) - 0.5) / var(--grid-columns)) * 100%);
  top: calc(((var(--marker-row) - 0.5) / var(--grid-rows)) * 100%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 32% 28%, #fff4c6, #f0c45b 76%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.68),
    0 0 18px rgba(240, 196, 91, 0.22);
}

.marker-col-1 { --marker-col: 1; }
.marker-col-3 { --marker-col: 3; }
.marker-col-4 { --marker-col: 4; }
.marker-col-5 { --marker-col: 5; }
.marker-col-8 { --marker-col: 8; }
.marker-row-1 { --marker-row: 1; }
.marker-row-2 { --marker-row: 2; }
.marker-row-3 { --marker-row: 3; }

.hero-grid-marker-strong {
  width: 20px;
  height: 20px;
  background: radial-gradient(circle at 30% 24%, #ffe3a0, #d69425 78%);
  box-shadow:
    0 0 0 1px rgba(255, 248, 219, 0.76),
    0 0 20px rgba(240, 196, 91, 0.3);
}

.hero-grid-marker-soft {
  opacity: 0.88;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 40px;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.hero p {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.panel-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.show-more-btn {
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #f7d06a, #e0a020);
  color: #1b2137;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(255, 161, 35, 0.2);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.show-more-btn:hover,
.show-more-btn:focus-visible {
  outline: none;
  transform: translateY(-2px);
  box-shadow: 0 18px 32px rgba(255, 161, 35, 0.24);
}

.page-shell {
  margin-top: 12px;
  padding: 14px 22px 22px;
  background: var(--shell-bg);
  border: 1px solid var(--shell-border);
  border-radius: 18px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 14px 28px rgba(15, 23, 42, 0.08);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.pattern-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.controls-panel {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  padding: 24px 24px 20px;
  background: linear-gradient(180deg, rgba(32,54,94,0.96) 0%, rgba(24,42,77,0.96) 100%) !important;
  border: 1px solid rgba(214,223,238,0.14) !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.04) !important;
}

.panel-title {
  margin-bottom: 14px;
  color: var(--gold-bright);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.control-group,
.tempo-group {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.panel-note {
  margin: 4px 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.song-context-card {
  margin-top: 4px;
  padding: 14px 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.song-context-label {
  margin-bottom: 8px;
  color: var(--gold-bright);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.song-context-title {
  color: var(--text);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
}

.song-context-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.panel-links {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.controls-panel .panel-link[aria-disabled="true"] {
  opacity: 0.45;
  cursor: default;
}

.control-group span,
.tempo-group span {
  color: var(--muted);
  font-size: 13px;
}

.control-group select {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
}

.control-group select option {
  color: var(--text);
  background: #142449;
}

.control-group select:focus {
  outline: none;
  border-color: rgba(240, 196, 91, 0.34);
  box-shadow: 0 0 0 3px rgba(240, 196, 91, 0.08);
}

.side-loop-pill {
  min-height: 46px;
}

.tempo-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
  justify-content: center;
}

.tempo-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  transition: background 0.14s;
}

.tempo-unit {
  color: var(--muted);
  font-size: 13px;
}

.panel-actions {
  display: flex;
  gap: 10px;
  margin: 16px 0;
}

.action-btn {
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  padding: 0 22px;
  font: inherit;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.14s, box-shadow 0.14s, transform 0.12s;
}

.action-play {
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 100%);
  color: #1b2137;
  box-shadow: 0 4px 18px rgba(240,196,91,0.18), 0 1.5px 8px 0 rgba(0,0,0,0.10);
  font-weight: 800;
}

.action-stop {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.main-panel {
  display: grid;
  gap: 18px;
}

.pattern-card,
.related-card {
  border-radius: 24px;
  padding: 24px 26px;
}

.flow-helper {
  border-radius: 20px;
  padding: 18px 20px 20px;
  background: rgba(10, 22, 46, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.2);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.flow-helper-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.flow-helper-text {
  margin: 0 0 10px;
}

.pattern-header,
.related-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.eyebrow {
  margin: 0 0 8px;
  color: rgba(240, 196, 91, 0.92);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.pattern-header h2,
.related-header h3 {
  margin: 0;
  font-size: 34px;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.related-header h3 {
  font-size: 28px;
}

.pattern-meta {
  min-width: 140px;
  text-align: right;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.pattern-meta strong {
  color: var(--gold-bright);
}

.pattern-description,
.related-header p,
.animator-hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.notation-card,
.animator-card {
  margin-top: 20px;
  padding: 20px 20px 18px;
  border-radius: 20px;
  background: var(--inset-bg);
  border: 1px solid var(--inset-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 18px 40px rgba(6, 12, 28, 0.36);
}

.animator-card {
  margin-top: 24px;
  padding: 24px 22px 20px;
  border-color: rgba(240, 196, 91, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 20px 46px rgba(6, 12, 28, 0.42),
    0 0 0 1px rgba(240, 196, 91, 0.04);
}

.notation-label,
.animator-label {
  margin-bottom: 10px;
  color: var(--gold-bright);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.animator-label .brand-dot {
  color: var(--text);
}

.animator-label .brand-beat {
  color: var(--gold);
}

.notation-value {
  font-size: 24px;
  letter-spacing: 0.08em;
  word-spacing: 0.18em;
  overflow-wrap: anywhere;
}

.notation-help {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.animator-intro {
  margin: 0 0 18px;
  max-width: 760px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.animator-controls {
  display: grid;
  grid-template-columns: minmax(190px, 220px) minmax(220px, 260px) minmax(140px, 170px) auto;
  align-items: end;
  gap: 14px;
  margin-bottom: 18px;
}

.inline-control {
  margin-bottom: 0;
}

.inline-control .tempo-pill,
.inline-control select,
.inline-actions .action-btn {
  height: 48px;
}

.inline-control span {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.pattern-control {
  min-width: 0;
}

.pattern-control select {
  min-width: 0;
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--inset-border);
  background: var(--inset-bg);
  color: var(--text);
  font: inherit;
}

.pattern-control select option {
  color: var(--text);
  background: #142449;
}

.pattern-control select:focus {
  outline: none;
  border-color: rgba(240, 196, 91, 0.34);
  box-shadow: 0 0 0 3px rgba(240, 196, 91, 0.08);
}

.loop-control {
  min-width: 0;
}

.loop-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--inset-border);
  background: var(--inset-bg);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}

.loop-pill input {
  accent-color: var(--gold-bright);
}

.loop-pill span {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.dot-track-shell {
  position: relative;
  margin-top: 8px;
  padding: 24px 20px 46px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(16, 29, 57, 0.96), rgba(12, 23, 47, 0.96));
  border: 1px solid var(--inset-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 16px 30px rgba(6, 12, 28, 0.26);
  overflow: hidden;
}

.dot-track {
  display: grid;
  gap: 0;
  align-items: start;
}

.dot-track.step-count-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dot-track.step-count-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.dot-track.step-count-8 {
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.dot-track.step-count-12 {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.dot-track.step-count-16 {
  grid-template-columns: repeat(16, minmax(0, 1fr));
}

.track-slot {
  position: relative;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.track-slot.beat-start::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 18px;
  width: 1px;
  background: var(--beat-line);
}

.track-slot.bar-start::before {
  background: var(--beat-line-strong);
}

.track-slot-label {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 11px;
}

.stroke {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0.92;
  transition: transform 0.14s ease, opacity 0.14s ease;
}

.stroke-dot {
  width: var(--dot-size, 12px);
  height: var(--dot-size, 12px);
  border-radius: 50%;
  background: radial-gradient(circle at 28% 22%, #fff3b9, #f0c45b 72%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.72),
    0 10px 22px rgba(7, 14, 30, 0.5);
  transition: transform 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
}

.stroke.down .stroke-dot {
  background: radial-gradient(circle at 28% 22%, #ffd97a, #c7861e 76%);
  box-shadow:
    0 0 0 1px rgba(255, 244, 210, 0.72),
    0 10px 22px rgba(7, 14, 30, 0.56);
}

.stroke.up .stroke-dot {
  background: radial-gradient(circle at 28% 22%, #fff9df, #efd894 76%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.78),
    0 8px 18px rgba(7, 14, 30, 0.34);
}

.stroke-arrow {
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  line-height: 1;
}

.stroke.mute .stroke-arrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.stroke.active {
  opacity: 1;
  transform: translateY(-2px);
}

.stroke.active .stroke-dot {
  background: var(--gold-bright);
  box-shadow:
    0 0 0 4px var(--active-glow),
    0 0 22px rgba(255, 179, 71, 0.42);
  transform: scale(1.08);
}

.stroke.active .stroke-arrow {
  color: var(--gold-bright);
}

.playhead-line {
  position: absolute;
  top: 14px;
  bottom: 30px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(250, 250, 255, 0.38), rgba(240, 196, 91, 0.28));
  box-shadow: 0 0 16px rgba(240, 196, 91, 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translateX(0);
  transition: opacity 0.15s ease;
}

.animator-summary {
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
}

.dot-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 28% 22%, #fff3b9, #f0c45b 72%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.6),
    0 8px 18px rgba(7, 14, 30, 0.35);
}

.note-sixteenth {
  width: 8px;
  height: 8px;
}

.note-eighth {
  width: 12px;
  height: 12px;
}

.note-quarter {
  width: 17px;
  height: 17px;
}

.note-half {
  width: 23px;
  height: 23px;
}

.note-whole {
  width: 30px;
  height: 30px;
}

.inline-actions {
  margin: 0;
}

.inline-actions .action-btn {
  white-space: nowrap;
}

.related-songs {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.related-songs-footer {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.related-song {
  display: block;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.related-song:hover {
  transform: translateY(-2px);
  background: var(--card-hover);
  border-color: rgba(240, 196, 91, 0.28);
}

.related-song-title {
  margin-bottom: 6px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
}

.related-song-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.siteFooter {
  width: min(1320px, 96vw);
  margin: 22px auto 0;
  padding: 18px 32px 28px;
  text-align: center;
  color: rgba(222, 232, 244, 0.82);
  font-size: 0.92rem;
  line-height: 1.6;
}

.siteFooter .footerTitle,
.siteFooter .footerText,
.siteFooter .footerContact,
.siteFooter .footerMeta,
.siteFooter .footerShareText {
  text-align: center;
}

.siteFooter .footerTitle {
  font-weight: 700;
  color: #f5f7fb;
  margin-bottom: 6px;
}

.siteFooter .footerText {
  max-width: 900px;
  margin: 0 auto 10px;
  line-height: 1.7;
}

.siteFooter .footerContact {
  margin-bottom: 8px;
  color: rgba(222, 232, 244, 0.9);
}

.siteFooter .footerContactLink {
  color: #f5f7fb;
  text-decoration: none;
}

.siteFooter .footerContactLink:hover,
.siteFooter .footerContactLink:focus-visible {
  text-decoration: underline;
}

.footerShare {
  margin-bottom: 8px;
}

.footerShareLinks {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footerShareLink {
  color: #f5f7fb;
  text-decoration: none;
}

.footerShareLink:hover,
.footerShareLink:focus-visible {
  text-decoration: underline;
}

.footerShareSep {
  color: rgba(185, 192, 207, 0.9);
}

.siteFooter .footerMeta {
  font-size: 0.88rem;
  color: rgba(185, 192, 207, 0.9);
}

.siteFooter .footerWordmark {
  display: inline-block;
  white-space: nowrap;
  line-height: 1;
  letter-spacing: -0.03em;
}

.siteFooter .footerWordmark .brand-dot {
  color: #f5f7fb;
}

.siteFooter .footerWordmark .brand-beat {
  color: var(--gold);
}

.siteFooter .footerWordmark .brand-tm {
  display: inline-block;
  margin-left: 1px;
  font-size: 0.5em;
  color: #f5f7fb;
  opacity: 0.92;
  vertical-align: text-top;
  transform: translateY(0.02em);
}

@media (max-width: 1040px) {
  .pattern-layout {
    grid-template-columns: 1fr;
  }

  .controls-panel {
    position: static;
  }

  .related-songs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body {
    padding: 16px;
  }

  .nav {
    position: relative;
    top: auto;
    z-index: 5;
    padding: 10px 0 0;
    margin-bottom: 16px;
  }

  .page-shell {
    padding: 18px;
  }

  .siteFooter {
    margin-top: 18px;
    padding: 16px 18px 24px;
  }

  .nav-inner {
    flex-direction: row;
    align-items: center;
    overflow: visible;
    padding: 0 14px;
    gap: 10px;
  }

  .nav-links {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 4px;
  }

  .nav-link {
    flex: 0 0 auto;
    padding: 0 8px;
    font-size: 11px;
    min-height: 32px;
  }

  .hero,
  .pattern-card,
  .related-card,
  .controls-panel {
    padding: 20px;
  }

  .hero,
  .pattern-header,
  .related-header {
    display: grid;
  }

  .patternsBanner {
    gap: 10px;
    padding: 16px;
    min-height: 0;
    overflow: hidden;
  }

  .pattern-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .controls-panel {
    width: 100%;
    min-width: 0;
  }

  .patternsBanner .icon {
    width: 96px;
    height: 96px;
    flex: 0 0 96px;
  }

  .patternsBanner .brandText {
    min-width: 0;
  }

  .patternsBanner .brandTitle {
    line-height: 1.08;
    overflow-wrap: anywhere;
  }

  .patternsBanner .brandTag {
    max-width: none;
  }

  .hero-ambient-lines span {
    left: 20px;
    right: 20px;
  }

  .hero-visual {
    width: 100%;
    margin-right: 0;
    margin-left: 0;
  }

  .animator-controls {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .pattern-control {
    min-width: 0;
  }

  .inline-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin: 0;
  }

  .pattern-header h2,
  .related-header h3 {
    font-size: 28px;
  }

  .pattern-meta {
    text-align: left;
  }

  .dot-track-shell {
    overflow-x: hidden;
    border-radius: 28px;
    padding: 18px 12px 38px;
  }

  .dot-track {
    width: 100%;
    min-width: 0;
  }

  .track-slot {
    min-height: 56px;
  }

  .track-slot-label {
    font-size: 10px;
  }

  .dot-legend {
    gap: 10px;
  }

  .related-songs {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .pattern-card,
  .related-card,
  .controls-panel {
    padding: 18px;
  }

  .page-shell {
    padding: 14px;
  }

  .hero-visual-grid {
    min-height: 148px;
  }

  .footerShareLinks {
    gap: 6px;
  }

  .nav-link {
    flex-basis: auto;
    padding: 0 6px;
    font-size: 10px;
    min-height: 30px;
  }

  .nav-logo {
    font-size: 22px;
  }

  .controls-panel {
    position: static;
  }

  .related-songs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .animator-controls {
    gap: 10px;
  }

  .inline-actions {
    grid-template-columns: 1fr;
  }

  .action-btn {
    width: 100%;
  }

  .dot-track {
    min-width: 0;
  }

  .legend-item {
    font-size: 11px;
  }

  .track-slot-label {
    display: none;
  }
}
