@font-face {
  font-family: "Adventor";
  src: url("fonts/texgyreadventor-regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Adventor";
  src: url("fonts/texgyreadventor-bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

body {
  margin: 0;
  padding: 28px 0 56px; /* extra room at the bottom so mobile doesn't hit the screen edge */
  background: #0E0F12;
  color: #ffffff;

  font-family: "Adventor", Arial, sans-serif;

  line-height: 1.5;

  display: flex;
  flex-direction: column;
  gap: 28px;

  opacity: 0;
  animation: fadeIn 0.6s forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

.top-bolt {
  max-width: 800px;
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 0 20px;
}

.bottom-bolt {
  margin-top: 40px; /* extra room before it, on top of body's usual gap */
  margin-bottom: 20px; /* a bit of extra room after it, on top of body's gap */
}

/* real reserved height, independent of the rotated panel's own JS-measured
   footprint — a plain fallback buffer in case that measurement is still off
   on some phones and the bottom bolt creeps up onto the sequencer */
.mobile-spacer {
  visibility: hidden;
  height: 0;
  overflow: hidden;
}

@media (max-width: 600px) {
  .mobile-spacer {
    height: 70px;
  }
}

.top-bolt img {
  display: block;
  width: 42px; /* 1.5x the 28px play button */
  height: 42px;
  /* numerically solved to tint the source image to #D5A430 */
  filter: brightness(0) invert(71%) sepia(75%) saturate(334%) hue-rotate(0deg) brightness(77%) contrast(126%);
}

/* MODULE SPACING (equal, driven by body gap) */
.module {
  max-width: 800px;
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 0 20px;
}

h2 {
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 8px;
  font-size: 20px;
}

/* TEXT vs LINKS hierarchy */
p {
  margin: 6px 0;
  opacity: 0.92;
  font-size: 16px;
}

/* LINKS slightly smaller than text */
a {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: #b3b3b3;
  text-decoration: underline;
  font-size: 15px;
  transition: color 0.2s ease;
}

.icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

a:hover {
  color: #D5A430;
}

.note {
  font-size: 12px;
  opacity: 0.6;
  margin-top: 10px;
}

.email {
  font-size: 15px;
  opacity: 1;
}

/* SEQUENCER */
.sequencer-module {
  margin-top: 40px; /* extra breathing room before the sequencer, on top of the usual gap */
}

.seq-intro {
  margin-bottom: 12px;
}

/* desktop default: plain wrapper, no special sizing (only the mobile
   rotated layout needs JS-measured dimensions here, see sequencer.js) */
.seq-rotate-wrap {
  position: relative;
}

.seq-panel {
  width: fit-content;
  margin: 0;
  background: #101114;
  border: 1px solid #26272c;
  border-radius: 6px;
  overflow: hidden;
  /* 10% bigger everywhere — `zoom` (unlike transform:scale) actually
     resizes the box for layout purposes too, so nothing needs to reflow
     manually, and it composes cleanly with the mobile rotation below */
  zoom: 1.2;
}

.seq-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 20px;
  border-bottom: 1px solid #26272c;
}

.seq-play-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #b3b3b3;
  background: transparent;
  border: 1px solid #3a3a3a;
  border-radius: 3px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.seq-play-btn svg {
  width: 11px;
  height: 11px;
}

.seq-play-btn:hover {
  color: #D5A430;
  border-color: #D5A430;
}

.seq-play-btn.is-playing,
.seq-play-btn.is-unmuted {
  color: #D5A430;
  border-color: #D5A430;
}

.seq-fader {
  display: flex;
  align-items: center;
  gap: 6px;
}

.seq-fader label {
  font-size: 9px;
  color: #6d6d6d;
  letter-spacing: 0.5px;
}

.seq-fader-value {
  font-size: 9px;
  color: #6d6d6d;
  width: 20px;
  text-align: center;
}

.seq-fader-track {
  position: relative;
  display: inline-flex;
}

.seq-filter-reset {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 5px;
  width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #3a3a3a;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.seq-filter-reset:hover {
  background: #D5A430;
  border-color: #D5A430;
}

.seq-fader input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 70px;
  height: 8px; /* rectangle, slightly narrower than the 10px thumb */
  background: #3a3a3a;
  border-radius: 2px;
  cursor: pointer;
}

.seq-fader input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #b3b3b3;
  transition: background 0.15s ease;
}

.seq-fader input[type="range"]:hover::-webkit-slider-thumb {
  background: #D5A430;
}

.seq-fader input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: none;
  border-radius: 50%;
  background: #b3b3b3;
  transition: background 0.15s ease;
}

