/*
 * FUNKY PAPER - the app's design language, ported to the web.
 *
 * Tokens are copied from Swipe-Gallary/src/theme.ts so the site and the app
 * stay one thing: white paper, fat black keylines, hard offset shadows, loud
 * flat colour. No gradients, no glass, no soft shadows.
 */

@import url("https://fonts.googleapis.com/css2?family=Anton&family=Archivo+Black&family=Space+Grotesk:wght@500;700&display=swap");

:root {
  /* Ink */
  --ink: #111111;
  --ink-soft: #5b5b5b;
  --ink-faint: #9a9a9a;

  /* Paper */
  --paper: #ffffff;
  --paper-warm: #fbf6ec;
  --paper-grey: #f0eee9;

  /* The loud six, plus two supports */
  --violet: #6b47ff;
  --lime: #d7ff3e;
  --coral: #ff5a3c;
  --yellow: #ffd52e;
  --aqua: #2fe6c3;
  --pink: #ff7bd5;
  --sky: #4da3ff;
  --grape: #2b0b4a;

  /* Keylines */
  --line-hair: 1.5px;
  --line-base: 2.5px;
  --line-fat: 3.5px;

  /* Radii */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-pill: 999px;

  /* Hard offset shadows - short, or they read as misprints rather than depth */
  --drop-sm: 3px;
  --drop-md: 5px;
  --drop-lg: 6px;

  --display: "Archivo Black", system-ui, sans-serif;
  --poster: "Anton", system-ui, sans-serif;
  --body: "Space Grotesk", system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
}

h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); }
h2 { font-size: clamp(2rem, 4.6vw, 3rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1.1em; }
a { color: inherit; }

:focus-visible {
  outline: var(--line-base) solid var(--violet);
  outline-offset: 3px;
}

/* ---------------------------------------------------------------- layout */

.wrap {
  width: min(1120px, 100% - 2.5rem);
  margin-inline: auto;
}

.narrow {
  width: min(760px, 100% - 2.5rem);
  margin-inline: auto;
}

section {
  padding: clamp(3.5rem, 8vw, 6.5rem) 0;
}

/* ------------------------------------------------------------- chunk/card */

/*
 * The app's Chunk component: a filled box with a fat keyline and a hard
 * offset shadow. The margin on the shadow side stops the drop being clipped.
 */
.chunk {
  background: var(--paper);
  border: var(--line-base) solid var(--ink);
  border-radius: var(--r-lg);
  box-shadow: var(--drop-md) var(--drop-md) 0 var(--ink);
  margin-right: var(--drop-md);
  margin-bottom: var(--drop-md);
}

/*
 * Fills that take ink type vs paper type. This mirrors inkOn() in theme.ts
 * and is an accessibility contract, not taste: pink, sky and coral all sit
 * near 3:1 on white, so white type on them would be illegible.
 */
.fill-lime   { background: var(--lime);   color: var(--ink); }
.fill-yellow { background: var(--yellow); color: var(--ink); }
.fill-aqua   { background: var(--aqua);   color: var(--ink); }
.fill-pink   { background: var(--pink);   color: var(--ink); }
.fill-sky    { background: var(--sky);    color: var(--ink); }
.fill-coral  { background: var(--coral);  color: var(--ink); }
.fill-warm   { background: var(--paper-warm); color: var(--ink); }
.fill-violet { background: var(--violet); color: var(--paper); }
.fill-grape  { background: var(--grape);  color: var(--paper); }

/* ---------------------------------------------------------------- marker */

/* The signature headline device: a marker-pen block behind a word. */
.hit {
  display: inline-block;
  background: var(--yellow);
  border: var(--line-base) solid var(--ink);
  border-radius: var(--r-sm);
  padding: 0.02em 0.28em 0.1em;
  transform: rotate(-1.5deg);
}

.hit-lime  { background: var(--lime); }
.hit-aqua  { background: var(--aqua); }
.hit-pink  { background: var(--pink); }
.hit-coral { background: var(--coral); }

/* ----------------------------------------------------------------- label */

.label {
  font-family: var(--body);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.sticker {
  display: inline-block;
  font-family: var(--body);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--lime);
  color: var(--ink);
  border: var(--line-base) solid var(--ink);
  border-radius: var(--r-pill);
  padding: 0.35rem 0.9rem;
  transform: rotate(-3deg);
}

/* ---------------------------------------------------------------- button */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--display);
  font-size: 1rem;
  text-decoration: none;
  background: var(--violet);
  color: var(--paper);
  border: var(--line-base) solid var(--ink);
  border-radius: var(--r-md);
  padding: 0.95rem 1.5rem;
  box-shadow: var(--drop-md) var(--drop-md) 0 var(--ink);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.btn:active {
  transform: translate(var(--drop-md), var(--drop-md));
  box-shadow: 0 0 0 var(--ink);
}

.btn-paper { background: var(--paper); color: var(--ink); }
.btn-lime  { background: var(--lime);  color: var(--ink); }

