/* One rule: a pill is a button. Everything else takes the shape of what it is.
   - the hero switcher is a story bar: labels over thin segments, the current one filling while it plays
   - the service tabs on phones are underline tabs, like a native app
   - the brief's chips stay as they are (they are choices you tap)
   - pillar tags and the window's pillar badge are small caps with a teal dot */

/* ---------------- hero: story bar ---------------- */
.hx-teal .hx-switch { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: none; margin-top: 22px; font-size: 13px; }
.hx-teal .hx-switch .sw-h { display: none; }
.hx-teal .hx-switch .sw { display: block; min-width: 0; }
.hx-teal .hx-switch i { display: none; }
.hx-teal .hx-switch button { position: relative; display: block; width: 100%; min-height: 0; margin: 0; padding: 0 0 12px; border: 0; border-radius: 0; background: none; font: inherit; font-weight: 500; letter-spacing: 0; text-align: left; text-decoration: none; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; transition: color 0.3s var(--ease); }
.hx-teal .hx-switch button::before, .hx-teal .hx-switch button::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 3px; }
.hx-teal .hx-switch button::before { background: var(--line-strong); }
.hx-teal .hx-switch button::after { background: var(--teal); transform-origin: left; transform: scaleX(0); }
.hx-teal .hx-switch button[aria-current="true"] { color: var(--ink); background: none; }
.hx-teal .hx-switch button[aria-current="true"]::after { animation: story var(--story, 5.6s) linear forwards; }
.hx-teal .hx-switch .sw.is-past button::after { transform: scaleX(1); opacity: 0.35; }
.hx-teal .hx-switch button:hover { color: var(--ink); }
.hx-teal .hx-switch button:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: 4px; }
@keyframes story { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .hx-teal .hx-switch button[aria-current="true"]::after { animation: none; transform: scaleX(1); } }

/* ---------------- the window's pillar badge: a dot, not a pill ---------------- */
.hs-pill { display: inline-flex; align-items: center; gap: 6px; padding: 0; border-radius: 0; background: none; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; }
.hs-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }

/* ---------------- pillar tags on the service cards ---------------- */
.tag-p { display: inline-flex; align-items: center; gap: 7px; padding: 0; border-radius: 0; background: none; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--teal-text); }
.tag-p::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }

/* ---------------- phones ---------------- */
@media (max-width: 760px) {
  /* story bar under the product window, full width */
  .hx-teal .hx-switch { order: 7; display: grid !important; gap: 5px !important; margin: 26px 0 0 !important; padding: 0 !important; overflow: visible !important; font-size: 11px; letter-spacing: -0.01em; }
  .hx-teal .hx-switch .sw { flex: initial !important; }
  .hx-teal .hx-switch button, .stack-tabs button { flex: initial; }
  .hx-teal .hx-switch button { min-height: 0 !important; padding: 0 0 10px !important; border: 0 !important; border-radius: 0 !important; background: none !important; color: var(--muted) !important; text-align: left; }
  .hx-teal .hx-switch button[aria-current="true"] { color: var(--ink) !important; }

  /* service tabs: underline tabs on a hairline, the current one in ink with a teal bar */
  .stack-tabs { gap: 22px !important; padding: 0 var(--edge) !important; border-bottom: 1px solid var(--line); background: var(--ground) !important; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .stack-tabs button { position: relative; min-height: 46px !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: none !important; font-size: 15px; font-weight: 500; color: var(--muted) !important; }
  .stack-tabs button::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2.5px; border-radius: 2px; background: var(--teal); transform: scaleX(0); transition: transform 0.3s var(--ease); }
  .stack-tabs button[aria-current="true"] { color: var(--ink) !important; font-weight: 600; }
  .stack-tabs button[aria-current="true"]::after { transform: scaleX(1); }

}

/* five service cards, not six (only while the cards are pinned) */
@media (min-width: 901px) and (min-height: 621px) { html:not(.unpin) .stack-room { height: calc(100svh + 5 * 72svh); } }

/* ---------------- pods: one screen on desktop ----------------
   heading, intro and the three forward deployed rows on the left, the photo filling the right,
   the four phases as a strip underneath; sizes follow the screen height so it all fits */
