/* Ascendance website. Same palette and typefaces as the app (apps/web/src/styles.css). */

@font-face {
  font-family: "Fraunces";
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/fraunces-500.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/fraunces-600.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/inter-500.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/inter-600.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --paper: #f7f3ec;
  --paper-deep: #efe8dc;
  --surface: #ffffff;
  --ink: #2b2620;
  --ink-soft: #6b6257;
  --line: #ded5c6;
  --forest: #1f4d3a;
  --forest-soft: #2f6b52;
  --on-forest: #ffffff;
  --gold: #e9c46a;
  --gold-ink: #8a6519;
  --hero: #1f4d3a;
  --hero-ink: #f5efe3;
  --display: "Fraunces", ui-serif, Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 70rem;
  --gutter: clamp(16px, 4vw, 40px);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #15130f;
    --paper-deep: #1e1b16;
    --surface: #221f19;
    --ink: #ece6da;
    --ink-soft: #a89f90;
    --line: #37322a;
    --forest: #5aa684;
    --forest-soft: #6fb896;
    --on-forest: #0e1712;
    --gold-ink: #e3bb66;
    --hero: #173a2c;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a {
  color: var(--forest);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-thickness: 2px;
}

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

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

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

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

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  padding: 8px 12px;
  background: var(--surface);
  z-index: 10;
}
.skip:focus {
  left: 8px;
}

/* Buttons ---------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  background: var(--forest);
  color: var(--on-forest);
  font: 600 1rem/1.2 var(--sans);
  text-decoration: none;
  text-align: center;
  transition: background-color 0.15s ease;
}
.button:hover {
  background: var(--forest-soft);
}
.button-small {
  white-space: nowrap;
  min-height: 40px;
  padding: 8px 16px;
  font-size: 0.9375rem;
}
.button-gold {
  background: var(--gold);
  color: #1f2a22;
}
.button-gold:hover {
  background: #f0d283;
}
.button-ghost {
  background: transparent;
  border-color: rgb(245 239 227 / 0.45);
  color: var(--hero-ink);
}
.button-ghost:hover {
  background: rgb(245 239 227 / 0.1);
}
.button-quiet {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.button-quiet:hover {
  background: var(--paper-deep);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Header and footer ------------------------------------------------------ */

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  min-height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font: 600 1.375rem/1 var(--display);
}
.logo-mark {
  width: 32px;
  height: 32px;
}
.header-nav {
  display: flex;
  gap: 28px;
  margin-right: auto;
}
.header-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
}
.header-nav a:hover {
  color: var(--ink);
}

.site-footer {
  background: var(--paper-deep);
  border-top: 1px solid var(--line);
  padding: 56px 0 64px;
  font-size: 0.9375rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 40px;
}
.footer-about p {
  color: var(--ink-soft);
  margin-top: 14px;
  max-width: 24rem;
}
.site-footer h2 {
  font: 600 0.9375rem/1.4 var(--sans);
  margin-bottom: 12px;
}
.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.site-footer ul a {
  color: var(--ink-soft);
  text-decoration: none;
}
.site-footer ul a:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* Hero: the ancestor wheel rises from the bottom edge ---------------------- */

.hero {
  background-color: var(--hero);
  /* The dotted canvas of the app's tree view. */
  background-image: radial-gradient(rgb(245 239 227 / 0.07) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  color: var(--hero-ink);
  overflow: hidden;
}
.hero-inner {
  padding-top: clamp(48px, 7vw, 88px);
}
.hero h1 {
  font-size: clamp(2.375rem, 5vw, 4rem);
  line-height: 1.05;
  max-width: 19ch;
}
.hero-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: start;
  margin-top: clamp(24px, 3vw, 36px);
}
.hero .lead {
  font-size: 1.1875rem;
  line-height: 1.6;
  color: rgb(245 239 227 / 0.86);
  max-width: 34rem;
  margin: 0;
}
.hero-note {
  margin: 16px 0 0;
  font-size: 0.9375rem;
  color: rgb(245 239 227 / 0.68);
}
.hero-fan {
  position: relative;
  margin: clamp(32px, 5vw, 56px) auto 0;
  max-width: 58rem;
}
.hero-fan figcaption {
  position: absolute;
  top: 0;
  left: 0;
  max-width: 12rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: rgb(245 239 227 / 0.6);
}
.fan {
  width: 100%;
  overflow: visible;
}
.fan text {
  text-anchor: middle;
  fill: #2b2620;
}
.fan-cell {
  stroke: var(--hero);
  stroke-width: 2.5;
}
.fan-empty {
  fill: rgb(245 239 227 / 0.04);
  stroke: rgb(245 239 227 / 0.2);
  stroke-width: 1.2;
  stroke-dasharray: 3 4;
}
.fan-given {
  font-family: var(--display);
  font-weight: 600;
}
.fan-last {
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: 0.03em;
}
.fan-years {
  font-family: var(--sans);
  fill: #5d554b;
}
@media (prefers-reduced-motion: no-preference) {
  .fan g[data-generation] {
    transform-box: view-box;
    transform-origin: 50% 100%;
    animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
    animation-delay: calc(var(--g) * 120ms);
  }
  @keyframes rise {
    from {
      opacity: 0;
      transform: scale(0.92);
    }
  }
}

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

