/* ============================================================
   snapshot cro — shared styles
   Loaded by every page. Design direction is Shep's; this file
   holds the structural shell only.
   ============================================================ */

:root {
  /* The page is white and the hero is a black card, mirroring the app
     card on the homepage -- arriving here should read as that card
     opened up rather than as a different site. So there are two
     grounds, not one: --bg/--fg for the page, --ink/--on-ink for the
     black surfaces (the hero card and the thumbnail frames). */
  --bg: #fff;
  --fg: #14171a;
  --ink: #000;
  --on-ink: #fff;
  --on-ink-muted: #b4b4b4;    /* body copy inside a black surface */
  --accent: #ffc42a;          /* the site's yellow, shared with the homepage */

  /* Card thumbnails. The image is deliberately clipped: it sits
     inset from the top-left and runs off the right and bottom, so
     the card shows a stylized corner rather than the whole shot.
     Tune these two to change how much shows. */
  --thumb-pad: 12%;           /* inset on the top and left only */
  --thumb-zoom: 150%;         /* image width relative to the frame */
  --thumb-radius: 12px;       /* the yellow frame's corners */
  --thumb-img-radius: 8px;    /* the screenshot's own corners */
  --muted: #5c6166;

  /* Header logo and header buttons share this, so they stay the same
     height at every breakpoint instead of drifting apart. Both numbers
     are the homepage's, so the two headers read as one site: a reader
     crossing between them should not feel the furniture resize.

     The homepage sizes its logo by width (190px on a 1000x225 file),
     which lands at ~43px tall. This wordmark has a different ratio, so
     it matches on height instead -- the dimension the eye reads in a
     header -- rather than on width. */
  --control-height: 48px;
  --brand-height: 43px;

  /* The modal reads as paper against the dimmed page — long body copy
     is easier on a light ground. */
  --panel: #f5f5f5;
  --panel-text: #14171a;
  --panel-muted: #5c6166;
  --panel-line: #d9dcde;
  --line: #e2e2e2;
  --ink-line: #2a2a2a;        /* hairlines on a black surface */
  --gutter: 20px;

  /* Lifted from the homepage's cards so the hero here and the app card
     there sit at the same elevation and corner radius. */
  --card-radius: 16px;
  --card-shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 14px 32px rgba(0, 0, 0, 0.09);
  --maxw: 1280px;

  /* One family at every size. Swap these two to change the whole
     site's type; nothing else references a font name. */
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-text: "Space Grotesk", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-text);
}

body.modal-open { overflow: hidden; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---- header ---- */

/* Sits in normal flow rather than fixed, so it never overlaps the
   grid on short screens. */
.site-header {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 22px var(--gutter);
}

/* Inset by the gutter rather than set as a border on the header, so
   the line ends exactly where the card grid does instead of running
   out to the padding edge. */
.site-header::after {
  content: "";
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 0;
  border-bottom: 1px solid var(--line);
}

.site-header .buttons { margin-top: 0; }

.brand {
  display: block;
  line-height: 0;
  flex: none;
}

/* The wordmark is 7.5:1, so at --brand-height it runs over 300px wide
   and would overflow a phone. The cap wins there; object-fit keeps it
   from squashing when it does. */
.brand img {
  display: block;
  height: var(--brand-height);
  width: auto;
  max-width: 58vw;
  object-fit: contain;
  object-position: left center;
}

/* ---- hero ----

   A black card on a white page, cut to the same radius and elevation
   as the cards on the homepage. The app card there is the door into
   this page; making the first thing you land on the same object means
   the click resolves instead of dropping you somewhere new.

   .hero-section carries the container's max-width and gutter, so the
   card's edges line up with the grid and the dividers below it; .hero
   is the card itself. */
.hero-section {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 40px var(--gutter) 64px;
}

.hero {
  display: grid;
  justify-items: start;
  padding: 56px 48px 60px;
  background: var(--ink);
  color: var(--on-ink);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  text-align: left;
}

.hero-title {
  margin: 0;
  max-width: 22ch;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5.2vw, 3.7rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.03em;
  text-wrap: balance;
}

/* Same yellow as the thumbnail frames below. It carries text here
   because it sits on black; nowhere else on this page does. */
.hero-title .accent { color: var(--accent); }

.logo {
  margin: 0;
  text-align: center;
}

.logo img {
  display: block;
  width: 92vw;
  max-width: 1200px;
  height: auto;
}

.hero-sub {
  max-width: 62ch;
  margin: 32px 0 0;
  color: var(--on-ink-muted);
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  line-height: 1.6;
}

.logo a {
  display: inline-block;
  line-height: 0;
}

/* ---- buttons ---- */

.buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
}

.buttons a {
  display: inline-flex;
  align-items: center;
  height: var(--control-height);
  padding: 0 24px;
  border: 2px solid var(--fg);
  border-radius: 999px;
  color: var(--fg);
  background: var(--bg);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1rem;
  transition: background-color .15s ease, color .15s ease;
}

.buttons a:hover,
.buttons a:focus-visible {
  background: var(--fg);
  color: var(--bg);
}

/* Dark on the white page; the yellow would all but vanish there. On
   the black hero card it is the other way round. */
:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 4px;
}

.hero :focus-visible { outline-color: var(--accent); }

/* ---- questions ---- */

.questions-section { padding: 0 0 72px; }

.questions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.question {
  padding: 11px 20px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--fg);
  font: inherit;
  font-size: .95rem;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}

/* Filled rather than outlined: yellow type on white is unreadable, so
   the accent goes behind the text instead of into it. */
.question:hover,
.question:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
}

/* ---- card grid ---- */

.grid-section { padding: 0 0 100px; }

