/* Front page: the "Enter Production Library" button on the way to the library.
 *
 * The client, 2 Dec 2026, asked for something "totally different, more
 * traditional"; CJ picked option E, "White studio key", from round 2 and said
 * "this one lets deploy". This file is option E exactly as approved in
 * design\traditional-button\approved-E\trad2.css: warm off-white face, #061616
 * ink, a 5px dark base edge, and a small black disc on the left holding a teal
 * play triangle that becomes three live bars on hover. Nothing here is meant to
 * be improved on: CJ approved what he saw.
 *
 * The markup is static, straight in index.html: no JS builds it, and rest,
 * hover, press and focus are all CSS, so nothing here can fail to initialise.
 *
 * The harness classes .is-hover / .is-press / .is-focus come with E from the
 * approved file; the preview and the tests use them to pin a state for a shot.
 */

/* Where the button sits: the slot the console button used, top of the search
   section, above SEARCH THE COMMUNITY. */
.search-section > .tb2 {
  margin: clamp(10px, 2.6vw, 26px) 0 clamp(34px, 5vw, 48px);
  vertical-align: middle;
}

/* Phone: full width up to 340, centred, never wider than the section. */
@media (max-width: 520px) {
  .search-section > .tb2 {
    display: flex;
    width: min(100%, 340px);
    margin-left: auto;
    margin-right: auto;
  }
}

/* ---------------------------------------------------------------- shared -- */
/* The face, the base edge and the press. */
.tb2 {
  --edge: 5px;
  --edge-c: #0A2A28;

  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 15px;

  min-height: 64px;
  max-width: 100%;
  padding: 0 34px;
  border: 0;
  border-radius: 14px;

  font-family: var(--f-display, 'Syne', system-ui, sans-serif);
  font-weight: 700;
  font-size: 15.5px;
  line-height: 1;
  letter-spacing: 0.075em;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;

  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;

  transform: translateY(0);
  transition:
    transform 210ms cubic-bezier(0.16, 1.45, 0.36, 1),   /* springs back */
    box-shadow 150ms cubic-bezier(0.25, 0.9, 0.3, 1),
    filter 140ms ease,
    color 140ms ease,
    background-color 140ms ease;
}

/* Text and icons ride above the grain. */
.tb2 > * { position: relative; z-index: 2; }
.tb2 .tb2-text { display: block; }

/* Fine film grain: inline SVG feTurbulence, laid on the face only. The alpha
   is forced opaque (feFuncA table) so the noise is mid-grey, not a wash of
   semi-transparent white; overlay then adds and removes about 1% of light. */
.tb2::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='table' tableValues='1 1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  opacity: var(--grain, 0.2);
  mix-blend-mode: overlay;
}