@media (min-width: 761px) and (min-height: 621px) {
  .pods { box-sizing: border-box; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding: calc(var(--nav-top) + var(--nav-h) + clamp(8px, 2.2vh, 32px)) var(--edge) clamp(20px, 4vh, 48px); }
  .pods .room-h { max-width: none; font-size: clamp(28px, min(3vw, 5vh), 54px); }
  .pods .room-lede .ln { display: inline; }
  .pods .room-lede { max-width: 64ch; margin-top: clamp(8px, 1.6vh, 18px); font-size: clamp(15.5px, 2vh, 18px); }
  .pod-head:has(.pod-photo) { grid-template-columns: minmax(0, 1fr) minmax(0, 36%); align-items: stretch; gap: clamp(32px, 4vw, 72px); }
  .pod-photo { aspect-ratio: auto; height: 100%; min-height: 240px; }
  .pod-photo > img { position: absolute; inset: 0; }
  .pods { scroll-margin-top: calc(-1 * (var(--nav-top) + var(--nav-h) + 24px)); }   /* the section already clears the nav */
  .pods .pl-grid { grid-template-columns: minmax(0, 1fr); max-width: 560px; gap: clamp(6px, 1vh, 10px); margin-top: clamp(16px, 3vh, 36px); }
  .pods .pl { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 16px; align-items: start; min-height: 0; padding: clamp(9px, 1.3vh, 14px) 16px; align-items: center; }
  .pods .pl-ic { grid-row: span 2; width: 36px; height: 36px; border-radius: 10px; }
  .pods .pl-ic svg { width: 20px; height: 20px; }
  .pods .pl h3 { margin: 0; font-size: clamp(16px, 2vh, 18px); letter-spacing: -0.02em; }
  .pods .pl p { margin-top: 1px; font-size: 14px; line-height: 1.4; }
  .phases-wrap { margin-top: clamp(16px, 3.4vh, 44px); }
  .phases { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .phases-wrap .ph-track { display: block; }
  .ph-card { margin-top: 12px; padding: 8px 8px 16px; }
  .ph-card h3 { margin: 12px 10px 0; font-size: clamp(17px, 2.2vh, 20px); }
  .ph-card p { margin: 4px 10px 0; font-size: 14.5px; line-height: 1.45; }
  .ph-art { height: clamp(96px, calc(100svh - 830px), 156px); }
}
/* shorter screens: the phases keep their numbers, titles and lines, without the little product UIs */
@media (min-width: 761px) and (min-height: 621px) and (max-height: 939px) {
  .ph-art { display: none; }
  .ph-card h3 { margin-top: 6px; }
}
@media (min-width: 761px) and (min-height: 621px) and (max-height: 740px) {
  .pods .pl p { line-height: 1.38; }
  .phases-wrap { margin-top: 12px; }
  .ph-card { padding-bottom: 12px; }
}
@media (min-width: 761px) and (min-height: 621px) and (max-height: 700px) {
  .ph-card p { display: none; }
  .ph-card { padding-bottom: 10px; }
}
/* tablets: one column, the photo steps aside so heading, rows and phases share the screen */
@media (min-width: 761px) and (max-width: 900px) and (min-height: 621px) {
  .pod-head:has(.pod-photo) { grid-template-columns: minmax(0, 1fr); }
  .pod-photo { display: none; }
  .ph-art { display: none; }
  .ph-card h3 { margin-top: 6px; }
}

/* ---------------- service bullets: a small marker, no 01 02 03 ---------------- */
.c-svc li { padding-left: 22px; }
.c-svc li::before { content: none; }
.c-svc b { position: relative; }
.c-svc b::before { content: ""; position: absolute; left: -22px; top: calc(50% - 3.5px); width: 7px; height: 7px; border-radius: 2px; background: var(--teal); }

/* ---------------- phases: a flow, step into step ----------------
   no numbers on top; an arrow between each card, lit as the flow reaches it */
.ph-n, .phases-wrap .ph-track { display: none !important; }
.ph-card { margin-top: 0; }
@media (min-width: 761px) {
  .phases { gap: 40px; }
  .ph:not(:last-child)::after { content: ""; position: absolute; z-index: 1; top: 50%; right: -34px; width: 28px; height: 28px; translate: 0 -50%; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--line-strong); transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease); }
  .ph:not(:last-child)::before { content: ""; position: absolute; z-index: 2; top: 50%; right: -26px; width: 12px; height: 12px; translate: 0 -50%; background: var(--muted); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6h8M6.5 2.5 10 6l-3.5 3.5' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6h8M6.5 2.5 10 6l-3.5 3.5' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; transition: background-color 0.4s var(--ease); }
  .ph.is-on:not(:last-child)::after { background: var(--teal); border-color: var(--teal); }
  .ph.is-on:not(:last-child)::before { background: #FFFFFF; }
}

/* pinned cards on shorter screens: keep each bullet's line under it, smaller and at most two lines */
@container (max-height: 660px) {
  .c-svc span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 12.5px; line-height: 1.35; }
  .c-svc li { padding-top: 5px; padding-bottom: 5px; gap: 2px; }
}
@container (max-height: 440px) {
  .c-svc span { display: none; }
}

