/* ==========================================================================
   SiteMura.ph — Page-level compositions
   Only layouts that belong to one page type. Reusable pieces live in
   components.css.
   ========================================================================== */

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

.hero {
  position: relative;
  padding-block: var(--s-8) var(--s-9);
  background:
    radial-gradient(70ch 40ch at 15% -10%, var(--accent-soft), transparent 70%),
    var(--ground);
  overflow: hidden;
}

.hero__grid { display: grid; gap: var(--s-7); align-items: center; }
@media (min-width: 980px) {
  .hero__grid { grid-template-columns: 1.05fr 0.95fr; gap: var(--s-8); }
}

.hero__title { font-size: var(--step-5); letter-spacing: -0.032em; }
.hero__title em { font-style: normal; color: var(--accent); }
.hero__sub { font-size: var(--step-2); line-height: var(--leading-snug); color: var(--ink-body); max-width: 46ch; }
.hero__note { font-size: var(--step--1); color: var(--ink-muted); }

/* The three-dot rule under the hero headline — the logo mark's dots reused as
   a divider. Decorative, so it is aria-hidden in the markup. */
.dot-rule { display: flex; gap: 7px; }
.dot-rule i { width: 9px; height: 9px; border-radius: 50%; display: block; }
.dot-rule i:nth-child(1) { background: var(--dot-red); }
.dot-rule i:nth-child(2) { background: var(--dot-amber); }
.dot-rule i:nth-child(3) { background: var(--dot-green); }

/* --- Hero: the site assembling itself --------------------------------------
   Stands in for a hero GIF. Vector + CSS, so it stays crisp at any size, weighs
   a few KB instead of megabytes, and — the reason a GIF could not do this job —
   takes every colour from a token, so it themes correctly in dark mode.

   One 7s loop drives the whole thing: the address bar types, a load bar sweeps,
   then each block fades up in sequence. Stagger comes from --i on each element,
   kept tight so the tail of one cycle cross-fades into the head of the next.
   -------------------------------------------------------------------------- */

.window--live { position: relative; }
.window--live .window__url { text-align: left; }

.type {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: bottom;
  border-right: 1.5px solid var(--accent);
  animation: type-in 7s steps(16, end) infinite,
             type-caret 0.9s step-end infinite;
}

@keyframes type-in {
  0%          { width: 0; }
  20%, 92%    { width: 100%; }
  100%        { width: 100%; }
}
@keyframes type-caret {
  0%, 49%     { border-right-color: var(--accent); }
  50%, 100%   { border-right-color: transparent; }
}

/* Thin progress line under the chrome — the page "loading". */
.window__load {
  display: block;
  height: 2px;
  background: var(--accent);
  transform-origin: left center;
  animation: load-sweep 7s var(--ease) infinite;
}
@keyframes load-sweep {
  0%        { transform: scaleX(0);   opacity: 1; }
  16%       { transform: scaleX(1);   opacity: 1; }
  24%, 100% { transform: scaleX(1);   opacity: 0; }
}

/* The miniature page. */
.mock {
  display: grid;
  align-content: start;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5) var(--s-5);
  min-height: 340px;
  background: var(--surface);
}

.mock__nav {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--line);
}
/* --accent, not --brand-blue: the accent lifts to a paler blue in dark mode,
   and this bar has to track the CTA rather than stay at the light-mode hue. */
.mock__logo { width: 38px; height: 11px; border-radius: 3px; background: var(--accent); }
.mock__links { display: flex; gap: 9px; margin-left: auto; }
.mock__links i { display: block; width: 22px; height: 6px; border-radius: 3px; background: var(--line-strong); }
.mock__cta { width: 44px; height: 17px; border-radius: 5px; background: var(--accent); }

.mock__hero { display: grid; gap: 9px; }
.mock__bar { display: block; border-radius: 4px; }
.mock__bar--h1    { height: 15px; width: 82%; background: var(--ink); }
.mock__bar--h2    { height: 15px; width: 56%; background: var(--accent); }
.mock__bar--text  { height: 7px;  width: 92%; background: var(--line-strong); margin-top: 5px; }
.mock__bar--text2 { height: 7px;  width: 74%; background: var(--line-strong); }
.mock__btn { width: 88px; height: 24px; border-radius: 5px; background: var(--accent); margin-top: 5px; }

