/*
 * Homepage additions: the real Doctoro apps, shown in a device frame.
 *
 * Loaded by index.html only, after site.css. The screens are the apps' own
 * (assets/screens/), so their blue stays inside the frame; everything around
 * them keeps the site's green palette and Geist (docs/BRAND.md).
 */

/* ------------------------------------------------------------ device frame */

.device {
  --w: 240px;
  position: relative;
  width: var(--w);
  margin: 0;
  padding: calc(var(--w) * 0.032);
  border-radius: calc(var(--w) * 0.16);
  background: linear-gradient(145deg, #1d3a32, #0b1c17 55%, #16302a);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    0 2px 0 rgba(255, 255, 255, 0.06),
    0 40px 80px -20px rgba(14, 42, 35, 0.45),
    0 18px 36px -18px rgba(14, 42, 35, 0.5);
}
.device img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: calc(var(--w) * 0.13);
  background-color: #fff;
}
/* The professional screenshot has no camera cut-out of its own. */
.device-island {
  position: absolute;
  top: calc(var(--w) * 0.058);
  left: 50%;
  width: 30%;
  height: calc(var(--w) * 0.085);
  border-radius: 999px;
  background-color: #050b09;
  transform: translateX(-50%);
}
.device-shine {
  position: absolute;
  inset: calc(var(--w) * 0.032);
  border-radius: calc(var(--w) * 0.13);
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 28%);
  pointer-events: none;
}

/* ------------------------------------------------------------ hero */

/* The photo is a wide panel at the top right; the phone stands in front of its
   lower-left corner. Everything is sized from the panel's width (cqi), so at
   every screen size the phone's top stays below both faces in the photo and
   no floating element covers a face. */