.seq-fader input[type="range"]:hover::-moz-range-thumb {
  background: #D5A430;
}

.seq-grid-wrap {
  overflow-x: auto;
  padding: 10px;
}

.seq-grid {
  display: inline-grid;
  grid-template-columns: 34px repeat(16, 20px) 24px 50px;
  gap: 3px;
}

.seq-label {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 4px;
  font-size: 9px;
  color: #6d6d6d;
  letter-spacing: 0.5px;
}

.seq-step {
  aspect-ratio: 1 / 1;
  background: #17181c;
  border: 1px solid #26272c;
  border-radius: 3px;
  padding: 0;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.seq-step--beat {
  border-color: #333438;
}

.seq-step:hover {
  border-color: #555;
}

.seq-mute {
  width: 13px;
  height: 13px;
  aspect-ratio: 1 / 1;
  align-self: center;
  justify-self: center;
  background: transparent;
  border: 1px solid #3a3a3a;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.seq-mute:hover {
  border-color: #D5A430;
}

.seq-mute.is-active {
  background: #D5A430;
  border-color: #D5A430;
}

.seq-vol {
  -webkit-appearance: none;
  appearance: none;
  align-self: center;
  justify-self: start;
  width: 46px;
  height: 6px; /* rectangle, slightly narrower than the 8px thumb */
  background: #3a3a3a;
  border-radius: 2px;
  cursor: pointer;
}

.seq-vol::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b3b3b3;
  transition: background 0.15s ease;
}

.seq-vol:hover::-webkit-slider-thumb {
  background: #D5A430;
}

.seq-vol::-moz-range-thumb {
  width: 8px;
  height: 8px;
  border: none;
  border-radius: 50%;
  background: #b3b3b3;
  transition: background 0.15s ease;
}

.seq-vol:hover::-moz-range-thumb {
  background: #D5A430;
}

.seq-step.is-active {
  background: #D5A430;
  border-color: #D5A430;
}

.seq-step.is-playhead {
  outline: 1.5px solid rgba(120, 200, 255, 0.85);
  outline-offset: -1.5px;
}

/* ============================
   MOBILE — the whole panel rotated 90deg, everything below either
   compensates for that rotation (counter-rotating text/icons back to
   horizontal, flipping slider direction) or reorders things via flex
   `order` so build order / DOM order can stay the same as desktop.
   Row build order and label text (2-letter vs full word) are handled in
   sequencer.js via the same breakpoint (matchMedia("(max-width: 600px)")).
   ============================ */
@media (max-width: 600px) {
  .seq-panel {
    transform-origin: top left;
    transform: rotate(90deg) translateY(-100%);
    /* topbar/grid stack as a flex column so their visual order can be
       swapped below without touching the (shared, desktop-order) DOM */
    display: flex;
    flex-direction: column;
  }

  .seq-topbar {
    order: 2;
  }

  .seq-grid-wrap {
    order: 1;
  }

  .seq-play-btn svg {
    /* cancels the panel's 90deg rotation so the play/mute icons stay upright */
    transform: rotate(-90deg);
  }

  /* visual order after rotation: value on top, slider in the middle, label
     on the bottom (was label/slider/value left-to-right before rotating) */
  .seq-fader > input[type="range"],
  .seq-fader > .seq-fader-track {
    order: 2;
  }

  .seq-fader label {
    order: 3;
    /* cancels the panel's 90deg rotation so the label reads horizontally */
    transform: rotate(-90deg);
  }

  .seq-fader-value {
    order: 1;
    /* same compensation as the fader label */
    transform: rotate(-90deg);
  }

  .seq-fader input[type="range"] {
    /* the whole panel is rotated 90deg; this local 180deg flips the slider
       back so it reads "up = more" instead of "up = less" */
    transform: rotate(180deg);
  }

  .seq-label {
    /* cancels the panel's 90deg rotation so the label reads horizontally;
       translateY here (pre-rotation) ends up as a horizontal nudge on
       screen once rotated — negative = left */
    transform: rotate(-90deg) translateY(-11px);
    /* mobile-only: align by the label's own bottom edge instead of
       centering, so it lines up with the play button's bottom edge */
    align-items: flex-end;
  }

  .seq-vol {
    /* same compensation as the topbar faders: cancels the panel's rotation
       so up = louder, down = quieter */
    transform: rotate(180deg);
  }
}

/* canvas */
#fx {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999; /* always draw bolts above the UI, including the sequencer panel */
}