/* ==========================================================================
   SUUBI EDIT BAY v1 (Nov 15, 2026)
   The website v3 look as a layer any Suubi page can wear in its own brand:
   a monitor with viewfinder corners, a REC counter, a live local clock and,
   when there is film, a clip track with a playhead you can drag. Section
   labels are numbered in mono, eyebrows can become the glowing tag pill, and
   the first visit gets a short opening shot.

   Brand comes from the page: --eb-accent (set by editbay.js from the page's
   config) colors the numbers, the REC dot and the playhead. Fonts, colors and
   headline style stay the client's own.

   Progressive: without editbay.js nothing here applies (every rule sits under
   html.editbay). Motion is transform and opacity only and stops for reduced motion.
   ========================================================================== */

html.editbay {
  --eb-accent: #e3262f;
  --eb-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --eb-ease: cubic-bezier(0.23, 1, 0.32, 1);
  --eb-line: rgba(255, 255, 255, 0.2);
  --eb-ink: rgba(255, 255, 255, 0.9);
  --eb-ink-2: rgba(235, 235, 245, 0.62);
}

/* ------------------------------------------------ numbered section labels */
html.editbay body {
  counter-reset: ebsec;
}
html.editbay [data-eb-num]::before {
  counter-increment: ebsec;
  content: counter(ebsec, decimal-leading-zero);
  width: auto;
  height: auto;
  margin-right: 2px;
  border-radius: 0;
  background: none;
  color: var(--eb-accent);
  font: 700 12px/1 var(--eb-mono);
  letter-spacing: 0.08em;
}

/* ------------------------------------------------------------ the tag pill */
html.editbay .eb-tag {
  display: inline-flex;
  align-self: flex-start;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  backdrop-filter: blur(24px) saturate(170%);
  color: #ffffff;
}
html.editbay .eb-tag::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--eb-accent);
  box-shadow: 0 0 12px var(--eb-accent);
}

/* ------------------------------------------------------- the monitor (bay) */
/* editbay.js adds eb-rel only when the element was not positioned already,
   so a page's own absolute or sticky layout is never changed. */
html.editbay .eb-rel {
  position: relative;
}
html.editbay .eb-hud {
  position: absolute;
  inset: var(--eb-inset, 12px);
  z-index: 6;
  color: var(--eb-ink);
  pointer-events: none;
  container-type: inline-size;
}
/* A narrow monitor drops the city name first, then the clock, so the row never crowds. */
@media (min-width: 641px) {
  @container (max-width: 380px) {
    html.editbay .eb-cn {
      display: none;
    }
  }
}
@media (max-width: 640px) {
  @container (max-width: 330px) {
    html.editbay .eb-cn {
      display: none;
    }
  }
}
@container (max-width: 240px) {
  html.editbay .eb-city {
    display: none;
  }
}
html.editbay .eb-bay.eb-has-tl > .eb-hud {
  bottom: calc(var(--eb-tl-h, 0px) + 12px);
}
html.editbay .eb-c {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 0 solid var(--eb-c, rgba(255, 255, 255, 0.78));
}
html.editbay .eb-c.eb-a {
  top: 0;
  left: 0;
  border-top-width: 2px;
  border-left-width: 2px;
  border-top-left-radius: 12px;
}
html.editbay .eb-c.eb-b {
  top: 0;
  right: 0;
  border-top-width: 2px;
  border-right-width: 2px;
  border-top-right-radius: 12px;
}
html.editbay .eb-c.eb-d {
  bottom: 0;
  left: 0;
  border-bottom-width: 2px;
  border-left-width: 2px;
  border-bottom-left-radius: 12px;
}
html.editbay .eb-c.eb-e {
  right: 0;
  bottom: 0;
  border-right-width: 2px;
  border-bottom-width: 2px;
  border-bottom-right-radius: 12px;
}
html.editbay .eb-row {
  position: absolute;
  top: 10px;
  right: 42px;
  left: 42px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font: 600 11.5px/1.2 var(--eb-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}
html.editbay .eb-row b {
  font-weight: 600;
}
html.editbay .eb-rec {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
html.editbay .eb-rec > i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--eb-accent);
  box-shadow: 0 0 14px var(--eb-accent);
  animation: eb-blink 1.1s steps(1, end) infinite;
}
@keyframes eb-blink {
  50% {
    opacity: 0.15;
  }
}

/* A monitor on a light page: dark corners and dark type. */
html.editbay .eb-bay.eb-light > .eb-hud {
  --eb-c: rgba(18, 18, 20, 0.72);
  color: #121214;
}
html.editbay .eb-bay.eb-light > .eb-hud .eb-row {
  text-shadow: none;
}

/* Film behind a part of the monitor: video, shade and grain. */
html.editbay .eb-host {
  isolation: isolate;
  overflow: hidden;
}
html.editbay .eb-host > .eb-bg {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
html.editbay .eb-host > .eb-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.62) 0%,
    rgba(0, 0, 0, 0.42) 40%,
    rgba(0, 0, 0, 0.82) 100%
  );
  pointer-events: none;
}
html.editbay .eb-host > .eb-shade::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("grain.png");
  background-size: 200px 200px;
  opacity: 0.45;
  mix-blend-mode: overlay;
}
html.editbay .eb-host > :not(.eb-bg):not(.eb-shade) {
  position: relative;
  z-index: 2;
}

