/*
 * THE ONLY FILE IN THIS REPO ALLOWED TO NAME A COLOUR. tests/separation.test.tsx
 * fails on a colour anywhere else (Promptuoso's check_tokens rule). The brand
 * kit reads its colours from here too (scripts/brand.tsx).
 *
 * BuyLifetimeApps' mark is 2.2 (Ishan, 2026-09-19): two triangles with engraved
 * bevels on a navy tile, lit from the top left - amber on the lit bands,
 * orange-red on the middle ones, coral-red in shade, orange faces. The page's
 * neutrals are the ones it shares with Promptuoso, and the page still BORROWS the
 * colour of whichever product is on show for that product's card and spotlight
 * (Ishan, 2026-09-16: every product keeps its own colour). Promptuoso's three
 * values are its final brand (docs/brand/promptuoso brand/ in the Horizon
 * planning folder).
 */
:root {
  /* the palette */
  --ink: #0f0f12;
  --graphite: #26262b;
  --slate: #50505a;
  --mist: #a0a0aa;
  --paper: #f8f8fa;

  /* the mark: the navy tile, top left to bottom, and its small-size rim */
  --navy-top: #2a3860;
  --navy-bottom: #131a2b;
  --navy-rim: #5a6690;
  /* the bevels, by how they face the light; the joined middle strip; the faces */
  --bevel-lit: #ffb43a;
  --bevel-mid: #e8551a;
  --bevel-shade: #c1352b;
  --bevel-base: #d9480f;
  --face-light: #ff8a2a;
  --face-deep: #ee6000;
  /* the wordmark's "Apps": the brand orange (Ishan, 2026-09-19) */
  --wordmark-accent: var(--face-deep);

  /* Promptuoso, lent where Promptuoso is shown */
  --promptuoso-fill: #c24e00;
  --promptuoso-mark-light: #b64900;
  --promptuoso-mark-dark: #ee6000;

  /* roles: light */
  --ground: var(--paper);
  --surface: #efeff3;
  --rule: #dcdce1;
  --text: var(--ink);
  --text-soft: var(--slate);
  --tile: var(--navy-top);
  --on-tile: var(--paper);
  --promptuoso-mark: var(--promptuoso-mark-light);
}

/* roles: dark */
@media (prefers-color-scheme: dark) {
  :root {
    --ground: var(--ink);
    --surface: #17171b;
    --rule: #2a2a31;
    --text: var(--paper);
    --text-soft: var(--mist);
    --promptuoso-mark: var(--promptuoso-mark-dark);
  }
}

/* A product's colour, for whatever borrows it: a card's status on the page, and
 * (with the growth rings, if brand.mark switches back) the mark's inner ring on
 * the tile - a symbol on a dark ground, so the lifted shade (Promptuoso's README:
 * it "stays lively at symbol size"). */
.accent-promptuoso {
  --borrowed: var(--promptuoso-mark);
  --borrowed-on-tile: var(--promptuoso-mark-dark);
  --borrowed-fill: var(--promptuoso-fill);
}

/* Derived from whatever is borrowed: a faint wash for a spotlight's ground, and
 * the text on a filled button (paper on the product's fill: 4.9:1 for Promptuoso). */
:root,
[class*='accent-'] {
  --borrowed-wash: color-mix(in srgb, var(--borrowed) 9%, transparent);
  --on-borrowed: var(--paper);
}

/*
 * Layout and type. This file names no colour: every colour is a token from
 * tokens.css, which the build puts in front of it.
 */
