/* Fractazm — one stylesheet for every page. No imports, no web fonts. */

:root {
  color-scheme: dark;

  --bg: #070a0c;
  --surface: #0f1417;
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #f3efe8;
  --muted: #abb1b4;
  --accent: #f6a99b;
  --teal: #8ee6d8;
  --glow: #0c3b3b;

  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(1.25rem, 5vw, 3rem);
  --page: 76rem;
  --wide: 92rem;
  --prose: 41rem;
  --section: clamp(5rem, 11vw, 9.5rem);
  --radius: 0.875rem;
}

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

html {
  /* A little larger on big screens, so the page does not look lost on them. */
  font-size: clamp(100%, 0.55rem + 0.5vw, 125%);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 2rem;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  flex: 1 0 auto;
}

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

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

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

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

::selection {
  background: var(--accent);
  color: #1a0f0c;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--page));
  margin-inline: auto;
}

.wrap--wide {
  width: min(100% - 2 * var(--gutter), var(--wide));
}

.nb {
  white-space: nowrap;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
}

.skip:focus {
  top: 0.75rem;
  color: var(--bg);
}

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

.site-header {
  position: relative;
  z-index: 2;
  padding-block: clamp(1.1rem, 2.5vw, 1.75rem);
}

.site-header .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  text-decoration: none;
}

.site-nav ul {
  display: flex;
  gap: clamp(1rem, 3vw, 2.25rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-block;
  padding-block: 0.35rem;
  color: var(--muted);
  font-size: 0.9375rem;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
}

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

.hero {
  position: relative;
  padding-bottom: clamp(3rem, 8vw, 6rem);
  /* The picture's faded rim is wider than the page; cut it at the sides only. */
  overflow: hidden;
  overflow: clip visible;
}

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
}

.hero__figure {
  width: min(118vw, 36rem);
  max-width: none;
  margin: -3rem 0 0;
  justify-self: center;
}