/* ------------------------------------------------------------------- nav */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  border-bottom: var(--line-base) solid var(--ink);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--display);
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: var(--r-sm);
  border: var(--line-base) solid var(--ink);
  background: var(--paper);
  padding: 2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  font-weight: 700;
  font-size: 0.95rem;
}

.nav-links a {
  text-decoration: none;
  border-bottom: var(--line-base) solid transparent;
}

.nav-links a:hover {
  border-bottom-color: var(--ink);
}

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

.hero {
  padding-top: clamp(2.5rem, 6vw, 4.5rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero p.lead {
  font-size: 1.15rem;
  max-width: 46ch;
  color: var(--ink-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

/* Real app screenshot in hero */
.hero-phone-img {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-phone-img img {
  width: min(320px, 100%);
  height: auto;
  border-radius: var(--r-lg);
  border: var(--line-fat) solid var(--ink);
  box-shadow: var(--drop-lg) var(--drop-lg) 0 var(--ink);
  display: block;
}

/* --------------------------------------------------------------- feature */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.6rem;
}

.card {
  padding: 1.6rem;
}

.card .icon {
  display: block;
  margin-bottom: 0.9rem;
  width: 40px;
  height: 40px;
  line-height: 1;
}

.card .icon svg {
  display: block;
  width: 40px;
  height: 40px;
}

.card h3 {
  margin-bottom: 0.4rem;
}

.card p {
  margin: 0;
  font-size: 0.97rem;
  line-height: 1.6;
}

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

.band {
  padding: clamp(2.2rem, 5vw, 3.4rem);
  text-align: center;
}

.band h2 {
  margin-bottom: 0.9rem;
}

.band p {
  max-width: 58ch;
  margin-inline: auto;
  margin-bottom: 0;
}

/* ----------------------------------------------------------------- steps */

.steps {
  counter-reset: step;
  display: grid;
  gap: 1.4rem;
}

.step {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
  padding: 1.4rem 1.5rem;
}

.step::before {
  counter-increment: step;
  content: counter(step);
  flex: none;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  font-family: var(--poster);
  font-size: 1.5rem;
  background: var(--paper);
  border: var(--line-base) solid var(--ink);
  border-radius: var(--r-pill);
}

.step h3 { margin-bottom: 0.25rem; }
.step p { margin: 0; font-size: 0.97rem; }

/* ---------------------------------------------------------------- footer */

.footer {
  border-top: var(--line-base) solid var(--ink);
  background: var(--paper-warm);
  padding: 2.5rem 0 3rem;
  font-size: 0.94rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.footer-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: var(--r-sm);
  border: var(--line-base) solid var(--ink);
  background: var(--paper);
  padding: 2px;
  flex-shrink: 0;
}

/* --------------------------------------------------------- screenshots */

.screenshots-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.6rem;
}

.screenshot-frame {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

.screenshot-frame img {
  width: 100%;
  height: auto;
  display: block;
  border-bottom: var(--line-base) solid var(--ink);
  transition: transform 0.3s ease;
}

.screenshot-frame:hover img {
  transform: scale(1.03);
}

.screenshot-cap {
  font-family: var(--display);
  font-size: 0.95rem;
  padding: 0.7rem 1rem;
  background: var(--paper);
  color: var(--ink);
}


.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  justify-content: space-between;
  align-items: center;
}

.footer a {
  font-weight: 700;
  text-decoration: none;
  border-bottom: var(--line-hair) solid var(--ink);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.3rem;
}

.muted {
  color: var(--ink-soft);
}

/* ------------------------------------------------------------ legal page */

.legal {
  padding-top: clamp(2.5rem, 6vw, 4rem);
}

.legal h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.4rem);
}

.legal h2 {
  font-size: 1.45rem;
  margin: 2.6rem 0 0.8rem;
  scroll-margin-top: 5rem;
}

.legal h3 {
  font-size: 1.1rem;
  margin: 1.8rem 0 0.5rem;
}

.legal ul {
  margin: 0 0 1.1em;
  padding-left: 1.3rem;
}

.legal li {
  margin-bottom: 0.45em;
}

.legal .updated {
  font-weight: 700;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* A pulled-out statement of the thing that matters most on the page. */
.callout {
  padding: 1.3rem 1.5rem;
  margin: 1.8rem 0;
}

.callout p:last-child { margin-bottom: 0; }

.toc {
  padding: 1.3rem 1.5rem;
  margin-bottom: 2rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.2rem;
  columns: 2;
  column-gap: 2rem;
}

.toc li { margin-bottom: 0.3em; }

.toc a {
  text-decoration: none;
  border-bottom: var(--line-hair) solid var(--ink-faint);
}

.toc a:hover { border-bottom-color: var(--ink); }

/* ---------------------------------------------------------------- mobile */

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-phone-img { order: -1; }
  .toc ol { columns: 1; }
  .nav-links { gap: 1rem; font-size: 0.88rem; }
  .screenshots-row { grid-template-columns: repeat(2, 1fr); }
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .screenshot-frame img { transition: none; }
}
