/* After-hours answering page. Teal = handled, amber = emergency. */
.ah-hero .hero__copy { max-width: 40rem; }
.ah-hero__note { margin-top: 1.25rem; max-width: 34em; font-size: .98rem; }
.panel > .wrap > h2 { max-width: 22ch; }

/* hero: the phone number rings twice, then settles */
.ah-ring { position: relative; }
@media (prefers-reduced-motion: no-preference) {
  .ah-ring::before, .ah-ring::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; border: 1px solid var(--teal); opacity: 0; pointer-events: none; animation: ah-ringout 1s var(--ease) 1.5s 1 both; }
  .ah-ring::after { animation-delay: 2.5s; }
  .ah-ring .num { display: inline-block; transform-origin: 50% 60%; animation: ah-shake 1s linear 1.5s 2 both; }
  @keyframes ah-ringout { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.06, 1.6); } }
  @keyframes ah-shake { 0%, 44%, 100% { transform: none; } 6%, 18%, 30% { transform: translateX(-2px) rotate(-1.5deg); } 12%, 24%, 36% { transform: translateX(2px) rotate(1.5deg); } }
}

/* ---------- shared range ---------- */
.ah-range { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 2.75rem; margin: 0; padding: 0; background: none; cursor: pointer; touch-action: pan-y; --fill: 0%; }
.ah-range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--teal) var(--fill), var(--line-2) var(--fill)); }
.ah-range::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line-2); }
.ah-range::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--teal); }
.ah-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 1.5rem; height: 1.5rem; margin-top: calc(2px - .75rem); border-radius: 50%; background: var(--ink); border: 0; box-shadow: 0 0 0 4px rgba(43, 212, 167, .28); }
.ah-range::-moz-range-thumb { width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--ink); border: 0; box-shadow: 0 0 0 4px rgba(43, 212, 167, .28); }
.ah-range:focus-visible { outline: none; }
.ah-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--amber); }
.ah-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--amber); }

/* ---------- the night: a pinned sequence, scroll is the clock ---------- */
.ah-seq .seq__stick { position: relative; }
.scrolly .ah-seq .seq__stick { position: sticky; }
.ah-seq .seq__stick::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(5, 8, 13, .9) 0%, rgba(5, 8, 13, .8) 40%, rgba(5, 8, 13, .25) 62%, rgba(5, 8, 13, .1) 100%), linear-gradient(0deg, rgba(5, 8, 13, .85) 0%, rgba(5, 8, 13, 0) 55%); }
.ah-dawn { position: absolute; inset: 0; pointer-events: none; opacity: var(--dawn, 0); background: radial-gradient(120% 70% at 50% 108%, rgba(255, 200, 87, .34), rgba(255, 150, 90, .14) 45%, transparent 75%), linear-gradient(0deg, rgba(255, 200, 87, .1), rgba(77, 171, 247, .07) 60%, transparent); }
.ah-seq .wrap { position: relative; }
.static .ah-seq .seq__stick { padding: clamp(4.5rem, 11vh, 8.5rem) 0; background: var(--bg); }
.static .ah-seq .seq__stick::before { display: none; }
.static .ah-play { display: none; }
.static .ah-ctl { grid-template-columns: minmax(0, 1fr); }

.ah-n { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-areas: "head board" "now board" "ctl ctl"; gap: clamp(.9rem, 2.2vh, 1.6rem) clamp(2rem, 4vw, 4rem); align-items: start; }
.ah-n__head { grid-area: head; }
.ah-n__head h2 { font-size: clamp(1.6rem, 2.7vw, 2.5rem); max-width: 22ch; }
.ah-n__note { margin-top: .6rem; font-size: .92rem; max-width: 30em; }
.ah-filter { margin-top: .9rem; gap: .4rem; }
.ah-filter .chip { padding: .4rem .85rem; font-size: .9rem; }
.ah-n__now { grid-area: now; min-width: 0; }
.ah-board { grid-area: board; align-self: end; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1rem, 2vw, 2rem); min-width: 0; position: relative; }
.ah-ctl { grid-area: ctl; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.5rem; align-items: start; }

