/*
 * The Theme Kit in Circuit's look. The kit (themes/_shared/assets/css/kit.css) draws every block the theme has no
 * template for, and every module section; this file sets its tokens, linked after kit.css, so the values here win.
 * Change the look here first: the tokens reach every block at once, a rule for one kit class reaches one part.
 *
 * Rules for this file: it loads nothing, no picture, font or address of any kind (the kit inlines it into module
 * previews; kit_components.test.php fails for one, and also for these words written in a comment);
 * colours only through the palette tokens the kit already reads (--text-primary, --surface, --primary, ...) or
 * color-mix() of them; weights only through the layout's --circuit-heading-weight and --circuit-body-strong.
 * The label face is the layout's --circuit-mono (a monospaced face for small labels and figures); where it is not set
 * (a module's preview) the browser's own monospaced face stands in.
 *
 * --kit-radius and --kit-button-radius are repeated in this theme's line of the shared button table
 * (themes/_shared/assets/css/resilience.css, --chrome-radius and --chrome-button-radius) so the cookie notice and the
 * phone action bar match the theme's own cards and buttons: theme-chrome.test.mjs compares the two. Change both.
 *
 * The look: an instrument panel. Cards are panels with a fine border that is lit at the top-left by the accent, small
 * labels are set in the monospaced face in spaced capitals with a lit dot before them, figures read like a display, and
 * every control shows a soft glow of the accent when it is pointed at or chosen.
 */

.kit-root {
  --kit-radius: 0.625rem;
  --kit-radius-sm: 0.375rem;
  --kit-button-radius: 0.375rem;
  --kit-input-radius: 0.375rem;
  --kit-media-radius: 0.625rem;
  --kit-chip-radius: 0.3125rem;
  --kit-heading-weight: var(--circuit-heading-weight, 600);
  --kit-heading-tracking: -0.018em;
  --kit-button-weight: var(--circuit-body-strong, 600);
  --kit-button-transform: none;
  --kit-button-tracking: 0.005em;
  --kit-eyebrow-tracking: 0.14em;
  --kit-focus: var(--accent-ink, #5ee8e5);
  --kit-star: var(--accent-ink, #5ee8e5);
  --kit-card-pad: clamp(1.25rem, 2vw, 1.6rem);
  --kit-gap-medium: clamp(1.25rem, 2vw, 1.75rem);
  --kit-gap-large: clamp(1.75rem, 3.4vw, 2.75rem);
  --kit-gutter: clamp(1rem, 4vw, 2rem);
  --kit-width-normal: 74rem;
  --kit-width-narrow: 46rem;
  --kit-pad-normal: clamp(3.5rem, 2.5rem + 4vw, 6.5rem);
  --kit-pad-compact: clamp(2rem, 1.5rem + 2vw, 3.25rem);
  --kit-pad-spacious: clamp(4.5rem, 3rem + 6vw, 8.5rem);
  /* A panel has no drop shadow at rest: a hairline and the lit edge make it. Pointed at, it glows in the accent. */
  --kit-shadow: none;
  --kit-shadow-hover: 0 0 0 1px color-mix(in srgb, var(--accent, #34e3e0) 38%, transparent), 0 18px 48px -22px color-mix(in srgb, var(--accent, #34e3e0) 60%, transparent);
  --circuit-kit-mono: var(--circuit-mono, ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace);
}

/* ------------------------------------------------------------------ Headings */

/* Sentence case in the heading face, set tight. Sizes are set for ordinary words at 320 px; the shared script is only the
   net for a long word (cms/THEME_DEVELOPMENT.md, rule 1). A line height under about 1.1 cuts marks in a box that clips.
   --circuit-scale brings a wide face (a monospaced heading) to the same room as the others (theme.css, "Faces"). */
.kit-heading {
  font-family: var(--font-heading, sans-serif);
  line-height: 1.12;
  text-wrap: balance;
}

.kit-heading--1 {
  font-size: calc(clamp(2.125rem, 1.4rem + 3vw, 3.75rem) * var(--circuit-scale, 1));
  line-height: 1.1;
}

.kit-heading--2 {
  font-size: calc(clamp(1.75rem, 1.3rem + 1.8vw, 2.75rem) * var(--circuit-scale, 1));
}

.kit-heading--3 {
  font-size: calc(clamp(1.15rem, 1.05rem + 0.45vw, 1.375rem) * var(--circuit-scale, 1));
  line-height: 1.3;
}

.kit-text--lead {
  color: var(--kit-muted);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
}

/* Small labels above headings: the monospaced face in spaced capitals, in the accent's readable shade, after a lit dot
   like an indicator on a panel. Capitals in a narrow face stay short enough for long Lithuanian words at 0.75rem. */
.kit-eyebrow,
.kit-card__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  color: var(--kit-accent-text);
  font-family: var(--circuit-kit-mono);
  font-size: 0.75rem;
  font-weight: 500;
  font-variant-ligatures: none;
  letter-spacing: var(--kit-eyebrow-tracking);
  line-height: 1.4;
  text-transform: uppercase;
}

.kit-eyebrow::before {
  content: "";
  flex: none;
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent), 0 0 10px currentColor;
}

.kit-text--center > .kit-eyebrow,
.kit-heading-group.kit-text--center .kit-eyebrow {
  justify-content: center;
}

/* ------------------------------------------------------------------ Buttons */

/* A small button (a row of review links, Next under a list of posts) is still 40 px tall: the kit's own 36 px is under
   what a thumb needs on a phone (verify-theme-stress.mjs, button-small). */
.kit-button--small {
  min-height: 2.5rem;
}

/* The main button glows faintly in its own colour when pointed at, like a key that lights. */
.kit-button--primary:hover {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--kit-primary) 22%, transparent), 0 10px 28px -14px var(--kit-primary);
}