@font-face {
  font-family: 'Bruno Ace';
  src: url('fonts/bruno-ace-latin-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --font-brand: 'Bruno Ace', 'Segoe UI Variable Display', 'Segoe UI', system-ui, sans-serif;
  --font-ui:
    'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  --font-mono: 'Cascadia Code', 'Cascadia Mono', Consolas, ui-monospace, monospace;
  --page: 68rem;
  --measure: 38rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 0.9rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

a:focus-visible {
  outline: 2px solid var(--borrowed);
  outline-offset: 3px;
  border-radius: 0.2rem;
}

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

.skip {
  position: absolute;
  top: -4rem;
  left: var(--gutter);
  z-index: 1;
  padding: 0.5rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 0.4rem;
}

.skip:focus {
  top: 0.75rem;
}

/* header */

header.site {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-block: 1.25rem;
}

.home {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.wordmark {
  font-family: var(--font-brand);
  font-size: 1.15rem;
  line-height: 1;
  white-space: nowrap;
}

.wordmark-accent {
  color: var(--wordmark-accent);
}

nav ul {
  display: flex;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

nav a {
  color: var(--text-soft);
  text-decoration: none;
}

nav a:hover {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--borrowed);
  text-underline-offset: 0.35em;
}

/* the mark: drawn by Mark.tsx, coloured here */

.mark {
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
}

/* the tile: a gradient, named in Mark.tsx after the mark's id */
.mark .tile-top {
  stop-color: var(--navy-top);
}

.mark .tile-bottom {
  stop-color: var(--navy-bottom);
}

.mark .face-light {
  stop-color: var(--face-light);
}

.mark .face-deep {
  stop-color: var(--face-deep);
}

/* 2.2's bevels, by how they face the light from the top left */
.mark .ink-lit {
  fill: var(--bevel-lit);
}

.mark .ink-mid {
  fill: var(--bevel-mid);
}

.mark .ink-shade {
  fill: var(--bevel-shade);
}

.mark .ink-base {
  fill: var(--bevel-base);
}

.mark .outline {
  fill: none;
  stroke: var(--bevel-lit);
  stroke-linejoin: miter;
  stroke-miterlimit: 10;
}

.mark .rim {
  fill: none;
}

.mark .ink-rim {
  stroke: var(--paper);
}

.mark .ink-rim-bold {
  stroke: var(--navy-rim);
}

.mark .line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mark .ink-paper.line {
  stroke: var(--on-tile);
}

.mark .ink-paper.solid {
  fill: var(--on-tile);
}

.mark .ink-borrowed.line {
  stroke: var(--borrowed-on-tile);
}

.mark .ink-borrowed.solid {
  fill: var(--borrowed-on-tile);
}

/* sections */

section {
  padding-block: clamp(2.5rem, 6vw, 4rem);
}

.hero {
  padding-block: clamp(4rem, 13vw, 8.5rem) clamp(2.5rem, 7vw, 4.5rem);
}

.hero h1 {
  max-width: 17ch;
  margin: 0 0 1.25rem;
  font: 400 clamp(2rem, 5.4vw, 3.5rem) / 1.12 var(--font-brand);
  text-wrap: balance;
}

.hero p {
  max-width: var(--measure);
  margin: 0 0 1rem;
  color: var(--text-soft);
  font-size: clamp(1.1rem, 2vw, 1.3rem);
}

.label {
  margin: 0 0 1.5rem;
  color: var(--text-soft);
  font: 600 0.8rem/1 var(--font-ui);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* the shelf: the products stand on a rule in the tile's navy */

.shelf {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 32rem), 1fr));
  gap: 1.25rem;
  margin: 0;
  padding: 0 0 1.25rem;
  list-style: none;
  border-bottom: 0.5rem solid var(--tile);
}

.product {
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: 1.25rem;
  align-items: start;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.product img {
  width: 4rem;
  height: 4rem;
}

.product h3 {
  margin: 0.1rem 0 0.6rem;
  font: 400 1.4rem/1.2 var(--font-brand);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.chip {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--rule);
  border-radius: 0.4rem;
  color: var(--text-soft);
  font: 500 0.78rem/1 var(--font-mono);
}

.chip.status {
  border-color: var(--borrowed);
  color: var(--text);
}

.product p {
  max-width: var(--measure);
  margin: 0 0 0.75rem;
}

.product .detail {
  margin: 0;
  color: var(--text-soft);
}

.about p,
.contact p {
  max-width: var(--measure);
  margin: 0 0 0.75rem;
}

.textlink {
  font-size: clamp(1.15rem, 2.6vw, 1.5rem);
  text-decoration: underline;
  text-decoration-color: var(--borrowed);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
  overflow-wrap: anywhere;
}

.textlink:hover {
  text-decoration-thickness: 3px;
}

/* footer */

footer.site {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 2rem;
  margin-top: clamp(2rem, 6vw, 4rem);
  padding-block: 2rem 3rem;
  border-top: 1px solid var(--rule);
  color: var(--text-soft);
  font-size: 0.9rem;
}

footer.site p {
  margin: 0;
}

@media (max-width: 34rem) {
  .product {
    grid-template-columns: 1fr;
  }
}

/* ---- storefront (P8-21) ---- */

.kicker,
.hero .kicker {
  margin: 0 0 0.9rem;
  color: var(--borrowed);
  font: 600 0.8rem/1.2 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: center;
  gap: 2rem;
}

.hero .hero-body {
  max-width: var(--measure);
  margin: 0 0 2rem;
  color: var(--text-soft);
  font-size: clamp(1.1rem, 2vw, 1.3rem);
}

.hero-art {
  display: grid;
  place-items: center;
}

.mark-hero {
  width: min(100%, 20rem);
  height: auto;
  aspect-ratio: 1;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.6rem 1.15rem;
  border: 1px solid var(--rule);
  border-radius: 0.6rem;
  background: var(--ground);
  font-weight: 600;
  text-decoration: none;
  transition:
    border-color 0.15s,
    transform 0.15s;
}

.button:hover {
  border-color: var(--borrowed);
}

.button.primary {
  border-color: var(--borrowed-fill);
  background: var(--borrowed-fill);
  color: var(--on-borrowed);
}

/* how it works */

.promises {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: promise;
}

.promises li {
  padding-top: 1.25rem;
  border-top: 2px solid var(--tile);
  counter-increment: promise;
}

.promises li::before {
  content: '0' counter(promise);
  display: block;
  margin-bottom: 0.5rem;
  color: var(--borrowed);
  font: 400 1.6rem/1 var(--font-brand);
}

.promises h3,
.features h3 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

.promises p,
.features p {
  margin: 0;
  color: var(--text-soft);
}

/* the card's buy line */

.buyline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.product .buyline .price,
.buyline .price {
  margin: 0;
  font: 600 0.95rem/1.2 var(--font-mono);
}

/* the spotlight */

.spotlight {
  margin-block: clamp(2rem, 5vw, 3rem);
  padding: clamp(1.5rem, 5vw, 3.5rem);
  border: 1px solid var(--rule);
  border-radius: calc(var(--radius) * 1.5);
  background: linear-gradient(160deg, var(--borrowed-wash), transparent 60%), var(--surface);
}

.spotlight-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.spotlight-head img {
  width: clamp(4rem, 12vw, 6rem);
  height: auto;
}

.spotlight-head .kicker {
  margin-bottom: 0.4rem;
}

.spotlight h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font: 400 clamp(1.8rem, 5vw, 3rem) / 1.1 var(--font-brand);
}

.lede {
  max-width: 44rem;
  margin: 0 0 2.5rem;
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 2rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.marker {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
  margin-bottom: 0.9rem;
  border: 3px solid var(--borrowed);
  border-radius: 0.45rem;
}

/* questions */

.faq-list {
  max-width: 46rem;
  border-top: 1px solid var(--rule);
}

.faq details {
  border-bottom: 1px solid var(--rule);
}

.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '+';
  flex: none;
  color: var(--borrowed);
  font: 400 1.4rem/1 var(--font-mono);
}

.faq details[open] summary::after {
  content: '\2212';
}

.faq summary:focus-visible {
  outline: 2px solid var(--borrowed);
  outline-offset: 3px;
}

.faq details p {
  max-width: var(--measure);
  margin: 0 0 1.25rem;
  color: var(--text-soft);
}

/* motion: the hero mark settles in once. Items rise as they scroll into view
 * where the browser can tie an animation to scrolling. None of it runs for
 * anyone who asks for reduced motion. */

@media (prefers-reduced-motion: no-preference) {
  .mark-hero {
    animation: mark-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .button:hover {
    transform: translateY(-1px);
  }

  @supports (animation-timeline: view()) {
    .reveal {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 60%;
    }
  }
}

@keyframes mark-in {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(1.5rem);
  }
}

@media (max-width: 48rem) {
  .hero-split {
    grid-template-columns: 1fr;
  }

  /* the header already shows the mark at phone width */
  .hero-art {
    display: none;
  }
}
