/*
 * Persa holding site, direction B "Cartón": kraft cardboard and marker ink,
 * after the hand-lettered signs at La Persa. Tokens mirror the app's; the
 * system and its rationale live in docs/design-tokens.md.
 */

@font-face {
  font-family: "Shantell Sans";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("/fonts/shantell-sans-latin-wght-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/fonts/figtree-latin-wght-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Figtree";
  font-style: italic;
  font-weight: 300 900;
  font-display: swap;
  src: url("/fonts/figtree-latin-wght-italic.woff2") format("woff2");
}

:root {
  color-scheme: light;

  --background: #e8dcc2; /* kraft */
  --card: #f3ead6; /* card stock */
  --raised: #dccba6; /* dark kraft */
  --foreground: #1e1a16; /* marker ink, 12.7:1 on kraft */
  --muted-foreground: #5a4f43; /* 5.9:1 on kraft */
  --primary: #b8322a; /* marker red: fills and large prices */
  --primary-ink: #9e2a23; /* red text at body size, 5.5:1 on kraft */
  --primary-foreground: #fff6e8;
  --tape: #f2c230;
  --success: #23692f;
  --rule: #8c7b5e; /* 3:1 on kraft */
  --ink-shadow: 4px 4px 0 var(--foreground);

  --font-display: "Shantell Sans", ui-rounded, system-ui, sans-serif;
  --font-sans: "Figtree", ui-sans-serif, system-ui, sans-serif;

  --radius-sm: 4px;
  --radius-md: 6px;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-spring: cubic-bezier(0.3, 1.5, 0.5, 1);
}

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

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

body {
  position: relative;
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  /* Tilted signs and their shadows must never cause sideways scrolling. */
  overflow-x: clip;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Paper fibres, under everything. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("/fibres.svg");
  opacity: 0.55;
  pointer-events: none;
}

::selection {
  background: var(--tape);
  color: var(--foreground);
}

.wrap {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 40rem) {
  .wrap {
    padding: 0 2rem;
  }
}

/* ---------- Header ---------- */

header {
  padding-block: 1rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 2.75rem;
  color: inherit;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  text-decoration: none;
}

.wordmark img {
  width: 2rem;
  height: 2rem;
  rotate: -6deg;
}

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

main {
  flex: 1;
  display: flex;
  align-items: center;
  padding-block: 2rem 4rem;
}

.hero {
  display: grid;
  gap: 3rem;
  align-items: center;
  margin-bottom: 4.5rem;
}

@media (min-width: 60rem) {
  .hero {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 4rem;
  }
}

/* "Launching soon" is a strip of tape stuck on the sign. */
.eyebrow {
  display: inline-block;
  margin: 0 0 1.75rem;
  padding: 0.375rem 1.25rem;
  background: var(--tape);
  color: var(--foreground);
  font-size: 1rem;
  font-weight: 700;
  rotate: -2deg;
  clip-path: polygon(0 8%, 3% 0, 97% 4%, 100% 0, 99% 50%, 100% 96%, 96% 100%, 4% 94%, 0 100%, 1% 50%);
}

h1 {
  margin: 0 0 1.5rem;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 1.1rem + 6vw, 4.75rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.015em;
  text-wrap: pretty;
}

.lede {
  max-width: 34rem;
  margin: 0;
  color: var(--muted-foreground);
  font-size: clamp(1.125rem, 1.05rem + 0.3vw, 1.25rem);
  text-wrap: pretty;
}

/* ---------- Hero art: the storefront on a phone ---------- */

.hero-art {
  position: relative;
  display: grid;
  justify-items: center;
  margin: 0;
  padding: 0.5rem 0 1.5rem;
}

.phone {
  position: relative;
  width: min(19.5rem, 88vw);
  padding: 0.625rem;
  border-radius: 2.75rem;
  background: var(--foreground);
  box-shadow: 10px 12px 0 rgb(30 26 22 / 18%);
  rotate: 2deg;
}

.screen {
  overflow: hidden;
  padding: 1.25rem 0.875rem 1rem;
  border-radius: 2.125rem;
  background: var(--background) url("/fibres.svg");
}

.hero-art p {
  margin: 0;
}

.screen .url {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.125rem 0.625rem;
  border: 1.5px solid var(--foreground);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted-foreground);
  font-size: 0.75rem;
}

.screen .store-name {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1.1;
}

.screen .store-meta {
  margin-top: 0.25rem;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
}

.items {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.item {
  border: 1.5px solid var(--foreground);
  border-radius: var(--radius-md);
  background: var(--card);
}

.item > p {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.25rem;
  padding: 0.375rem 0.5rem 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.2;
}

.item b {
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 800;
  rotate: -4deg;
}

.art {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  border-bottom: 1.5px solid var(--foreground);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--raised);
  color: var(--foreground);
}

