/* Fightnome — one stylesheet, four pages, no framework and no JavaScript.

   Colours and type are the app's own tokens rather than approximations:
   FNBlack #000000, FNAccent #FF3B30,
   FNAccentPress #E12C22, FNWhite, FNGray1 #A3A3A3, FNGray2 #666666,
   FNBorder #262626 — and SF Pro through -apple-system, the same face the app
   draws with. The monospace is not decoration either: the app sets every
   timer and count in monospaced digits, so labels and numerals here speak in
   the same voice. */

:root {
  --bg: #000000; /* FNBlack — the app's own FN.bg */
  --surface: #101010;
  --border: #262626;
  --ink: #ffffff;
  --ink-2: #a3a3a3;
  --ink-3: #666666;
  --accent: #ff3b30;

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  --measure: 32rem;
  --gutter: 1.5rem;
  --footer-height: 6rem;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  /* Flat black, `FN.bg` itself. A dark gradient here spans only about three
     8-bit levels, and every way of hiding the steps that follow — an ordered
     dither in the image, a grain tile over it — was beaten by the browser
     resampling one or the other. Black cannot band, and the accent has more
     to push against. */
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a:hover,
a:focus-visible {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.wrap {
  max-width: 70rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* --- Type ------------------------------------------------------------ */

.eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.25rem;
}

h1,
h2 {
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.03;
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.75rem, 8.5vw, 5rem);
}

h2 {
  font-size: clamp(2rem, 5vw, 3rem);
}

/* The second line drops to the accent — the same device the store frames use,
   so the page and the listing read as one product rather than two. */
h1 .accent,
h2 .accent {
  color: var(--accent);
  display: block;
}

.lede {
  color: var(--ink-2);
  font-size: clamp(1.0625rem, 2.2vw, 1.25rem);
  max-width: var(--measure);
  margin: 1.5rem 0 0;
}

/* --- Device ---------------------------------------------------------- */

/* The image is the device: a real iPhone model with a real capture on its
   display, path-traced by tools/device-render in the app repo. So there is
   nothing here to draw a frame around and nothing to rotate — a CSS
   `rotateY` would turn the pixels a second time without touching the light,
   which is the tell the render exists to avoid. */
.device {
  max-width: 22rem;
}

/* --- Hero ------------------------------------------------------------ */

/* One screenful, footer included. The device used to run off the bottom
   edge on purpose, back when three more sections followed it — with nothing
   below but the footer, the same clip reads as an image that failed to load
   rather than a frame that continues. */
.hero {
  min-height: calc(100svh - var(--footer-height));
  display: flex;
  align-items: center;
  padding: var(--gutter) 0;
}

.hero .lede {
  margin-inline: 0;
}

.hero-device {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  margin-top: clamp(2rem, 6vh, 3rem);
}

.device {
  position: relative;
}

/* Bounded by the viewport's height, not by a width — the phone is the
   tallest thing on the page, so height is what decides whether it fits. */
.device img {
  max-height: 70svh;
  width: auto;
  display: block;
  opacity: 0;
  transition: opacity 0.7s ease;
}

/* The first image keeps its place in the flow and so decides how big the
   frame is; the rest are stacked on it. They differ by under one percent in
   size, which is what makes a plain crossfade work — matching them by height
   and centring is enough. */
.device img:not(:first-child) {
  position: absolute;
  top: 0;
  left: 50%;
  height: 100%;
  transform: translateX(-50%);
}

.device img.is-current {
  opacity: 1;
}

.dots {
  display: flex;
  gap: 0.75rem;
}

.dots button {
  width: 0.5rem;
  height: 0.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ink-3);
  opacity: 0.45;
  cursor: pointer;
  transition:
    opacity 0.3s ease,
    background-color 0.3s ease;
}

.dots button:hover {
  opacity: 0.8;
}

.dots button[aria-current="true"] {
  background: var(--accent);
  opacity: 1;
}

/* A dot is half a centimetre wide; the focus ring needs room of its own. */
.dots button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* Asked not to animate, the page shows one phone and stops moving. The dots
   still work — they just cut instead of fading. */
@media (prefers-reduced-motion: reduce) {
  .device img {
    transition: none;
  }
}

@media (min-width: 60rem) {
  .hero .wrap {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: clamp(2rem, 6vw, 5rem);
    width: 100%;
  }

  .hero-device {
    margin-top: 0;
  }
}

/* --- Call to action --------------------------------------------------- */

.cta {
  margin: 2.5rem 0 0;
}

/* Apple's guidelines set a floor of 40px tall and clear space of at least a
   tenth of the badge's height on every side. 48px carries the weight of the
   headline above it without crowding anything. Nothing here touches the
   badge's own colour or shape — only its size and the space around it. */
.badge {
  display: inline-block;
  padding: 0.5rem;
  margin: -0.5rem;
  transition: opacity 0.2s ease;
}

.badge img {
  display: block;
  height: 48px;
  width: auto;
}

.badge:hover {
  opacity: 0.82;
}

.badge:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 0.5rem;
}

/* --- Footer ---------------------------------------------------------- */

footer {
  min-height: var(--footer-height);
  display: flex;
  align-items: center;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  padding-top: 2rem;
  padding-bottom: 3rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
}

footer a {
  color: var(--ink-2);
}

/* --- Documents ------------------------------------------------------- */

.doc {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 3.5rem var(--gutter) 4rem;
}

.doc-head {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.5rem;
  margin-bottom: 2.5rem;
}

.back {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.doc h1 {
  font-size: clamp(2rem, 6vw, 2.75rem);
  margin: 1.25rem 0 0.5rem;
}

.date {
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 0.8125rem;
  margin: 0;
}

.doc section {
  margin-bottom: 2.5rem;
}

.doc h2 {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.doc p {
  color: var(--ink-2);
  margin: 0 0 1rem;
}

/* The generated legal pages put their links straight inside <footer> rather
   than in a .footer-inner wrapper, so the spacing lives here. */
.doc footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
}

.doc footer a {
  margin-right: 1.5rem;
  color: var(--ink-2);
}
