/* Ancestral Nest: the landing pages. One stylesheet for every language. */

:root {
  --bark: #2B231D;        /* text, buttons */
  --ink-2: #4F453D;
  --ink-3: #6A5F56;
  --egg: #2F7F7B;         /* Deep egg: links, labels */
  --egg-dark: #1F5C59;
  --robin: #8FCFCB;       /* Robin's egg: the mark, on dark */
  --seaglass: #EEF4F2;    /* panels */
  --birch: #F2F4F1;       /* bands */
  --paper: #F7F6F2;       /* documents */
  --line: #E3E5DF;
  --line-glass: #DCE3E0;
  --line-paper: #E3E1D8;
  --night: #2B231D;
  --night-text: #F3EFEA;
  --night-soft: #D9D1C8;
  --night-line: #4A3F37;

  --serif: 'Prata', Georgia, 'Times New Roman', serif;
  --sans: 'Golos Text', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --shadow: 0 1px 2px rgba(43, 35, 29, .08), 0 12px 32px rgba(43, 35, 29, .12);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: #FFFFFF;
  color: var(--bark);
  font: 17px/1.55 var(--sans);
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--egg); }
a:hover { color: var(--egg-dark); }
:focus-visible { outline: 3px solid var(--egg); outline-offset: 3px; border-radius: 4px; }
h1, h2, p, figure, ul { margin: 0; }
b, strong { font-weight: 600; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 10;
  background: var(--bark); color: #FFFFFF; padding: 10px 14px; border-radius: 8px; text-decoration: none;
}
.skip:focus { top: 12px; color: #FFFFFF; }

.wrap { max-width: 1200px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

.eyebrow {
  font-family: var(--mono); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--egg);
}
h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(40px, 6.4vw, 64px); line-height: 1.05; letter-spacing: -.01em; text-wrap: balance;
}
:lang(ru) h1 { font-size: clamp(38px, 6vw, 60px); line-height: 1.08; }
h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(30px, 4.4vw, 42px); line-height: 1.12; text-wrap: balance;
}
.lede { font-size: 19px; color: var(--ink-2); }
.muted { color: var(--ink-2); }
.small { font-size: 14px; color: var(--ink-2); }
figcaption { font-size: 14px; color: var(--ink-3); }
.todo { background: #FFF3C4; border-radius: 3px; padding: 0 3px; }

.btn {
  display: inline-block; text-decoration: none; font-weight: 600; border-radius: 10px;
  padding: 15px 24px; background: var(--bark); color: #FFFFFF; border: 0; font: inherit; font-weight: 600; cursor: pointer;
}
.btn:hover { background: #45392F; color: #FFFFFF; }
.btn.ghost { background: #FFFFFF; color: var(--bark); border: 1px solid #CFCFC6; padding: 14px 22px; font-weight: 500; }
.btn.ghost:hover { background: var(--birch); }
.btn.small { font-size: 15px; padding: 11px 18px; border-radius: 8px; }

/* Top bar */
.top { border-bottom: 1px solid var(--line); background: #FFFFFF; }
.top .wrap { padding-top: 18px; padding-bottom: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--bark); }
.brand:hover { color: var(--bark); }
.brand-name { font-family: var(--serif); font-size: 22px; letter-spacing: .01em; }
.mark {
  width: 38px; height: 38px; border-radius: 10px; background: var(--egg);
  display: grid; place-items: center; flex: 0 0 auto;
}
.mark img { width: 76%; height: auto; }
.sections { display: flex; flex-wrap: wrap; gap: 6px 22px; flex: 1 1 360px; font-size: 15px; }
.sections a, .foot nav a { color: var(--ink-2); text-decoration: none; }
.sections a:hover, .foot nav a:hover { color: var(--egg); }
.actions { display: flex; gap: 14px; align-items: center; }
.langs { display: flex; gap: 2px; font-family: var(--mono); font-size: 13px; }
.langs a { color: var(--ink-3); text-decoration: none; padding: 6px 7px; border-radius: 6px; }
.langs a:hover { color: var(--bark); background: var(--birch); }
.langs a[aria-current] { color: var(--bark); font-weight: 500; }
.signin { color: var(--bark); text-decoration: none; font-size: 15px; font-weight: 500; padding: 10px 12px; border-radius: 8px; }
.signin:hover { color: var(--bark); background: var(--birch); }

/* Hero */
.hero { overflow: hidden; }
.hero .wrap { position: relative; isolation: isolate; padding-top: 72px; padding-bottom: 32px; display: flex; flex-direction: column; gap: 48px; }
.hero-top { display: flex; flex-wrap: wrap; gap: 32px 56px; align-items: flex-end; }
.hero-head { flex: 1 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.hero-lede { flex: 1 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-shot { display: flex; flex-direction: column; gap: 12px; }
.hero-shot .panel { background: var(--seaglass); border-radius: 22px; padding: 28px; }
.hero-shot img { border-radius: 12px; box-shadow: var(--shadow); }

/* The tree, from the user's drawing, behind the hero: its crown above the screenshot, the trunk behind it */
@property --grow { syntax: '<number>'; inherits: false; initial-value: 1; }
@keyframes grow { from { --grow: 0; opacity: 0; } 30% { opacity: 1; } to { --grow: 1; } }
.grows {
  -webkit-mask-image: linear-gradient(to top, #000 calc(var(--grow) * 112% - 12%), transparent calc(var(--grow) * 112%));
  mask-image: linear-gradient(to top, #000 calc(var(--grow) * 112% - 12%), transparent calc(var(--grow) * 112%));
}
.hero-tree {
  position: absolute; z-index: -1; pointer-events: none;
  right: max(0px, calc(50% - 600px)); top: -8px;
  width: min(600px, 52%); opacity: .34;
  animation: grow 2.6s cubic-bezier(.3, .7, .2, 1) .15s both;
}

/* What the family keeps */
.facts { background: var(--birch); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts .wrap {
  padding-top: 28px; padding-bottom: 28px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px 32px; font-size: 15px; color: var(--ink-2);
}
.facts b { color: var(--bark); }

/* Sections */
.section .wrap { display: flex; flex-direction: column; gap: 36px; padding-top: 88px; padding-bottom: 88px; }
.section-head { display: flex; flex-wrap: wrap; gap: 24px 64px; align-items: flex-end; }
.section-head > div { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.section-head > p, .section-head > .side { flex: 1 1 380px; min-width: 0; }
.side { display: flex; flex-direction: column; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.shot { display: flex; flex-direction: column; gap: 12px; }
.shot img { border-radius: 14px; border: 1px solid var(--line); }
.shot.lifted img { border: 0; box-shadow: var(--shadow); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.card { border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; display: flex; flex-direction: column; gap: 6px; }
.card span { color: var(--ink-2); font-size: 15px; }

#tree .wrap { padding-bottom: 40px; }
#places .wrap { padding-top: 56px; padding-bottom: 56px; flex-direction: row; flex-wrap: wrap; gap: 40px 56px; align-items: center; }
#places .stack { flex: 1 1 340px; min-width: 0; }
#places .shot { flex: 2 1 560px; min-width: 0; gap: 10px; }
#places figcaption { font-size: 13px; }

/* Records */
#records { background: var(--birch); }
#records .wrap { padding-top: 72px; padding-bottom: 72px; flex-direction: row; flex-wrap: wrap; gap: 48px; align-items: center; }
#records .stack { flex: 1 1 420px; min-width: 0; }
#records ul { padding-left: 20px; color: var(--ink-2); display: flex; flex-direction: column; gap: 6px; }
.record {
  flex: 1 1 420px; min-width: 0; background: #FFFFFF; border: 1px solid var(--line-paper); border-radius: 16px; padding: 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.record .kind { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.record .title { font-family: var(--serif); font-size: 24px; line-height: 1.25; }
.ref { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; font-family: var(--mono); font-size: 12px; margin: 0; }
.ref div { background: var(--paper); border: 1px solid var(--line-paper); border-radius: 6px; padding: 8px; display: flex; flex-direction: column; min-width: 0; }
.ref dt { color: var(--ink-3); }
.ref dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.entry { padding: 14px 16px; background: var(--paper); border-radius: 10px; font-size: 15px; color: var(--ink-2); display: flex; flex-direction: column; gap: 4px; }
.entry .kind { font-size: 12px; }
.record figcaption { font-size: 13px; }

/* Photos */
#photos .wrap { padding-top: 72px; padding-bottom: 72px; gap: 32px; }
#photos .section-head { gap: 24px 48px; }
#photos .section-head > div { flex-basis: 520px; }
.who { flex: 1 1 340px; min-width: 0; border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.who-title { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.who ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.who li { display: flex; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.who .score { font-family: var(--mono); font-size: 13px; color: var(--egg); white-space: nowrap; }
.who .score.plain { color: var(--ink-3); }

/* DNA */
#dna { background: var(--seaglass); }
#dna .shot { gap: 10px; }
#dna .shot img { border-color: var(--line-glass); }
#dna .card { background: #FFFFFF; border: 0; padding: 22px; gap: 8px; }
#dna .cards { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.note { font-size: 14px; color: var(--ink-2); max-width: 760px; }

/* Together */
#together { background: var(--night); color: var(--night-text); }
#together .eyebrow { color: var(--robin); }
#together .intro { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
#together .intro p { color: var(--night-soft); }
#together .card { border-color: var(--night-line); padding: 22px; gap: 8px; }
#together .card b { color: #FFFFFF; }
#together .card span { color: var(--night-soft); }

/* Privacy */
#privacy .wrap { flex-direction: row; flex-wrap: wrap; gap: 48px; }
#privacy .stack { flex: 1 1 380px; min-width: 0; }
.points { flex: 1 1 520px; min-width: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 22px 32px; }
.points div { display: flex; flex-direction: column; gap: 6px; }
.points span { color: var(--ink-2); font-size: 15px; }

/* Start: the tree again, grown as the section comes into view */
#start { background: var(--seaglass); border-top: 1px solid var(--line-glass); }
#start .wrap { flex-direction: row; flex-wrap: wrap; gap: 40px; align-items: center; }
.start-tree { flex: 0 0 auto; width: 210px; margin: -24px 0 -40px; }
#start .stack { flex: 1 1 380px; min-width: 0; }
#start h2 { font-size: clamp(32px, 4.8vw, 46px); line-height: 1.1; }
@supports (animation-timeline: view()) {
  .start-tree img { animation: grow linear both; animation-timeline: view(); animation-range: entry 0% cover 40%; }
}
.signup { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.signup label { font-size: 14px; font-weight: 600; }
.signup .row { display: flex; flex-wrap: wrap; gap: 10px; }
.signup input {
  flex: 1 1 220px; min-width: 0; font: inherit; font-size: 16px; padding: 14px 16px;
  border: 1px solid #C8D3CF; border-radius: 10px; background: #FFFFFF; color: var(--bark);
}
.signup .btn { font-size: 16px; padding: 14px 22px; }
.signup .small { font-size: 13px; color: var(--ink-3); }

/* Footer */
.foot { border-top: 1px solid var(--line); }
.foot .wrap {
  padding-top: 32px; padding-bottom: 40px; display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center;
  justify-content: space-between; font-size: 14px; color: var(--ink-3);
}
.foot .brand-name { font-size: 18px; }
.foot .mark { width: 30px; height: 30px; border-radius: 8px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot .credits { flex: 1 1 100%; font-size: 12px; color: var(--ink-3); }

@media (max-width: 760px) {
  .sections { display: none; }
  .top .wrap { justify-content: space-between; padding-top: 14px; padding-bottom: 14px; }
  .hero .wrap { padding-top: 44px; gap: 36px; }
  .hero-tree { width: min(440px, 92%); right: -14%; top: 10px; opacity: .42; }
  .hero-shot .panel { padding: 12px; border-radius: 16px; }
  .section .wrap { padding-top: 64px; padding-bottom: 64px; gap: 28px; }
  #records .wrap, #photos .wrap { padding-top: 56px; padding-bottom: 56px; }
  .ref { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .start-tree { width: 150px; margin: -16px auto -8px; }
}
@media (max-width: 560px) {
  /* the hero's own button is just below, and the languages are in the footer */
  .actions .btn.small, .top .langs { display: none; }
}
@media (max-width: 360px) {
  .brand-name { font-size: 19px; }
  .mark { width: 34px; height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-tree, .start-tree img { animation: none !important; }
}

@media print {
  .top .actions, .signup, .hero-tree, .start-tree { display: none; }
  .section, #together { break-inside: avoid; }
}