.hero-app {
  container-type: inline-size;
}
.hero-app.hero-visual {
  aspect-ratio: 4 / 5;
}
.hero-app .hero-photo {
  inset: 0 0 41% 22%;
}
.hero-app .hero-photo img {
  object-position: 50% 30% !important;
}
.hero-app .hero-device {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 2;
  --w: 37cqi;
}
.hero-app .fc-2 {
  top: auto;
  right: 0;
  bottom: 27%;
  z-index: 3;
}
.hero-app .fc-3 {
  left: auto;
  right: 3%;
  bottom: 9%;
  z-index: 3;
}
.hero-beta {
  display: inline-grid;
  place-items: center;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background-color: var(--ink);
  color: var(--trace-light);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-join {
  margin-top: 1.1rem;
  font-size: 0.95rem;
  color: var(--muted);
}
.hero-join a,
.cta-join a {
  font-weight: 600;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cta-band .cta-join {
  margin-top: 1.2rem;
  font-size: 0.98rem;
}
.cta-band .cta-join a {
  color: var(--trace-light);
}

/* ------------------------------------------------------------ patient features (from the app's own poster) */

.feature-list .fl-icon.is-blue { background-color: #e6efff; color: #1d5fd0; }
.feature-list .fl-icon.is-green { background-color: var(--mint); color: var(--accent); }
.feature-list .fl-icon.is-red { background-color: #fde8e4; color: #b5321f; }
.feature-list .fl-icon.is-sun { background-color: #fbf0d9; color: #96620c; }

/* ------------------------------------------------------------ app cards: the real screens, whole phone in view */

.app-card.has-device {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 420px;
}
.app-card.has-device .app-copy {
  align-self: stretch;
}
.app-card .device {
  --w: clamp(150px, 14vw, 180px);
  align-self: center;
  transform: rotate(4deg) translateY(0);
  transition: transform 0.7s var(--ease);
}
@media (hover: hover) {
  .app-card:hover .device {
    transform: rotate(1.5deg) translateY(-8px);
  }
}
.beta-row {
  display: grid;
  gap: 0.7rem;
  justify-items: start;
  margin-top: auto;
  padding-top: 1.8rem;
}
.beta-row small {
  font-size: 0.84rem;
  line-height: 1.45;
  color: rgba(230, 242, 236, 0.72);
}

/* ------------------------------------------------------------ closing band */

.cta-pillars {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem 0;
  margin: 2rem auto 0;
  padding: 0;
  list-style: none;
}
.cta-pillars li {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.2rem 1.3rem;
  font-size: 0.95rem;
  color: var(--on-dark);
}
.cta-pillars li + li {
  border-left: 1px solid rgba(230, 242, 236, 0.18);
}
.cta-pillars svg {
  width: 18px;
  height: 18px;
  color: var(--trace-light);
}
.cta-band .cta-sign {
  margin-top: 1.4rem;
  font-size: 1.15rem;
  font-weight: 500;
  color: #fff;
}
.cta-band .cta-where {
  position: relative;
  margin-top: 2rem;
  font-family: "Geist Mono", ui-monospace, monospace;
  max-width: none;
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  color: var(--on-dark-muted);
}

/* ------------------------------------------------------------ small screens */

@media (max-width: 1024px) {
  .hero-app.hero-visual {
    justify-self: center;
  }
}
@media (max-width: 760px) {
  .app-card.has-device {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .app-card .device {
    justify-self: center;
    margin-top: 1.5rem;
    --w: 190px;
  }
  .cta-pillars li {
    flex-basis: 100%;
    justify-content: center;
  }
  .cta-pillars li + li {
    border-left: 0;
  }
  .cta-band .cta-where {
    letter-spacing: 0.12em;
    white-space: nowrap;
  }
}
@media (max-width: 520px) {
  .hero-app .fc-2,
  .hero-app .fc-3 {
    right: 0;
    max-width: 58%;
    padding: 0.65rem 0.75rem;
    font-size: 0.8rem;
  }
  .hero-app .float-card .fc-icon {
    width: 34px;
    height: 34px;
  }
}

/* ------------------------------------------------------------ hero spacing
   The picture is taller than the text, so centring the text left a large
   empty band above the Beta line. The text now starts at the top. */
.hero:has(.hero-app) {
  padding-top: clamp(1.75rem, 4vw, 3rem);
}
.hero:has(.hero-app) .hero-grid {
  align-items: start;
}
.hero:has(.hero-app) .hero-grid > :first-child {
  padding-top: clamp(0rem, 2.5vw, 2rem);
}

/* ------------------------------------------------------------ living hero
   Calm, continuous motion so the hero feels alive: the photo drifts slowly,
   the phone breathes, the cards bob out of step. Off for reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .hero-app .hero-photo img {
    transform-origin: 60% 35%;
    animation: home-kenburns 22s ease-in-out infinite alternate;
    will-change: transform;
  }
  .js .hero-app .hero-device {
    animation:
      home-device-in 1s var(--ease) 0.35s both,
      home-breathe 7s ease-in-out 1.4s infinite;
  }
  .js .hero-app .fc-2 {
    animation: home-bob 6.5s ease-in-out 0.6s infinite;
  }
  .js .hero-app .fc-3 {
    animation: home-bob 7.5s ease-in-out 2.2s infinite;
  }
  .app-card .device img,
  .beta-device img {
    animation: none;
  }
}
@keyframes home-kenburns {
  from { transform: scale(1) translate3d(0, 0, 0); }
  to { transform: scale(1.09) translate3d(-1.5%, -1%, 0); }
}
@keyframes home-breathe {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(-0.6deg); }
}
@keyframes home-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

/* ------------------------------------------------------------ motion */

@media (prefers-reduced-motion: reduce) {
  .app-card .device,
  .app-card:hover .device {
    transition: none;
    transform: rotate(4deg);
  }
}
@keyframes home-device-in {
  from { opacity: 0; transform: translateY(28px) rotate(-2deg); }
  to { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------ hero on large screens
   The picture was capped at 540px and pushed to the far right, leaving a wide
   empty middle. Above 1400px it grows into a wider panel beside the text,
   and the phone and cards scale with it (all sized from its width). */
@media (min-width: 1400px) {
  .hero:has(.hero-app) .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: clamp(2rem, 3vw, 3.5rem);
  }
  .hero-app.hero-visual {
    max-width: 920px;
    aspect-ratio: 7 / 6;
    justify-self: stretch;
  }
  .hero-app .hero-photo {
    inset: 0 0 26% 24%;
  }
  .hero-app .hero-device {
    --w: 34cqi;
  }
  .hero-app .fc-2 {
    bottom: 13%;
    right: 2%;
  }
  .hero-app .fc-3 {
    bottom: 0;
    right: 26%;
  }
  .hero:has(.hero-app) h1 {
    font-size: clamp(4.6rem, 4.6vw, 5.6rem);
  }
  .hero:has(.hero-app) .hero-lede {
    max-width: 38rem;
  }
}

/* ------------------------------------------------------------ hero: both apps, |/
   The patient app stands upright; Doctoro Professional leans against it to
   the right, like two cards propped together. Sized from the visual's width. */
.hero-duo {
  container-type: inline-size;
  position: relative;
  width: 100%;
  max-width: 640px;
  aspect-ratio: 1 / 1;
  justify-self: center;
}
.hero-duo .device {
  position: absolute;
  bottom: 4%;
  --w: 40cqi;
}
.hero-duo .duo-patient {
  left: 10%;
  z-index: 2;
}
.hero-duo .duo-pro {
  left: 46%;
  z-index: 1;
  transform-origin: 0% 100%;
  transform: rotate(14deg);
}
.hero-duo .fc-2 {
  position: absolute;
  top: 9%;
  right: 0;
  bottom: auto;
  left: auto;
  z-index: 3;
}
.hero-duo .fc-3 {
  position: absolute;
  bottom: 0;
  left: 0;
  right: auto;
  z-index: 3;
}
@media (min-width: 1400px) {
  .hero:has(.hero-duo) .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .hero-duo { max-width: 760px; }
}
@media (max-width: 1024px) {
  .hero-duo { max-width: 520px; margin-top: 1rem; }
}
@media (max-width: 520px) {
  .hero-duo { aspect-ratio: 1 / 1.05; }
  .hero-duo .device { --w: 47cqi; bottom: 2%; }
  .hero-duo .duo-patient { left: 2%; }
  .hero-duo .duo-pro { left: 44%; transform: rotate(12deg); }
  .hero-duo .fc-2 { top: 2%; }
  .hero-duo .float-card { max-width: 62%; font-size: 0.78rem; padding: 0.6rem 0.7rem; }
  .hero-duo .float-card .fc-icon { width: 32px; height: 32px; }
}
@media (prefers-reduced-motion: no-preference) {
  .js .hero-duo .duo-patient {
    animation: home-device-in 1s var(--ease) 0.3s both, home-breathe 7s ease-in-out 1.4s infinite;
  }
  .js .hero-duo .duo-pro {
    animation: duo-pro-in 1.1s var(--ease) 0.5s both, duo-pro-sway 8s ease-in-out 1.8s infinite;
  }
  .js .hero-duo .fc-2 { animation: home-bob 6.5s ease-in-out 0.6s infinite; }
  .js .hero-duo .fc-3 { animation: home-bob 7.5s ease-in-out 2.2s infinite; }
}
@keyframes duo-pro-in {
  from { opacity: 0; transform: rotate(4deg) translateY(30px); }
  to { opacity: 1; transform: rotate(14deg); }
}
@keyframes duo-pro-sway {
  0%, 100% { transform: rotate(14deg) translateY(0); }
  50% { transform: rotate(12deg) translateY(-8px); }
}
