/* Shared chrome for the Business Opportunity detail pages.
   Same tokens and visual language as the main site. */

:root {
  --electric-red: #cc0000;
  --blue: #00bfff;
  --charcoal: #111111;
  --surface-2: #1a1a1a;
  --surface-3: #161616;
  --line: #2c2c2c;
  --line-soft: #262626;
  --text: #f2f2f2;
  --muted: #cccccc;
  --faint: #8a8a8a;
  --dim: #7d7d7d;
  --laser: rgba(204, 0, 0, 0.45);
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --maxw: 1280px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #151515;
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; }

/* header */
.detail-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(17, 17, 17, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--electric-red);
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.7);
}
.detail-header-inner {
  display: flex; align-items: center; gap: 2rem;
  height: 64px; max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; letter-spacing: 0.14em; font-size: 0.95rem; text-transform: uppercase; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(135deg, var(--electric-red) 0%, #7c0000 100%); box-shadow: 0 0 12px var(--laser); display: inline-block; }

.breadcrumb {
  margin-left: auto; display: flex; gap: 0.5rem; align-items: center;
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em;
  color: var(--dim); flex-wrap: wrap;
}
.breadcrumb .here { color: var(--muted); }
.breadcrumb a { color: var(--dim); transition: color 180ms; }
.breadcrumb a:hover { color: var(--blue); }

/* header CTA buttons — match the homepage navbar ghost buttons */
.header-ctas { display: flex; gap: 0.5rem; }
.header-ctas a {
  background: transparent; color: var(--muted); border: 1.5px solid #3a3a3a;
  padding: 0.32rem 0.8rem; font-size: 0.7rem; font-weight: 600; border-radius: 8px;
  white-space: nowrap; transition: color 180ms, border-color 180ms;
}
.header-ctas a:hover { color: var(--blue); border-color: var(--blue); }

/* desk switcher — jump between the four desks and the homepage catalogue */
.desk-switcher {
  border-top: 1px solid var(--line-soft, #232323);
  background: rgba(16, 16, 16, 0.6);
}
.desk-switcher-inner {
  display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap;
  max-width: var(--maxw); margin: 0 auto; padding: 0.45rem 1.5rem;
}
.desk-switcher .switch-label {
  font-family: var(--mono, monospace); font-size: 0.6rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--faint, #8a8a8a); margin-right: 0.4rem;
}
.desk-switcher a {
  font-family: var(--mono, monospace); font-size: 0.68rem; letter-spacing: 0.08em;
  color: var(--dim, #7d7d7d); padding: 0.25rem 0.6rem; border-radius: 6px;
  border: 1px solid transparent; transition: color 180ms, border-color 180ms, background 180ms;
}
.desk-switcher a:hover {
  color: var(--blue); border-color: rgba(0, 191, 255, 0.35); background: rgba(0, 191, 255, 0.06);
}
.desk-switcher a.current {
  color: var(--accent, var(--electric-red)); border-color: var(--line, #2c2c2c); background: var(--surface-3, #161616);
}

@media (max-width: 900px) { .header-ctas { display: none; } }

/* page body */
.detail-main { padding: clamp(2.6rem, 6vw, 4.5rem) 0; }

.desk-kicker {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--blue);
}
.desk-title {
  margin-top: 0.6rem; font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 700; letter-spacing: 0.02em;
}
.desk-role { margin-top: 0.35rem; font-size: 1rem; font-weight: 700; color: var(--accent, var(--electric-red)); }
.status-row { margin-top: 1rem; display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
.status-label { font-family: var(--mono); font-size: 0.72rem; color: var(--dim); }

.badge {
  display: inline-block; font-family: var(--mono); font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.18em; padding: 0.3rem 0.7rem; border-radius: 999px;
}
.badge.live { color: var(--blue); border: 1px solid rgba(0, 191, 255, 0.4); background: rgba(0, 191, 255, 0.08); }
.badge.reserved { color: var(--faint); border: 1px solid var(--line); background: transparent; }
.badge.planning { color: var(--amber, #ffb86b); border: 1px solid rgba(255, 184, 107, 0.4); background: rgba(255, 184, 107, 0.08); }

.desk-desc { margin-top: 1.2rem; color: var(--muted); max-width: 68ch; font-size: 1rem; }

.abs-rule { width: 44px; height: 3px; background: var(--accent, var(--electric-red)); margin-top: 1.6rem; border-radius: 2px; }

/* panel cards on the detail page */
.desk-panels { margin-top: 2.4rem; display: grid; gap: 1.1rem; }
.panel {
  border: 1px solid var(--line); background: var(--charcoal);
  border-radius: 10px; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  padding: 1.3rem 1.4rem;
}
.panel > b {
  display: block; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 0.6rem;
}
.panel p { color: var(--muted); font-size: 0.9rem; }

.mono-line { font-family: var(--mono); font-size: 0.75rem; color: var(--blue); letter-spacing: 0.06em; }

/* programme trio rows */
.trio {
  border: 1px solid var(--line-soft); background: var(--surface-3);
  border-radius: 8px; padding: 0.9rem 1rem; margin-top: 0.8rem;
  display: flex; flex-direction: column; gap: 0.75rem;
}
.trio-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.trio-row .row-name { font-weight: 700; font-size: 0.85rem; white-space: nowrap; }
.trio-row .row-desc { color: var(--muted); font-size: 0.82rem; }

/* plan chips */
.chips { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.7rem; }
.chip {
  font-family: var(--font); font-size: 0.72rem; font-weight: 700;
  padding: 0.35rem 0.85rem; border-radius: 999px;
  border: 1px solid var(--line); color: var(--accent, var(--electric-red)); background: var(--surface-3);
}
.chip .p-label { font-size: 0.55rem; letter-spacing: 0.14em; text-transform: uppercase; margin-left: 0.35rem; color: var(--faint); }

/* footer */
.detail-footer { border-top: 1px solid var(--line-soft); background: #101010; padding: 1.6rem 0 2rem; }
.back-link {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-weight: 700; font-size: 0.85rem; color: var(--accent, var(--electric-red));
  margin-bottom: 1.1rem; transition: transform 180ms;
}
.back-link .arrow { transition: transform 180ms; }
.back-link:hover .arrow { transform: translateX(-3px); }
.disclaimer {
  border-left: 3px solid var(--electric-red);
  background: var(--surface-3); border-radius: 0 8px 8px 0;
  padding: 0.85rem 1.1rem; color: var(--faint); font-size: 0.76rem; max-width: 90ch;
}
.foot-base {
  margin-top: 1.2rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  color: var(--dim); font-size: 0.72rem; font-family: var(--mono); letter-spacing: 0.08em;
}

/* reveal */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 420ms ease-out, transform 420ms ease-out; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* clickable trio rows — each programme links to its own page */
a.trio-row { color: inherit; border-radius: 6px; }
a.trio-row:hover .row-name { color: var(--accent, var(--electric-red)); }
a.trio-row .row-name { transition: color 180ms; }

/* long combined desk labels: let them wrap cleanly instead of overflowing */
.desk-switcher a { hyphens: none; overflow-wrap: anywhere; max-width: 100%; }

@media (max-width: 640px) {
  .desk-switcher a { font-size: 0.6rem; padding: 0.35rem 0.5rem; line-height: 1.5; white-space: normal; }
  .trio-row { flex-direction: column; align-items: flex-start; gap: 0.35rem; }
  .trio-row .row-name { white-space: normal; }
}

@media (max-width: 640px) {
  .breadcrumb { display: none; }
  .detail-header-inner { height: 56px; }
  .desk-switcher-inner { padding: 0.4rem 1rem; }
}

/* ---------- tabs ---------- */
.tabs { margin-top: 2.2rem; }
.tablist {
  display: flex; gap: 0.4rem; flex-wrap: wrap;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 0;
}
.tab-btn {
  font-family: var(--font); font-size: 0.85rem; font-weight: 700;
  color: var(--faint); background: none; cursor: pointer;
  border: none; border-bottom: 2px solid transparent;
  padding: 0.7rem 1rem; letter-spacing: 0.02em;
  transition: color 200ms, border-color 200ms;
}
.tab-btn:hover { color: var(--muted); }
.tab-btn[aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--accent, var(--electric-red));
}
.tab-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }

.tab-panel {
  padding: 1.6rem 0 0.4rem;
  animation: tab-in 200ms ease;
}
.tab-panel[hidden] { display: none; }
@keyframes tab-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.desk-panels { margin-top: 0; }

.plan-note {
  display: flex; align-items: baseline; gap: 0.6rem;
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--dim);
  border: 1px dashed var(--line); border-radius: 8px;
  background: transparent; padding: 0.55rem 0.8rem; margin-bottom: 1.1rem;
}

.plan-list { display: flex; flex-direction: column; gap: 0.9rem; }
.plan-item { border-left: 2px solid var(--line); padding-left: 0.9rem; }
.plan-item b { display: block; font-size: 0.85rem; color: var(--text); }
.plan-item b .phase { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.16em; text-transform: uppercase; margin-left: 0.5rem; }
.plan-item p { color: var(--muted); font-size: 0.85rem; margin-top: 0.2rem; }

.start-row { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; margin-top: 1.4rem; }
.start-btn {
  font-family: var(--font); font-size: 0.85rem; font-weight: 600;
  color: #fff; background: var(--electric-red);
  border: none; border-radius: 8px; padding: 0.75rem 1.3rem;
  cursor: pointer; box-shadow: 0 0 14px var(--laser);
  transition: background-color 200ms, transform 200ms;
}
.start-btn:hover { background: #b50000; transform: translateY(-1px); }
.start-btn:active { transform: translateY(1px); }
.start-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.start-note { font-family: var(--mono); font-size: 0.68rem; color: var(--dim); letter-spacing: 0.06em; max-width: 56ch; }

/* Responsive BlockchainAutomata concept gallery: one full-width visual per row;
   <picture> swaps in a portrait SVG composition on narrow screens. */
.atm-gallery { margin-top: 2.2rem; }
.atm-gallery-heading { max-width: 80ch; margin-bottom: 1.4rem; }
.atm-visual-kicker { font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.2em; color: var(--blue); }
.atm-gallery-heading h2 { margin-top: 0.35rem; font-size: clamp(1.35rem, 3vw, 2rem); }
.atm-gallery-heading > p { margin-top: 0.45rem; color: var(--muted); font-size: 0.9rem; }
.atm-finality-callout { display: grid; gap: 0.45rem; margin-top: 1rem; padding: 1rem 1.1rem; border: 1px solid rgba(0,191,255,.32); border-left: 3px solid var(--electric-red); border-radius: 8px; background: #121719; }
.atm-finality-callout b { color: var(--text); font-size: 0.95rem; }
.atm-finality-callout span { color: var(--muted); font-size: 0.82rem; }
.atm-finality-callout a { color: var(--blue); font-family: var(--mono); font-size: 0.7rem; width: fit-content; }
.atm-concept-list { display: grid; grid-template-columns: minmax(0,1fr); gap: 1.6rem; }
.atm-concept-card { min-width: 0; width: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--charcoal); box-shadow: 0 2px 12px rgba(0,0,0,.3); }
.atm-picture { display: block; width: 100%; overflow: hidden; padding: 0.6rem; background: #101113; }
.atm-svg { display: block; width: 100%; height: auto; aspect-ratio: auto; object-fit: contain; border: 1px solid var(--line-soft); border-radius: 6px; background: #101113; }
.atm-concept-card figcaption { min-height: 128px; padding: 1rem 1.1rem .85rem; }
.atm-concept-card figcaption > span { display: block; font-family: var(--mono); font-size: .62rem; letter-spacing: .16em; color: var(--blue); }
.atm-concept-card figcaption b { display: block; margin-top: .38rem; font-size: 1rem; }
.atm-concept-card figcaption p { margin-top: .35rem; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.atm-gallery-disclaimer { margin-top: 1rem; padding-left: .8rem; border-left: 3px solid var(--electric-red); color: var(--dim); font-family: var(--mono); font-size: .68rem; }
@media (max-width: 720px) {
  .container { padding-left: 1rem; padding-right: 1rem; }
  .desk-title { overflow-wrap: anywhere; }
  .atm-concept-card figcaption { min-height: auto; padding: 1.1rem 1.15rem; }
  .atm-concept-card figcaption > span { font-size: .7rem; letter-spacing: .12em; }
  .atm-concept-card figcaption b { font-size: 1.08rem; }
  .atm-concept-card figcaption p { font-size: .9rem; line-height: 1.55; }
  .atm-svg { aspect-ratio: auto; }
  .atm-picture { padding: 0.45rem; }
  .atm-finality-callout { padding: .85rem; }
  .atm-finality-callout a { overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) { .atm-concept-card { scroll-behavior: auto; } }

/* ---------- global reduced-motion override ----------
   Every page that loads this file is a programme detail page; this is the
   last word on motion for them: under prefers-reduced-motion ALL residual
   hover/entry micro-transitions and any animation stop, not only the
   specific selectors named above. Specific overrides above (e.g. .reveal
   shown immediately) keep their meaning — those declarations are separate
   properties and still win for their own property. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* operator workspace rows (workspace.html) */
.desk-panels-1col { max-width: 72ch; }
/* the workspace toggles sections with the hidden attribute; explicit display
   on these classes would override it, so keep hidden meaning hidden there */
#verified-row[hidden], #signed-out-panel[hidden], #workspace-panels[hidden], #start-card[hidden] { display: none !important; }
.start-rows { list-style: none; margin-top: 0.7rem; display: grid; gap: 0.45rem; }
.start-row-item {
  display: flex; justify-content: space-between; gap: 1rem; align-items: baseline;
  font-family: var(--mono); font-size: 0.78rem;
  border: 1px solid var(--line-soft); border-left: 3px solid var(--blue);
  background: var(--surface-3); padding: 0.55rem 0.8rem; border-radius: 6px;
}
.start-row-item .desk-name { color: var(--text); font-weight: 600; }
.start-row-item .dim, .dim { color: var(--dim); font-size: 0.7rem; }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 10px);
  z-index: 500; background: #1c1c1c; border: 1px solid var(--line);
  border-bottom: 2px solid var(--blue); color: var(--text);
  font-size: 0.8rem; padding: 0.65rem 1.1rem; border-radius: 8px;
  opacity: 0; pointer-events: none;
  transition: opacity 300ms, transform 300ms;
  font-family: var(--mono); letter-spacing: 0.06em; max-width: 88vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
