/* jflamb.com — the cover of the Ledger set.
   Tokens come from ./ledger.css (vendored from @jflamb/ledger; refresh with
   `npm run sync:site` in the ledger repo). This file holds only site-local
   layout and the licensed decoration: the organic shapes. */

:root {
  /* site-local decoration tokens — alias down to Ledger, never redefine it */
  --shape-fill: #d8ddcf;
  --shape-line: var(--color-action);
}

:root[data-theme="dark"] {
  --shape-fill: #1d251e;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --shape-fill: #1d251e;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--color-surface-page);
  color: var(--color-text-primary);
  font-family: var(--font-prose);
  text-rendering: optimizeLegibility;
}

.cover {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100svh;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 4.5rem);
}

.message {
  z-index: 2;
  align-self: center;
  justify-self: center;
  min-width: 0;
  width: min(100%, 66rem);
  padding-block: 4rem;
  text-align: center;
}

.eyebrow {
  margin: 0 0 clamp(1.25rem, 2.5vw, 2rem);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}

h1 {
  margin: 0;
  font-family: var(--font-prose);
  font-size: var(--text-hero);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.95;
  text-wrap: balance;
}

.rule {
  width: clamp(5rem, 9vw, 8.5rem);
  height: 0.25rem;
  margin: clamp(2rem, 4vw, 3.25rem) auto clamp(1.75rem, 3.5vw, 2.75rem);
  background: var(--color-action);
}

p {
  max-width: 100%;
  margin-inline: auto;
  overflow-wrap: break-word;
}

.lead {
  margin-block: 0;
  font-size: clamp(1.45rem, 2.3vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.detail {
  max-width: 44rem;
  margin-block: clamp(1.2rem, 2.5vw, 2rem) 0;
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  line-height: 1.6;
  color: var(--color-text-secondary);
}

footer {
  z-index: 2;
  justify-self: center;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: 0.08em;
  color: var(--color-link);
}

.shape,
.line {
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

.shape {
  background: var(--shape-fill);
  opacity: 0.68;
  filter: saturate(0.7);
}

.shape-left {
  top: -18%;
  bottom: -14%;
  left: -15rem;
  width: clamp(22rem, 34vw, 40rem);
  border-radius: 43% 57% 62% 38% / 38% 42% 58% 62%;
  transform: rotate(-8deg);
}

.shape-right {
  right: -15rem;
  bottom: -35%;
  width: clamp(28rem, 42vw, 50rem);
  aspect-ratio: 1 / 1.4;
  border-radius: 62% 38% 40% 60% / 42% 34% 66% 58%;
  transform: rotate(19deg);
}

.line {
  right: -6rem;
  bottom: -12rem;
  width: clamp(25rem, 49vw, 57rem);
  aspect-ratio: 1;
  border: 0.2rem solid var(--shape-line);
  border-left-color: transparent;
  border-radius: 48% 52% 45% 55% / 57% 43% 57% 43%;
  transform: rotate(-18deg);
  opacity: 0.75;
}

@media (max-width: 48rem) {
  .cover {
    padding: 2rem 1.5rem;
  }

  .message {
    padding-block: 3rem;
  }

  h1 {
    font-size: clamp(3.4rem, 19vw, 6rem);
  }

  .lead {
    max-width: 21rem;
  }

  .detail {
    max-width: 19rem;
  }

  .shape-left {
    left: -18rem;
  }

  .shape-right {
    right: -18rem;
    bottom: -20%;
  }

  .line {
    right: -15rem;
    bottom: -9rem;
  }
}

/* High contrast: Ledger flips the palette system-wide; the site only
   quiets its decoration further. */
@media (prefers-contrast: more) {
  .shape {
    opacity: 0.35;
  }

  .line {
    opacity: 0.5;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