/* The clip track: play, timecode, a strip of the film, a playhead to drag. */
html.editbay .eb-tl {
  position: relative;
  z-index: 3;
  padding: 14px 18px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.35);
  color: #ffffff;
}
html.editbay .eb-tl-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin-bottom: 10px;
}
html.editbay .eb-tl-play {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  cursor: pointer;
  transition: transform 160ms var(--eb-ease);
}
html.editbay .eb-tl-play::after {
  content: "";
  position: absolute;
  inset: -4px;
}
html.editbay .eb-tl-play:active {
  transform: scale(0.92);
}
html.editbay .eb-tl-play:focus-visible,
html.editbay .eb-tl-track:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}
html.editbay .eb-tl-play svg {
  width: 15px;
  height: 15px;
}
html.editbay .eb-tl-play .eb-ip,
html.editbay .eb-tl-play.is-paused .eb-iz {
  display: none;
}
html.editbay .eb-tl-play.is-paused .eb-ip {
  display: block;
}
html.editbay .eb-tl-tc {
  flex: none;
  font: 600 14px var(--eb-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
html.editbay .eb-tl-hint {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow: hidden;
  color: var(--eb-ink-2);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: opacity 300ms ease;
}
html.editbay .eb-tl-hint svg {
  flex: none;
  width: 17px;
  height: 17px;
  color: #ffffff;
}
html.editbay .eb-tl.is-scrubbed .eb-tl-hint {
  opacity: 0.5;
}
html.editbay .eb-tl-name {
  flex: none;
  margin-left: auto;
  color: var(--eb-ink-2);
  font: 600 11px var(--eb-mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
html.editbay .eb-tl-lane {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
html.editbay .eb-tl-v {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--eb-ink-2);
  font: 700 11px var(--eb-mono);
}
html.editbay .eb-tl-track {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 56px;
  border-radius: 11px;
  outline: 0;
  cursor: ew-resize;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}
html.editbay .eb-tl-strip {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 11px;
  background-color: rgba(255, 255, 255, 0.06);
  background-position: left center;
  background-repeat: repeat-x;
  background-size: auto 100%;
}
html.editbay .eb-tl-wave {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 6px;
}
html.editbay .eb-tl-wave > i {
  flex: 1;
  height: calc(var(--h) * 100%);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.42);
}
html.editbay .eb-tl-track::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--eb-line);
  border-radius: 11px;
  pointer-events: none;
}
html.editbay .eb-tl-head {
  position: absolute;
  top: -8px;
  bottom: -6px;
  left: 0;
  width: 100%;
  pointer-events: none;
}
html.editbay .eb-tl-head::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -1px;
  width: 2px;
  background: var(--eb-accent);
  box-shadow: 0 0 14px var(--eb-accent);
}
html.editbay .eb-tl-head > i {
  position: absolute;
  top: -5px;
  left: -8px;
  width: 16px;
  height: 14px;
  border-radius: 4px 4px 8px 8px;
  background: var(--eb-accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}
html.editbay .eb-tl-ruler {
  display: flex;
  justify-content: space-between;
  min-height: 13px;
  margin: 8px 0 0 40px;
  color: rgba(235, 235, 245, 0.55);
  font: 500 10.5px var(--eb-mono);
  letter-spacing: 0.06em;
}
html.editbay.eb-scrubbing,
html.editbay.eb-scrubbing * {
  cursor: ew-resize !important;
}

/* --------------------------------------------- the opening shot, once */
@media (prefers-reduced-motion: no-preference) {
  html.editbay.eb-intro .eb-hud {
    animation: eb-focus 1100ms var(--eb-ease) 150ms both;
  }
  html.editbay.eb-intro .eb-host > .eb-bg {
    animation: eb-inbg 1500ms var(--eb-ease) both;
  }
}
@keyframes eb-focus {
  from {
    opacity: 0;
    transform: scale(1.04);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes eb-inbg {
  from {
    opacity: 0;
    transform: scale(1.08);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ------------------------------------------------------------------ phone */
@media (max-width: 640px) {
  html.editbay .eb-hud {
    inset: var(--eb-inset-s, var(--eb-inset, 9px));
  }
  html.editbay .eb-tag {
    min-height: 34px;
    padding: 0 13px;
  }
  html.editbay .eb-c {
    width: 22px;
    height: 22px;
  }
  html.editbay .eb-row {
    top: 7px;
    right: 30px;
    left: 30px;
    font-size: 10px;
  }
  html.editbay .eb-tl {
    padding: 12px 12px 10px;
  }
  html.editbay .eb-bay.eb-has-tl > .eb-hud {
    bottom: calc(var(--eb-tl-h, 0px) + 9px);
  }
  html.editbay .eb-tl-hint,
  html.editbay .eb-tl-name {
    display: none;
  }
  html.editbay .eb-tl-track {
    height: 48px;
  }
  html.editbay .eb-tl-v {
    width: 28px;
  }
  html.editbay .eb-tl-ruler {
    margin-left: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.editbay .eb-rec > i {
    animation: none;
  }
}
