/* Konas overrides on top of tasteskill's kit. The rules live in ../DESIGN.md.
   Four font sizes, ever: A h1, B h2, C lead and titles, D everything else. */
@font-face { font-family: "Albert Sans"; src: url("/assets/fonts/albert-sans-latin.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }

:root, :root[data-type="service"] {
  --p-bg: #f4f2e9; --p-surface: #e6efe2; --p-ink: #132d39; --p-muted: #50636a;
  --p-accent: #006f65; --p-accent-ink: #fffef8; --p-action: #006f65; --p-action-ink: #fffef8;
  --p-inv-bg: #132d39; --p-inv-surface: #1c3a47; --p-inv-ink: #f4f2e9; --p-inv-muted: #b8c8bf;
  --p-inv-accent: #d9e8d6; --p-inv-accent-ink: #132d39; --p-inv-action: #d9e8d6; --p-inv-action-ink: #132d39;
  --font-display: "Albert Sans", system-ui, sans-serif;
  --font-text: "Albert Sans", system-ui, sans-serif;
  --display-weight: 500; --display-tracking: -0.025em; --display-tracking-xl: -0.035em;

  --size-a: clamp(40px, 2.286vw + 31.09px, 64px);
  --size-b: clamp(28px, .762vw + 25.03px, 36px);
  --size-c: clamp(20px, .19vw + 19.26px, 22px);
  --size-d: 16px;

  --t-h1: var(--size-a); --t-h2: var(--size-b); --t-stat: var(--size-b);
  --t-h3: var(--size-c); --t-lead: var(--size-c); --t-card: var(--size-c);
  --t-body: var(--size-d); --t-small: var(--size-d); --t-label: var(--size-d);
  --ly-h1: var(--size-a); --ly-lead: var(--size-c);
  --paper-white: #fffef8; --line-soft: #c9d6cd; --band: #00574f;
}
@media (min-width: 1024px) { :root { --t-lead: var(--size-c); --t-card: var(--size-c); --t-h3: var(--size-c); } }

/* The kit hardcodes a few sizes. Pull every one back to the scale. */
.nav__link, .nav__logo, .btn, .link, label, input, textarea, button, th, td, small, .t-label, .t-small, .dg, .dg * { font-size: var(--size-d); }
header.nav .btn, header.nav .nav__link, .nav__actions .btn, .actionbar .btn { font-size: var(--size-d); }
header.nav.is-open .nav__link { font-size: var(--size-c); }
header.nav.is-open .nav__actions .btn { font-size: var(--size-d); }
.nav__logo { font-weight: 500; gap: 8px; color: var(--ink); }
.k-mark { flex: none; color: var(--ink); }
h3 { font-size: var(--size-c); font-weight: 500; letter-spacing: -0.01em; margin: 0; }
h2 { font-size: var(--size-b); }
.lead { font-size: var(--size-c); line-height: 1.45; margin: var(--s-5) 0 0; max-width: 34em; }
p { margin: var(--s-4) 0 0; }
.note { color: var(--muted); }
.hero__lead { font-size: var(--size-c); }

/* Sections never spill: on a short screen they grow instead of overlapping the next. */
@media (min-width: 640px) {
  main > :is(section, .section):not(.hero, .section--hero), footer.closing { height: auto; min-height: calc(var(--h, 1) * 100svh); }
  .hero.hero--split { height: auto; min-height: 100svh; }
  .hero--split .hero__media.hero__frame { overflow: visible; }
}
@media (max-width: 1023px) {
  header.nav:not(.is-open) .nav__actions { order: 1; margin-left: auto; }
  header.nav .nav__toggle { order: 2; margin-left: var(--s-3); }
  header.nav.is-open .nav__toggle { margin-left: auto; }
}
/* Sections share grounds so each screen hands off without a seam. */
.band { background: var(--surface); }
.split-top { align-items: start; }

/* Documents: the product, at true reading size. */
.doc { display: block; background: var(--paper-white); border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: var(--s-6); font-size: var(--size-d); line-height: 1.5; }
.doc > p:first-of-type { margin-top: var(--s-4); }
.doc__head { display: flex; justify-content: space-between; gap: var(--s-4); align-items: baseline; padding-bottom: var(--s-4); border-bottom: 1px solid var(--line-soft); }
.doc__head span { color: var(--muted); white-space: nowrap; }
.doc__head strong { font-weight: 500; }
.doc__title { font-size: var(--size-c); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--gut); top: 8px; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); z-index: 20; }
.skip:focus { width: auto; height: auto; clip-path: none; padding: var(--s-2) var(--s-4); background: var(--paper-white); }
main:focus { outline: none; }
.doc__label { color: var(--muted); }
.doc__foot { margin: var(--s-5) 0 0; padding-top: var(--s-4); border-top: 1px solid var(--line-soft); color: var(--muted); }
.list { list-style: none; margin: 0; padding: 0; counter-reset: l; }
.list li { counter-increment: l; display: grid; grid-template-columns: 32px 1fr; padding: var(--s-4) 0; border-bottom: 1px solid var(--line-soft); }
.list li:last-child { border-bottom: 0; padding-bottom: 0; }
.list li::before { content: counter(l); grid-row: 1 / 3; color: var(--accent); font-weight: 500; font-size: var(--size-c); line-height: 1.2; }
.list strong { font-size: var(--size-c); font-weight: 500; line-height: 1.3; }
.list span { color: var(--ink); }
.kv { margin: var(--s-4) 0 0; display: grid; gap: var(--s-3); }
.kv div { display: grid; grid-template-columns: 124px 1fr; gap: var(--s-4); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.slots { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-2); padding: 0; margin: var(--s-3) 0 0; }
.slots li { border: 1px solid var(--line-soft); border-radius: var(--r-sm); padding: var(--s-1) var(--s-3); }
.step { margin-bottom: var(--s-4); }
.cycle > div { display: flex; flex-direction: column; }
.cycle .doc { flex: 1; }
.cycle { margin-top: var(--s-5); row-gap: var(--s-4); }
.cycle .doc { padding: var(--s-4) var(--s-6); }
.cycle .doc__head { padding-bottom: var(--s-3); }
.cycle .kv { margin-top: var(--s-3); gap: var(--s-2); }
.cycle .doc > p:first-of-type { margin-top: var(--s-3); }
.cycle .doc__label { margin-top: var(--s-2); }
.cycle .step { margin-bottom: var(--s-3); }
.g2__row + .g2__row .cycle { margin-top: var(--s-5); }


