/* casatookan.com: the colours are the app icon's: toucan orange, the
   bird's maroon, the sand under every casa; the canvas is the app's own. */
:root {
  --orange: #F7941D;
  --orange-deep: #E8730F;
  --maroon: #8C1C06;
  --sand: #F1D28A;
  --canvas: #ECECF3;
  --surface: #FFFFFF;
  --ink: #26262E;
  --dim: #5F6272;
  --navy: #3A4A63;
  --navy-deep: #2C3A50;
  --line: #DCDCE6;
  --display: 'Baloo 2', ui-rounded, system-ui, sans-serif;
  --body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --wrap: 1120px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 17px/1.6 var(--body);
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: 20px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- hero: the orange world of the app ---------- */
.hero {
  background: linear-gradient(180deg, #FFA431 0%, var(--orange) 45%, var(--orange-deep) 100%);
  color: var(--maroon);
  overflow: hidden;
}
.top {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-block: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand img { width: 40px; height: 40px; border-radius: 11px; }
.brand span { font-family: var(--display); font-weight: 800; font-size: 22px; }
.top nav { display: flex; gap: 22px; font-weight: 800; }
.top nav a { text-decoration: none; }
.top nav a:hover { text-decoration: underline; text-underline-offset: 4px; }

.hero-copy { padding-block: 48px 8px; max-width: 760px; }
.hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(44px, 7.4vw, 84px);
  line-height: 0.98;
  letter-spacing: -0.01em;
  margin: 0 0 22px;
  text-wrap: balance;
}
.hero p.lead {
  font-size: clamp(18px, 2.1vw, 21px);
  line-height: 1.5;
  color: #5A1304;
  max-width: 34em;
  margin: 0 0 30px;
}
.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 20px 8px 16px;
  border-radius: 14px;
  background: var(--maroon);
  color: #FFF4E6;
  text-decoration: none;
  font-weight: 800;
  line-height: 1.15;
}
.store svg { width: 24px; height: 24px; flex: none; fill: currentColor; }
.store small { display: block; font-weight: 600; font-size: 12px; opacity: 0.8; }
.store:hover { background: #6E1504; }

/* the casa ladder: one building per rank, growing with the value held */
.ladder {
  display: grid;
  grid-template-columns: 0.62fr 0.72fr 0.82fr 0.92fr 1.05fr 1.25fr;
  align-items: end;
  gap: clamp(2px, 1.2vw, 18px);
  margin-top: clamp(28px, 5vw, 56px);
  position: relative;
}
.ladder::after {
  /* the sand they all stand on, edge to edge */
  content: "";
  position: absolute;
  left: -50vw;
  right: -50vw;
  bottom: 0;
  height: clamp(54px, 6.4vw, 78px);
  background: var(--sand);
  border-radius: 50% 50% 0 0 / 22px 22px 0 0;
  z-index: 0;
}
.rung { margin: 0; position: relative; z-index: 1; text-align: center; }
.rung img { width: 100%; height: auto; margin-bottom: calc(-1 * clamp(4px, 1vw, 12px)); }
.rung figcaption {
  position: relative;
  z-index: 2;
  padding: 4px 0 14px;
  font-size: clamp(11px, 1.3vw, 14px);
  line-height: 1.25;
  color: #6B3B07;
}
.rung figcaption b { display: block; font-family: var(--display); font-size: clamp(12px, 1.6vw, 17px); color: var(--maroon); }

@media (prefers-reduced-motion: no-preference) {
  .rung img { animation: rise 600ms cubic-bezier(.2,.9,.3,1.2) both; }
  .rung:nth-child(2) img { animation-delay: 120ms; }
  .rung:nth-child(3) img { animation-delay: 240ms; }
  .rung:nth-child(4) img { animation-delay: 360ms; }
  .rung:nth-child(5) img { animation-delay: 480ms; }
  .rung:nth-child(6) img { animation-delay: 600ms; }
}
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.92); } to { opacity: 1; transform: none; } }

/* ---------- scroll scenes ----------
   A scene is a tall section whose .pin sticks to the viewport while the
   reader scrolls through it; site.js turns the scroll into a progress and
   a step. Without JS (no .js on <html>) scenes are plain sections and
   every step is shown. --len is the scene's length in screen heights. */
.kicker { font-family: var(--body); font-weight: 800; font-size: 17px; color: var(--orange-deep); margin: 0 0 14px; }
.steps-text h3, .big {
  font-family: var(--display); font-weight: 800; line-height: 1.04; margin: 0 0 16px; text-wrap: balance;
}
.steps-text h3 { font-size: clamp(32px, 4.6vw, 56px); }
.steps-text p { margin: 0 0 14px; max-width: 32em; color: var(--dim); font-size: clamp(17px, 1.5vw, 19px); }
.steps-text p strong { color: var(--ink); }
.more { display: inline-block; margin-top: 6px; font-weight: 800; color: var(--maroon); text-underline-offset: 4px; }

