/* LARK console — Type B content windows, per BRAND-BOOK.md.
   Everything is driven by variables so sky mode stays intact. */

:root {
  --bg-color: #f4f4f4;
  --line-color: #333333;
  --line-color-light: #aaaaaa;
  --next-color: #0044ff;
  --past-color: #666666;
  --shadow-color: rgba(0, 0, 0, 0.2);
  --wash: rgba(0, 0, 0, 0.02);
  --ui-font: 'Courier New', Courier, monospace;

  font-size: 18px;
}

body.sky {
  --bg-color: #050510;
  --line-color: #ffffff;
  --line-color-light: #555566;
  --past-color: #9999aa;
  --shadow-color: rgba(255, 255, 255, 0.2);
  --wash: rgba(255, 255, 255, 0.03);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 40px 20px 60px;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
  padding-bottom: max(60px, env(safe-area-inset-bottom));
  background: var(--bg-color);
  color: var(--line-color);
  font-family: var(--ui-font);
  /* Day / sky theme change is the one slow transition. */
  transition: background 0.8s ease, color 0.8s ease;
}

.console {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* --- Brand lockup: the only place letter-spacing is allowed --- */

.lockup {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.lockup .mark {
  border: 1px solid var(--line-color);
  padding: 3px 8px;
}

.lockup .expansion {
  opacity: 0.75;
  letter-spacing: 0.06em;
}

.spacer {
  flex: 1;
}

/* --- Call hero: Britrln onboarding moment (brand-book exception) --- */

@font-face {
  font-family: 'Britrln';
  src: url('/fonts/britrln_.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Britrdn';
  src: url('/fonts/britrdn_.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

.call-hero {
  border: 1px solid var(--line-color);
  border-radius: 0;
  background: var(--line-color);
  color: var(--bg-color);
  box-shadow: 6px 6px 0 var(--shadow-color);
  padding: 36px 24px 32px;
  text-align: center;
  transition: background 0.8s ease, box-shadow 0.8s ease, color 0.8s ease;
}

.call-hero-label {
  margin: 0 0 14px;
  font-family: var(--ui-font);
  font-size: 0.65rem;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.85;
}

.call-hero-number {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.12em;
  margin: 0;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.15s ease;
  flex-wrap: wrap;
}

.call-hero-number:hover {
  opacity: 0.82;
}

.call-hero-prefix {
  font-family: 'Britrln', 'Britrdn', Georgia, serif;
  font-size: clamp(2.6rem, 11vw, 5rem);
  font-weight: normal;
  line-height: 1;
  letter-spacing: 0.02em;
  word-break: break-word; 
}

.call-hero-digits {
  font-family: 'Britrln', 'Britrdn', Georgia, serif;
  font-size: clamp(2.6rem, 11vw, 5rem);
  font-weight: normal;
  line-height: 1;
  letter-spacing: 0.02em;
  word-break: break-word;
}

.call-hero-aside {
  margin: 16px 0 0;
  font-family: var(--ui-font);
  font-size: 0.65rem;
  font-style: italic;
  opacity: 0.75;
}

.call-hero.is-unset .call-hero-digits {
  font-family: var(--ui-font);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.65;
}

/* --- Buttons: base .btn only --- */

.btn {
  background: var(--bg-color);
  border: 1px solid var(--line-color);
  border-radius: 0;
  color: var(--line-color);
  padding: 5px 12px;
  font-family: var(--ui-font);
  font-size: 0.65rem;
  font-weight: normal;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn:hover {
  background: var(--line-color);
  color: var(--bg-color);
}

.btn[aria-pressed='true'],
.btn.is-active {
  background: var(--line-color);
  color: var(--bg-color);
}

.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.45;
  cursor: default;
}

.btn:disabled:hover,
.btn[aria-disabled='true']:hover {
  background: var(--bg-color);
  color: var(--line-color);
}

/* --- Type B content window --- */

.window {
  border: 1px solid var(--line-color);
  border-radius: 0;
  background: var(--bg-color);
  box-shadow: 6px 6px 0 var(--shadow-color);
  /* Matches the body, so the day / sky invert eases as one surface. */
  transition: background 0.8s ease, box-shadow 0.8s ease;
}

.expanded-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  border-bottom: 1px solid var(--line-color);
}

.expanded-header h2 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: normal;
  text-transform: uppercase;
}

.expanded-body {
  padding: 20px;
}

.expanded-body > * + * {
  margin-top: 12px;
}

.expanded-body p {
  margin: 0;
  font-size: 0.7rem;
  line-height: 1.6;
}

.expanded-body p.secondary {
  opacity: 0.75;
}

/* Italic is reserved for helper and voice lines. */
.voice-line {
  font-style: italic;
  font-size: 0.7rem;
  line-height: 1.6;
  opacity: 0.85;
  border-left: 2px solid var(--line-color);
  padding-left: 12px;
}

/* --- Micro badges: square hard chips --- */

.badge {
  border: 1px solid var(--line-color);
  padding: 2px 6px;
  font-size: 0.55rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge.filled {
  background: var(--line-color);
  color: var(--bg-color);
}

.badge.muted {
  border-color: var(--line-color-light);
  color: var(--past-color);
}

/* Inside the LCD the surface is already inverted, so the chips invert too. */
.badge.invert {
  border-color: var(--bg-color);
  color: var(--bg-color);
}

.badge.invert.filled {
  background: var(--bg-color);
  color: var(--line-color);
}

.badge.invert.muted {
  border-color: var(--bg-color);
  color: var(--bg-color);
  opacity: 0.6;
}

/* --- Readout: label / value pairs --- */

.readout {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.readout > div {
  border-top: 1px dashed var(--line-color-light);
  padding-top: 4px;
}

.readout dt {
  font-size: 0.65rem;
  text-transform: uppercase;
  opacity: 0.75;
}

.readout dd {
  margin: 4px 0 0;
  font-size: 0.7rem;
}

/* --- Section wash, not a card --- */

.wash {
  background: var(--wash);
  border: 1px solid var(--line-color-light);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.wash .label {
  font-size: 0.65rem;
  text-transform: uppercase;
  opacity: 0.75;
}

.wash .value {
  font-size: 0.7rem;
}

/* --- Relay player: Winamp's density, flattened into the house style --- */

/* The readout borrows the call hero's inversion, so it needs no new colour. */
.lcd {
  background: var(--line-color);
  color: var(--bg-color);
  border: 1px solid var(--line-color);
  border-radius: 0;
  padding: 14px 15px;
  transition: background 0.8s ease, color 0.8s ease;
}

.lcd-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lcd-glyph {
  font-size: 0.8rem;
  line-height: 1;
}

.lcd-time {
  font-size: 1.5rem;
  line-height: 1;
  white-space: nowrap;
}

.lcd-slash {
  opacity: 0.5;
  margin: 0 0.35em;
}

.lcd-title {
  margin-top: 10px;
  font-size: 0.7rem;
  text-transform: uppercase;
  word-break: break-word;
}

.lcd-chips {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Analyser bars are divs rather than canvas, so the theme variables reach them. */
.analyser {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 26px;
  flex-shrink: 0;
}

.analyser .bar {
  width: 3px;
  height: 2px;
  background: var(--bg-color);
  opacity: 0.85;
  transition: height 0.08s linear;
}

/* --- Timeline: the relay as one continuous tape --- */

.timeline-bar {
  position: relative;
  display: flex;
  align-items: stretch;
  height: 38px;
  border: 1px solid var(--line-color);
  background: var(--bg-color);
  overflow: hidden;
}

.timeline-empty {
  margin: 0;
  padding: 0 10px;
  align-self: center;
  font-size: 0.6rem;
  text-transform: uppercase;
  opacity: 0.6;
}

/* Each segment is a real button, so jumping is clickable and focusable. */
.timeline .segment {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 4px;
  border: 0;
  /* The right edge is the checkpoint: where the line changed hands. */
  border-right: 1px solid var(--line-color);
  background: transparent;
  color: var(--line-color);
  font-family: var(--ui-font);
  font-size: 0.55rem;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.timeline .segment:last-of-type {
  border-right: 0;
}

.timeline .segment:hover {
  background: var(--wash);
}

.timeline .segment.heard {
  background: var(--wash);
}

.timeline .segment.is-current {
  background: var(--line-color);
  color: var(--bg-color);
}

/* Outlined, so it stays visible over both plain and inverted segments. */
.playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--bg-color);
  box-shadow: 0 0 0 1px var(--line-color);
  pointer-events: none;
}

.timeline-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  font-size: 0.55rem;
  text-transform: uppercase;
  opacity: 0.75;
}

/* --- Transport --- */

.transport {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Borders collapse into one another, the way a Winamp button cluster reads. */
.transport-cluster {
  display: flex;
}

.transport-cluster .btn + .btn {
  margin-left: -1px;
}

.btn.glyph {
  min-width: 40px;
  padding: 6px 10px;
  font-size: 0.7rem;
  line-height: 1;
  text-align: center;
}

/* --- Ledger: vertical rule with circular dots --- */

.ledger {
  margin: 0;
  padding: 0 0 0 20px;
  list-style: none;
  border-left: 1px solid var(--line-color-light);
}

.ledger .entry {
  position: relative;
  padding: 0 0 16px 12px;
}

.ledger .entry:last-child {
  padding-bottom: 0;
}

/* Circular dots are a documented radius exception. */
.ledger .entry::before {
  content: '';
  position: absolute;
  left: -25px;
  top: 4px;
  width: 9px;
  height: 9px;
  border: 1px solid var(--line-color);
  border-radius: 50%;
  background: var(--bg-color);
}

.ledger .entry.archived::before {
  background: var(--line-color);
}

/* The entry the transport is currently sitting on. */
.ledger .entry.is-current {
  background: var(--wash);
}

.ledger .entry-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ledger .sequence {
  font-size: 0.7rem;
}

.ledger .meta {
  font-size: 0.65rem;
  opacity: 0.75;
  margin-top: 4px;
}

.ledger .entry-actions {
  margin-top: 8px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* --- Are.na wall: bordered rectangles, radius 0 --- */

.wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.wall .block {
  border: 1px solid var(--line-color);
  padding: 10px;
  display: block;
  color: inherit;
  text-decoration: none;
  transition: background 0.15s ease;
}

/* List and grid hover is a light wash, not an invert. */
.wall .block:hover {
  background: var(--wash);
}

.wall .block .title {
  font-size: 0.65rem;
  text-transform: uppercase;
  word-break: break-word;
}

.wall .block .meta {
  font-size: 0.55rem;
  opacity: 0.75;
  margin-top: 6px;
}

.wall .block .cover {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--line-color-light);
  margin-bottom: 8px;
}

.empty {
  font-size: 0.65rem;
  text-transform: uppercase;
  opacity: 0.65;
}

.helper {
  font-size: 0.65rem;
  font-style: italic;
  opacity: 0.75;
}

.rule-dashed {
  border: 0;
  border-top: 1px dashed var(--line-color-light);
  margin: 0;
}

.footnote {
  font-size: 0.65rem;
  text-transform: uppercase;
  opacity: 0.65;
  text-align: center;
}

/* --- Mobile: drop the floating panel chrome --- */

@media (max-width: 768px) {
  :root {
    font-size: 16px;
  }

  body {
    padding: 20px 0 40px;
  }

  .console {
    gap: 20px;
  }

  .lockup {
    padding: 0 15px;
  }

  .window {
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }

  .call-hero {
    border-left: 0;
    border-right: 0;
    box-shadow: none;
    padding: 28px 15px 24px;
  }

  .call-hero-number {
    font-size: clamp(2.2rem, 14vw, 3.4rem);
  }

  .expanded-body {
    padding: 14px 15px;
  }

  .readout {
    grid-template-columns: 1fr;
  }

  .lcd-row {
    flex-wrap: wrap;
  }

  .lcd-time {
    font-size: 1.2rem;
  }

  /* The analyser is decoration; the readout keeps the width when space is tight. */
  .analyser {
    height: 20px;
  }

  .transport-cluster {
    flex: 1 0 auto;
  }
}