/* A strip of tape holding each photo up. */
.art::before {
  content: "";
  position: absolute;
  top: -0.5rem;
  left: 50%;
  width: 2.75rem;
  height: 0.875rem;
  margin-left: -1.375rem;
  background: var(--tape);
  opacity: 0.92;
  rotate: -5deg;
}

.item:nth-child(even) .art::before {
  rotate: 4deg;
}

.art svg {
  width: 64%;
  height: 64%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.art .wash {
  fill: var(--tape);
}

.art-record .wash {
  fill: var(--primary);
}

.art .light {
  fill: var(--tape);
  fill-opacity: 0.35;
  stroke: none;
}

.badge {
  position: absolute;
  right: 0.25rem;
  bottom: 0.375rem;
  padding: 0 0.375rem;
  border: 2px solid var(--success);
  border-radius: var(--radius-sm);
  background: rgb(243 234 214 / 85%);
  color: var(--success);
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 800;
  rotate: -8deg;
}

/* The text that makes it all worthwhile. */
.sms {
  position: absolute;
  top: 1.75rem;
  left: 1.125rem;
  right: 1.125rem;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.75rem 1fr;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  border-radius: 1.125rem;
  background: rgb(38 36 34 / 94%);
  color: #f4f1ea;
  font-size: 0.8125rem;
  line-height: 1.35;
  box-shadow: 0 12px 28px -10px rgb(30 26 22 / 60%);
}

.sms img {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.4rem;
}

.sms .sms-head {
  display: flex;
  justify-content: space-between;
  color: #c9c3b8;
  font-size: 0.75rem;
}

.sms-head b {
  color: #f4f1ea;
}

/* ---------- Steps: three signs taped to the wall ---------- */

.steps {
  display: grid;
  gap: 1.75rem;
  margin: 0 0 3.5rem;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

@media (min-width: 48rem) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

.steps li {
  position: relative;
  display: grid;
  grid-template-columns: 3.25rem 1fr;
  column-gap: 1rem;
  align-content: start;
  padding: 1.5rem 1.25rem 1.25rem;
  border: 1.5px solid var(--foreground);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--ink-shadow);
  counter-increment: step;
  rotate: -0.8deg;
}

.steps li:nth-child(2) {
  rotate: 0.9deg;
}

.steps li:nth-child(3) {
  rotate: -0.4deg;
}

/* Tape at the top of each sign. */
.steps li::after {
  content: "";
  position: absolute;
  top: -0.625rem;
  left: 50%;
  width: 4.5rem;
  height: 1.125rem;
  margin-left: -2.25rem;
  background: var(--tape);
  opacity: 0.92;
  rotate: 3deg;
}

/* The step number, circled in marker. The steps are a real sequence. */
.steps li::before {
  content: counter(step);
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border: 2.5px solid var(--primary);
  border-radius: 48% 52% 44% 56% / 56% 44% 52% 48%;
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  rotate: -6deg;
}

.steps strong {
  display: block;
  margin-bottom: 0.25rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.25;
}

.steps span {
  color: var(--muted-foreground);
  font-size: 1.0625rem;
  line-height: 1.5;
}

.contact {
  margin: 0;
  font-size: 1.1875rem;
}

/* ---------- Links and focus ---------- */

a {
  color: var(--primary-ink);
  font-weight: 600;
  text-decoration-line: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: color-mix(in srgb, var(--primary) 45%, transparent);
  text-underline-offset: 0.2em;
  transition: text-decoration-color 150ms var(--ease-standard);
}

a:hover {
  text-decoration-color: var(--primary);
}

a:focus-visible {
  outline: 3px solid var(--foreground);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

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

footer {
  padding-block: 1.5rem calc(1.5rem + env(safe-area-inset-bottom));
  border-top: 2px dashed var(--rule);
  color: var(--muted-foreground);
  font-size: 0.9375rem;
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}

footer .wrap a {
  display: inline-block;
  padding-block: 0.75rem;
  margin-block: -0.75rem;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  /* One entrance: the sign goes up, then the storefront, then the steps. */
  .home .eyebrow {
    animation: slap 450ms var(--ease-standard) 100ms both;
  }

  .home h1 {
    animation: rise 700ms var(--ease-standard) 150ms both;
  }

  .home .lede {
    animation: rise 700ms var(--ease-standard) 260ms both;
  }

  .home .phone {
    animation: phone-in 900ms var(--ease-spring) 300ms both;
  }

  .home .item {
    animation: rise 550ms var(--ease-standard) both;
  }

  .home .item:nth-child(1) {
    animation-delay: 650ms;
  }

  .home .item:nth-child(2) {
    animation-delay: 730ms;
  }

  .home .item:nth-child(3) {
    animation-delay: 810ms;
  }

  .home .item:nth-child(4) {
    animation-delay: 890ms;
  }

  .home .art::before {
    animation: slap 380ms var(--ease-standard) 1000ms both;
  }

  .home .steps li {
    animation: sign-up 650ms var(--ease-spring) both;
  }

  .home .steps li:nth-child(1) {
    animation-delay: 500ms;
  }

  .home .steps li:nth-child(2) {
    animation-delay: 600ms;
  }

  .home .steps li:nth-child(3) {
    animation-delay: 700ms;
  }

  /* After the entrance, the offer-accepted moment repeats. */
  .home .sms {
    animation: notify 9s var(--ease-standard) 1.6s infinite both;
  }

  .home .badge {
    animation: stamp 9s var(--ease-standard) 1.6s infinite both;
  }
}

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

@keyframes slap {
  from {
    opacity: 0;
    transform: scale(1.5);
  }
}

@keyframes phone-in {
  from {
    opacity: 0;
    transform: translateY(2.5rem) rotate(6deg);
  }
}

@keyframes sign-up {
  from {
    opacity: 0;
    transform: translateY(1.25rem) rotate(-4deg);
  }
}

@keyframes notify {
  0% {
    opacity: 0;
    transform: translateY(-140%);
  }
  7% {
    opacity: 1;
    transform: translateY(6%);
  }
  10%,
  78% {
    opacity: 1;
    transform: translateY(0);
  }
  88%,
  100% {
    opacity: 0;
    transform: translateY(-140%);
  }
}

@keyframes stamp {
  0%,
  9% {
    opacity: 0;
    transform: scale(2.4);
  }
  13%,
  82% {
    opacity: 1;
    transform: scale(1);
  }
  90%,
  100% {
    opacity: 0;
    transform: scale(1);
  }
}

/* ---------- Long-form pages such as the privacy policy ---------- */

main.page {
  display: block;
  padding-block: 1.5rem 5rem;
}

.prose {
  max-width: 46rem;
  margin-inline: max(0px, calc((100% - 72rem) / 2)) auto;
}

.prose h1 {
  margin-bottom: 0.75rem;
  font-size: clamp(2.5rem, 1.9rem + 3vw, 3.75rem);
}

.prose .meta {
  display: inline-block;
  margin: 0 0 2.5rem;
  padding: 0.125rem 0.875rem;
  background: var(--tape);
  font-size: 0.9375rem;
  font-weight: 600;
  rotate: -1.5deg;
}

.prose h2 {
  margin: 3.5rem 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.625rem, 1.4rem + 0.8vw, 2rem);
  font-weight: 800;
  line-height: 1.2;
  scroll-margin-top: 1.5rem;
}

.prose h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.1875rem;
  font-weight: 700;
}

