/* Hearo Show. Design tokens first; change the look here, not in the rules below. */
@font-face { font-family: "Garant Pro"; src: url("fonts/garantpro-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Garant Pro"; src: url("fonts/garantpro-medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Garant Pro"; src: url("fonts/garantpro-semibold.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --green: #3DBA84;
  --green-deep: #239766;
  --paper: #F5F5F0;
  --ink: #1A1A1A;
  --sage: #6B817F;
  --white: #FFFFFF;
  --line: rgba(26, 26, 26, 0.1);
  --radius: 1.5rem;
  --radius-small: 0.9rem;
  --pad: 2.5rem;
  --bar: 4.75rem;
  --touch: 3rem; /* smallest thing meant to be touched */
  --shadow: 0 0.5rem 1.6rem rgba(26, 26, 26, 0.08);
}

/* One rem is 24px on the LG screen (1920 on its long side, either way up) and 16px on a
   phone. Everything is in rem. */
html { font-size: clamp(16px, 1.25vmax, 24px); -webkit-text-size-adjust: 100%; }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--white); color: var(--ink); font-family: "Garant Pro", "Helvetica Neue", Arial, sans-serif; font-weight: 400; line-height: 1.4; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; touch-action: manipulation; }
h1, h2, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 0.2rem solid var(--green-deep); outline-offset: 0.2rem; }
html[data-mode="offline"] { -webkit-user-select: none; user-select: none; }
html[data-mode="offline"] .web-only, html[data-mode="web"] .offline-only, html[data-mode="offline"] .foot { display: none; }
html.layer-open { overflow: hidden; }
/* LG only: webOS does not scroll the page itself for a finger drag, only a box inside it.
   So in the LG build the page stays put and <main> is the box that scrolls. */