.group-title {
  margin: 0 0 24px;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.02em;
}

.group-divider {
  height: 0;
  margin: 64px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* Padding is always present, not added on highlight, so switching the
   background on doesn't shift the card's contents. */
.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  margin: 0;
  background: none;
  border: 0;
  border-radius: 14px;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}

/* Fixed ratio reserves the space before the image loads, so the
   grid doesn't jump as cards fill in. */
.card-image {
  display: block;
  aspect-ratio: 4 / 3;
  padding: var(--thumb-pad) 0 0 var(--thumb-pad);
  background: var(--ink);
  border: 2px solid var(--accent);
  border-radius: var(--thumb-radius);
  overflow: hidden;
}

/* Anchored top-left at its own scale — whatever falls outside the
   frame on the right and bottom is clipped away. */
.card-image img {
  display: block;
  width: var(--thumb-zoom);
  max-width: none;
  height: auto;
  border-radius: var(--thumb-img-radius);
  transition: transform .25s ease;
  transform-origin: top left;
}

.card:hover .card-image img,
.card:focus-visible .card-image img {
  transform: scale(1.03);
}

/* Set when a question sends the reader to this card. Inverted rather
   than outlined, and it stays until they open the card or pick a
   different question. */
.card.is-highlighted {
  background: var(--accent);
  color: var(--ink);
}

.card.is-highlighted .card-subtitle { color: rgba(0, 0, 0, .68); }

/* The thumbnail frame keeps its black fill and yellow border when the
   card is highlighted, so the image still sits on black. */

.card-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.1rem;
  line-height: 1.2;
}

.card-subtitle {
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.3;
}

.grid-error {
  grid-column: 1 / -1;
  color: var(--muted);
}

/* ---- modal ---- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: var(--gutter);
  background: rgba(0, 0, 0, .85);
  overflow-y: auto;
}

.modal[hidden] { display: none; }

.modal-panel {
  position: relative;
  width: 100%;
  max-width: 1200px;
  max-height: calc(100vh - 2 * var(--gutter));
  overflow-y: auto;
  /* Top padding clears the close button rather than letting it sit
     over the image column. */
  padding: 60px 40px 32px;
  background: var(--panel);
  color: var(--panel-text);
  border: 2px solid var(--accent);
  border-radius: var(--thumb-radius);
}

/* ---- modal: head ---- */

.modal-head {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 36px;
  align-items: center;
}

/* Text takes the full width when an item has no image. */
.modal-head.is-textonly { grid-template-columns: 1fr; }

.modal-divider {
  height: 0;
  margin: 32px 0;
  border: 0;
  border-top: 1px solid var(--panel-line);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid var(--panel-line);
  border-radius: 50%;
  color: var(--panel-text);
  font: inherit;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}

.modal-close:hover {
  background: var(--panel-text);
  color: var(--panel);
}

/* Sticky so it stays reachable part-way down a long body, and lands in
   the corner when the reader gets to the end. The button closes the
   dialog -- it was a back-to-top, which did nothing visible on a card
   whose body is short enough not to scroll. */
.modal-foot {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  margin-top: 28px;
  padding: 12px 0 4px;
  background: var(--panel);
}

.modal-foot-close {
  padding: 10px 18px;
  background: none;
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  color: var(--panel-muted);
  font: inherit;
  font-size: .88rem;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.modal-foot-close:hover,
.modal-foot-close:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
}

.modal-image img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--panel-line);
  border-radius: var(--thumb-img-radius);
}

.modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.02em;
}

.modal-subtitle {
  margin: 6px 0 0;
  color: var(--panel-muted);
  font-size: 1rem;
}

/* Capped independently of the panel — at 1200px wide, full-width
   paragraphs would run past the point where the eye can find the
   next line. */
.modal-body {
  max-width: 70ch;
  font-family: var(--font-text);
  font-size: 1rem;
  line-height: 1.65;
}

.modal-body p { margin: 0 0 1em; }
.modal-body p:last-child { margin-bottom: 0; }

/* ---- responsive ---- */

@media (max-width: 1000px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 760px) {
  /* The wordmark is 8:1, so at phone widths it reads as a thin strip
     unless it runs nearly edge to edge. Uncapped here on purpose. */
  .logo img { width: 96vw; max-width: none; }

  /* Left, not centred — the hero below it is left-aligned, and a
     centred logo over a left-aligned headline reads as a mistake. */
  .site-header { justify-content: flex-start; padding-top: 18px; }
  .hero-section { padding: 24px var(--gutter) 48px; }
  .hero { padding: 36px 24px 40px; }
}

@media (max-width: 720px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .modal-panel { padding: 56px 20px 28px; }
  .modal-head { grid-template-columns: 1fr; gap: 24px; }
  .modal-divider { margin: 24px 0; }
}

@media (max-width: 420px) {
  .grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; }
}

/* ============================================================
   Back to the parent site. Snapshot CRO is a product of The Real
   Heroes of Ecommerce; without this the page is a dead end that
   links nowhere but the App Store.

   A square icon button to the left of the wordmark, not a text
   link beside Install: the text version sat in the same nav as
   the Install pill and competed with it for the eye.
   ============================================================ */
.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.back {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--control-height);
  height: var(--control-height);
  border: 2px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.back svg { display: block; width: 20px; height: 20px; }
.back:hover,
.back:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
}

.site-footer {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 48px var(--gutter) 56px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-text);
  font-size: .9rem;
}
.site-footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.site-footer a:hover, .site-footer a:focus-visible { color: var(--fg); }

@media (max-width: 720px) {
  /* The wordmark already runs near edge to edge here, so the back button
     shrinks with the other controls rather than stealing from it. */
  .header-left { gap: 10px; }
}
