/*
  /projects/session-orchestrator - page styles, built on /projects/base.css.
  Quiet and cinematic: dark surfaces, one coral accent, planets on hairlines.
*/

::selection {
  background: rgba(224, 122, 91, 0.35);
  color: var(--fg);
}

code {
  font-family: var(--f-mono);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  background: var(--shot);
  isolation: isolate;
}

.hero__media {
  position: relative;
  aspect-ratio: 16 / 9;
}

.hero__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--shot);
  /* Edges melt into the black, like the deck. */
  -webkit-mask-image: radial-gradient(ellipse 72% 58% at 50% 50%, #000 52%, transparent 100%);
  mask-image: radial-gradient(ellipse 72% 58% at 50% 50%, #000 52%, transparent 100%);
}

.hero__top {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  padding-top: 18px;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: var(--s-xs);
  color: var(--faint);
}

.crumbs a {
  color: var(--muted);
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--fg);
  text-decoration: underline;
}

.crumbs [aria-current] {
  color: var(--muted);
}

.hero__inner {
  position: relative;
  z-index: 1;
  margin-top: -1.5rem;
  padding-bottom: clamp(3rem, 8vw, 5rem);
}

.hero__text {
  max-width: 36rem;
}

.hero__title {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.hero__name {
  font-family: var(--f-mono);
  font-size: var(--s-xs);
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.hero__line {
  max-width: 22ch;
}

.hero__copy {
  max-width: 34rem;
  color: var(--sub);
  font-size: var(--s-md);
}

.hero__by {
  margin-top: 18px;
  font-family: var(--f-mono);
  font-size: var(--s-sm);
  color: var(--muted);
}

/* Small screens: the button sits in the flow under the copy, clear of the clip.
   The controls row carries the hero's bottom space, with or without the button. */
.hero__inner {
  padding-bottom: 1.5rem;
}

.hero__controls {
  position: relative;
  z-index: 2;
  padding-bottom: clamp(3rem, 8vw, 5rem);
}

@media (min-width: 1024px) {
  .hero {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: min(56.25vw, calc(100svh - 57px), 960px);
  }

  /* The clip sits right of and above the copy, so the settled workers clear the headline. */
  .hero__media {
    position: absolute;
    inset: 0 0 12% 20%;
    aspect-ratio: auto;
  }

  /* A soft floor so the copy reads over the clip's last frame. */
  .hero__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
      linear-gradient(to top, var(--shot) 0%, rgba(2, 2, 2, 0.7) 22%, rgba(2, 2, 2, 0) 48%),
      linear-gradient(to right, rgba(2, 2, 2, 0.75) 0%, rgba(2, 2, 2, 0) 45%);
    pointer-events: none;
  }

  .hero__inner {
    margin-top: 0;
    padding-top: 6rem;
    padding-bottom: clamp(3rem, 6vh, 4.5rem);
  }

  /* Wide screens: bottom right of the hero, on the container's edge. */
  .hero__controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: clamp(3rem, 6vh, 4.5rem);
    display: flex;
    justify-content: flex-end;
    padding-bottom: 0;
    pointer-events: none;
  }

  .hero__toggle {
    pointer-events: auto;
  }
}

/* ---------- Video controls ---------- */

.media-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 14px 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: rgba(2, 2, 2, 0.72);
  color: var(--sub);
  font-family: var(--f-mono);
  font-size: var(--s-xs);
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.media-toggle[hidden] {
  display: none;
}

.media-toggle:hover {
  border-color: var(--muted);
  color: var(--fg);
}

.media-toggle:focus-visible {
  border-radius: var(--r-pill);
}

/* Drawn icons: two bars while playing (pause), a triangle otherwise (play). */
.media-toggle__icon {
  position: relative;
  width: 10px;
  height: 10px;
}

.media-toggle__icon::before {
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  clip-path: polygon(10% 0, 100% 50%, 10% 100%);
}

.media-toggle[data-state="playing"] .media-toggle__icon::before {
  clip-path: polygon(0 0, 35% 0, 35% 100%, 0 100%, 0 0, 65% 0, 100% 0, 100% 100%, 65% 100%, 65% 0);
}

/* ---------- Sections ---------- */

.sec {
  padding-block: clamp(4rem, 9vw, 7rem);
}