html[data-mode="offline"], html[data-mode="offline"] body { height: 100%; overflow: hidden; }
html[data-mode="offline"] body { display: flex; flex-direction: column; }
html[data-mode="offline"] .bar { position: static; flex: none; }
html[data-mode="offline"] main { flex: 1 1 0; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
html[data-mode="offline"] main::-webkit-scrollbar { display: none; }

/* ---------- top bar ---------- */
.bar { position: sticky; top: 0; z-index: 5; height: var(--bar); padding: 0 var(--pad); display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--white); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; min-height: var(--touch); border-radius: var(--radius-small); }
.brand img { height: 1.7rem; width: auto; }
.bar-nav { display: flex; gap: 0.6rem; }
.pill { display: inline-flex; align-items: center; justify-content: center; min-height: var(--touch); padding: 0 1.5rem; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-weight: 500; font-size: 1.05rem; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.pill.is-on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.pill:active { background: var(--green); border-color: var(--green); color: var(--ink); }

.view { padding: 1.8rem var(--pad) var(--pad); min-height: calc(100vh - var(--bar)); }
.view-head { margin-bottom: 1.2rem; }
.view-head h2 { font-size: 2.4rem; line-height: 1.05; font-weight: 600; letter-spacing: -0.02em; }
.view-head p { margin-top: 0.6rem; max-width: 44rem; font-size: 1.1rem; color: var(--sage); }
.foot { padding: 0 var(--pad) 1.5rem; color: var(--sage); font-size: 0.9rem; }
.text-link { text-decoration: underline; text-underline-offset: 0.2em; }

/* ---------- start ---------- */
/* The four hearos from hearo.net come first. Each scene is drawn by src/scenes/
   illustrations.js on a 1920 x 848 stage that it scales to cover its frame, so the frame
   is never wider than that shape: the whole figure shows, and on a narrow screen the
   empty sides are what gets cropped. */
.view-home, .view-team { padding: 0; }
.hearos { --h: min(46vh, 44vw); position: relative; background: var(--white); }
.hearos-stage { display: grid; }
.hearos-stage li { grid-area: 1 / 1; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0s linear 0.3s; }
.hearos-stage li.active { opacity: 1; visibility: visible; transition: opacity 0.3s ease, visibility 0s; }
.hearos [data-scene] { position: relative; overflow: hidden; height: var(--h); width: min(100%, calc(var(--h) * 2.264)); margin: 0 auto; background: var(--white); }
[data-scene] > div { position: absolute; top: 0; left: 0; overflow: hidden; transform-origin: 0 0; pointer-events: none; }
/* LG build: the same four scenes as one looping video (scripts/render-hearos.mjs). */
.hearos-video { display: block; height: var(--h); width: calc(var(--h) * 2.264); max-width: 100%; margin: 0 auto; object-fit: contain; background: var(--white); pointer-events: none; }
.hearos-dots { position: absolute; right: var(--pad); bottom: 1rem; display: flex; gap: 0.5rem; padding: 0.45rem 0.9rem; border-radius: 999px; background: #DFF0E5; }
.hearos-dots i { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--white); transition: background 0.3s; }
.hearos-dots i.is-on { background: var(--green); }

/* The headline and the four doors fill the rest of the first screen, centered in it; the
   rotating pictures (.home-more) start below that. */
.home { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.8fr); grid-template-areas: "copy doors"; gap: 2.5rem 3.5rem; align-items: center; align-content: center; min-height: calc(100vh - var(--bar) - min(46vh, 44vw)); padding: 1rem var(--pad); }
.home-more { padding: 0 var(--pad) var(--pad); }
.home-copy { grid-area: copy; }
.home h1 { font-size: 2.9rem; line-height: 1.04; font-weight: 600; letter-spacing: -0.03em; }
.home h1 em { font-style: normal; color: var(--green-deep); }
.lede { font-size: 1.2rem; line-height: 1.45; }
.home .lede { margin-top: 1rem; color: var(--sage); max-width: 36rem; }
.doors { grid-area: doors; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; }
.door { display: flex; align-items: center; gap: 0.8rem; min-height: 4rem; padding: 0 0.9rem 0 1.6rem; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 1.4rem; font-weight: 500; transition: background 0.15s, color 0.15s; }
.door span { flex: 1; }
.door b { font-weight: 400; color: var(--green); font-variant-numeric: tabular-nums; }
.door svg { width: 2.3rem; height: 2.3rem; padding: 0.5rem; border-radius: 50%; background: var(--green); color: var(--ink); }
.door:active { background: var(--green-deep); }
.stage { position: relative; width: 100%; max-width: 46rem; margin: 0 auto; aspect-ratio: 1760 / 1078; border-radius: var(--radius); overflow: hidden; background: var(--green); }
.shot { position: absolute; inset: 0; opacity: 0; transition: opacity 0.9s ease; }
.shot.is-on { opacity: 1; }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot-family { display: flex; align-items: center; justify-content: center; padding: 7%; }
.shot-family img { object-fit: contain; filter: drop-shadow(0 1.2rem 1.6rem rgba(26, 26, 26, 0.25)); }
.dots { position: absolute; right: 1.2rem; top: 1.2rem; display: flex; gap: 0.4rem; }
.dots i { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: rgba(255, 255, 255, 0.5); transition: width 0.3s, background 0.3s; }
.dots i.is-on { width: 1.6rem; border-radius: 999px; background: var(--white); }

/* ---------- team ---------- */
.team-scene { --h: min(32vh, 49vw); background: var(--green); }
.team-scene [data-scene] { position: relative; overflow: hidden; height: var(--h); width: min(100%, calc(var(--h) * 2.04)); margin: 0 auto; }
.view-pad { padding: 1.8rem var(--pad) var(--pad); }
.grid-team { grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); }
.card-person { padding-bottom: 1.1rem; text-align: center; }
.card-person .card-art { aspect-ratio: 1 / 0.92; margin-bottom: 0.8rem; }
.card-person .card-art img { object-position: bottom; inset: 0.8rem 0.5rem 0; width: calc(100% - 1rem); height: calc(100% - 0.8rem); }
.card-person strong { padding: 0 0.8rem; font-size: 1.15rem; line-height: 1.2; }
.card-person > span:last-child { padding: 0.15rem 0.9rem 0; color: var(--sage); font-size: 0.9rem; line-height: 1.25; }
.wall { margin-top: 2.5rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); grid-auto-flow: dense; gap: 0.6rem; }
.wall li { aspect-ratio: 1; border-radius: var(--radius-small); overflow: hidden; background: var(--paper); }
.wall li.wide { grid-column: span 2; grid-row: span 2; }
.wall img { width: 100%; height: 100%; object-fit: cover; }
.flip-book { position: relative; flex: 1 1 0; min-height: 0; width: 100%; }
.sheet-art .flip-book img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: bottom; opacity: 0; filter: none; }
.sheet-art .flip-book img.is-on { opacity: 1; }
.sheet[data-kind="team"] .sheet-art { padding-bottom: 0; }