.kit-button--secondary {
  border-color: color-mix(in srgb, var(--kit-accent) 70%, transparent);
  background: color-mix(in srgb, var(--kit-accent) 7%, transparent);
}

.kit-button--secondary:hover {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--kit-accent) 22%, transparent), 0 10px 28px -12px var(--kit-accent);
}

/* ------------------------------------------------------------------ Panels (cards) */

/* A card is a panel: the surface, a fine border, and a lit edge along its top that is brightest at the left, where an
   indicator would sit. Pointed at, the border takes the accent and the panel glows. */
/* The border is a gradient drawn under the panel (border-box) and the panel's own fill over it (padding-box): lit at the
   top left, the plain hairline everywhere else. Only where the surface is solid: on a coloured band or a photograph the
   kit's surface is a clear tint, and the gradient would show through it. */
.kit-card--surface {
  border-color: transparent;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--kit-text) 3.5%, transparent), transparent 9rem) padding-box,
    linear-gradient(var(--kit-surface), var(--kit-surface)) padding-box,
    linear-gradient(135deg, color-mix(in srgb, var(--kit-accent) 80%, var(--kit-line)) 0%, var(--kit-line) 32%, var(--kit-line) 100%) border-box;
}

:is(.kit-section--inverse, .kit-section--accent, .kit-section--image, .kit-slide) .kit-card--surface {
  border-color: var(--kit-line);
  background: var(--kit-surface);
}

.kit-card--linked:hover {
  border-color: color-mix(in srgb, var(--kit-accent) 55%, var(--kit-line));
}