/* Photo block, with a slow highlight passing over it. */
.mock__media {
  position: relative;
  display: block;
  min-height: 84px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--accent-soft), var(--surface-sunken));
  overflow: hidden;
}
.mock__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg,
    transparent 35%,
    color-mix(in srgb, var(--surface) 55%, transparent) 50%,
    transparent 65%);
  background-size: 250% 100%;
  animation: mock-shimmer 7s var(--ease) infinite;
}
@keyframes mock-shimmer {
  0%, 30%   { background-position: 160% 0; }
  70%, 100% { background-position: -60% 0; }
}

.mock__cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-3); }
.mock__cards span {
  display: block;
  min-height: 46px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-sunken);
}

/* Every block rides the same 7s loop, offset by --i. */
.mock__logo, .mock__links, .mock__cta,
.mock__bar, .mock__btn, .mock__media, .mock__cards span {
  /* `both` matters: without a backwards fill the blocks sit fully visible
     through the 1.15s delay, then pop to invisible before fading in. */
  animation: mock-in 7s var(--ease) infinite both;
  animation-delay: calc(1.15s + var(--i, 0) * 0.075s);
}

@keyframes mock-in {
  0%        { opacity: 0; transform: translateY(9px); }
  9%        { opacity: 1; transform: none; }
  90%       { opacity: 1; transform: none; }
  100%      { opacity: 0; transform: translateY(-5px); }
}

/* base.css collapses every animation to 0.01ms under reduced motion, which
   would freeze these on their final keyframe — invisible. Stop them instead. */