/* ---------- cards ---------- */
.grid { display: grid; gap: 1.1rem; }
.grid-products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-devices { grid-template-columns: repeat(auto-fill, minmax(10.6rem, 1fr)); }
.grid-videos { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { display: flex; flex-direction: column; background: var(--paper); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 0 var(--line); transition: transform 0.15s, box-shadow 0.15s; }
.card:active { transform: scale(0.98); }
.card:focus-visible { outline-offset: 0.1rem; box-shadow: var(--shadow); }
.card-art { position: relative; display: flex; align-items: center; justify-content: center; }
.card-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.card strong { font-weight: 600; }
/* A few pictures have a white background rather than a clear one; on a card it takes the card's tone. */
.card-product .card-art img, .card-person .card-art img { mix-blend-mode: multiply; }

.card-product .card-art { aspect-ratio: 5 / 2; }
.card-product .card-art img { inset: 1.1rem 1.3rem 0; width: calc(100% - 2.6rem); height: calc(100% - 1.1rem); object-position: bottom; }
.card-text { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.9rem 1.4rem 1.1rem; }
.card-text small, .sheet-body small { font-size: 0.8rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--green-deep); }
.card-text strong { font-size: 1.5rem; line-height: 1.15; letter-spacing: -0.01em; }
.card-text span { color: var(--sage); font-size: 1.05rem; }

.card-device { padding: 1rem 0.8rem 1.1rem; text-align: center; gap: 0.7rem; }
.card-device .card-art { aspect-ratio: 1 / 0.82; }
.card-device strong { font-size: 1rem; line-height: 1.2; font-weight: 500; }

.filters { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1.4rem; }

.card-video .card-art { aspect-ratio: 16 / 9; background: var(--ink); }
.card-video .card-art img { object-fit: cover; }
.card-video strong { padding: 0.9rem 1.2rem 1.1rem; font-size: 1.1rem; line-height: 1.2; font-weight: 500; }
.play { position: absolute; left: 50%; top: 50%; width: 4rem; height: 4rem; margin: -2rem 0 0 -2rem; border-radius: 50%; background: var(--green); color: var(--ink); display: flex; align-items: center; justify-content: center; box-shadow: 0 0.4rem 1.2rem rgba(0, 0, 0, 0.35); }
.play svg { width: 1.9rem; height: 1.9rem; }
.card-video time { position: absolute; right: 0.7rem; bottom: 0.7rem; padding: 0.15rem 0.6rem; border-radius: 999px; background: rgba(26, 26, 26, 0.8); color: var(--white); font-size: 0.8rem; font-variant-numeric: tabular-nums; }