.hero__ball {
  -webkit-mask-image: radial-gradient(circle closest-side, #000 72%, transparent 100%);
  mask-image: radial-gradient(circle closest-side, #000 72%, transparent 100%);
}

.hero__ball img {
  width: 100%;
}

.hero__figure figcaption {
  position: relative;
  margin-top: -12.5%;
  text-align: center;
}

.placard {
  color: var(--muted);
  font-size: 0.875rem;
  letter-spacing: 0.01em;
}

.placard b {
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.0625rem;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
}

.hero__text {
  width: 100%;
  max-width: 34rem;
  margin-top: 1.75rem;
  text-align: center;
}

.hero__kicker {
  margin-bottom: 1.1rem;
  color: var(--accent);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.hero h1 {
  font-size: clamp(2.9rem, 1.55rem + 6.2vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.hero h1 em,
.display em {
  color: var(--accent);
  font-style: italic;
  font-weight: 500;
}

.slogan {
  margin-top: 1.15rem;
  font-family: var(--serif);
  font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.375rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.slogan em,
.statement .display em {
  color: var(--teal);
  font-style: italic;
  font-weight: 500;
}

.hero__lead {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  line-height: 1.55;
}

.hero__lead strong {
  color: var(--text);
  font-weight: 500;
}

/* ---------- Store buttons (our own; the official badges come at launch) ---------- */

.store {
  margin-top: 2.25rem;
}

.store__status {
  margin-bottom: 0.9rem;
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 500;
}

.store__buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 3.25rem;
  padding: 0.55rem 0.8rem 0.55rem 1.3rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: default;
}

.store-btn__tag {
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
}

.store-btn.is-live {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.store-btn.is-live:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg);
}

.store-btn.is-live .store-btn__tag {
  background: rgba(7, 10, 12, 0.1);
  color: var(--bg);
}

@media (max-width: 26rem) {
  .store-btn {
    gap: 0.5rem;
    padding-left: 1.05rem;
    padding-right: 0.65rem;
    font-size: 1rem;
  }

  .store-btn__tag {
    padding-inline: 0.6rem;
  }
}

/* ---------- Sections ---------- */

.section {
  padding-block: var(--section);
}

.section + .section {
  padding-top: 0;
}

.section__head {
  max-width: 60rem;
  margin-bottom: clamp(2.25rem, 5vw, 4rem);
}

.display {
  font-size: clamp(2.25rem, 1.4rem + 3.8vw, 4.25rem);
  letter-spacing: -0.028em;
}

.lead {
  margin-top: 1.4rem;
  max-width: 36rem;
  color: var(--muted);
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  line-height: 1.55;
}

/* Three things to do with a fractal */

.moves {
  display: grid;
  gap: 2rem clamp(1.5rem, 4vw, 3.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.moves li {
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}

.moves h3 {
  margin-bottom: 0.7rem;
  font-size: 1.75rem;
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.moves p,
.note {
  color: var(--muted);
}

.note {
  margin-top: clamp(2rem, 4vw, 3rem);
  max-width: 40rem;
  font-size: 0.9375rem;
}

.panorama {
  margin: clamp(3rem, 7vw, 5.5rem) 0 0;
}

.panorama img {
  width: 100%;
  border-radius: var(--radius);
  background: var(--surface);
}

.panorama figcaption {
  margin-top: 0.9rem;
}

/* Gallery */

.gallery {
  columns: 1;
  column-gap: clamp(1rem, 2.2vw, 2rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.gallery li {
  break-inside: avoid;
  margin: 0 0 clamp(1.5rem, 2.6vw, 2.25rem);
}

.gallery figure {
  margin: 0;
}

.gallery img {
  width: 100%;
  border-radius: var(--radius);
  background: var(--surface);
}

.gallery figcaption {
  margin-top: 0.7rem;
}

.gallery__after {
  margin-top: clamp(1.5rem, 4vw, 3rem);
  color: var(--muted);
  font-family: var(--serif);
  font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  font-style: italic;
  text-align: center;
}

/* No AI. Pure math. */

.statement {
  position: relative;
  padding-top: clamp(1rem, 3vw, 3rem);
  text-align: center;
  isolation: isolate;
}

.statement::before {
  content: "";
  position: absolute;
  inset: -35% 0;
  z-index: -1;
  background: radial-gradient(ellipse 46% 50% at 50% 50%, rgba(21, 104, 100, 0.3), transparent 72%);
  pointer-events: none;
}

.statement .display {
  font-size: clamp(2.6rem, 1.4rem + 5.4vw, 5.5rem);
  letter-spacing: -0.032em;
}

.statement .lead {
  max-width: 38rem;
  margin: 1.75rem auto 0;
}

.statement__aside {
  margin-top: 1.75rem;
  color: var(--text);
  font-family: var(--serif);
  font-size: clamp(1.1875rem, 1.05rem + 0.6vw, 1.5rem);
  font-style: italic;
}

/* Rows: a heading on the left, the details on the right */

.rows {
  border-bottom: 1px solid var(--line);
}

.row {
  display: grid;
  gap: 1.75rem clamp(2rem, 6vw, 6rem);
  padding-block: clamp(3rem, 7vw, 5.5rem);
  border-top: 1px solid var(--line);
}

.row h2 {
  font-size: clamp(2rem, 1.35rem + 2.8vw, 3.25rem);
  letter-spacing: -0.025em;
}

.row__body > p {
  max-width: 36rem;
  color: var(--muted);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
}

.row__body > p + p {
  margin-top: 1rem;
}

.features {
  display: grid;
  gap: 1.75rem clamp(1.5rem, 4vw, 3rem);
  margin: 2.25rem 0 0;
}

.features dt {
  margin-bottom: 0.35rem;
  font-family: var(--serif);
  font-size: 1.3125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.features dd {
  margin: 0;
  color: var(--muted);
}

.sizes {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem clamp(1.25rem, 4vw, 2.75rem);
  margin: 2.25rem 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--serif);
  font-size: clamp(1.75rem, 1.2rem + 2.4vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.sizes li:nth-child(1) {
  color: #8f9699;
}

.sizes li:nth-child(2) {
  color: #b3b8ba;
}

.sizes li:nth-child(3) {
  color: #d6d6d3;
}

.sizes + p {
  margin-top: 1.25rem;
}

.facts {
  display: grid;
  gap: 0 clamp(1.5rem, 4vw, 3rem);
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--serif);
  font-size: clamp(1.3125rem, 1.1rem + 0.8vw, 1.625rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.facts li {
  padding-block: 0.95rem;
  border-bottom: 1px solid var(--line);
}

.facts + p {
  margin-top: 1.75rem;
}

/* Thanks */

.thanks {
  max-width: 46rem;
  margin-inline: auto;
  text-align: center;
}

.thanks h2 {
  margin-bottom: 1.5rem;
  font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);
  font-style: italic;
  font-weight: 500;
}

.thanks p {
  color: var(--muted);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
}

.thanks p + p {
  margin-top: 1rem;
}

/* Closing call */

.closing {
  position: relative;
  padding-block: var(--section);
  text-align: center;
  isolation: isolate;
}

.closing::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse 60% 70% at 50% 100%, rgba(21, 104, 100, 0.32), transparent 70%);
  pointer-events: none;
}

.closing .display {
  font-size: clamp(1.75rem, 0.95rem + 3.8vw, 4.25rem);
}

.closing .store {
  margin-top: 2.5rem;
}

.closing .lead {
  margin-inline: auto;
}

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

.site-footer {
  flex-shrink: 0;
  padding-block: 2.5rem 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9375rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 2.5rem;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer a {
  display: inline-block;
  padding-block: 0.3rem;
}

.site-footer .wordmark {
  color: var(--text);
  font-size: 1.125rem;
}

.site-footer__who {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1rem;
}

/* ---------- Text pages: Privacy, Support, 404 ---------- */

.page {
  padding-block: clamp(2.5rem, 7vw, 5.5rem) var(--section);
}

.page .wrap {
  max-width: var(--prose);
}

.page h1 {
  font-size: clamp(2.6rem, 1.6rem + 4.6vw, 4.5rem);
  letter-spacing: -0.03em;
}

.page__date {
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.page__lead {
  margin-top: 2rem;
  font-family: var(--serif);
  font-size: clamp(1.3125rem, 1.15rem + 0.8vw, 1.625rem);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.prose h2 {
  margin: clamp(3rem, 6vw, 4.25rem) 0 1.1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: clamp(1.625rem, 1.35rem + 1.2vw, 2.125rem);
  letter-spacing: -0.02em;
}

.prose h3 {
  margin: 2rem 0 0.5rem;
  font-family: var(--sans);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0;
  text-wrap: pretty;
}

.prose p,
.prose li {
  color: #c9cdce;
}

.prose p + p {
  margin-top: 0.9rem;
}

.prose ul {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
}

.prose li {
  padding-left: 0.2rem;
}

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

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

.prose strong {
  color: var(--text);
  font-weight: 600;
}

.prose a,
.page__lead a {
  color: var(--accent);
  text-decoration-color: rgba(246, 169, 155, 0.45);
}

.prose a:hover,
.page__lead a:hover {
  text-decoration-color: currentColor;
}

.devices {
  display: grid;
  gap: 1.25rem 2.5rem;
  margin-top: 0.9rem;
}

.devices h4 {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.devices ul {
  margin-top: 0;
}

.lost {
  display: grid;
  place-items: center;
  padding-block: clamp(1rem, 4vw, 3rem) var(--section);
  text-align: center;
}

.lost__figure {
  width: min(92vw, 24rem);
  margin: -1.5rem auto -2rem;
}

.lost h1 {
  font-size: clamp(2.4rem, 1.6rem + 3.8vw, 4rem);
}

.lost p {
  max-width: 30rem;
  margin: 1.25rem auto 0;
  color: var(--muted);
  font-size: 1.125rem;
}

.lost .button {
  margin-top: 2.25rem;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0.5rem 1.5rem;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease;
}

.button:hover {
  background: var(--accent);
  color: var(--bg);
}

/* ---------- Wider screens ---------- */

@media (min-width: 40rem) {
  .gallery {
    columns: 2;
  }

  .features,
  .facts,
  .devices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .moves {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 60rem) {
  .hero {
    padding-bottom: clamp(2rem, 5vw, 5rem);
  }

  .hero .wrap {
    grid-template-columns: minmax(0, 11fr) minmax(0, 12fr);
    align-items: center;
    justify-items: start;
    min-height: min(100svh - 6rem, 50rem);
  }

  .hero__text {
    grid-column: 1;
    grid-row: 1;
    margin-top: 0;
    max-width: none;
    text-align: left;
  }

  .hero__figure {
    grid-column: 2;
    grid-row: 1;
    width: min(62vw, 51rem, 100svh - 2rem);
    margin: -3rem 0 -3rem -9%;
    justify-self: center;
  }

  .hero__lead {
    max-width: 30rem;
  }

  .store__buttons {
    justify-content: flex-start;
  }

  .closing .store__buttons {
    justify-content: center;
  }

  .row {
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  }
}

@media (min-width: 72rem) {
  .gallery {
    columns: 3;
  }
}

/* ---------- Motion: gentle, and only for those who have not asked for less ---------- */

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

  .hero__ball {
    animation: arrive 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .hero__ball img {
    animation: drift 11s ease-in-out 1.6s infinite alternate;
  }

  .hero__text > *,
  .hero__figure figcaption {
    animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .hero__text > :nth-child(1) { animation-delay: 0.15s; }
  .hero__text > :nth-child(2) { animation-delay: 0.25s; }
  .hero__text > :nth-child(3) { animation-delay: 0.36s; }
  .hero__text > :nth-child(4) { animation-delay: 0.46s; }
  .hero__text > :nth-child(5) { animation-delay: 0.56s; }
  .hero__figure figcaption { animation-delay: 0.9s; }

  .reveal-on .reveal {
    opacity: 0;
    transform: translateY(1.25rem);
    transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
  }

  .reveal-on .reveal.is-in {
    opacity: 1;
    transform: none;
  }
}

@keyframes arrive {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
}

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

@keyframes drift {
  to {
    transform: translateY(-1.6%) scale(1.018);
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }
}