.ah-clock { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem 1rem; font-family: var(--display); font-weight: 600; font-size: clamp(2.2rem, 4.6vw, 4rem); line-height: 1; letter-spacing: -.03em; }
.ah-clock [data-clock] { display: inline-block; min-width: 4.6em; }
.ah-lamp { display: inline-flex; align-items: center; gap: .5em; font: 500 .95rem var(--text); letter-spacing: 0; color: var(--amber); }
.ah-lamp::before { content: ""; width: .55em; height: .55em; border-radius: 50%; background: currentColor; }
.ah-lamp.is-open { color: var(--teal); }
.ah-tally { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin: .9rem 0 0; max-width: 30rem; }
.ah-tally div { display: grid; gap: .2rem; }
.ah-tally dd { font-family: var(--display); font-weight: 600; font-size: clamp(1.4rem, 2.2vw, 1.9rem); line-height: 1; letter-spacing: -.02em; }
.ah-tally dt { font-size: .82rem; color: var(--ink-2); line-height: 1.25; }
.ah-tally--hot dd { color: var(--amber); }
.ah-tally--ok dd { color: var(--teal); }
@media (prefers-reduced-motion: no-preference) {
  .ah-tally dd.is-bump { animation: ah-bump .5s var(--ease); }
  @keyframes ah-bump { 0% { transform: translateY(.35em); opacity: .2; } }
}

