/*
  adafin.app — one stylesheet, no build step.
  System fonts only: the site loads nothing from other hosts.
  Motion lives only inside the prefers-reduced-motion: no-preference block at the end;
  without it every element is simply at rest and visible.
*/

:root {
  color-scheme: light dark;

  --bg: #f7f6f3;
  --bg-glass: rgba(247, 246, 243, 0.82);
  --surface: #efede8;
  --line: #dcd8d0;
  --line-strong: #bdb7ac;
  --text: #17151b;
  --muted: #5b5664;
  --accent: #9333ea;
  --accent-text: #7e22ce;
  --accent-soft: rgba(147, 51, 234, 0.09);

  --serif: ui-serif, "New York", "Iowan Old Style", Charter, "Bitstream Charter", Cambria, Georgia, serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --wrap: 68rem;
  --measure: 40rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0a0d;
    --bg-glass: rgba(11, 10, 13, 0.78);
    --surface: #141218;
    --line: #26232c;
    --line-strong: #3a3542;
    --text: #ecebef;
    --muted: #a39fab;
    --accent: #a855f7;
    --accent-text: #c084fc;
    --accent-soft: rgba(168, 85, 247, 0.1);
  }
}

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

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

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

main {
  flex: 1;
}

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

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

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

p {
  margin: 0 0 1em;
}

a {
  color: var(--accent-text);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-color: currentColor;
}

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

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05em 0.3em;
  overflow-wrap: anywhere;
}

strong {
  font-weight: 650;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin: 0 0 1.1rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

/* ---------- Skip link ---------- */

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  background: var(--text);
  color: var(--bg);
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  text-decoration: none;
}

.skip:focus {
  top: 1rem;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .site-header {
    background: var(--bg-glass);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    backdrop-filter: saturate(1.4) blur(14px);
  }
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand img {
  width: 1.75rem;
  height: 1.75rem;
}

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

.site-nav a {
  position: relative;
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.3rem 0;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
}

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

.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

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

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-top: 1.75rem;
  padding-bottom: 2rem;
}

.site-footer p {
  margin: 0;
}

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

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--text);
}

/* ---------- Buttons and links with arrows ---------- */

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 550;
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.5rem 1.05rem;
}

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

.arrow {
  display: inline-block;
}

.button:hover .arrow,
.text-link:hover .arrow {
  transform: translateX(3px);
}

.text-link {
  font-weight: 550;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

/* ---------- Landing: hero ---------- */

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
  padding-top: clamp(3rem, 9vw, 7rem);
  padding-bottom: clamp(3rem, 7vw, 5rem);
}

.hero h1 {
  font-size: clamp(2.6rem, 7vw, 4.8rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin-bottom: 1.4rem;
}

.hero h1 em {
  font-style: italic;
  font-weight: 500;
}

.lede {
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  line-height: 1.5;
  color: var(--muted);
  max-width: 28rem;
  margin-bottom: 2rem;
}

.availability {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
  padding: 0.5rem 0;
}

.status::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

.hero-art {
  color: var(--text);
  justify-self: center;
  width: 100%;
  max-width: 26rem;
}

.hero-art .faint {
  opacity: 0.35;
}

.hero-art .soft {
  opacity: 0.6;
}

.hero-art .accent {
  color: var(--accent);
}

/* ---------- Landing: sections ---------- */

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

.section-title {
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
  letter-spacing: -0.02em;
}

.features {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem clamp(1.5rem, 3vw, 2.5rem);
}

.features li {
  border-top: 1px solid var(--line-strong);
  padding-top: 1.25rem;
}

.features .num {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent-text);
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 0.7rem;
}

.features h3 {
  font-size: 1.4rem;
  margin-bottom: 0.45rem;
}

.features p {
  color: var(--muted);
  margin: 0;
  max-width: 20rem;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 1.5rem clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.section .split {
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  border-top: 1px solid var(--line);
  padding-top: clamp(2rem, 4vw, 3rem);
}

.checklist {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, max-content));
  gap: 0.6rem 3rem;
  font-size: 1.1rem;
}

