/* Product page. Institutional grammar of the DRABDA system: titles in Montserrat 900, text 400, black on white
   with #F5F5F5 sections. One accent per surface: the post-it yellow carries the product, cyan marks the best
   quadrant of the matrix. The one bold element is the table in the opening; everything else stays quiet. */
.landing { --wrap: 1240px; background: var(--white); }
.landing h2 { font-size: clamp(30px, 3.6vw, 48px); font-weight: 900; letter-spacing: -0.035em; line-height: 1.04; max-width: 20ch; }
.landing h3 { font-size: var(--t-md); font-weight: 700; letter-spacing: -0.01em; }
.band-inner { max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }
.band { padding: 104px 0; scroll-margin-top: 72px; }
.band-lede { margin-top: 18px; font-size: var(--t-md); line-height: 1.45; color: var(--ink-soft); max-width: 52ch; }
.btn-large { min-height: 52px; padding: 13px 24px; font-size: var(--t-base); }

/* ---------- Bar ---------- */
.site-bar { position: sticky; top: 0; z-index: 50; background: rgb(255 255 255 / 0.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.site-bar-inner { max-width: var(--wrap); margin: 0 auto; padding: 0 32px; min-height: 72px; display: flex; align-items: center; gap: 32px; }
/* Sections of the page: black like the sidebar of the app, each with its Lucide icon. The section in view stays
   marked (landing.js sets aria-current), the same grey as hover so the bar never shows two kinds of emphasis. */
.site-nav { display: flex; gap: 4px; margin-right: auto; }
.site-nav a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 12px; border-radius: var(--radius-btn);
  font-size: var(--t-sm); font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .15s;
}
.site-nav a:hover, .site-nav a[aria-current='true'] { background: var(--table); }
.site-nav a:focus-visible { outline: 3px solid var(--ink); outline-offset: 1px; }
.site-nav svg { width: 18px; height: 18px; flex: none; }
.site-actions { display: flex; gap: 8px; align-items: center; }
.site-actions .btn { min-height: 40px; }

/* ---------- Opening ---------- */
.hero {
  max-width: var(--wrap); margin: 0 auto; padding: 72px 32px 112px;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; align-items: center;
}
.hero h1 { font-size: clamp(44px, 4.9vw, 74px); font-weight: 900; letter-spacing: -0.04em; line-height: 0.98; max-width: 10ch; hyphens: manual; }
.hero-lede { margin-top: 28px; font-size: 19px; line-height: 1.55; color: var(--ink-soft); max-width: 44ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero-audience { margin-top: 28px; font-size: var(--t-sm); color: var(--ink-soft); max-width: 44ch; }

.demo { margin: 0; display: grid; gap: 14px; min-width: 0; }
.demo-tabs { display: inline-flex; justify-self: start; gap: 2px; padding: 4px; border-radius: var(--radius-btn); background: var(--table); max-width: 100%; overflow-x: auto; }
.demo-tabs button {
  border: 0; border-radius: 6px; padding: 8px 14px; background: none; color: var(--ink-soft);
  font-weight: 600; font-size: var(--t-sm); white-space: nowrap; cursor: pointer; transition: background-color .15s, color .15s, transform 120ms var(--ease-out);
}
.demo-tabs button:active { transform: scale(0.97); }
.demo-tabs button:hover { color: var(--ink); }
.demo-tabs button[aria-selected='true'] { background: var(--ink); color: var(--white); }

.demo-table {
  position: relative; aspect-ratio: 5 / 4; container-type: size; overflow: hidden; border-radius: var(--radius-box);
  background-color: var(--table); background-image: radial-gradient(#d4d4d4 1px, transparent 1px); background-size: 18px 18px;
}
.demo-frame > div { position: absolute; inset: 0; opacity: 0; transition: opacity 320ms var(--ease-out); }
.demo-table[data-layout='sort'] .frame-sort,
.demo-table[data-layout='moscow'] .frame-moscow,
.demo-table[data-layout='matrix'] .frame-matrix { opacity: 1; }
.frame-group, .frame-band {
  position: absolute; border: 1.5px dashed var(--rule-strong); border-radius: var(--radius-btn); background: rgb(255 255 255 / 0.7);
  font-weight: 600; font-size: clamp(10px, 1.7cqw, 14px); line-height: 1.2; color: var(--ink);
}
.frame-group { left: calc(var(--x) * 1%); width: calc(var(--w) * 1%); top: 4%; height: 92%; padding: 2.4cqh 1.6cqw; }
.frame-band { left: 3%; right: 3%; top: calc(var(--y) * 1%); height: 22%; display: flex; align-items: center; padding: 0 76% 0 2.4cqw; }
.frame-matrix::before { content: ''; position: absolute; left: 4%; top: 4%; width: 46%; height: 46%; background: var(--accent-wash); border-radius: var(--radius-btn) 0 0 0; }
.frame-axis { position: absolute; background: var(--ink-soft); }
.frame-axis.is-x { left: 4%; right: 4%; top: 50%; height: 2px; margin-top: -1px; }
.frame-axis.is-y { top: 4%; bottom: 4%; left: 50%; width: 2px; margin-left: -1px; }
.frame-label { position: absolute; font-weight: 600; font-size: clamp(10px, 1.6cqw, 13px); color: var(--ink-soft); }
.frame-label.is-y { left: calc(50% + 10px); top: 4%; }
.frame-label.is-x { right: 4%; top: calc(50% + 8px); }

.demo-notes { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; }
.demo-note {
  position: absolute; left: 0; top: 0; width: 22cqw; padding: 1.8cqh 1.4cqw 1.6cqh;
  font-size: clamp(11px, 2.1cqw, 16px); line-height: 1.25;
  background: var(--paper); border-bottom: 1px solid var(--paper-edge);
  border-radius: 2px 2px 3px 14px / 2px 2px 3px 6px;
  box-shadow: 0 1px 1px rgb(60 45 0 / 0.12), 2px 6px 10px -6px rgb(60 45 0 / 0.45);
  transform: translate(calc(var(--x) * 1cqw - 50%), calc(var(--y) * 1cqh - 50%)) rotate(var(--r));
  transition: transform 560ms var(--ease-in-out) var(--delay, 0ms);
}
/* Opening, seen once per visit. The title leads with the longest rise; text and buttons follow with
   shrinking gaps and shorter rises; the audience line and the activity switch only fade. The post-its spread
   from their pile at 120ms, while the title is still moving (public/landing.js), so it reads as one wave. */
@keyframes hero-rise { from { opacity: 0; translate: 0 var(--rise); } }
@keyframes hero-fade { from { opacity: 0; } }
.hero h1 { animation: hero-rise 600ms var(--ease-out) both; --rise: 16px; }
.hero-lede { animation: hero-rise 560ms var(--ease-out) 90ms both; --rise: 10px; }
.hero .hero-actions { animation: hero-rise 520ms var(--ease-out) 160ms both; --rise: 8px; }
.hero-audience { animation: hero-fade 480ms var(--ease-out) 220ms both; }
.demo-tabs { animation: hero-fade 480ms var(--ease-out) 160ms both; }

/* First view: a pile in the middle of the table, spread out once on load (public/landing.js). */
.demo-table.is-piled .demo-note { transform: translate(calc(50cqw - 50%), calc(50cqh - 50%)) rotate(var(--r)); }
.demo-caption { font-size: var(--t-sm); line-height: 1.5; color: var(--ink-soft); max-width: 62ch; min-height: 4.5em; }

/* ---------- Steps: a real sequence, numbered on post-its ---------- */
.steps { background: var(--table); }
.steps-list { list-style: none; margin: 56px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px; counter-reset: step; position: relative; }
.steps-list::before { content: ''; position: absolute; left: 0; right: 0; top: 24px; height: 2px; background: var(--ink); }
.steps-list li { counter-increment: step; position: relative; display: grid; gap: 10px; align-content: start; }
.steps-list li::before {
  content: counter(step); display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 14px;
  background: var(--paper); border-bottom: 1px solid var(--paper-edge); border-radius: 2px 2px 3px 12px / 2px 2px 3px 5px;
  box-shadow: 0 1px 1px rgb(60 45 0 / 0.12), 2px 6px 10px -6px rgb(60 45 0 / 0.45);
  font-weight: 900; font-size: 22px; transform: rotate(-2deg);
}
.steps-list li:nth-child(even)::before { transform: rotate(1.5deg); }
.steps-list p { color: var(--ink-soft); }

/* ---------- Activities: typographic rows with the app's own scenes ---------- */
.activity-rows { list-style: none; margin: 56px 0 0; padding: 0; border-top: 2px solid var(--ink); }
.activity-row { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 48px; align-items: center; padding: 36px 0; border-bottom: 1px solid var(--rule); }
.activity-row > div { display: grid; gap: 10px; max-width: 60ch; }
.activity-row p { color: var(--ink-soft); }
.activity-row .activity-result { color: var(--ink); font-size: var(--t-sm); padding-left: 14px; border-left: 3px solid var(--paper); }
.activity-visual { display: block; }
.activity-row:hover .scene-note.is-moving { transform: rotate(var(--r)) scale(1); box-shadow: 0 1px 1px rgb(60 45 0 / .14), 1px 3px 5px -3px rgb(60 45 0 / .45); }

/* ---------- Brand: the product's yellow, the consultancy's colours on the phones ---------- */
.brand-band { background: var(--paper); }
.brand-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: center; }
.brand-copy { display: grid; gap: 18px; }
.brand-copy p { font-size: var(--t-md); line-height: 1.45; max-width: 44ch; }
.phones { display: flex; justify-content: center; gap: 28px; }
.phone {
  width: 220px; aspect-ratio: 9 / 18; border: 8px solid var(--ink); border-radius: 30px; background: var(--white);
  overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 30px 50px -30px rgb(60 45 0 / 0.6);
}
.phone.is-second { margin-top: 64px; }
.phone-bar { padding: 22px 14px 10px; border-bottom: 1px solid var(--rule); }
.phone-logo { font-weight: 700; font-size: 13px; color: var(--b-action); letter-spacing: -0.01em; }
.phone-body { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.phone-title { font-weight: 700; font-size: 14px; line-height: 1.2; }
.phone-notes { flex: 1; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; padding: 12px 8px; border-radius: 6px; background: var(--table); }
.phone-notes span { width: calc(50% - 4px); height: 38px; background: var(--paper); border-bottom: 1px solid var(--paper-edge); border-radius: 1px 1px 2px 8px / 1px 1px 2px 4px; }
.phone-notes span:nth-child(2) { transform: rotate(2deg); }
.phone-send { display: grid; place-items: center; height: 34px; border-radius: 6px; background: var(--b-action); color: var(--b-ink); font-weight: 600; font-size: 13px; }

/* ---------- Structure: account, client, project, studies ---------- */
.structure-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; align-items: start; }
.tree, .tree ol { list-style: none; margin: 0; padding: 0; }
.tree ol { margin: 6px 0 0 15px; padding-left: 26px; border-left: 1px solid var(--rule-strong); display: grid; gap: 6px; }
.tree li { display: grid; gap: 6px; }
.tree-node { display: flex; align-items: center; gap: 14px; padding: 10px 0; }
.tree-node > span:last-child { display: grid; gap: 2px; }
.tree-node strong { font-weight: 700; }
.tree-role { font-size: var(--t-sm); color: var(--ink-soft); }
.tree-node.is-leaf { padding-left: 4px; }
.tree-node.is-leaf strong { font-weight: 600; }
.tree-tile { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 8px; font-weight: 700; font-size: 12px; }
.tree-tile.is-account { background: var(--ink); color: var(--white); }
.tree-tile.is-client { background: #56ccf2; }
.tree-tile.is-client-2 { background: var(--rule); }
.tree-tile.is-project { background: var(--paper); width: 24px; height: 24px; border-radius: 6px; }

/* ---------- Data and access ---------- */
.data { background: var(--table); }
.facts { margin: 56px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 40px; }
.facts div { padding-top: 18px; border-top: 2px solid var(--ink); display: grid; gap: 8px; align-content: start; }
.facts dt { font-weight: 700; font-size: var(--t-base); }
.facts dd { margin: 0; color: var(--ink-soft); font-size: var(--t-sm); line-height: 1.55; }

/* ---------- Closing ---------- */
.closing { background: var(--ink); color: var(--white); padding: 112px 0; }
.closing-inner { display: grid; gap: 18px; }
.closing h2 { max-width: 18ch; }
.closing p { font-size: var(--t-md); color: rgb(255 255 255 / 0.72); }
.closing :focus-visible { outline-color: var(--white); }
.btn-inverse { background: var(--white); border-color: var(--white); color: var(--ink); }
.btn-inverse:hover { background: rgb(255 255 255 / 0.85); border-color: transparent; color: var(--ink); }
.btn-inverse-ghost { background: transparent; border-color: rgb(255 255 255 / 0.5); color: var(--white); }
.btn-inverse-ghost:hover { background: rgb(255 255 255 / 0.1); border-color: var(--white); color: var(--white); }

/* ---------- Footer: DRABDA signs as the maker, after the product ---------- */
.site-foot { border-top: 1px solid var(--rule); padding: 32px 0; }
.site-foot-inner { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; font-size: var(--t-sm); }
.site-foot .mark { width: 22px; height: 22px; }
.site-foot .wordmark { font-size: 16px; }
.maker { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; color: var(--ink-soft); }
.drabda-logo { display: inline-flex; color: var(--ink); }
.drabda-logo .logo { width: 66px; height: 14px; }
.site-foot a:not(.brand) { color: var(--ink-soft); cursor: pointer; }

/* Medium widths: the icons alone keep the sections reachable; the name stays in the tooltip and for screen readers. */
@media (max-width: 1180px) {
  .site-bar-inner { gap: 20px; }
  .site-nav a { padding-inline: 10px; }
  .site-nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 1080px) {
  .site-actions { margin-left: auto; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 48px; padding-top: 48px; }
  .hero h1 { max-width: 12ch; }
  .steps-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps-list::before { display: none; }
  .brand-layout, .structure-layout { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .site-nav { display: none; }
  .band { padding: 72px 0; }
  .band-inner, .site-bar-inner, .hero { padding-inline: 16px; }
  .site-bar-inner { gap: 12px; min-height: 64px; }
  .site-actions .btn-ghost { display: none; }
  .site-actions .btn { padding-inline: 12px; font-size: 14px; }
  .site-bar .wordmark { font-size: 16px; }
  .site-bar .mark { width: 22px; height: 22px; }
  .hero { padding-bottom: 72px; }
  .hero-lede { font-size: var(--t-base); }
  .demo-table { aspect-ratio: 1; }
  .demo-note { width: 22cqw; font-size: clamp(9.5px, 2.9cqw, 13px); padding: 1.2cqh 1.4cqw; }
  .frame-group, .frame-band { font-size: clamp(9.5px, 2.7cqw, 12px); }
  .steps-list, .facts { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .activity-row { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .phones { gap: 14px; }
  .phone { width: 46%; border-width: 6px; border-radius: 22px; }
  .phone.is-second { margin-top: 40px; }
  .maker { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .demo-note, .demo-frame > div, .demo-tabs button { transition: none; }
  /* The opening collapses: everything fades in together, nothing rises. */
  .hero h1, .hero-lede, .hero .hero-actions, .hero-audience, .demo-tabs { animation: hero-fade 300ms var(--ease-out) both; }
}