.scene { position: relative; }
.stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); gap: clamp(32px, 6vw, 88px); align-items: center; padding-block: 72px; }
.device { display: flex; justify-content: center; }
.device .phone { position: relative; width: min(300px, 74vw); border-radius: 40px; background: #1B1B22; padding: 9px; box-shadow: 0 40px 80px -30px rgba(58, 74, 99, 0.55); }
.device .screen { border-radius: 32px; width: 100%; height: auto; }
.dots { display: none; }

.js .scene { height: calc(var(--len) * 100vh); height: calc(var(--len) * 100svh); }
.js .pin { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; align-items: center; overflow: hidden; }
.js .pin > .wrap { width: 100%; }

/* steps: texts stacked in one cell, screens stacked in the phone */
.js .scene-steps .steps-text { display: grid; }
.js .scene-steps .kicker, .js .scene-steps .dots { grid-row: 1; }
.js .scene-steps .step, .js .scene-steps .kicker { grid-column: 1; }
.js .scene-steps .step { grid-row: 2; opacity: 0; transform: translateY(28px); transition: opacity .5s ease, transform .6s cubic-bezier(.2,.8,.2,1); pointer-events: none; }
.js .scene-steps .dots { display: flex; gap: 8px; grid-row: 3; margin-top: 18px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); transition: background .3s, width .3s; }
.js .scene-steps .screen { position: absolute; inset: 9px; width: calc(100% - 18px); opacity: 0; transform: scale(1.04); transition: opacity .5s ease, transform .7s cubic-bezier(.2,.8,.2,1); }
.js .scene-steps .screen[data-i="0"] { position: relative; inset: auto; width: 100%; }
.js .scene-steps[data-step="0"] [data-i="0"], .js .scene-steps[data-step="1"] [data-i="1"], .js .scene-steps[data-step="2"] [data-i="2"] { opacity: 1; transform: none; pointer-events: auto; }
.js .scene-steps[data-step="0"] .dots [data-i="0"], .js .scene-steps[data-step="1"] .dots [data-i="1"], .js .scene-steps[data-step="2"] .dots [data-i="2"] { background: var(--orange); width: 24px; border-radius: 4px; }
/* the phone drifts up a little across the whole scene */
.js .scene-steps .device .phone { transform: translateY(calc((0.5 - var(--p, 0)) * 60px)); }

/* plain sections between scenes */
.intro { padding-block: clamp(80px, 10vw, 128px) 0; }
.big { font-size: clamp(40px, 6vw, 72px); max-width: 14em; }
.cols3, .cols2 { display: grid; gap: 28px clamp(24px, 4vw, 48px); margin-top: 28px; }
.cols3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 960px; }
.intro p { margin: 0; color: var(--dim); font-size: clamp(17px, 1.5vw, 19px); }
.intro p b { color: var(--ink); }
.after-words { padding-top: 0; padding-bottom: clamp(80px, 10vw, 120px); }