.kit-card__title {
  font-size: calc(1.125rem * var(--circuit-scale, 1));
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.kit-card__meta {
  font-family: var(--circuit-kit-mono);
  font-size: 0.8125rem;
  font-variant-ligatures: none;
}

/* A card's large icon stands in a small lit socket. */
.kit-card .kit-icon--large,
.kit-features .kit-icon--large {
  box-sizing: content-box;
  width: 1.375rem;
  height: 1.375rem;
  padding: 0.6rem;
  border: 1px solid color-mix(in srgb, var(--kit-accent) 34%, var(--kit-line));
  border-radius: var(--kit-radius-sm);
  background: color-mix(in srgb, var(--kit-accent) 9%, transparent);
  box-shadow: inset 0 0 14px -6px var(--kit-accent);
}

/* ------------------------------------------------------------------ Figures */

/* Statistics and prices read like a display: the monospaced face, its own figures. From 1200 px five statistics stand in
   a row of about 200 px each; a monospaced figure is wide, so the size stops at 40 px, where "1500 m²" still fits. */
.kit-stat__value {
  font-family: var(--circuit-kit-mono);
  font-size: clamp(1.875rem, 1.35rem + 1.6vw, 2.5rem);
  font-variant-ligatures: none;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.kit-stat__label {
  color: var(--kit-muted);
  font-family: var(--circuit-kit-mono);
  font-size: 0.75rem;
  font-variant-ligatures: none;
  letter-spacing: 0.1em;
  line-height: 1.5;
  text-transform: uppercase;
}

.kit-price__amount {
  font-family: var(--circuit-kit-mono);
  font-variant-ligatures: none;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.kit-price--large .kit-price__amount {
  font-size: clamp(1.875rem, 1.4rem + 1.8vw, 2.625rem);
}

.kit-price__period,
.kit-price__note {
  font-family: var(--circuit-kit-mono);
  font-variant-ligatures: none;
}

/* ------------------------------------------------------------------ Chips, badges and quotes */

.kit-chip,
.kit-badge {
  font-family: var(--circuit-kit-mono);
  font-variant-ligatures: none;
  letter-spacing: 0.04em;
}

/* A quotation is spoken: the heading face upright (no italic is loaded, and none is faked), and the name under it in the
   monospaced face like a signature on a log. */
.kit-quote {
  border-inline-start-width: 2px;
}

.kit-quote__text {
  font-style: normal;
  letter-spacing: -0.005em;
}

.kit-quote__author {
  font-family: var(--circuit-kit-mono);
  font-size: 0.8125rem;
  font-variant-ligatures: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.kit-quote__role {
  margin-top: 0.15rem;
  font-family: var(--font-body, sans-serif);
  letter-spacing: 0;
  text-transform: none;
}

/* ------------------------------------------------------------------ Questions */

.kit-accordion__title {
  padding-block: 1.1rem;
  font-weight: var(--circuit-body-strong, 600);
}

/* The chevron sits in a small square key; the open question lights it. */
.kit-accordion__chevron {
  box-sizing: content-box;
  padding: 0.3rem;
  border: 1px solid var(--kit-line);
  border-radius: var(--kit-radius-sm);
}

.kit-accordion__item[open] .kit-accordion__chevron {
  border-color: color-mix(in srgb, var(--kit-accent) 60%, transparent);
  color: var(--kit-accent-text);
  box-shadow: 0 0 12px -4px var(--kit-accent);
}

/* ------------------------------------------------------------------ Forms */

/* A field's name in the monospaced face; the field itself a dark well that lights at its edge when it is used. */
.kit-field__label {
  color: var(--kit-muted);
  font-family: var(--circuit-kit-mono);
  font-size: 0.8125rem;
  font-variant-ligatures: none;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.kit-input {
  border-color: color-mix(in srgb, var(--kit-text) 20%, transparent);
  background-color: color-mix(in srgb, var(--kit-text) 3%, var(--kit-surface));
}

.kit-input:focus {
  border-color: var(--kit-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--kit-accent) 20%, transparent), 0 0 18px -6px var(--kit-accent);
}

/* A quotation inside a card (a project's word from its client) is set at the size of the card's text, not a section's. */
.kit-card .kit-quote__text {
  font-size: 1.0625rem;
  line-height: 1.55;
}