#controls .checks { margin-top: var(--s-6); gap: var(--s-4); }
del { color: var(--ink); text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.status { color: var(--accent) !important; font-weight: 500; }
.reviewnote { margin-top: var(--s-5); padding: var(--s-4) var(--s-5); background: #e6efe2; border-radius: var(--r-sm); }
.reviewnote p:first-child { margin: 0; }
.reviewnote .doc__label { margin-top: var(--s-2); }

.hero__frame { background: var(--accent); padding: var(--s-6); display: flex; align-items: center; justify-content: center; border-radius: var(--r-md); }
.hero__frame .doc { width: 100%; border: 0; padding: var(--s-6) var(--s-7); }
.tight { margin-top: var(--s-1); }

#review .doc { padding: var(--s-7); }

/* Sectors: three equal columns, no icons. */
.sectors { margin-top: var(--s-7); }
.sector { background: var(--paper-white); border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: var(--s-7) var(--s-6); display: flex; flex-direction: column; min-height: 320px; }
.sector p { margin: var(--s-3) 0 0; }
.sector .sector__label { margin-top: auto; padding-top: var(--s-5); color: var(--muted); }
.sector ul { list-style: none; padding: var(--s-3) 0 0; margin: 0; display: grid; gap: var(--s-2); }

/* Operating model: a responsibility matrix, full width. */
.matrix-wrap { margin-top: var(--s-6); padding: var(--s-3) var(--s-6); }
.matrix { width: 100%; border-collapse: separate; border-spacing: 0; }
.matrix thead th { color: var(--muted); font-weight: 400; padding: var(--s-3) 0; border-bottom: 1px solid var(--line-soft); text-align: center; width: 15%; }
.matrix thead th:first-child { text-align: left; width: auto; }
.matrix tbody th { text-align: left; font-weight: 400; padding: var(--s-4) 0; }
.matrix td { text-align: center; }
.matrix tbody tr:not(:last-child) > * { border-bottom: 1px solid var(--line-soft); }
.matrix tr[data-owner="ai"] td[data-col="ai"]::before,
.matrix tr[data-owner="konas"] td[data-col="konas"]::before,
.matrix tr[data-owner="you"] td[data-col="you"]::before { content: ""; display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); }
.matrix tr[data-owner="ai"] td[data-col="ai"]::before { background: var(--muted); }

/* The one brand band. */
.brand { background: var(--band); color: var(--paper-white); --ink: var(--paper-white); }
.brand h2, .brand .lead { color: var(--paper-white); }
.brand .sync { color: #132d39; border: 0; }
.brand .sync strong { color: inherit; }
.brand .sync__box--k { color: var(--paper-white); }

/* Still CRM diagram, at reading size. */
.sync { display: grid; grid-template-columns: 1fr 200px 1fr; grid-template-rows: auto 1fr; align-items: stretch; gap: var(--s-6) var(--s-4); background: var(--paper-white); border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: var(--s-6); min-height: 480px; }
.sync__frame { grid-column: 1 / -1; margin: 0; color: var(--muted); padding-bottom: var(--s-3); border-bottom: 1px solid var(--line-soft); align-self: start; }
.sync__box { display: grid; align-content: start; gap: var(--s-2); padding: var(--s-5); border: 1px solid var(--line-soft); border-radius: var(--r-sm); }
.sync__box strong { font-size: var(--size-c); font-weight: 500; margin-bottom: var(--s-2); }
.sync__box--k { background: var(--accent); border-color: var(--accent); color: var(--paper-white); }
.sync__link { align-self: center; display: grid; gap: var(--s-2); text-align: center; color: var(--muted); }
.sync__link i { display: block; height: 2px; background: var(--accent); position: relative; }
.sync__link i::after { content: ""; position: absolute; right: 0; top: -4px; border-left: 8px solid var(--accent); border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.sync__link i.back::after { right: auto; left: 0; border-left: 0; border-right: 8px solid var(--accent); }

.steps { list-style: none; padding: 0; margin: var(--s-6) 0 0; display: grid; gap: var(--s-4); }
.steps h3 { margin: 0; }
.steps p { margin: var(--s-1) 0 0; }

/* The close and the form. */
.closing { background: var(--bg); }
.form { display: block; }
:is(a, input, textarea, button) { scroll-margin-block: calc(var(--nav) + var(--s-7)) calc(var(--bar, 0px) + var(--s-6)); }
.field { display: grid; gap: var(--s-2); align-content: start; }
.field__error { margin: 0; color: #9c2f1c; }
.form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.form__wide { grid-column: 1 / -1; }
.form textarea { padding: var(--s-3) var(--s-4); border: 1px solid var(--muted); border-radius: var(--r-sm); background: var(--paper-white); color: var(--ink); font: inherit; resize: vertical; }
.form input { height: 48px; padding: 0 var(--s-4); border: 1px solid var(--muted); border-radius: var(--r-sm); background: var(--paper-white); color: var(--ink); font-family: inherit; }
.form input[aria-invalid="true"] { border-color: #9c2f1c; }
.form .btn { margin-top: var(--s-5); }
.form__lead { margin: 0 0 var(--s-5); }
.form__status { min-height: 1.5em; margin-top: var(--s-3); color: var(--accent); }
.form__status[data-tone="error"] { color: #9c2f1c; }
.form__status:focus { outline: none; }
.hp { position: absolute; left: -9999px; height: 1px; overflow: hidden; }
.turnstile:empty { display: none; }
.turnstile { margin-top: var(--s-4); }
.foot { margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid var(--line-soft); }
.foot__cols { display: grid; grid-template-columns: 1fr auto auto; gap: var(--s-8); }
.closing .foot__cols { grid-template-columns: auto minmax(0,1fr) minmax(0,1fr); gap: var(--s-6); }
.closing .foot__cols div { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); }
.closing .foot__head { width: 100%; }
.foot__cols div { display: grid; gap: var(--s-2); align-content: start; }
.foot__cols a:not(.nav__logo) { color: var(--ink); text-decoration: none; }
.foot__cols a:not(.nav__logo):hover { text-decoration: underline; }
.foot__head { margin: 0; color: var(--muted); }
.footer:not(.closing) .foot { border-top: 0; margin-top: 0; }
.foot__legal { margin: var(--s-4) 0 0; color: var(--muted); }

/* Legal, thanks and 404 pages. */
.page { padding: calc(var(--nav) + var(--s-8)) 0 var(--s-9); }
.page .wrap > * { max-width: 42em; }
.page h1 { font-size: var(--size-b); font-weight: 500; margin: 0; }
.page h2 { font-size: var(--size-c); margin: var(--s-7) 0 0; font-weight: 500; }

@media (max-width: 1023px) {
  .form__grid { grid-template-columns: 1fr; }
  .foot__cols, .closing .foot__cols { grid-template-columns: 1fr 1fr; gap: var(--s-6); }
  .foot__cols > .nav__logo { grid-column: 1 / -1; }
  .hero__frame { padding: var(--s-5); align-items: flex-start; }
}
@media (max-width: 1279px) {
  .sync { grid-template-columns: 1fr; grid-template-rows: none; min-height: 0; }
}
@media (min-width: 1024px) {
  footer.closing > .wrap { row-gap: 0; }
  footer.closing { padding-bottom: var(--s-6); }
}
@media (min-width: 640px) and (max-width: 1023px) {
  .sector { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--s-6); min-height: 0; padding: var(--s-6); }
  .sector h3 { grid-row: 1 / span 2; }
  .sector .sector__label { grid-column: 2; margin-top: 0; padding-top: 0; }
  .sector ul { grid-column: 2; }
}
@media (max-width: 639px) {
  .doc { padding: var(--s-5); }
  .kv div { grid-template-columns: 1fr; gap: 0; }
  .matrix-wrap { padding: var(--s-2) var(--s-4); }
}

@media (max-width: 639px) {
  header.nav .nav__bar .nav__actions:not(.x) { display: none; }
  header.nav .nav__toggle { margin-left: auto; }
  .sector { min-height: 0; }
  .sector .sector__label { padding-top: var(--s-4); }
  .form .btn { width: 100%; }
}

/* Deliberate bend: on phones, documents stay at true reading size, so sections take their
   natural height instead of a fixed screen. See DESIGN.md. */
@media (max-width: 639px) {
  main > :is(section, .section):not(.hero, .section--hero), footer.closing { height: auto; min-height: 0; }
  main > :is(section, .section).g2m > .wrap { display: block; }
  main > :is(section, .section):not(.hero, .section--hero) { padding-top: var(--s-8); padding-bottom: var(--s-8); }
  footer.closing { padding-top: var(--s-8); padding-bottom: calc(var(--s-6) + var(--bar)); }
  .g2__row + .g2__row { margin-top: var(--s-5); }
  .hero__frame .list li:nth-child(n+3), .hero__frame .doc__foot { display: none; }
  .hero__frame .list li:nth-child(2) { border-bottom: 0; padding-bottom: 0; }
  .hero__frame .doc { padding: var(--s-4) var(--s-5); }
  header.nav .nav__actions { display: none; }
  .hero.hero--split { height: auto; min-height: 100svh; }
  .hero--split .hero__media.hero__frame { height: auto; flex: 0 0 auto; overflow: visible; }
  .foot__cols, .closing .foot__cols { grid-template-columns: 1fr; }
  .doc__head { flex-wrap: wrap; gap: var(--s-1) var(--s-4); }
  .doc__head span { white-space: normal; }
  .matrix thead th { width: 20%; }
}
/* Between 640 and 1023 the two-up documents stack. */
@media (min-width: 1024px) {
  .hero--split .hero__media.hero__frame { min-height: calc(100svh - 184px); }
}
@media (min-width: 640px) and (max-width: 1023px) {
  #cycle { --h: 2; }
  .hero.hero--split { height: auto; min-height: 100svh; }
  .hero--split .hero__media.hero__frame { height: auto; flex: 0 0 auto; overflow: visible; }
  .matrix tbody th { padding-block: 26px; }
}