.checklist li {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.checklist li::before {
  content: "";
  flex: none;
  width: 0.8rem;
  height: 1.5px;
  background: var(--accent);
}

.facts {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.75rem clamp(1.5rem, 3vw, 2.5rem);
  border-top: 1px solid var(--line);
  padding-top: clamp(2rem, 4vw, 3rem);
}

.facts dt {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.facts dd {
  margin: 0;
  font-size: 0.98rem;
}

/* ---------- Documents (privacy, support, 404) ---------- */

.doc .wrap {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  padding-top: clamp(2.5rem, 7vw, 4.5rem);
}

.doc-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.75rem;
  margin-bottom: 2rem;
}

.doc-head h1 {
  font-size: clamp(2.2rem, 5vw, 3.1rem);
  letter-spacing: -0.025em;
  margin-bottom: 0.6rem;
}

.doc-head .meta {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
}

.doc-head .intro {
  font-size: 1.12rem;
  color: var(--muted);
  margin: 1.1rem 0 0;
}

.doc-head .intro strong {
  color: var(--text);
}

.doc h2 {
  font-size: 1.4rem;
  margin: 2.5rem 0 0.8rem;
  scroll-margin-top: 5rem;
}

.doc h3 {
  font-family: var(--sans);
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: 0;
  margin: 1.6rem 0 0.35rem;
  scroll-margin-top: 5rem;
}

.doc ul,
.doc ol {
  padding-left: 1.3rem;
  margin: 0 0 1em;
}

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

.doc li::marker {
  color: var(--muted);
}

.terms {
  margin: 0 0 1em;
  border-top: 1px solid var(--line);
}

.terms dt {
  font-weight: 650;
  padding-top: 0.8rem;
}

.terms dt code {
  font-weight: 400;
  margin-left: 0.35rem;
  font-size: 0.78em;
}

.terms dd {
  margin: 0.15rem 0 0;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.summary {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 1.25rem 1.5rem 1.25rem 1.4rem;
  margin: 0 0 1rem;
}

.summary h2 {
  margin-top: 0;
  font-size: 1.15rem;
}

.summary ul {
  margin: 0;
}

.summary li:last-child {
  margin-bottom: 0;
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0 !important;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 2.2rem;
  margin-bottom: 0.7em;
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.3em;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--accent-text);
}

.contact-card {
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin: 0 0 1rem;
}

.contact-card .email {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 500;
  display: inline-block;
  margin-bottom: 0.6rem;
  overflow-wrap: anywhere;
}

.contact-card p {
  margin: 0;
  color: var(--muted);
}

.note {
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- 404 ---------- */

.lost {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent-text);
  margin: 0 0 1rem;
}

/* ---------- Narrow screens ---------- */

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

  .hero-art {
    max-width: 16rem;
    justify-self: start;
  }

  .split {
    grid-template-columns: 1fr;
  }

  .features {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

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

@media (max-width: 30rem) {
  body {
    font-size: 1rem;
  }

  .site-nav ul {
    gap: 1rem;
  }

  .site-nav a {
    font-size: 0.9rem;
  }

  .facts {
    grid-template-columns: 1fr;
  }

  .checklist {
    gap: 0.6rem 2rem;
  }
}

/* ---------- Motion (only when the visitor hasn't asked for less) ---------- */

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

  a,
  .site-nav a,
  .button {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease,
      text-decoration-color 0.2s ease;
  }

  .site-nav a::after,
  .arrow {
    transition: transform 0.3s var(--ease);
  }

  :focus-visible {
    transition: outline-offset 0.15s ease;
  }

  /* Hero: text rises in once on load. */
  .reveal {
    animation: rise 0.8s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 90ms + 80ms);
  }

  /* Drawing: parts fade in after the text, the progress line fills, and the long strip
     glides through one full chapter under the reading frame and settles where it began.
     Everything stops within five seconds of load (WCAG 2.2.2), so no pause control is needed. */
  .art-part {
    animation: fade 0.9s ease both;
    animation-delay: calc(var(--i, 0) * 140ms + 300ms);
  }

  .hero-art .progress {
    transform-box: fill-box;
    transform-origin: left center;
    animation: fill 1.6s var(--ease) 0.9s both;
  }

  .strip-scroll {
    animation: strip 3.4s cubic-bezier(0.65, 0, 0.35, 1) 1.2s both;
  }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(14px);
    }
  }

  @keyframes fade {
    from {
      opacity: 0;
    }
  }

  @keyframes fill {
    from {
      transform: scaleX(0);
    }
  }

  @keyframes strip {
    from {
      transform: translateY(0);
    }
    to {
      transform: translateY(-333px);
    }
  }
}

@media print {
  .site-header nav,
  .skip,
  .hero-art {
    display: none;
  }

  .site-header {
    position: static;
  }

  body {
    background: #fff;
    color: #000;
  }
}