/* Focus: one ring, outside the base edge, on the page ground. */
.tb2:focus-visible,
.tb2.is-focus {
  outline: 3px solid var(--teal-bright, #5EEAD4);
  outline-offset: 4px;
}

/* ------------------------------------------------------------------- E -- */
/* White studio key. Warm off-white face, ink label, dark base edge, and a
   small black disc on the left: a teal play triangle at rest, which turns
   into three live bars on hover. */
.tb2-e {
  --edge: 5px;
  --edge-c: #0A2A28;
  --grain: 0.45;
  gap: 14px;
  padding: 0 24px;
  background-color: #F4F7F6;
  background-image: linear-gradient(180deg, #FCFEFD 0%, #F4F7F6 46%, #E9EFED 100%);
  color: #061616;
  box-shadow:
    inset 0 1px 0 #FFFFFF,                          /* 1px top light line */
    inset 0 -1px 0 rgba(6, 22, 22, 0.10),
    inset 0 0 0 1px rgba(6, 22, 22, 0.055),
    0 var(--edge) 0 var(--edge-c),                  /* the base edge */
    0 16px 22px -8px rgba(0, 0, 0, 0.55);           /* cast shadow on the page */
}

.tb2-e .tb2-disc {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #061616;
  color: var(--teal-primary, #2DD4BF);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: box-shadow 140ms ease;
}
.tb2-e .tb2-ico { display: block; width: 22px; height: 22px; }
.tb2-e .tb2-tri,
.tb2-e .tb2-eq { transition: opacity 120ms ease; }
.tb2-e .tb2-eq { opacity: 0; }
.tb2-e .tb2-eq rect { transform-box: fill-box; transform-origin: 50% 100%; }

/* The ink fix: styles.css has a blanket `a:hover { color: var(--teal-primary); }`,
   which would turn E's ink label teal on hover. This keeps it #061616. */
.tb2-e:hover,
.tb2-e.is-hover {
  color: #061616;
  transform: translateY(-1px);
  filter: brightness(1.02);
  box-shadow:
    inset 0 1px 0 #FFFFFF,
    inset 0 -1px 0 rgba(6, 22, 22, 0.10),
    inset 0 0 0 1px rgba(6, 22, 22, 0.055),
    0 calc(var(--edge) + 1px) 0 var(--edge-c),
    0 20px 26px -8px rgba(0, 0, 0, 0.6);
}
.tb2-e:hover .tb2-disc,
.tb2-e.is-hover .tb2-disc {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 0 0 1px rgba(45, 212, 191, 0.55);
}
.tb2-e:hover .tb2-tri,
.tb2-e.is-hover .tb2-tri { opacity: 0; }
.tb2-e:hover .tb2-eq,
.tb2-e.is-hover .tb2-eq { opacity: 1; }
.tb2-e:hover .tb2-eq rect,
.tb2-e.is-hover .tb2-eq rect { animation: tb2-eq 700ms ease-in-out infinite alternate; }
.tb2-e .tb2-eq rect:nth-of-type(2) { animation-delay: -240ms; }
.tb2-e .tb2-eq rect:nth-of-type(3) { animation-delay: -480ms; }

@keyframes tb2-eq {
  from { transform: scaleY(0.34); }
  to   { transform: scaleY(1); }
}

.tb2-e:active,
.tb2-e.is-press {
  color: #061616;
  filter: brightness(0.985);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 2px 3px rgba(6, 22, 22, 0.09),
    inset 0 0 0 1px rgba(6, 22, 22, 0.07),
    0 0 0 var(--edge-c),
    0 2px 5px -1px rgba(0, 0, 0, 0.5);
}

/* ---------------------------------------------------------------- press -- */
/* The whole point: the face drops exactly the height of its base and the base
   edge goes to zero, so it seats on the page instead of floating. 80ms down,
   the 210ms spring on .tb2 carries it back up. Kept last so that pressing a
   hovered button wins the cascade at equal specificity. */
.tb2:active,
.tb2.is-press {
  transform: translateY(var(--edge));
  transition:
    transform 80ms ease-out,
    box-shadow 80ms ease-out,
    filter 80ms ease-out,
    color 140ms ease,
    background-color 140ms ease;
}

/* --------------------------------------------------------------- phone -- */
/* Full width up to 340 x 58, 15px Syne 700. The label alone is 283px at 15px;
   at 360 the section is 312 wide, so at this size the disc and play icon cannot
   come along without dropping the type to ~13px, which is the thin-and-cheap
   look CJ rejected. So on phones the key is the label, flush and centred, and
   the music detail belongs to the pointer layouts. */
@media (max-width: 520px) {
  .tb2 {
    min-height: 58px;
    padding: 0 14px;
    gap: 0;
    font-size: 15px;
    letter-spacing: 0.06em;
  }
  .tb2 .tb2-disc,
  .tb2 .tb2-ico,
  .tb2 .tb2-meter { display: none; }
  .tb2-e { padding: 0 14px; }
}

/* ------------------------------------------------------- reduced motion -- */
/* No bars moving, no spring. The press itself still works: the face still
   seats on its base in 80ms. */
@media (prefers-reduced-motion: reduce) {
  .tb2,
  .tb2 .tb2-ico,
  .tb2 .tb2-tri,
  .tb2 .tb2-eq,
  .tb2 .tb2-eq rect { transition: none; }
  .tb2 .tb2-eq rect,
  .tb2-e:hover .tb2-eq rect,
  .tb2-e.is-hover .tb2-eq rect { animation: none !important; }
}