.section {
  padding: clamp(72px, 10vw, 120px) 0;
}
.section-deep {
  background: var(--paper-deep);
}
.section-paper {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.section-title {
  font-size: clamp(2rem, 3.6vw, 2.75rem);
  max-width: 20ch;
}
.section-lead {
  font-size: 1.1875rem;
  color: var(--ink-soft);
  max-width: 38rem;
  margin-top: 18px;
}
.more {
  font-weight: 500;
}
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: start;
}

/* Features: text beside a screenshot that runs to the edge of the window. */
.features {
  display: grid;
  gap: clamp(72px, 9vw, 128px);
  margin: clamp(48px, 6vw, 80px) 0 clamp(80px, 9vw, 128px);
}
.feature {
  display: grid;
  grid-template-columns:
    minmax(var(--gutter), 1fr) minmax(0, 25rem) clamp(32px, 5vw, 72px)
    minmax(0, 40rem) minmax(var(--gutter), 1fr);
  align-items: center;
}
.feature-text {
  grid-column: 2;
  grid-row: 1;
}
.feature-shot {
  grid-column: 4 / 6;
  grid-row: 1;
  margin: 0;
}
.feature-flip {
  grid-template-columns:
    minmax(var(--gutter), 1fr) minmax(0, 40rem) clamp(32px, 5vw, 72px)
    minmax(0, 25rem) minmax(var(--gutter), 1fr);
}
.feature-flip .feature-text {
  grid-column: 4;
}
.feature-flip .feature-shot {
  grid-column: 1 / 3;
}
.feature-shot img {
  width: 100%;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 14px 0 0 14px;
  box-shadow: 0 24px 60px -28px rgb(43 38 32 / 0.35);
}
.feature-flip .feature-shot img {
  border-right: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 14px 14px 0;
}
.feature h3 {
  font-size: clamp(1.5rem, 2.4vw, 1.875rem);
  margin-bottom: 18px;
}
.feature ul {
  padding-left: 1.2em;
  color: var(--ink-soft);
}
.feature li + li {
  margin-top: 6px;
}

.more-title {
  font-size: 1.5rem;
  margin-bottom: 24px;
}
.more-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 40px;
  margin: 0;
}
.more-list > div {
  border-top: 1px solid var(--line);
  padding: 20px 0 28px;
}
.more-list dt {
  font: 600 1.125rem/1.3 var(--display);
  margin-bottom: 8px;
}
.more-list dd {
  margin: 0;
  color: var(--ink-soft);
}

.checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 22px;
}
.checks li {
  position: relative;
  padding-left: 40px;
  color: var(--ink-soft);
}
.checks strong {
  display: block;
  color: var(--ink);
  font-weight: 600;
}
.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--forest)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E")
    center / 14px no-repeat;
}

.steps {
  list-style: none;
  counter-reset: step;
  margin: 48px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
}
.steps li {
  counter-increment: step;
  border-top: 2px solid var(--forest);
  padding-top: 20px;
}
.steps li::before {
  content: counter(step);
  display: block;
  font: 600 2.5rem/1 var(--display);
  color: var(--gold-ink);
  margin-bottom: 14px;
}
.steps h3 {
  font-size: 1.375rem;
  margin-bottom: 10px;
}
.steps p {
  color: var(--ink-soft);
}

.soon {
  font-weight: 600;
  color: var(--gold-ink);
}
.store-badge img {
  height: 53px;
  width: auto;
}
.qr {
  justify-self: center;
  max-width: 17rem;
  text-align: center;
}
.qr svg {
  width: 200px;
  margin: 0 auto 16px;
  padding: 16px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--line);
}
.qr p {
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.narrow {
  max-width: calc(46rem + 2 * var(--gutter));
}
.faq {
  margin-top: 36px;
  border-top: 1px solid var(--line);
}
.faq details {
  border-bottom: 1px solid var(--line);
}
.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  font: 600 1.1875rem/1.35 var(--display);
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: "+";
  font: 400 1.5rem/1 var(--sans);
  color: var(--forest);
  transition: transform 0.2s ease;
}
.faq details[open] summary::after {
  transform: rotate(45deg);
}
.faq details p {
  color: var(--ink-soft);
  padding-bottom: 8px;
}

.cta-band {
  background: var(--hero);
  color: var(--hero-ink);
  padding: 64px 0;
}
.cta-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.cta-band h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
}

/* Guides and legal pages -------------------------------------------------- */