.sec--tight {
  padding-block: clamp(3rem, 6vw, 5rem);
}

.sec__head {
  max-width: 40rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.sec__head h2 {
  margin-bottom: 14px;
}

.sec__lede {
  font-family: var(--f-mono);
  font-size: var(--s-sm);
  line-height: 1.6;
  color: var(--accent-text);
}

.sec__body {
  margin-top: 14px;
  color: var(--muted);
}

@media (min-width: 1024px) {
  .sec__split {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 4rem;
    align-items: start;
  }

  .sec__split--wide {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  }

  .sec__split .sec__head {
    margin-bottom: 0;
  }
}

h3 {
  font-size: var(--s-md);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.3;
}

/* ---------- Six jobs ---------- */

.jobs__key {
  display: none;
}

.jobs__row {
  display: grid;
  gap: 4px;
  padding-block: 16px;
  border-top: 1px solid var(--line);
}

.jobs__row:last-child {
  border-bottom: 1px solid var(--line);
}

.jobs__name {
  font-family: var(--f-mono);
  font-size: var(--s-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.jobs__was {
  color: var(--muted);
}

.jobs__now {
  color: var(--fg);
}

.jobs__tag {
  font-family: var(--f-mono);
  font-size: var(--s-xs);
  color: var(--muted);
}

.jobs__now .jobs__tag {
  color: var(--accent-text);
}

@media (min-width: 768px) {
  .jobs__key,
  .jobs__row {
    display: grid;
    grid-template-columns: 10rem minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 24px;
    align-items: baseline;
  }

  .jobs__key {
    padding-bottom: 10px;
    font-family: var(--f-mono);
    font-size: var(--s-xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .jobs__key span:last-child {
    color: var(--accent-text);
  }

  .jobs__name {
    margin-bottom: 0;
  }

  .jobs__tag {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* ---------- A run: planets on a hairline ---------- */

.run {
  position: relative;
  display: grid;
  gap: 26px;
}

/* The hairline the planets sit on. */
.run::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 6px;
  width: 1px;
  background: linear-gradient(180deg, #2e2c28, #3a3732 50%, #2e2c28);
}

.run__step {
  position: relative;
  padding-left: 36px;
}

.run__step > .planet {
  position: absolute;
  top: 5px;
  left: 0;
}

.run__num {
  display: block;
  font-family: var(--f-mono);
  font-size: var(--s-xs);
  color: var(--muted);
  margin-bottom: 2px;
}

.run__title {
  color: var(--fg);
}

.run__step--you .run__title,
.run__step--you .run__num {
  color: var(--accent-text);
}

.run__note {
  margin-top: 4px;
  font-size: var(--s-sm);
  color: var(--muted);
}

.legend {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 32px;
  font-family: var(--f-mono);
  font-size: var(--s-xs);
  color: var(--muted);
}

@media (min-width: 1024px) {
  .run {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 20px;
  }

  .run::before {
    top: 6px;
    bottom: auto;
    left: 6px;
    right: 0;
    width: auto;
    height: 1px;
    background: linear-gradient(90deg, #2e2c28, #3a3732 50%, #2e2c28);
  }

  .run__step {
    padding-left: 0;
    padding-top: 34px;
  }

  .run__step > .planet {
    top: 0;
  }
}

/* ---------- Layers ---------- */

.frame {
  position: relative;
  overflow: hidden;
  border: 1px solid #1d1c19;
  border-radius: var(--r-md);
  background: var(--shot);
}

.layers__video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.frame__toggle {
  position: absolute;
  left: 12px;
  bottom: 12px;
}

.layers {
  display: grid;
  gap: 2.5rem;
}

.layers__list {
  counter-reset: layer;
}

.layers__list li {
  counter-increment: layer;
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  column-gap: 8px;
  padding-block: 12px;
  border-top: 1px solid var(--line);
}

.layers__list li:last-child {
  border-bottom: 1px solid var(--line);
}

.layers__list li::before {
  content: counter(layer);
  grid-row: span 2;
  font-family: var(--f-mono);
  font-size: var(--s-xs);
  color: var(--muted);
  padding-top: 3px;
}

.layers__list p {
  margin-top: 2px;
  font-size: var(--s-sm);
  color: var(--muted);
}

@media (min-width: 1024px) {
  .layers {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 3.5rem;
    align-items: center;
  }
}

/* ---------- Escalation ladder ---------- */

.ladder {
  position: relative;
  display: grid;
  gap: 28px;
}

.ladder::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 6px;
  width: 1px;
  background: linear-gradient(180deg, #2e2c28, #3a3732 60%, rgba(224, 122, 91, 0.6));
}

.ladder__rung {
  position: relative;
  padding-left: 36px;
}

.ladder__rung > .planet {
  position: absolute;
  top: 5px;
  left: 0;
}

.ladder__rung p {
  margin-top: 4px;
  font-size: var(--s-sm);
  color: var(--muted);
}

.ladder__rung--you h3 {
  color: var(--accent-text);
}

/* ---------- What it never does ---------- */

.never {
  display: grid;
  gap: 14px;
}

.never li {
  display: grid;
  grid-template-columns: 13px minmax(0, 1fr);
  gap: 16px;
  align-items: baseline;
  color: var(--sub);
}

.never li::before {
  content: "";
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #121211;
  border: 1px solid #47443e;
  transform: translateY(2px);
}

@media (min-width: 768px) {
  .never {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 32px;
  }
}

/* ---------- It learns ---------- */

.learn {
  display: grid;
  gap: 28px;
}

.learn__col {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.learn__col p:not(.learn__when) {
  max-width: 34rem;
  color: var(--sub);
}

.learn__when {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-family: var(--f-mono);
  font-size: var(--s-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (min-width: 768px) {
  .learn {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px;
  }
}

/* ---------- Proof: eval bars ---------- */

.evals__list {
  display: grid;
  gap: 22px;
}

.eval__name {
  margin-bottom: 8px;
  font-size: var(--s-sm);
  color: var(--fg);
}

.eval__name code {
  display: block;
  margin-top: 2px;
  font-size: var(--s-xs);
  color: var(--muted);
}

.bar {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) 2.75rem;
  gap: 12px;
  align-items: center;
  font-family: var(--f-mono);
  font-size: var(--s-xs);
  color: var(--muted);
}

.bar + .bar {
  margin-top: 4px;
}

.bar__track {
  position: relative;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--raise);
  overflow: hidden;
}

.bar__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--v) * 100%);
  border-radius: inherit;
  background: #7d7a73;
}

.bar--with .bar__fill {
  background: linear-gradient(90deg, rgba(224, 122, 91, 0.35), rgba(224, 122, 91, 0.9));
}

.bar__value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--sub);
}

.bar--with .bar__label,
.bar--with .bar__value {
  color: var(--accent-text);
}

.evals__facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.evals__facts dt {
  font-size: var(--s-xs);
  color: var(--muted);
}

.evals__facts dd {
  order: -1;
  font-family: var(--f-mono);
  font-size: var(--s-lg);
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}

.evals__facts div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.evals__meta {
  margin-top: 20px;
  font-family: var(--f-mono);
  font-size: var(--s-xs);
  color: var(--muted);
}

/* ---------- Try it ---------- */

.try {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
}

.try__line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 16px;
}

.try__line + .try__line {
  border-top: 1px solid var(--line);
}

.try__line code {
  flex: 1;
  min-width: 0;
  font-size: var(--s-xs);
  line-height: 1.6;
  color: var(--sub);
  overflow-wrap: anywhere;
}

.copy {
  flex: none;
  min-width: 4.5rem;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font-family: var(--f-mono);
  font-size: var(--s-xs);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.copy:hover {
  border-color: var(--muted);
  color: var(--fg);
}

.copy[data-copied] {
  color: var(--accent-text);
  border-color: rgba(224, 122, 91, 0.5);
}

/* ---------- Call to action ---------- */

.cta {
  padding-block: clamp(4rem, 10vw, 8rem) clamp(5rem, 10vw, 8rem);
}

.cta__inner > * {
  max-width: 40rem;
}

.cta__line {
  width: 64px;
  margin-bottom: 32px;
  background: linear-gradient(90deg, rgba(224, 122, 91, 0.35), rgba(224, 122, 91, 0.9));
}

.cta h2 {
  margin-bottom: 14px;
}

.cta p {
  color: var(--sub);
}

.cta__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin-top: 28px;
}

.cta__back {
  font-family: var(--f-mono);
  font-size: var(--s-sm);
  color: var(--muted);
}