/* ---------------- nav: the services dropdown ---------------- */
.nav { overflow: visible; }
.nav-dd { position: relative; display: flex; align-items: center; height: 100%; }
.nav-links .dd-t { gap: 6px; }
.dd-t svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.24s var(--ease); }
.dd-menu { position: absolute; z-index: 30; top: calc(100% - 4px); left: -8px; width: 360px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 60px -24px rgba(var(--shade), 0.35); opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s; }
.dd-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }   /* keeps the hover alive across the gap */
.nav-dd:hover .dd-menu, .nav-dd:focus-within .dd-menu { opacity: 1; visibility: visible; transform: none; }
.nav-dd:hover .dd-t svg, .nav-dd:focus-within .dd-t svg { transform: rotate(180deg); }
.nav-dd.dd-shut .dd-menu { opacity: 0; visibility: hidden; transform: translateY(6px); }
.nav-links .dd-menu a { display: flex; align-items: center; gap: 12px; height: auto; padding: 10px 12px; border-radius: 10px; color: var(--ink); }
.nav-links .dd-menu a:hover, .nav-links .dd-menu a:focus-visible { background: var(--teal-wash); }
.dd-ic { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--teal-wash); color: var(--teal); }
.dd-menu a:hover .dd-ic { background: var(--surface); }
.dd-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.dd-menu b { display: block; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.dd-menu small { display: block; margin-top: 1px; font-size: 13px; color: var(--muted); }
.nav-links .dd-menu .dd-all { justify-content: space-between; margin-top: 4px; padding: 12px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; font-size: 14px; font-weight: 600; color: var(--teal-text); }
@media (prefers-reduced-motion: reduce) { .dd-menu, .dd-t svg { transition: none; } }

/* phone menu: the five services listed under Services */
.menu-sub { display: flex; flex-direction: column; padding: 6px 0 10px 2px; border-bottom: 1px solid var(--line); }
.menu .menu-sub a { min-height: 40px; border: 0; font-size: 17px; font-weight: 500; letter-spacing: -0.01em; color: var(--soft); }
.menu nav a:has(+ .menu-sub) { border-bottom: 0; }
html.rib .dd-menu { opacity: 0; visibility: hidden; }

/* ---------------- hero: always one screen, the logo strip on its bottom edge ----------------
   the product window is sized by the screen's height as well as its width, so on short screens
   it shrinks instead of pushing the strip below the fold */
@media (min-width: 901px) {
  .hx-teal { padding-top: calc(var(--nav-top) + var(--nav-h) + clamp(12px, 3.2vh, 32px)); padding-bottom: calc(52px + clamp(16px, 4.5vh, 64px)); }
  .hx-teal > .hx-stage { width: 100%; max-width: calc((100svh - 300px) * 1.36); justify-self: center; gap: clamp(24px, 5.5vh, 64px); }
  .hx-teal > .hx-copy { padding-bottom: clamp(48px, 10vh, 108px); }
}
@media (min-width: 901px) and (max-height: 700px) {
  .hx-teal .hx-title { font-size: clamp(36px, min(4.2vw, 8vh), 72px); }
  .hx-actions { margin-top: 28px; }
}
/* tablets in portrait: copy over the window; the window shrinks to leave room for the strip */
@media (min-width: 761px) and (max-width: 900px) {
  .hx-teal > .hx-stage { width: 100%; max-width: max(420px, calc((100svh - 600px) * 1.36)); margin-inline: auto; gap: 32px; }
}
/* small phones: tighter steps between headline, button, window and switch */
@media (max-width: 760px) and (max-height: 740px) {
  .hx-teal { padding-top: calc(var(--nav-top) + var(--nav-h) + 10px); padding-bottom: calc(52px + 14px); }
  .hx-teal .hx-title { font-size: clamp(30px, 8.6vw, 40px); }
  .hx-teal .hx-actions { margin-top: 18px; }
  .hx-teal > .hx-stage > .hs { margin-top: 22px; }
  .hx-teal .hx-switch { margin-top: 18px !important; }
}
/* tablets and phones: the hero is at least one screen, so the strip sits on the screen's bottom edge */
@media (max-width: 900px) {
  .hx-teal { min-height: 100svh; align-content: center; }
}
/* tablets on their side: copy and window side by side, as on desktop */
@media (min-width: 761px) and (max-width: 900px) and (orientation: landscape) {
  .hx-teal { grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 28px; padding-bottom: calc(52px + 24px); }
  .hx-teal .hx-title { font-size: clamp(32px, 4.6vw, 44px); }
  .hx-teal > .hx-stage { max-width: calc((100svh - 300px) * 1.36); gap: 24px; }
}
/* small phones: the window gives up a little width so the strip stays on screen */
@media (max-width: 760px) and (max-height: 700px) {
  .hx-teal > .hx-stage > .hs { width: 100%; max-width: calc((100svh - 480px) * 1.45); margin-inline: auto; }
}
@media (max-width: 760px) and (max-height: 700px) {
  .hs-float .fb { display: none; }
}