/* grow: one casa, ranked by the value counter */
.grow { display: flex; flex-direction: column; align-items: center; text-align: center; padding-block: 56px; }
.grow-lead { font-family: var(--display); font-weight: 800; font-size: clamp(28px, 4vw, 46px); line-height: 1.08; margin: 0; }
.casa-stage { position: relative; width: min(440px, 78vw, 46vh); aspect-ratio: 1; margin: 6px auto 0; }
.casa-stage::before {
  content: ""; position: absolute; left: -30%; right: -30%; bottom: 7%; height: 22%;
  background: radial-gradient(closest-side, var(--sand), rgba(241, 210, 138, 0));
}
.casa-stage img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transform: scale(.86) translateY(14px); transition: opacity .45s ease, transform .6s cubic-bezier(.2,.9,.3,1.25); }
.casa-stage img.on { opacity: 1; transform: none; }
.casa-card { width: min(420px, 88vw); background: var(--orange-deep); color: #fff; border-radius: 18px; padding: 14px 16px; text-align: left; box-shadow: 0 18px 40px -20px rgba(140, 28, 6, .6); }
.casa-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.casa-row .tier { font-family: var(--display); font-size: 20px; }
.casa-row .value { font-family: var(--display); font-weight: 800; font-size: 26px; font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .3); margin: 10px 0 8px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: #fff; border-radius: 4px; }
.next { font-size: 14px; font-weight: 700; opacity: .9; font-variant-numeric: tabular-nums; }
.grow-note { margin: 22px auto 0; max-width: 34em; color: var(--dim); }
.scene-grow:not([data-ready]) .casa-stage img[data-k="0"] { opacity: 1; transform: none; }

/* sheet: the parts arrive one by one, then Sign is pressed */
.sheet { width: min(380px, 100%); margin-inline: auto; background: var(--surface); border-radius: 28px; padding: 22px; box-shadow: 0 40px 80px -30px rgba(58, 74, 99, 0.55); }
.sheet .site { display: flex; align-items: center; gap: 12px; }
.sheet .favicon { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, #2f80ed, #163e73); color: #fff; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 20px; }
.sheet .site b { display: block; font-size: 16px; }
.sheet .site span { font-size: 13.5px; color: var(--dim); }
.sheet h4 { font-family: var(--display); font-size: 25px; line-height: 1.1; margin: 18px 0 12px; }
.signer { display: flex; align-items: center; gap: 12px; border-radius: 18px; padding: 12px; background: #FDE8CE; }
.signer img { width: 58px; height: 58px; border-radius: 16px; background: var(--orange); }
.signer b { font-family: var(--display); font-size: 18px; display: block; line-height: 1.15; }
.signer span { font-size: 13px; color: var(--dim); }
.sheet .what { margin: 14px 0 18px; padding: 12px 14px; border-radius: 14px; background: var(--canvas); font-size: 14px; }
.sheet .what b { display: block; }
.sheet .actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.sheet .actions span { text-align: center; padding: 12px; border-radius: 999px; font-weight: 800; transition: transform .25s, box-shadow .25s, background .25s; }
.sheet .no { background: var(--canvas); }
.sheet .yes { background: var(--orange); color: #fff; }
.js .scene-sheet .sheet { transform: translateY(calc((1 - var(--p, 0)) * 40px)); }
.js .scene-sheet [data-r] { opacity: 0; transform: translateY(18px); transition: opacity .45s ease, transform .55s cubic-bezier(.2,.8,.2,1); }
.js .scene-sheet [data-r].in { opacity: 1; transform: none; }
.js .scene-sheet.signed .yes { background: var(--maroon); transform: scale(.96); box-shadow: 0 0 0 6px rgba(247, 148, 29, .3); }

/* words: the sentence lights up as you scroll */
.words { font-family: var(--display); font-weight: 800; font-size: clamp(38px, 6.4vw, 84px); line-height: 1.05; margin: 0; max-width: 15em; text-wrap: balance; }
.js .words .w { color: #C9C7D6; transition: color .25s; }
.js .words .w.lit { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .js .scene *, .js .scene *::before { transition: none !important; }
  .js .scene-steps .device .phone, .js .scene-sheet .sheet { transform: none !important; }
}

/* ---------- developers ---------- */
.devs { background: var(--navy); color: #E9EDF5; padding-block: clamp(64px, 9vw, 104px); }
.devs .wrap { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 72px); }
.devs h2 { font-family: var(--display); font-weight: 800; font-size: clamp(32px, 4.4vw, 50px); line-height: 1.05; margin: 0 0 16px; color: #fff; }
.devs p { color: #B9C3D6; max-width: 32em; margin: 0 0 14px; }
.devs code { font-size: 0.92em; background: var(--navy-deep); padding: 1px 6px; border-radius: 6px; color: #fff; }
.doclist { list-style: none; margin: 0; padding: 0; border-top: 1px solid #52627C; }
.doclist li { border-bottom: 1px solid #52627C; }
.doclist a { display: block; padding: 16px 4px; text-decoration: none; }
.doclist a b { font-family: var(--display); font-size: 21px; color: #fff; display: block; }
.doclist a span { color: #B9C3D6; font-size: 15px; }
.doclist a:hover b { color: var(--sand); }

/* ---------- footer ---------- */
footer.site { padding-block: 40px 56px; font-size: 14.5px; color: var(--dim); }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; }
footer.site nav { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-left: auto; }
footer.site a { text-decoration: none; font-weight: 700; color: var(--ink); }
footer.site a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- small screens ---------- */
@media (max-width: 820px) {
  .devs .wrap, .cols3, .cols2 { grid-template-columns: 1fr; }
  .stage { grid-template-columns: 1fr; gap: 18px; padding-block: 24px; align-content: center; }
  .js .scene-steps .steps-text h3 { font-size: clamp(26px, 7vw, 36px); margin-bottom: 8px; }
  .js .scene-steps .steps-text p { font-size: 15.5px; margin-bottom: 0; }
  .js .scene-steps .dots { margin-top: 10px; }
  .js .scene-steps .device .phone { width: min(230px, 30svh, 62vw); border-radius: 30px; padding: 7px; }
  .js .scene-steps .screen { border-radius: 24px; inset: 7px; width: calc(100% - 14px); }
  /* the browser scene scrolls like a plain section on phones: text, then the Browse tab */
  .js .scene-sheet { height: auto; }
  .js .scene-sheet .pin { position: static; height: auto; overflow: visible; }
  .js .scene-sheet .steps-text h3 { font-size: clamp(26px, 7vw, 36px); }
  .scene-sheet .browse-visual .sheet { display: none; }
  .scene-sheet .browse-visual { justify-content: center; }
  .scene-sheet .browse-visual .phone { width: min(260px, 66vw); }
  .casa-stage { width: min(300px, 70vw, 38svh); }
  .top nav { gap: 16px; font-size: 15.5px; }
  .hero-copy { padding-top: 28px; }
}
@media (max-width: 520px) {
  .top nav a.hide-sm { display: none; }
  .rung figcaption { padding-bottom: 10px; }
  .rung figcaption span { display: none; }
  footer.site nav { margin-left: 0; }
}

/* ---------- hero: Tookan avatars on the sand ---------- */
.ladder.avatars { grid-template-columns: repeat(8, minmax(0, 1fr)); padding-bottom: clamp(16px, 3vw, 34px); }
.ladder.avatars .rung img { border-radius: 50%; margin: 0; box-shadow: 0 16px 26px -16px rgba(140, 28, 6, .75); }
.ladder.avatars .rung:nth-child(even) { transform: translateY(-16%); }
@media (prefers-reduced-motion: no-preference) {
  .rung:nth-child(7) img { animation-delay: 720ms; }
  .rung:nth-child(8) img { animation-delay: 840ms; }
}

/* ---------- estates, casas and the ID: three cards with art ---------- */
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px clamp(24px, 4vw, 48px); margin-top: 32px; }
.trio article { display: flex; flex-direction: column; gap: 16px; }
.trio .art { height: 176px; display: flex; align-items: flex-end; justify-content: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 16px; overflow: hidden; }
.trio .estate img { height: 118px; width: auto; max-width: 31%; object-fit: contain; }
.trio .casa { flex-direction: column; align-items: center; }
.trio .casa img { height: 112px; width: auto; }
.trio .casa { gap: 8px; justify-content: flex-end; }
.chips { display: flex; gap: 6px; justify-content: center; }
.chips span { font: 800 12.5px var(--body); padding: 3px 10px; border-radius: 999px; }
.chips .btc { background: #FDE7CC; color: #8C4A06; }
.chips .evm { background: #E2E6FA; color: #33408F; }
.trio .idart { align-items: center; }
.idcard { width: min(100%, 268px); background: linear-gradient(135deg, #FFA431, var(--orange-deep)); border-radius: 18px; padding: 14px; display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 2px 12px; align-items: center; color: var(--maroon); box-shadow: 0 18px 32px -20px rgba(140, 28, 6, .8); }
.idcard img { grid-row: span 3; width: 72px; height: 72px; border-radius: 50%; border: 3px solid #fff; }
.idcard small { font: 800 11px var(--body); letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.idcard b { font: 800 21px/1.1 var(--display); overflow: hidden; text-overflow: ellipsis; }
.idcard span { font: 700 13px var(--body); color: #5A1304; }

/* ---------- browser: the Browse tab, the signer sheet over its corner ---------- */
.browse-visual { position: relative; display: flex; justify-content: flex-end; }
.browse-visual .phone { width: min(280px, calc((100svh - 200px) * .46)); }
.browse-visual .sheet { position: absolute; left: 0; bottom: -3%; width: min(264px, 56%); padding: 16px; border-radius: 22px; z-index: 2; }
.browse-visual .sheet h4 { font-size: 21px; margin: 12px 0 8px; }
.browse-visual .sheet .what { margin: 10px 0 14px; font-size: 13px; }

/* ---------- keys: the Tookan at its door ---------- */
.with-art { display: grid; grid-template-columns: minmax(180px, 300px) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.keys-art { width: 100%; height: auto; }
.stack { display: flex; flex-direction: column; gap: 16px; max-width: 34em; }

@media (max-width: 820px) {
  .trio, .with-art { grid-template-columns: 1fr; }
  .keys-art { width: min(240px, 60vw); margin: 0 auto; }
}
@media (max-width: 520px) {
  .ladder.avatars { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .ladder.avatars .rung:nth-child(n+6) { display: none; }
}