.prose p,
.prose ul {
  margin: 0 0 1rem;
}

.prose strong {
  font-weight: 700;
}

.prose ul {
  padding-left: 1.25rem;
}

.prose li::marker {
  color: var(--primary);
}

.prose li + li {
  margin-top: 0.4rem;
}

.prose .toc {
  margin: 2rem 0 0.5rem;
  padding: 0.75rem 1.25rem;
  border: 1.5px solid var(--foreground);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--ink-shadow);
}

.prose .toc ul {
  display: grid;
  gap: 0 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 32rem) {
  .prose .toc ul {
    grid-template-columns: 1fr 1fr;
  }
}

.prose .toc li + li {
  margin-top: 0;
}

/* Full-height rows keep each entry a 44px touch target. */
.prose .toc a {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  text-decoration: none;
}

.prose .toc a:hover {
  text-decoration: underline;
}

/* ---------- Not-found page: a lone sign ---------- */

main.lost .wrap {
  max-width: 34rem;
}

main.lost .sign {
  position: relative;
  padding: 2.5rem 1.75rem 2rem;
  border: 1.5px solid var(--foreground);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--ink-shadow);
  rotate: -1.5deg;
}

main.lost .sign::after {
  content: "";
  position: absolute;
  top: -0.75rem;
  left: 50%;
  width: 5.5rem;
  height: 1.25rem;
  margin-left: -2.75rem;
  background: var(--tape);
  opacity: 0.92;
  rotate: -3deg;
}

main.lost h1 {
  margin-bottom: 1rem;
}

main.lost .lede {
  color: var(--foreground);
}