/* ---------- detail sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 2.5rem; background: rgba(26, 26, 26, 0.55); }
.sheet-panel { position: relative; display: grid; grid-template-columns: minmax(0, 0.4fr) minmax(0, 0.6fr); grid-template-rows: minmax(0, 1fr) auto; width: min(100%, 72rem); height: min(100%, 40rem); background: var(--white); border-radius: 2rem; overflow: hidden; box-shadow: 0 2rem 5rem rgba(0, 0, 0, 0.35); }
.sheet-art { grid-row: 1 / 3; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.5rem; padding: 2.5rem; background: var(--green); min-height: 0; }
.sheet-art img { flex: 1 1 0; min-height: 0; width: 100%; object-fit: contain; filter: drop-shadow(0 1rem 1.4rem rgba(26, 26, 26, 0.3)); }
.sheet-art img + img { flex: 0.7 1 0; }
.sheet-body { padding: 2.8rem 3rem 1rem; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet-body h2 { margin: 0.3rem 3.5rem 0 0; font-size: 2.7rem; line-height: 1.04; font-weight: 600; letter-spacing: -0.02em; }
.sheet-body .tagline { margin-top: 0.5rem; font-size: 1.4rem; font-weight: 500; color: var(--green-deep); }
.sheet-body .lede { margin-top: 1rem; }
.sheet-body p + p { margin-top: 0.9rem; }
.sheet-body > p:not(.lede):not(.tagline):not(.chips) { color: var(--sage); font-size: 1.05rem; }
.points { margin-top: 1.3rem; display: grid; gap: 0.55rem; font-size: 1.1rem; }
.points li { position: relative; padding-left: 1.5rem; }
.points li::before { content: ""; position: absolute; left: 0.1rem; top: 0.5em; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--green); }
.chips { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chips span { padding: 0.3rem 0.9rem; border-radius: 999px; background: var(--paper); font-size: 0.85rem; color: var(--sage); }
.parts { margin-top: 1.5rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; }
.parts li { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.9rem 1.1rem; border-radius: var(--radius-small); background: var(--paper); }
.parts img { height: 5.5rem; width: 100%; object-fit: contain; margin-bottom: 0.5rem; }
.parts strong { font-weight: 600; font-size: 1.05rem; }
.parts span { color: var(--sage); font-size: 0.95rem; line-height: 1.3; }
.round { display: inline-flex; align-items: center; justify-content: center; width: 3.4rem; height: 3.4rem; border-radius: 50%; background: var(--ink); color: var(--paper); transition: background 0.15s; }
.round svg { width: 1.5rem; height: 1.5rem; }
.round:active { background: var(--green-deep); }
.flip { display: flex; transform: scaleX(-1); }
.sheet-close { position: absolute; top: 1.4rem; right: 1.4rem; }
.sheet-steps { grid-column: 2; display: flex; justify-content: flex-end; gap: 0.6rem; padding: 0.8rem 1.4rem 1.4rem; }

/* ---------- video player ---------- */
.player { position: fixed; inset: 0; z-index: 20; background: #000; display: flex; align-items: center; justify-content: center; }
.player video { width: 100%; height: 100%; background: #000; }
.player:focus-visible { outline: none; }
.player-close { position: absolute; top: 1.4rem; right: 1.4rem; background: rgba(245, 245, 240, 0.92); color: var(--ink); }

/* ---------- narrower screens ---------- */
@media (max-width: 1100px) {
  .grid-products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-videos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Upright screens (a StanbyME turned on end, tablets, phones): stack the start view. */
@media (max-aspect-ratio: 1/1), (max-width: 820px) {
  .home { grid-template-columns: 1fr; grid-template-areas: "copy" "doors" "lede"; gap: 1.2rem; min-height: calc(100vh - var(--bar) - 100vw * 1128 / 900); }
  .home-copy { display: contents; }
  .home h1 { grid-area: copy; font-size: 2.6rem; }
  .home .lede { grid-area: lede; margin-top: 0.6rem; }
  .door { min-height: 3.6rem; }
  .stage { max-width: none; }
  .home .lede { max-width: none; }
  .sheet-panel { grid-template-columns: 1fr; grid-template-rows: minmax(0, 0.38fr) minmax(0, 0.62fr) auto; height: min(100%, 60rem); }
  .sheet-art { grid-row: 1; }
  .sheet-steps { grid-column: 1; }
}
@media (max-width: 820px) {
  :root { --pad: 1.1rem; --bar: 4rem; --touch: 2.75rem; }
  .brand img { height: 1.4rem; }
  .bar-nav { gap: 0.3rem; }
  .pill { padding: 0 0.85rem; font-size: 0.95rem; }
  .home { min-height: 0; }
  .home h1 { font-size: 2.2rem; }
  .door { min-height: 3.4rem; font-size: 1.15rem; padding-left: 1.2rem; }
  .door svg { width: 2rem; height: 2rem; padding: 0.45rem; }
  .grid-team { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wall { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .view-head h2 { font-size: 2rem; }
  .grid-products { grid-template-columns: 1fr; }
  .grid-devices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-videos { grid-template-columns: 1fr; }
  .filters { flex-wrap: nowrap; overflow-x: auto; margin-right: calc(-1 * var(--pad)); padding-right: var(--pad); scrollbar-width: none; }
  .sheet { padding: 0; }
  .sheet-panel { width: 100%; height: 100%; border-radius: 0; grid-template-rows: minmax(0, 0.32fr) minmax(0, 0.68fr) auto; }
  .sheet-art { padding: 1.5rem 4.5rem; }
  .sheet-body { padding: 1.6rem 1.3rem 1rem; }
  .sheet-body h2 { font-size: 2rem; }
  .parts { grid-template-columns: 1fr; }
}
/* ---------- the hearos on an upright screen ----------
   Tall and stark: the figure fills the width and "I am Hearo" sits above the head, so the
   hearo takes most of a StanbyME stood on end. The scenes are drawn for a wide stage
   (1920 x 848, words either side of the figure). Here each one is shown through a window
   --wd units wide centered on --cx, wide enough for the whole figure and its effect
   (lightning, flames, capes, plasma: nothing may be cut off), with white above it, and
   its three words are moved up into that space. All numbers are in the scene's own units
   and were measured from the scenes; if hearo.net changes a banner (npm run scenes),
   check these on a 1080 x 1920 screen and adjust. */
@media (max-aspect-ratio: 1/1) {
  .hearos { height: calc(100vw * 1128 / 900); overflow: hidden; }
  .hearos-stage, .hearos-stage li { height: 100%; }
  .hearos-video { width: 100%; height: 100%; }
  .hearos-stage li { position: relative; }
  .hearos [data-scene] { --ss: calc(100vw / var(--wd, 900)); position: absolute; left: 0; bottom: 0; width: 100%; height: calc(848 * var(--ss)); margin: 0; overflow: visible; background: none; transform: translateX(calc((960 - var(--cx, 960)) * var(--ss))); }
  .hearos [data-scene] > div { overflow: visible; }
  .hearos [data-scene] > div > div:last-child > svg { transform-origin: 0 0; }
  .hearos [data-scene="gabe"] { --cx: 909; --wd: 900; }
  .hearos [data-scene="gabe"] > div > div:last-child > svg:nth-child(1) { transform: translate(23.2px, -563.3px) scale(1.12); }
  .hearos [data-scene="gabe"] > div > div:last-child > svg:nth-child(2) { transform: translate(35.5px, -560.9px) scale(1.12); }
  .hearos [data-scene="gabe"] > div > div:last-child > svg:nth-child(3) { transform: translate(-158.9px, -564.0px) scale(1.12); }
  .hearos [data-scene="cameron"] { --cx: 920; --wd: 900; }
  .hearos [data-scene="cameron"] > div > div:last-child > svg:nth-child(1) { transform: translate(81.0px, -564.0px) scale(0.97); }
  .hearos [data-scene="cameron"] > div > div:last-child > svg:nth-child(2) { transform: translate(78.0px, -564.0px) scale(0.97); }
  .hearos [data-scene="cameron"] > div > div:last-child > svg:nth-child(3) { transform: translate(-131.8px, -564.0px) scale(0.97); }
  .hearos [data-scene="maria"] { --cx: 905; --wd: 900; }
  .hearos [data-scene="maria"] > div > div:last-child > svg:nth-child(1) { transform: translate(84.5px, -564.4px) scale(0.96) skewX(-5deg) !important; }
  .hearos [data-scene="maria"] > div > div:last-child > svg:nth-child(2) { transform: translate(78.9px, -561.9px) scale(0.96) skewX(-5deg) !important; }
  .hearos [data-scene="maria"] > div > div:last-child > svg:nth-child(3) { transform: translate(-195.4px, -562.4px) scale(0.96) skewX(-5deg) !important; }
  .hearos [data-scene="kristi"] { --cx: 769; --wd: 960; }
  .hearos [data-scene="kristi"] > div > div:last-child > svg:nth-child(1) { transform: translate(-599.9px, -475.3px) scale(1.1); }
  .hearos [data-scene="kristi"] > div > div:last-child > svg:nth-child(2) { transform: translate(-583.9px, -468.6px) scale(1.1); }
  .hearos [data-scene="kristi"] > div > div:last-child > svg:nth-child(3) { transform: translate(-588.5px, -458.2px) scale(1.1); }
}
/* A large upright screen (the StanbyME on end) ends cleanly after the doors: no intro. */
@media (max-aspect-ratio: 1/1) and (min-width: 821px) {
  .home .lede { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