.ah-stage { position: relative; height: 13.5rem; margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.ah-stage__in { will-change: opacity, transform; }
.ah-stage__meta { color: var(--ink-2); font-size: .92rem; min-height: 1.5em; }
.ah-stage__quote { margin-top: .25rem; font-family: var(--display); font-weight: 600; font-size: clamp(1.25rem, 2.1vw, 1.75rem); line-height: 1.18; letter-spacing: -.015em; max-width: 20em; }
.ah-stage__rest { visibility: hidden; }
.ah-stage.is-other .ah-stage__quote { color: var(--ink-2); font-weight: 500; }
.ah-stage__status { margin-top: .6rem; min-height: 1.9rem; }
.ah-stage__status .tag:empty { visibility: hidden; }
.ah-stage__slot { position: absolute; left: 0; bottom: 0; width: 1px; height: 3.2rem; pointer-events: none; }

.ah-board::before { content: ""; position: absolute; inset: -.5rem; border-radius: 1.5rem; background: rgba(5, 8, 13, .7); box-shadow: 0 0 2.5rem 2rem rgba(5, 8, 13, .7); pointer-events: none; }
.ah-col { position: relative; min-width: 0; }
.ah-col h3 { font-size: 1.05rem; padding-bottom: .6rem; }
.ah-col--tech h3 { color: var(--amber); }
.ah-col--office h3 { color: var(--teal); }
.ah-jobs { display: grid; gap: .4rem; }
.ah-job { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .05rem .75rem; padding: .5rem .8rem; border-radius: .7rem; background: var(--bg-3); border: 1px solid var(--line-2); font-size: .85rem; line-height: 1.4; color: var(--ink-2); opacity: 0; will-change: transform, opacity; }
.ah-job[hidden] { display: none; }
.ah-job b { color: var(--ink); font-weight: 600; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ah-job time { white-space: nowrap; }
.ah-job__what { grid-column: 1 / -1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ah-job.is-moving { z-index: 5; box-shadow: 0 24px 40px -18px rgba(0, 0, 0, .9); }
.ah-col--tech .ah-job.is-moving, .ah-col--tech .ah-job.is-landed { border-color: rgba(255, 200, 87, .55); }
.ah-col--office .ah-job.is-moving, .ah-col--office .ah-job.is-landed { border-color: rgba(43, 212, 167, .5); }
.ah-none { font-size: .9rem; }

.ah-play { min-width: 10.5rem; }
.ah-time { min-width: 0; }
.ah-ticks { position: relative; height: 2.2rem; margin: -.35rem .75rem 0; pointer-events: none; }
.ah-ticks i { position: absolute; top: 0; width: 2px; height: .6rem; margin-left: -1px; border-radius: 1px; background: var(--teal); opacity: .9; }
.ah-ticks i.is-tech { background: var(--amber); height: .85rem; }
.ah-ticks i[hidden] { display: none; }
.ah-ticks__label { position: absolute; top: 1.05rem; transform: translateX(-50%); font-size: .8rem; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ah-ticks__label--a { transform: none; margin-left: -.75rem; }
.ah-ticks__label--z { transform: translateX(-100%); margin-left: .75rem; }

/* ---------- pick the call ---------- */
.ah-try { margin-top: 3rem; }
.ah-field { border: 0; padding: 0; margin: 0 0 2rem; min-width: 0; }
.ah-field legend { padding: 0; margin-bottom: .8rem; font-weight: 600; color: var(--ink); }
.ah-lines { display: grid; gap: .5rem; }
.ah-line { display: block; width: 100%; min-height: 3rem; padding: .75rem 1.1rem; border-radius: .9rem; border: 1px solid var(--line-2); background: none; color: var(--ink-2); font: 500 1rem/1.35 var(--text); text-align: left; cursor: pointer; transition: color .2s, border-color .2s, background-color .2s; }
.ah-line:hover { color: var(--ink); border-color: var(--ink-2); }
.ah-line[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.ah-result__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.ah-steps { counter-reset: s; min-height: 17rem; }
.ah-steps li { counter-increment: s; display: grid; grid-template-columns: 2rem minmax(0, 1fr); padding: .8rem 0; border-bottom: 1px solid var(--line); color: var(--ink-2); line-height: 1.45; }
.ah-steps li::before { content: counter(s); font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: .9rem; padding-top: .08rem; }
.ah-steps li.is-key { color: var(--amber); font-weight: 500; }
.ah-steps li.is-key.is-office { color: var(--teal); }
.ah-result__end { margin-top: 1.1rem; font-family: var(--display); font-weight: 600; font-size: 1.2rem; line-height: 1.25; }
.ah-result__note { margin-top: .9rem; font-size: .9rem; }
@media (prefers-reduced-motion: no-preference) {
  .ah-result.is-fresh .ah-steps li, .ah-result.is-fresh .ah-result__end, .ah-result.is-fresh [data-try-tag] { animation: ah-in .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 120ms); }
  @keyframes ah-in { from { opacity: 0; transform: translate3d(-.6rem, .5rem, 0); } }
}

/* ---------- rules, demo shops, your hours ---------- */
.ah-rules { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 6rem); margin-top: 3rem; }
.ah-rules .facts { margin-top: 1.25rem; gap: 0; }
.ah-rules .facts li { padding: .95rem 0; border-top: 1px solid var(--line); max-width: 30em; }
.ah-demos { align-items: center; }
.ah-demos > h2 { max-width: 14ch; }
.ah-trades { display: flex; flex-wrap: wrap; gap: .5rem; }
.ah-trades .tag { font-size: .95rem; padding: .4rem .9rem; color: var(--ink); }
.ah-hours { align-items: center; }
.ah-hours > h2 { max-width: 14ch; }
.ah-yours { max-width: 42rem; }
.ah-yours__label { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; font-family: var(--display); font-weight: 600; font-size: clamp(1.25rem, 2vw, 1.6rem); margin-bottom: .5rem; }
.ah-yours__time { color: var(--teal); }
.ah-yours__ends { display: flex; justify-content: space-between; margin-top: -.2rem; font-size: .8rem; color: var(--ink-2); }
.ah-yours__answer { margin: 1.5rem 0 .9rem; min-height: 2.4em; font-family: var(--display); font-weight: 600; font-size: clamp(1.5rem, 2.8vw, 2.2rem); line-height: 1.15; letter-spacing: -.02em; max-width: 24ch; }

/* ---------- shorter desktop screens ---------- */
@media (min-width: 62.01rem) and (max-height: 52rem) {
  .ah-n__note { display: none; }
  .ah-stage { height: 12.8rem; margin-top: .8rem; padding-top: .7rem; }
  .ah-job { padding: .35rem .7rem; }
  .ah-jobs { gap: .3rem; }
}

/* ---------- tablet: one column, the swarm behind ---------- */
@media (max-width: 62rem) {
  .ah-seq .seq__stick::before { background: rgba(5, 8, 13, .72); }
  .ah-n { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "now" "board" "ctl"; }
  .ah-n__head h2 { max-width: none; }
  .ah-stage { height: 11rem; }
  .ah-tally { max-width: none; }
  .ah-steps { min-height: 0; }
}
@media (max-width: 40rem) {
  .ah-hero .actions .btn, .close .actions .btn { width: 100%; }
  .ah-hero .hero__copy { margin-inline: calc(var(--edge) * -1); padding: 3rem var(--edge) 0; background: linear-gradient(180deg, transparent, rgba(5, 8, 13, .84) 20%); }
  .ah-hero { padding-bottom: 2rem; }
  .scrolly .ah-seq .seq__stick { align-items: start; padding-top: calc(var(--head-h) + .25rem); }
  .ah-n { gap: .6rem; }
  .ah-n__head h2 { font-size: 1.3rem; }
  .ah-n__note { margin-top: .3rem; font-size: .76rem; line-height: 1.35; }
  .ah-filter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: .5rem calc(var(--edge) * -1) 0; padding: 3px var(--edge); }
  .ah-filter::-webkit-scrollbar { display: none; }
  .ah-filter .chip { flex: none; white-space: nowrap; }
  .ah-clock { font-size: 1.9rem; }
  .ah-clock [data-clock] { min-width: 0; }
  .ah-lamp { font-size: .85rem; }
  .ah-tally { gap: .5rem; margin-top: .45rem; }
  .ah-tally dd { font-size: 1.3rem; }
  .ah-tally dt { font-size: .72rem; }
  .ah-stage { height: 9.4rem; margin-top: .6rem; padding-top: .5rem; }
  .ah-stage__meta { font-size: .8rem; }
  .ah-stage__quote { font-size: 1.1rem; }
  .ah-stage__status { margin-top: .35rem; }
  .ah-stage__status .tag { font-size: .76rem; padding: .2rem .6rem; }
  .ah-stage__slot { height: 2.9rem; }
  .ah-board { gap: .5rem; }
  .ah-col h3 { font-size: .86rem; padding-bottom: .35rem; letter-spacing: 0; }
  .ah-jobs { gap: .25rem; }
  .ah-job { padding: .3rem .55rem; border-radius: .55rem; font-size: .74rem; }
  .ah-job b { font-size: .8rem; }
  .ah-job time { display: none; }
  .ah-ctl { gap: .9rem; }
  .ah-play { min-width: 0; min-height: 2.75rem; padding: .5rem .9rem; font-size: .85rem; }
  .ah-board::before { display: none; }
  .ah-ticks { height: 1.9rem; }
  .ah-ticks__label { font-size: .68rem; }
  .ah-ticks__label--mid { display: none; }
  .ah-rules { grid-template-columns: 1fr; }
}
/* short phones: keep the whole night on one screen */
@media (max-width: 40rem) and (max-height: 50rem) {
  .scrolly .ah-n__note { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .scrolly .ah-job__what { display: none; }
  .scrolly .ah-stage { height: 8.6rem; }
  .scrolly .ah-stage__slot { height: 1.9rem; }
  .scrolly .ah-tally dt { font-size: .68rem; }
}
@media (max-width: 40rem) and (max-height: 42rem) {
  .scrolly .ah-n__head h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .scrolly .ah-filter { margin-top: 0; }
}
