/* Page CSS for the root page (en and vi): only what sits inside a visual.
   Palette logic: the studio is warm paper and green-black ink with Cashew's pine as the one accent;
   each app keeps its own colour inside its own frame (Catch the Cow's straw gold, Cashew's pine). */

:root {
  --cow-straw: #f3dca4;      /* Catch the Cow: the warm band behind its cows */
  --cow-night: #1b130c;      /* its outline and phone body */
  --cw-pine: #1a5a52;        /* Cashew: its icon's ground */
  --cw-pine-deep: #123d37;
  --shot-shadow: 0 1px 2px rgb(27 34 30 / .10), 0 18px 40px -18px rgb(27 34 30 / .38);
}

::selection { background: #cfe3de; color: #13221e; }
html { scrollbar-color: #b9b3a3 transparent; }

/* ---------- Hero: both apps on the sand ground ---------- */
.duo { background: var(--ground-bg, #d9ccb7); isolation: isolate; }
.duo__land {
  position: absolute; z-index: 1; top: 56px; left: 40px; width: min(500px, calc(100% - 80px));
  padding: 10px; border-radius: 34px; background: var(--cow-night); box-shadow: var(--shot-shadow);
}
.duo__land img { display: block; width: 100%; height: auto; aspect-ratio: 2200 / 1012; border-radius: 25px; object-fit: cover; }
.duo__port { position: absolute; z-index: 2; top: 236px; right: 32px; width: 300px; }
.hero .duo .ly-float { z-index: 3; width: 252px; }
@media (max-width: 1279px) and (min-width: 1024px) {
  .duo__land { left: 24px; top: 40px; width: calc(100% - 48px); }
  .duo__port { top: 260px; right: 24px; width: 280px; }
}
@media (max-width: 1023px) {
  .duo__land { left: 32px; top: 32px; width: min(520px, calc(100% - 64px)); }
  .duo__port { top: 120px; right: 32px; width: 260px; }
}
@media (max-width: 639px) {
  .duo__land { left: 16px; top: 16px; width: calc(100% - 32px); padding: 6px; border-radius: 22px; }
  .duo__land img { border-radius: 17px; }
  .duo__port { display: none; }
  .hero .duo .ly-float { display: none; }
}

/* ---------- Cashew phone (live HTML of the app's screens, its own tokens) ---------- */
.cw {
  --bg: #f5f6f2; --surface: #ffffff; --surface-2: #eceee8; --line: #d9ded3; --ink: #14211c; --muted: #56635c;
  --action: #0a635b; --on-action: #ffffff; --action-soft: #ddefec; --brand: #1a5a52; --on-brand: #fff; --on-brand-muted: #cfe3de;
  --amber: #c9822b; --danger: #a82b2b; --income: #146136; --expense: #9e3724;
  border-radius: 46px; padding: 11px; background: #0f1714;
  box-shadow: 0 0 0 1px rgb(255 255 255 / .06), 0 30px 60px -20px rgb(10 30 25 / .5);
  color: var(--ink); font-family: var(--font-text);
}
.cw .screen { border-radius: 36px; overflow: hidden; background: var(--bg); font-size: 13px; line-height: 1.35; min-height: 600px; }
.cw .status { display: flex; justify-content: space-between; align-items: center; padding: 13px 24px 6px; font-weight: 500; font-size: 14px; }
.cw .island { width: 86px; height: 25px; border-radius: 20px; background: #0f1714; }
.cw .sig { display: flex; gap: 5px; align-items: center; }
.cw .sig i { display: block; width: 16px; height: 9px; border-radius: 2px; background: currentColor; opacity: .85; }
.cw .body { padding: 6px 14px 16px; }
.cw .title { font-weight: 500; font-size: 26px; letter-spacing: -.02em; margin: 8px 2px 12px; }
.cw .card { background: var(--surface); border-radius: 18px; padding: 13px 15px; border: 1px solid var(--line); }
.cw .card + .card, .cw .label + .card { margin-top: 10px; }
.cw .hero-card { background: var(--brand); color: var(--on-brand); border-color: transparent; }
.cw .hero-card .k, .cw .hero-card .d { color: var(--on-brand-muted); font-size: 13px; }
.cw .hero-card .v { font-size: 32px; font-weight: 500; letter-spacing: -.02em; margin: 2px 0; font-variant-numeric: tabular-nums; }
.cw .label { font-weight: 500; font-size: 15px; margin: 16px 2px 0; }
.cw .budget + .budget { margin-top: 12px; }
.cw .row { display: flex; justify-content: space-between; gap: 8px; }
.cw .row span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.cw .bar { height: 7px; border-radius: 4px; background: var(--surface-2); margin-top: 6px; overflow: hidden; }
.cw .bar i { display: block; height: 100%; border-radius: 4px; background: var(--action); }
.cw .bar i.warn { background: var(--amber); }
.cw .bar i.over { background: var(--danger); }
.cw .tx { display: flex; align-items: center; gap: 10px; }
.cw .tx + .tx { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.cw .ic { flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--action-soft); color: var(--action); }
.cw .ic svg { width: 16px; height: 16px; }
.cw .meta { flex: 1; min-width: 0; }
.cw .meta small { display: block; color: var(--muted); font-size: 12px; }
.cw .amt { font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cw .amt.in { color: var(--income); }
.cw .amt.out { color: var(--expense); }
.cw .seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; }
.cw .seg span { text-align: center; padding: 6px 0; border-radius: 9px; font-weight: 500; }
.cw .seg span.on { background: var(--surface); box-shadow: 0 1px 2px rgb(0 0 0 / .12); }
.cw .amount { margin-top: 14px; text-align: center; padding: 20px 0 16px; }
.cw .amount b { display: block; font-size: 42px; font-weight: 500; letter-spacing: -.02em; color: var(--expense); }
.cw .amount small { color: var(--muted); }
.cw .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cw .chips span { padding: 6px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; }
.cw .chips span.on { background: var(--action); color: var(--on-action); border-color: transparent; }
.cw .save { margin-top: 16px; text-align: center; padding: 12px; border-radius: 14px; background: var(--action); color: var(--on-action); font-weight: 500; }

/* ---------- Catch the Cow frame: its screens on its own straw ground ---------- */
.cow-frame { background: var(--cow-straw); padding: 0; border-color: transparent; }
.frame > .cow-shots {
  position: absolute; inset: 0; padding: 32px; display: grid; gap: 16px;
  grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; align-content: start;
}
.cow-shots .shot { margin: 0; border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shot-shadow); background: var(--cow-night); }
.cow-shots .shot--main { grid-column: 1 / -1; }
.cow-shots img { display: block; width: 100%; height: auto; }
@media (max-width: 639px) { .frame > .cow-shots { padding: 16px; gap: 10px; } }

/* ---------- Cashew frame on the dark band ---------- */
.cw-frame { background: var(--cw-pine-deep); padding: 0; border-color: transparent; --ratio: 0px; height: 548px; }
.frame.cw-frame > .cw-pair { position: absolute; inset: 48px 0 auto; display: flex; justify-content: center; gap: 40px; }
.cw-frame .cw { width: 300px; flex: none; }
@media (max-width: 1279px) { .hero .duo .ly-float, .duo__scan { display: none; } }
.cw-frame::after { content: ""; position: absolute; inset: auto 0 0; height: 96px; z-index: 2; background: linear-gradient(to bottom, rgb(18 61 55 / 0), var(--cw-pine-deep)); }
@media (max-width: 1023px) { .cw-frame { height: 480px; } }
@media (max-width: 639px) { .frame.cw-frame > .cw-pair { inset: 24px 0 auto; } .cw-frame .cw { width: 290px; } }

.cw-points { display: grid; gap: var(--s-5); align-content: start; }
.cw-points li { display: grid; gap: var(--s-1); padding-bottom: var(--s-5); border-bottom: 1px solid var(--line); }
.cw-points li:last-child { border-bottom: 0; padding-bottom: 0; }
.cw-points strong { font-weight: 500; font-size: var(--t-card); }

/* ---------- Comparison table ---------- */
.cmp { display: grid; }
.cmp__row { min-height: 56px; align-items: center; border-bottom: 1px solid var(--line); padding-block: var(--s-3); }
.cmp__row > [role="rowheader"] { color: var(--muted); }
.cmp__head { align-items: end; padding-block: 0 var(--s-4); border-bottom: 0; }
.cmp__app { display: grid; grid-template-columns: 48px 1fr; gap: var(--s-1) var(--s-4); align-items: center; }
.cmp__app img { grid-row: span 2; width: 48px; height: 48px; border-radius: 11px; box-shadow: 0 0 0 1px var(--line); }
.cmp__app strong { font-weight: 500; font-size: var(--t-card); }
.cmp__links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); }
@media (max-width: 639px) {
  .cmp__row > [role="rowheader"] { grid-column: 1 / -1; font-size: var(--t-small); }
  .cmp__row > [role="cell"], .cmp__row > [role="columnheader"] { grid-column: auto; }
  .cmp__head > [role="columnheader"]:first-child { display: none; }
  .cmp__app { grid-template-columns: 1fr; }
  .cmp__app img { grid-row: auto; width: 40px; height: 40px; }
}

/* ---------- Headlines: Plex at a slightly narrow width (its wdth axis) ---------- */
h1, h2, .btn--xl { font-stretch: 92%; }

/* ---------- Tablet and phone screens ---------- */
@media (min-width: 640px) and (max-width: 1023px) {
  .cw-frame { height: 400px; }
  .frame.cow-frame { --ratio: 52%; }
  .cow-shots .shot:not(.shot--main) { display: none; }
  .duo__land { width: calc(100% - 64px - 272px); }
  .cmp__row { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .cmp__row > * { grid-column: span 3 !important; }
}
@media (max-width: 639px) {
  .cw-frame { height: 300px; }
  .cw-points { gap: var(--s-3); }
  .cw-points li { padding-bottom: var(--s-3); }
  #cashew .section-head { margin-bottom: var(--s-5); }
  #details .section-head p { display: none; }
  .cmp__row { min-height: 0; padding-block: var(--s-2); grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--s-3); }
  .cmp__row > [role="cell"] { font-size: var(--t-small); }
  .cmp__head { align-items: start; }
  .cmp__app .link { display: none; }
  .frame.cow-frame { --ratio: 96%; }
  .frame > .cow-shots { grid-template-columns: 1fr; }
  .cow-shots .shot:not(.shot--main) { display: block; }
  .cow-shots .shot:last-child { display: none; }
  .cmp__row.cmp--wide { display: none; }
}
@media (min-width: 1024px) and (max-width: 1279px) { .frame.cow-frame { --ratio: 112%; } .frame > .cow-shots { grid-template-columns: 1fr; } }

/* ---------- Paperlane: its library screen in the hero, its screens in its own section ---------- */
.duo__scan { position: absolute; z-index: 2; left: 40px; top: 316px; width: 170px; border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shot-shadow); }
.duo__scan img { display: block; width: 100%; height: auto; }
.sl-shot { --ratio: 100%; background: #1a2233; }
.sl-shot .frame__img { object-position: 50% 0; }
@media (min-width: 640px) and (max-width: 1023px) {
  .sl-shots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sl-shots > * { grid-column: auto !important; }
  .sl-shot { --ratio: 200%; }
}
@media (max-width: 639px) {
  .sl-shots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sl-shots > * { grid-column: auto !important; }
  .sl-shot { --ratio: 160%; }
  .sl-shot:last-child { display: none; }
}
@media (min-width: 1024px) and (max-width: 1279px) { .cmp__row.cmp--wide { display: none; } .cmp__row { padding-block: var(--s-2); } }
@media (min-width: 640px) and (max-width: 1023px) { .cmp__row.cmp--acct { display: none; } }
@media (min-width: 1280px) { .frame.cow-frame { --ratio: 90%; } .frame > .cow-shots { align-content: center; } }
@media (max-width: 639px) { .sl-shot { --ratio: 190%; } }
@media (min-width: 640px) and (max-width: 1023px) { .cmp__head { align-items: start; } }

/* ---------- Short desktop windows: a section grows past its screen rather than squeeze or overlap ---------- */
@media (min-width: 1024px) {
  main > :is(section, .section):not(.hero), footer.closing {
    height: auto; min-height: calc(var(--h, 1) * 100vh); min-height: calc(var(--h, 1) * 100svh);
    display: flex; flex-direction: column;
  }
  main > :is(section, .section):not(.hero) > .wrap, footer.closing > .wrap { flex: 1 0 auto; height: auto; }
  footer.closing > .wrap { grid-template-rows: minmax(min-content, 1fr) auto; }
}
.closing__cta > .btn { flex: none; }
