/* Page CSS: only what sits inside a visual and the kit lacks (tasteskill, system.md).
   Everything else comes from /assets/system.css and the kit's layers. */

:root {
  --p-bg: #ffffff; --p-surface: #f2f2f2; --p-ink: #0a0a0a; --p-muted: #6b6b6b;
  --p-accent: #d92b21; --p-accent-ink: #ffffff; --p-action: #d92b21; --p-action-ink: #ffffff;
  --p-inv-bg: #000000; --p-inv-surface: #010101; --p-inv-ink: #ffffff; --p-inv-muted: #868686;
  --p-inv-accent: #d92b21; --p-inv-accent-ink: #ffffff; --p-inv-action: #d92b21; --p-inv-action-ink: #ffffff;
  --font-display: "Red Hat Display", system-ui, sans-serif;
  --font-text: "Red Hat Text", system-ui, sans-serif;
  --display-weight: 400;
  --display-tracking: -0.025em;
  --display-tracking-xl: -0.035em;
}

/* the hero's window: the agent's chat rises from the panel and is cut by its foot */
.hero__window .stage { inset: 0; }

/* the services list: each name links to its page */
.svc-rows .rows__name { display: inline-flex; align-items: center; gap: var(--s-2); }
.svc-rows .rows__name .m-arrow { width: 12px; height: 12px; }
.svc-rows li p { color: var(--ink); }

/* the systems cards: one panel height for the group */
#systems .panel { --p-h: 340px; }
@media (max-width: 639px) { #systems .panel { --p-h: 240px; } }

/* the menu card's picture */
.menu-panel { --p-h: 160px; }

/* the tools grid: real icons on light tiles, eight across */
.tools-frame { padding: var(--s-7); }
.tools-grid { list-style: none; margin: 0; padding: 0; width: 100%; display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr)); gap: var(--s-6) var(--s-5); }
.tool { display: grid; justify-items: center; align-content: start; gap: var(--s-3); text-align: center; }
.tool__name { font-size: var(--t-label); font-weight: 500; color: var(--ink); }
@media (max-width: 1023px) { .tools-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 639px) {
  .tools-frame { padding: var(--s-5); }
  .tools-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-5) var(--s-3); }
  .tools-grid .ic-tile--72 { --tile: 56px; }
}

/* a service page's hero: the tools that service runs on, in the picture's frame */
.hero__tools { display: grid; place-items: center; padding: var(--s-7); }
.tools-grid--hero { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 420px; gap: var(--s-7) var(--s-6); }
@media (max-width: 639px) { .hero__tools { padding: var(--s-5); } .tools-grid--hero { gap: var(--s-5) var(--s-4); } }

/* the project form: the filled panel beside the facts */
.form-panel { background: var(--g-alt); padding: var(--s-7); border-radius: var(--r-lg); }
.form-panel .form { display: grid; gap: var(--s-5); }
.form-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-5); }
@media (max-width: 639px) { .form-panel { padding: var(--s-5); } .form-pair { grid-template-columns: 1fr; } }

/* the plain facts beside the form: label left, fact right, a rule closing each row */
.facts-list { margin: 0; display: grid; }
.facts-list > div { display: grid; grid-template-columns: 9em 1fr; gap: var(--s-4); padding: var(--s-4) 0; border-bottom: 1px solid var(--line); }
.facts-list dt { color: var(--muted); }
.facts-list dd { margin: 0; }

/* the footer's name, set large on the dark ground */
.footer .footer__name { font-size: clamp(30px, 2.4vw, 48px); }

/* legal pages: one long text column under the fixed header */
.legal-page { padding: calc(var(--nav) + var(--s-9)) 0 var(--s-9); }
.legal-container { max-width: 46rem; }
.legal-back { display: inline-block; margin-bottom: var(--s-7); color: var(--muted); }
.legal-back:hover { color: var(--ink); }
.legal-page .eyebrow { font-size: var(--t-label); font-weight: 500; color: var(--muted); }
.legal-title { margin: var(--s-3) 0 var(--s-4); font: var(--display-weight) var(--t-h2)/1.08 var(--font-display); letter-spacing: var(--display-tracking); }
.legal-date { color: var(--muted); padding-bottom: var(--s-6); margin: 0 0 var(--s-7); border-bottom: 1px solid var(--line); }
.legal-body { font-size: var(--t-body); line-height: 1.7; }
.legal-body p { margin: 0 0 var(--s-4); }
.legal-body h2 { font: 500 var(--t-card)/1.3 var(--font-text); margin: var(--s-7) 0 var(--s-3); }
.legal-body h3 { font: 500 var(--t-body)/1.4 var(--font-text); margin: var(--s-5) 0 var(--s-2); }
.legal-body ul { padding-left: 1.2em; margin: 0 0 var(--s-4); }
.legal-body li { margin-bottom: var(--s-1); }
.legal-body a { text-decoration: underline; text-underline-offset: 3px; }