.article-wrap {
  padding-top: 40px;
  padding-bottom: clamp(72px, 9vw, 112px);
}
.crumbs {
  font-size: 0.875rem;
  color: var(--ink-soft);
  margin-bottom: 28px;
}
.crumbs a {
  color: var(--ink-soft);
}
.prose {
  max-width: 44rem;
}
.prose h1 {
  font-size: clamp(2.25rem, 4.4vw, 3.25rem);
  margin-bottom: 20px;
}
.prose .lead {
  font-size: 1.25rem;
  color: var(--ink-soft);
  margin-bottom: 2em;
}
.prose h2 {
  font-size: 1.625rem;
  margin: 2.2em 0 0.6em;
}
.prose h3 {
  font-size: 1.25rem;
  margin: 1.8em 0 0.5em;
}
.prose ul,
.prose ol {
  padding-left: 1.3em;
  margin: 0 0 1.2em;
}
.prose li + li {
  margin-top: 8px;
}
.prose code {
  font-size: 0.92em;
  background: var(--paper-deep);
  padding: 1px 5px;
  border-radius: 4px;
}
.prose mark {
  background: #fde68a;
  color: #2b2620;
  padding: 0 4px;
}
.prose .actions {
  margin-top: 2.4em;
}

.table-scroll {
  overflow-x: auto;
  margin: 1.4em 0 1.8em;
}
table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  font-size: 0.9688rem;
}
caption {
  text-align: left;
  font-weight: 600;
  padding-bottom: 10px;
}
th,
td {
  text-align: left;
  padding: 10px 14px 10px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  font-weight: 600;
  color: var(--ink-soft);
  font-size: 0.875rem;
}
td:first-child {
  font-weight: 500;
}

.calc {
  display: grid;
  gap: 10px;
  padding: 24px;
  margin: 1.2em 0 1.6em;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.calc-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
}
.calc label {
  display: block;
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 6px;
}
.calc input[type="number"],
.calc input[type="date"],
.calc select {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  font: 500 1.0625rem var(--sans);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.calc input[type="number"],
.calc input[type="date"] {
  max-width: 14rem;
  font-size: 1.25rem;
}
.calc .check {
  display: flex;
  align-items: center;
  gap: 10px;
  align-self: end;
  min-height: 48px;
}
.calc .check label {
  margin: 0;
  font-weight: 500;
}
.calc .check input {
  width: 20px;
  height: 20px;
  accent-color: var(--forest);
}
.calc output {
  display: block;
  grid-column: 1 / -1;
  margin-top: 8px;
  padding: 14px 18px;
  border-left: 3px solid var(--forest);
  background: var(--paper);
  border-radius: 0 10px 10px 0;
  line-height: 1.7;
}

.guide-list {
  list-style: none;
  padding: 0;
  margin: 40px 0 0;
  max-width: 44rem;
  border-top: 1px solid var(--line);
}
.guide-list li {
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.guide-list h3 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}
.guide-list h3 a {
  color: var(--ink);
  text-decoration: none;
}
.guide-list h3 a:hover {
  color: var(--forest);
  text-decoration: underline;
}
.guide-list p {
  color: var(--ink-soft);
  margin: 0;
}

.redirect {
  padding-top: clamp(64px, 12vw, 140px);
  padding-bottom: clamp(64px, 12vw, 140px);
  max-width: calc(40rem + 2 * var(--gutter));
}
.redirect h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  margin-bottom: 16px;
}
.redirect p {
  color: var(--ink-soft);
}

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

@media (max-width: 960px) {
  .header-nav {
    display: none;
  }
  .header-inner {
    justify-content: space-between;
  }
  .hero-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-fan {
    display: flex;
    flex-direction: column-reverse;
    margin-left: calc(-1 * var(--gutter));
    margin-right: calc(-1 * var(--gutter));
  }
  .hero-fan figcaption {
    position: static;
    max-width: none;
    padding: 0 var(--gutter) 16px;
  }
  .feature,
  .feature-flip {
    grid-template-columns: var(--gutter) minmax(0, 1fr) var(--gutter);
    row-gap: 28px;
  }
  .feature-text,
  .feature-flip .feature-text {
    grid-column: 2;
    grid-row: 1;
  }
  .feature-shot,
  .feature-flip .feature-shot {
    grid-column: 2 / 4;
    grid-row: 2;
  }
  .feature-flip .feature-shot img {
    border-left: 1px solid var(--line);
    border-right: 0;
    border-radius: 12px 0 0 12px;
  }
  .more-list,
  .steps {
    grid-template-columns: minmax(0, 1fr);
  }
  .steps {
    gap: 32px;
  }
  .split {
    grid-template-columns: minmax(0, 1fr);
  }
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer-about {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 1rem;
  }
  .hero .lead {
    font-size: 1.0625rem;
  }
  .hero .actions .button {
    width: 100%;
  }
  .calc-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .cta-band .button {
    width: 100%;
  }
}

.guide-theme {
  margin-top: 56px;
  max-width: 44rem;
}
.guide-theme > h2 {
  font-size: 1.25rem;
  color: var(--ink-soft);
}
.guide-theme .guide-list {
  margin-top: 12px;
}

.related {
  margin-top: 64px;
  max-width: 44rem;
}
.related > h2 {
  font-size: 1.25rem;
}
.related .guide-list {
  margin-top: 16px;
}
.related .more {
  margin-top: 20px;
}
.related .guide-list h3 {
  font-size: 1.25rem;
}
