/*
SPDX-FileCopyrightText: 2026 Jorge Pérez Burgueño and Nodus contributors
SPDX-License-Identifier: AGPL-3.0-only

The Nodus family: the front page and the page of each app. Loaded after
nodus.css and home.css, and builds only on what they define.
*/

/* ============================================================ the phone */
/* The mobile counterpart of the desktop window in home.css: the same carousel
   (data-shots, .shots, .shot, arrows), with the screenshot held in an iPhone
   body instead of a window with three coloured controls. The caption stays a
   line under the phone, never laid over the screen. */
.phone {
  position: relative;
  width: min(100%, var(--phone-width, 300px));
  margin-inline: auto;
}
.phone .shots { background: transparent; }
.phone .shot img,
.phone-still img {
  display: block; width: 100%; height: auto;
  aspect-ratio: var(--phone-ratio, 1179 / 2556);
  object-fit: cover; object-position: top center;
  border: 9px solid #07060c;
  border-radius: 46px;
  background: #07060c;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.10),
    0 0 0 2px color-mix(in srgb, var(--accent, #a78bfa) 18%, transparent),
    var(--shadow);
  transition: box-shadow 0.6s var(--ease);
}
.scene:hover .phone .shot img,
.app-card:hover .phone-still img {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.14),
    0 0 0 2px color-mix(in srgb, var(--accent, #a78bfa) 45%, transparent),
    var(--shadow);
}
/* the Dynamic Island, sitting on the screen of whichever shot is showing */
.phone .shots::before,
.phone-still::before {
  content: ""; position: absolute; z-index: 1; pointer-events: none;
  top: 19px; left: 50%; transform: translateX(-50%);
  width: 29%; height: 22px; border-radius: 999px;
  background: #07060c;
}
.phone-still { position: relative; margin: 0; }
.phone .shot figcaption {
  border-top: 0; background: none;
  padding: 16px 4px 0; justify-content: center; text-align: center;
}
.phone .shot .shot-step { display: none; }
/* the arrows sit beside the phone, not over its screen */
.phone .shot-arrow { top: calc(50% - 24px); }
.phone .shot-arrow.prev { left: -52px; }
.phone .shot-arrow.next { right: -52px; }
.phone-row { display: flex; justify-content: center; padding-inline: 56px; }

/* An iPad shot is landscape and wants a thinner bezel. */
.phone.is-ipad { --phone-width: 560px; --phone-ratio: 4 / 3; }
.phone.is-ipad .shot img { border-width: 11px; border-radius: 28px; }
.phone.is-ipad .shots::before { display: none; }

@media (max-width: 700px) {
  .phone { --phone-width: 248px; }
  .phone .shot img, .phone-still img { border-width: 7px; border-radius: 38px; }
  .phone .shots::before, .phone-still::before { top: 15px; height: 18px; }
  .phone .shot-arrow.prev { left: -44px; }
  .phone .shot-arrow.next { right: -44px; }
  .phone-row { padding-inline: 46px; }
}

/* ============================================================ app hero */
.app-mark {
  --icon: 84px; display: block; margin: 0 auto 22px;
  filter: drop-shadow(0 18px 40px color-mix(in srgb, var(--accent, #a78bfa) 35%, transparent));
}
.hero .app-platforms {
  margin-top: 18px;
  font: 600 11px/1.4 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3);
}
.hero .app-tagline {
  font-family: var(--serif); font-size: clamp(26px, 3.6vw, 44px);
  line-height: 1.1; letter-spacing: -0.03em; color: var(--ink);
  margin-top: 10px;
}

/* ============================================================ front page */
/* The two desktop apps reuse .scene from home.css. The mobile apps are four
   cards, two by two where there is room for them. */
.family-mobile {
  display: grid; gap: clamp(18px, 2.4vw, 28px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: clamp(32px, 4vw, 48px);
}
.app-card {
  display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr);
  gap: clamp(18px, 2.4vw, 30px); align-items: center;
  padding: clamp(18px, 2.4vw, 28px);
  color: inherit; text-decoration: none;
}
.app-card .phone-still { width: 100%; }
.app-card .phone-still img { border-width: 6px; border-radius: 26px; }
.app-card .phone-still::before { top: 12px; height: 12px; }
.app-card h3 { font-size: clamp(22px, 2.2vw, 28px); letter-spacing: -0.02em; }
.app-card h3 .glow { color: var(--accent); }
.app-card p { margin: 10px 0 0; font-size: 14.5px; line-height: 1.58; color: var(--ink-2); }
.app-card .app-platforms {
  margin-top: 12px;
  font: 600 10.5px/1.4 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3);
}
.app-card .arrow-link { margin-top: 16px; }

.family-links { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 24px; }

@media (max-width: 900px) {
  .family-mobile { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .app-card { grid-template-columns: minmax(0, 104px) minmax(0, 1fr); }
  .app-card .phone-still img { border-width: 5px; border-radius: 20px; }
  .app-card .phone-still::before { top: 9px; height: 9px; }
}

/* ============================================================ credit line */
.shot-credit {
  margin-top: 14px; font-size: 12.5px; line-height: 1.5; color: var(--ink-3);
}
.shot-credit a { color: var(--ink-2); }

/* ============================================================ app icons */
/* Every app icon is a full square in its light version, clipped to the same
   rounded corner, so the family reads as one set at any size. */
.app-icon, .app-mark {
  display: inline-block; flex: 0 0 auto;
  width: var(--icon, 44px); height: var(--icon, 44px);
  border-radius: 23%;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.10), 0 10px 26px -12px rgba(0, 0, 0, 0.7);
}
.app-card .app-icon { display: block; margin-bottom: 12px; }
.brand-icon { display: inline-grid; place-items: center; }
.brand-icon svg { width: 58%; height: 58%; }

/* ============================================================ hero launchers */
/* Under the front-page title: one panel per kind of app, each with its icons,
   a way to read more and a button that opens its download dialog. */
.launchers {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px; margin: 34px auto 0; max-width: 860px; text-align: left;
}
.launcher {
  display: flex; flex-direction: column; gap: 14px;
  padding: 18px 18px 16px;
  border: 1px solid var(--membrane); border-radius: var(--r-l);
  background: linear-gradient(180deg, rgba(22, 18, 38, 0.72), rgba(11, 9, 20, 0.72));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.launcher:hover { border-color: rgba(167, 139, 250, 0.45); transform: translateY(-2px); }
.launcher-head { display: flex; flex-direction: column; gap: 4px; color: var(--ink); }
.launcher-head b { font-size: 17px; letter-spacing: -0.01em; }
.launcher-kicker {
  font: 600 10.5px/1.3 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3);
}
.launcher-icons { --icon: 40px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.icon-link { display: inline-flex; border-radius: 23%; transition: transform 0.25s var(--ease); }
.icon-link:hover { transform: translateY(-2px) scale(1.06); }
.icon-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.launcher-actions { display: flex; gap: 8px; margin-top: auto; }
.launcher-actions .btn { flex: 1 1 auto; justify-content: center; padding-inline: 12px; }
@media (max-width: 760px) {
  .launchers { grid-template-columns: minmax(0, 1fr); max-width: 420px; }
}

/* ============================================================ dialogs */
.dl-plat .app-os, .dl-app-group .app-os { border-radius: 23%; object-fit: cover; background: #fff; }
.dl-plat .app-os { width: 30px; height: 30px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12); }
.dl-app-group { display: flex; align-items: center; gap: 12px; }
.dl-app-group .app-os { --icon: 34px; width: 34px; height: 34px; }
.dl-app-group > span { display: flex; flex-direction: column; gap: 2px; }
.dl-app-group .ver { margin: 0; font-weight: 400; letter-spacing: 0; text-transform: none; }
.dl-chip {
  display: inline-block; vertical-align: 2px; margin-left: 6px;
  padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--membrane); color: var(--ink-2);
  font: 600 10.5px/1.2 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
}
.dl-hint { margin: 16px 2px 0; font-size: 13px; line-height: 1.55; color: var(--ink-3); }
.dl-hint b { color: var(--ink-2); font-weight: 600; }
.dl-hint a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
/* the hero mark keeps its own line, centred above the app's name */
.hero .app-mark { display: block; }

/* ============================================================ the opening */
/* The family pages run the same opening as Nodus Research (home.css): the field
   gathers into the page's own letter, then the hero rises. These are the hero
   pieces home.css does not know about. */
.intro-armed .hero .app-mark,
.intro-armed .hero .app-platforms,
.intro-armed .hero .launchers { opacity: 0; }
.intro-run .hero .app-mark { animation: intro-mark 1.1s var(--ease) both; }
.intro-run .hero .launchers { animation: intro-rise 0.9s var(--ease) 1.36s both; }
.intro-run .hero .app-platforms { animation: intro-rise 0.9s var(--ease) 1.44s both; }