@media (prefers-reduced-motion: reduce) {
  .type, .window__load, .mock__media::after,
  .mock__logo, .mock__links, .mock__cta,
  .mock__bar, .mock__btn, .mock__media, .mock__cards span {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .type { width: auto; border-right-color: transparent; }
  .window__load { opacity: 0; }
}

/* --- Page header (every page except home) --------------------------------- */

.page-header {
  padding-block: var(--s-7) var(--s-6);
  background:
    radial-gradient(60ch 28ch at 10% -40%, var(--accent-soft), transparent 70%),
    var(--ground);
  border-bottom: 1px solid var(--line);
}
.page-header__inner { display: grid; gap: var(--s-3); max-width: 720px; }

.breadcrumb { display: flex; gap: var(--s-2); list-style: none; padding: 0; font-size: var(--step--2); color: var(--ink-muted); }
.breadcrumb li { margin: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: var(--s-2); color: var(--line-strong); }
.breadcrumb a { color: var(--ink-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

/* --- Tier ladder (packages) ------------------------------------------------ */

.tiers { display: grid; gap: var(--s-5); }
@media (min-width: 760px)  { .tiers { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1120px) { .tiers { grid-template-columns: repeat(4, 1fr); } }

.tier {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  padding: var(--s-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.tier {
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}
.tier:hover { transform: translateY(-3px); box-shadow: var(--shadow-md), var(--edge); border-color: var(--line-strong); }

/* The tier we push. Raised a step above the others rather than merely outlined,
   so the hierarchy survives being scanned rather than read. */
.tier--featured {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--accent), var(--edge);
}
.tier--featured:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--accent), var(--edge);
  border-color: var(--accent);
}
.tier__head { display: grid; gap: var(--s-2); }
.tier__name {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.tier__en { font-size: var(--step--2); color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.1em; font-family: var(--font-mono); }
.tier__pitch { font-size: var(--step--1); color: var(--ink-muted); }
.tier__meta {
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
  padding-block: var(--s-3);
  border-block: 1px solid var(--line);
  font-size: var(--step--2);
  font-family: var(--font-mono);
  color: var(--ink-muted);
}
.tier__cta { margin-top: auto; }

/* Full detail block, one per tier, on packages.html */
.tier-detail {
  display: grid;
  gap: var(--s-6);
  padding-block: var(--s-7);
  border-bottom: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-h) + var(--s-5));
}
.tier-detail:last-of-type { border-bottom: 0; }
@media (min-width: 900px) {
  .tier-detail { grid-template-columns: 320px 1fr; gap: var(--s-8); align-items: start; }
  .tier-detail__aside { position: sticky; top: calc(var(--header-h) + var(--s-5)); }
}
.tier-detail__aside { display: grid; gap: var(--s-4); align-content: start; }
.tier-detail__cols { display: grid; gap: var(--s-6); }
@media (min-width: 620px) { .tier-detail__cols { grid-template-columns: 1fr 1fr; } }

/* --- Care plans ------------------------------------------------------------ */

.plans { display: grid; gap: var(--s-5); }
@media (min-width: 860px) { .plans { grid-template-columns: repeat(3, 1fr); } }

.plan {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  padding: var(--s-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.plan { transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.plan:hover { transform: translateY(-3px); box-shadow: var(--shadow-md), var(--edge); border-color: var(--line-strong); }
.plan--featured { border-color: var(--accent); box-shadow: var(--shadow-lg), 0 0 0 1px var(--accent), var(--edge); }
.plan--featured:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg), 0 0 0 1px var(--accent), var(--edge); border-color: var(--accent); }
.plan__name { font-family: var(--font-display); font-size: var(--step-2); font-weight: 700; color: var(--ink); }

/* --- Demo grid (portfolio) ------------------------------------------------- */

.demos { display: grid; gap: var(--s-5); }
@media (min-width: 700px)  { .demos { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1060px) { .demos { grid-template-columns: repeat(3, 1fr); } }

/* Real client work: two per row rather than three, so the screenshots are big
   enough to actually judge the design — which is the whole point of the page. */
@media (min-width: 700px) { .demos--work { grid-template-columns: repeat(2, 1fr); } }

/* The screenshot sits in the window frame's content area. The link wrapper
   must be a block or the image inherits inline layout and leaves a gap. */
.demo__shot {
  display: block;
  overflow: hidden;
  background: var(--surface-sunken);
  line-height: 0;
}
.demo__shot img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top center;
  transition: transform var(--dur-slow) var(--ease);
}
.demo:hover .demo__shot img { transform: scale(1.02); }

@media (prefers-reduced-motion: reduce) {
  .demo:hover .demo__shot img { transform: none; }
}

.demo { display: flex; flex-direction: column; }
.demo .window { transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.demo:hover .window { transform: translateY(-4px); box-shadow: var(--shadow-lg), var(--edge); }
.demo .window { display: flex; flex-direction: column; height: 100%; }
.demo__meta { display: grid; gap: var(--s-2); padding: var(--s-4); background: var(--surface); }
.demo__name { font-family: var(--font-display); font-weight: 700; font-size: var(--step-1); color: var(--ink); }
.demo__type { font-size: var(--step--2); font-family: var(--font-mono); color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.08em; }

/* --- Segments table (who we sell to) --------------------------------------- */

.segment { display: grid; gap: var(--s-2); padding: var(--s-4) 0; border-bottom: 1px solid var(--line); }
.segment:last-child { border-bottom: 0; }
@media (min-width: 780px) {
  .segment { grid-template-columns: 1.1fr 1.3fr auto; align-items: center; gap: var(--s-5); }
}
.segment__who { font-weight: 600; color: var(--ink); }
.segment__need { font-size: var(--step--1); color: var(--ink-muted); }

/* --- CTA band -------------------------------------------------------------- */

.cta-band { background: var(--brand-navy); color: var(--ink-invert); padding-block: var(--s-8); }
.cta-band h2 { color: #fff; }
.cta-band p { color: #b9c6dd; }
.cta-band__inner { display: grid; gap: var(--s-5); justify-items: center; text-align: center; }

/* --- Comparison table column emphasis -------------------------------------- */

.compare thead th:nth-child(3),
.compare tbody td:nth-child(3) { background: var(--accent-soft); }
.compare thead th:nth-child(3) { background: var(--accent); }

/* --- Contact page layout ---------------------------------------------------- */

.contact-grid { display: grid; gap: var(--s-7); }
@media (min-width: 980px) { .contact-grid { grid-template-columns: 1.2fr 0.8fr; gap: var(--s-8); } }

.channel {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-3) var(--s-4);
  align-items: center;
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--line);
}
.channel:last-child { border-bottom: 0; }
.channel__name { font-weight: 600; color: var(--ink); }
.channel__value { font-family: var(--font-mono); font-size: var(--step--1); color: var(--ink-muted); grid-column: 2; }

/* --- Legal / long-form prose ------------------------------------------------ */

.prose { display: grid; gap: var(--s-5); max-width: var(--measure); }
.prose h2 { font-size: var(--step-3); padding-top: var(--s-4); }
.prose h3 { font-size: var(--step-1); }
.prose ul, .prose ol { display: grid; gap: var(--s-2); }

/* --- 404 --------------------------------------------------------------------- */

.notfound { display: grid; gap: var(--s-5); justify-items: center; text-align: center; padding-block: var(--s-10); }
.notfound__code { font-family: var(--font-mono); font-size: var(--step-5); font-weight: 600; color: var(--accent); line-height: 1; }

/* --- Pay page --------------------------------------------------------------
   Two columns: how to send on the left, tell-us form on the right. On a phone
   they stack in that order, which is the order the task actually happens in.
   -------------------------------------------------------------------------- */

.pay-grid { display: grid; gap: var(--s-7); }
@media (min-width: 980px) {
  .pay-grid { grid-template-columns: 0.9fr 1.1fr; gap: var(--s-8); align-items: start; }
}

.paymethod {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm), var(--edge);
}
.paymethod__head { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.paymethod__name {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 700;
  color: var(--ink);
}
.paymethod__rows { display: grid; gap: var(--s-2); margin: 0; }
.paymethod__rows > div {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: var(--s-3);
  align-items: baseline;
}
.paymethod__rows dt { font-size: var(--step--1); color: var(--ink-muted); }
.paymethod__rows dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink);
  word-break: break-word;
}
@media (max-width: 480px) {
  .paymethod__rows > div { grid-template-columns: 1fr; gap: 2px; }
}

/* ==========================================================================
   Order flow on pay.html — three steps: brief, method, pay
   ========================================================================== */

/* --- Progress bar --------------------------------------------------------
   Numbered because this genuinely is a sequence with a fixed length, which is
   the same reason .steps on process.html is allowed numbers. Three items only,
   so it can stay a row on a phone if the labels drop away.
   ---------------------------------------------------------------------- */

.steps-bar {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin: 0;
  padding: 0;
  list-style: none;
  flex-wrap: wrap;
}
.steps-bar__item {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--step--1);
  color: var(--ink-muted);
}
.steps-bar__item + .steps-bar__item::before {
  content: "";
  width: var(--s-5);
  height: 1px;
  background: var(--line);
  margin-right: var(--s-1);
}
.steps-bar__num {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  flex: none;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: var(--step--2);
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
}
.steps-bar__item.is-current { color: var(--ink); font-weight: 600; }
.steps-bar__item.is-current .steps-bar__num {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
/* Done steps get the green that means "yes, included, complete" everywhere
   else on this site — not a fourth arbitrary state colour. */
.steps-bar__item.is-done .steps-bar__num {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.steps-bar__item.is-done { color: var(--ink-body); }
@media (max-width: 560px) {
  .steps-bar__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .steps-bar__item + .steps-bar__item::before { width: var(--s-4); }
}

/* --- Selectable payment method -------------------------------------------
   A <label> wrapping a real radio, so the whole card is a hit target and the
   keyboard/screen-reader behaviour is the browser's own rather than something
   re-implemented with divs and JS.
   ---------------------------------------------------------------------- */

.paymethod--pick {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-4);
  align-items: start;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}
.paymethod--pick:hover { border-color: color-mix(in oklab, var(--accent) 40%, var(--line)); }

.paymethod__radio {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--accent);
  flex: none;
}
.paymethod__body { display: grid; gap: var(--s-2); }
.paymethod__note { font-size: var(--step--1); color: var(--ink-body); }

/* The selected card. Colour is reinforcement only — the radio itself already
   carries the state, so this still reads correctly with no colour vision. */
.paymethod--pick:has(.paymethod__radio:checked) {
  border-color: var(--accent);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--accent);
}
/* Focus must land on the card, not the 18px radio inside it. */
.paymethod--pick:has(.paymethod__radio:focus-visible) { outline: var(--ring); outline-offset: 2px; }

/* --- QR Ph panel ---------------------------------------------------------- */

.qr {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-6);
  align-items: start;
  padding: var(--s-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm), var(--edge);
}
.qr__frame {
  display: grid;
  place-items: center;
  width: 15rem;
  height: 15rem;
  flex: none;
  /* Always white, in both themes. A QR scanner needs the real contrast
     polarity — inverting it in dark mode makes many phone cameras fail. */
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s-3);
}
.qr__img { width: 100%; height: 100%; object-fit: contain; display: block; }
.qr__placeholder { font-size: var(--step--1); color: var(--ink-muted); text-align: center; margin: 0; }
.qr__status {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink-muted);
  margin: 0;
}
.qr__status.is-paid { color: var(--ok); font-weight: 700; }
.qr__status.is-expired { color: var(--warn); font-weight: 700; }

@media (max-width: 620px) {
  .qr { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .qr__frame { width: min(15rem, 78vw); height: min(15rem, 78vw); }
}