/* a legal page is a document, not a stack of screens: it grows with its text */
main > section.legal-page { height: auto; min-height: 100svh; padding: calc(var(--nav) + var(--s-9)) 0 var(--s-9); }
main > section.legal-page > .wrap { height: auto; display: block; }

/* --- fixes from the checker --- */
/* the project form's message box: room to write on a desktop, shorter on a tablet and a phone */
#start textarea { min-height: 216px; }
@media (max-width: 1023px) {
  #start textarea { min-height: 120px; }
  .facts-list { grid-template-columns: 1fr 1fr; column-gap: var(--s-5); }
  .facts-list > div { grid-template-columns: 1fr; gap: var(--s-1); }
}
@media (max-width: 639px) { .facts-list { grid-template-columns: 1fr; } }
/* the three cards stack at the tablet: two screens there (layout-v4.md, the tablet) */
@media (min-width: 640px) and (max-width: 1023px) { #systems { --h: 2; } }
/* the close's big button runs across the column below the desktop, so it reads as the close's slab */
@media (max-width: 1023px) { .closing__cta.close--type > .btn--xl { width: 100%; } }
/* the service names are links: 44px to tap on a phone */
@media (max-width: 639px) { .svc-rows .rows__name { min-height: 44px; } }

/* the tools mosaic: six cells across from the desktop, three on a phone without the use line */
.tools-mosaic { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 639px) {
  .tools-mosaic { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tools-mosaic .ic-cell { padding: 16px 12px; gap: 10px; }
  .tools-mosaic .ic-cell__meta { display: none; }
  .tools-mosaic .ic-cell__name { font-size: 14px; }
}
/* a glyph beside each contact fact */
.facts-list dt { display: flex; align-items: center; gap: var(--s-2); }
.fact-ico { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
/* the systems cards at the tablet: taller panels so the two screens hold the three cards without a hole */
@media (min-width: 640px) and (max-width: 799px) { #systems .panel { --p-h: 400px; } }
@media (min-width: 800px) and (max-width: 1023px) { #systems .panel { --p-h: 480px; } }
/* the project form at the tablet: less padding so the section stays one screen */
@media (min-width: 640px) and (max-width: 1023px) { .form-panel { padding: var(--s-6); } }
@media (max-width: 639px) { #start textarea { min-height: 216px; } }
/* the close's big button at the tablet: across the column (the kit's own rule is 50% wide) */
@media (min-width: 640px) and (max-width: 1023px) { .closing__cta.close--type > .btn--xl:not(.btn--wide) { width: 100%; } }

/* Short screens (a laptop at 125% zoom is about 1536x730): a section is at least one screen tall and
   grows with what it holds, so nothing ever runs into the next section. The kit fixes the height to
   exactly one screen, which overlapped on short screens. The hero keeps its one screen. */
main > :is(section, .section):not(.hero), footer.closing {
  height: auto;
  min-height: calc(var(--h, 1) * 100svh);
  display: flex;
  flex-direction: column;
}
main > :is(section, .section):not(.hero) > :is(.wrap, .container), footer.closing > .wrap {
  height: auto;
  flex: 1 0 auto;
}
/* a frame that fills the rest of its column keeps a real size when the section grows */
main > :is(section, .section) .frame--fill { min-height: 420px; }
@media (max-width: 1023px) { main > :is(section, .section) .frame--fill { min-height: 320px; } }
/* a .fill block takes the rest of the screen but never less than its content */
main > :is(section, .section) > .wrap > .fill { flex: 1 0 auto; }
/* a service hero's tools: four across at 56px, so ten tools take three rows and fit a short screen */
.tools-grid--hero { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 460px; gap: var(--s-6) var(--s-5); }
.tools-grid--hero .ic-tile--72 { --tile: 56px; }

/* the closing call, centred on the dark ground: the heading, its line and the big button */
.closing__cta.close--type { align-items: center; text-align: center; }
.closing__cta.close--type > .section-head { justify-items: center; margin-inline: auto; }
.closing__cta.close--type > .section-head p { margin-inline: auto; }
@media (min-width: 640px) { .closing__cta.close--type > .btn--xl { align-self: center; } }

/* the hero diagram of the five services */
.hero__hub { display: grid; place-items: center; padding: var(--s-5); }
.hero__hub .dg { width: 100%; }
/* a service row: the name and its tools on one line */
.svc-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); }
.svc-icons { display: inline-flex; gap: var(--s-2); flex: none; }
