/*
 * Kiru in the Stack Light look.
 *
 * Two voices:
 *   LEGEND   Lozenge Legend: capitals drawn from the lamp's own corner and gap. Only on "hardware":
 *            the wordmark, lamp legends and keys. Its capital height is 0.7 of the font size.
 *   READING  Sofia Sans 400 for everything the site says; 800 only to mark the chosen thing.
 * One case rule: lettering on hardware is in capitals; everything else is sentence case.
 * Colour is rationed: one ink on a cool grey casing, peach only for the one main key,
 * amber only for a lit lamp.
 *
 * Loaded after the inline styles in base.html, so it wins over them at equal specificity.
 */

@font-face {
  font-family: 'Lozenge Legend';
  src: url('../fonts/lozenge-legend.woff') format('woff');
  font-weight: 400 900;
  font-style: normal;
  font-display: block;
}

:root {
  --kl-casing: #DDE2E6;
  --kl-ink: #15191C;
  --kl-panel: #FFFFFF;
  --kl-rule: #C5CCD0;
  --kl-quiet: #465057;      /* the legend on an unlit lamp, and nothing else */
  --kl-glass: #CBD3D9;
  --kl-peach: #FF8552;
  --kl-lip: #D9623A;
  --kl-amber: #E3A700;
  --kl-ink-2: #4A545B;      /* secondary text: still 7.8:1 on white */
  --kl-rule-soft: #D5DBDF;  /* hairlines inside the white panel */
  --kl-field: #8A949B;      /* field borders: 3:1 on white */
  --kl-legend: 'Lozenge Legend', 'Arial Narrow', Impact, sans-serif;
  --kl-reading: 'Sofia Sans', 'Helvetica Neue', Arial, sans-serif;

  /* the shared tokens other pages use */
  --ui-font-sans: var(--kl-reading);
  --ui-color-text: var(--kl-ink);
  --ui-color-primary: var(--kl-ink);
}

/* ---------------------------------------------------------------- the casing */

html,
body {
  background: var(--kl-casing);
}

body {
  font-family: var(--kl-reading);
  color: var(--kl-ink);
}

/* every page's content sits on one opaque panel on the casing */
.main-content {
  background: var(--kl-panel);
  backdrop-filter: none;
  border: 1px solid var(--kl-rule);
  border-radius: 16px;
  box-shadow: none;
  margin: 88px 24px 24px;       /* the top margin merges with the wrapper's 60 px: 24 px clear of the 64 px bar */
}

/* a page that is its own composition (the home page) sits straight on the casing */
.main-content.kl-bare {
  background: transparent;
  border: 0;
  border-radius: 0;
  margin: 0;
  padding: 0;
  min-height: 0;
}

/* panels do not jump when you point at them */
.card {
  border: 1px solid #D5DBDF;
  border-radius: 12px;
  box-shadow: none;
}

.card:hover {
  transform: none;
  box-shadow: none;
}

/* ---------------------------------------------------------------- navigation */

.navbar {
  background: var(--kl-casing) !important;
  backdrop-filter: none;
  box-shadow: none;
  border-bottom: 1px solid var(--kl-rule);
  min-height: 64px;
}

.navbar .nav-link {
  font-weight: 400;
  font-size: 17px;
  color: var(--kl-ink) !important;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.navbar-brand {
  font-family: var(--kl-legend);
  font-weight: 900;
  font-size: 34.29px;           /* capitals 24 px */
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--kl-ink) !important;
}

/* a small ink key, lettered like hardware */
.kl-key-ink {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: var(--kl-ink);
  color: #FFFFFF;
  font-family: var(--kl-legend);
  font-weight: 900;
  font-size: 20px;              /* capitals 14 px */
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
}

.kl-key-ink:hover,
.kl-key-ink:focus-visible {
  background: #2A3136;
  color: #FFFFFF;
  text-decoration: none;
}

/* ---------------------------------------------------------------- buttons on every page */

.btn-primary,
.btn-dark,
.btn-success {
  background-color: var(--kl-ink);
  border-color: var(--kl-ink);
  color: #FFFFFF;
  border-radius: 10px;
  font-weight: 800;
}

.btn-primary:hover,
.btn-dark:hover,
.btn-success:hover {
  background-color: #2A3136;
  border-color: #2A3136;
  color: #FFFFFF;
}

.btn-outline-dark {
  border-radius: 10px;
  font-weight: 800;
}

.back-to-top {
  background: var(--kl-ink);
  border-radius: 12px;
  box-shadow: none;
}

.back-to-top:hover {
  background: #2A3136;
  box-shadow: none;
}

/* ---------------------------------------------------------------- footer */

.footer {
  background: transparent;
  border-top: 1px solid var(--kl-rule);
  color: var(--kl-ink);
}

.footer p,
.footer .philosophy-text {
  font-style: normal;
  font-size: 17px;
  color: var(--kl-ink) !important;
}

.footer .text-muted {
  color: var(--kl-ink) !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
}

/* ================================================================ inner pages
 * Every page renders inside .main-content, a white panel on the casing. These rules put the Bootstrap
 * components the pages use (cards, badges, buttons, forms, tables, alerts, tabs) into the look, so a page
 * needs page-specific styles only for what is really its own.
 */

.main-content {
  color: var(--kl-ink);
  font-size: 17px;
}

/* one ink for text; secondary text is demoted by size, and stays legible */
.main-content p,
.main-content li {
  color: var(--kl-ink) !important;
}

.main-content .text-muted,
.main-content .text-secondary,
.main-content .form-text,
.main-content small {
  color: var(--kl-ink-2) !important;
}

.main-content :is(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6) {
  font-family: var(--kl-reading);
  font-weight: 800;
  letter-spacing: -0.005em;
  color: var(--kl-ink) !important;
}

.main-content :is(.display-1, .display-2, .display-3, .display-4, .display-5, .display-6) {
  font-weight: 800;
  letter-spacing: -0.01em;
}

.main-content .lead {
  font-size: 20px;
  font-weight: 400;
  line-height: 1.5;
}

/* text inside the pages' own dark (ink) surfaces stays light */
.main-content :is(.bg-dark, .bg-black, .text-bg-dark, .table-dark, [style*="background: #000"], [style*="background:#000"], [style*="background-color: #000"], [style*="background-color:#000"], [style*="background: black"], [style*="background: #111"], [style*="background:#111"]) :is(p, li, small, span, .text-muted, .text-secondary, h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6, .lead) {
  color: rgba(255, 255, 255, .9) !important;
}

/* plates: flat, white, one hairline; they do not lift or cast shadows */
.main-content .card {
  background: var(--kl-panel) !important;
  border: 1px solid var(--kl-rule-soft);
  border-radius: 14px;
  box-shadow: none;
  overflow: hidden;
}

.main-content .card-header {
  background: transparent;
  border-bottom: 1px solid var(--kl-rule-soft);
  color: var(--kl-ink);
  font-weight: 800;
  padding: 14px 18px;
}

.main-content .card-header:is(.bg-dark, .bg-black, .bg-primary) {
  background: var(--kl-ink) !important;
  border-bottom-color: var(--kl-ink);
}

.main-content .card-footer {
  background: transparent;
  border-top: 1px solid var(--kl-rule-soft);
}

.main-content :is(.shadow, .shadow-sm, .shadow-lg) {
  box-shadow: none !important;
}

.main-content .bg-light {
  background-color: #F2F4F6 !important;
}

.main-content hr {
  border-color: var(--kl-rule-soft);
  opacity: 1;
}

/* badges are small chips: sentence case, heavy, a tint for meaning plus the word itself */
.main-content .badge {
  font-family: var(--kl-reading);
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  padding: 6px 9px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.main-content .badge:is(.bg-success, .text-bg-success) { background: #E4F1E8 !important; color: #1E5B32 !important; border-color: #9CC9AB; }
.main-content .badge:is(.bg-warning, .text-bg-warning) { background: #FBF0CC !important; color: #4D3800 !important; border-color: #E3C25A; }
.main-content .badge:is(.bg-danger, .text-bg-danger) { background: #FBE4E2 !important; color: #8E1A12 !important; border-color: #E8A39C; }
.main-content .badge:is(.bg-info, .text-bg-info) { background: #E6EDF2 !important; color: #1F4A66 !important; border-color: #A9C1D1; }
.main-content .badge:is(.bg-secondary, .bg-light, .text-bg-secondary, .text-bg-light, .badge-kiru-neutral) { background: #EDF0F2 !important; color: #2F383E !important; border-color: #C5CCD0; }
.main-content .badge:is(.bg-primary, .bg-dark, .text-bg-primary, .text-bg-dark, .badge-kiru-dark) { background: var(--kl-ink) !important; color: #FFFFFF !important; border-color: var(--kl-ink); }

/* buttons: ink keys and ink outlines; peach is kept for the one key on the home page */
.main-content .btn,
.modal .btn {
  font-family: var(--kl-reading);
  font-weight: 800;
  border-radius: 10px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.main-content .btn-lg { min-height: 52px; font-size: 18px; }
.main-content .btn-sm { min-height: 34px; font-size: 14px; }

.main-content :is(.btn-outline-dark, .btn-outline-secondary, .btn-outline-primary, .btn-outline-success, .btn-outline-info),
.modal :is(.btn-outline-dark, .btn-outline-secondary, .btn-outline-primary) {
  color: var(--kl-ink);
  background: transparent;
  border: 1.5px solid var(--kl-ink);
}

.main-content :is(.btn-outline-dark, .btn-outline-secondary, .btn-outline-primary, .btn-outline-success, .btn-outline-info):hover,
.modal :is(.btn-outline-dark, .btn-outline-secondary, .btn-outline-primary):hover {
  color: var(--kl-ink);
  background: rgba(21, 25, 28, .07);
  border-color: var(--kl-ink);
}

.main-content .btn-secondary,
.modal .btn-secondary {
  background: #E6E9EC;
  border-color: #C5CCD0;
  color: var(--kl-ink);
}

.main-content .btn-secondary:hover,
.modal .btn-secondary:hover {
  background: #D7DCE0;
  border-color: #AEB7BD;
  color: var(--kl-ink);
}

.main-content .btn-danger { background: #C8261E; border-color: #C8261E; color: #FFFFFF; }
.main-content .btn-outline-danger { color: #A31F18; border: 1.5px solid #A31F18; }
.main-content .btn-warning { background: var(--kl-amber); border-color: #C99500; color: var(--kl-ink); }
.main-content .btn-light { background: #FFFFFF; border: 1.5px solid #C5CCD0; color: var(--kl-ink); }

.main-content .btn:focus-visible,
.modal .btn:focus-visible {
  outline: 3px solid var(--kl-ink);
  outline-offset: 2px;
  box-shadow: none;
}

/* fields: 44 px, a clear border, an ink ring when in use */
.main-content :is(.form-control, .form-select) {
  min-height: 44px;
  border: 1.5px solid var(--kl-field);
  border-radius: 10px;
  font-size: 17px;
  color: var(--kl-ink);
  background-color: #FFFFFF;
}

.main-content textarea.form-control {
  min-height: 96px;
}

.main-content :is(.form-control, .form-select):focus {
  border-color: var(--kl-ink);
  box-shadow: 0 0 0 3px rgba(21, 25, 28, .18);
}

.main-content .form-control::placeholder {
  color: #6B757C;
  opacity: 1;
}

.main-content :is(.form-label, label) {
  font-weight: 800;
  color: var(--kl-ink);
}

.main-content .form-check-label {
  font-weight: 400;
}

.main-content .form-check-input:checked {
  background-color: var(--kl-ink);
  border-color: var(--kl-ink);
}

.main-content .input-group-text {
  background: #F2F4F6;
  border: 1.5px solid var(--kl-field);
  color: var(--kl-ink);
}

/* tables: hairlines, heavy headings, figures that line up */
.main-content .table {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: #F4F6F7;
  --bs-table-hover-bg: #EEF1F3;
  --bs-table-color: var(--kl-ink);
  color: var(--kl-ink);
  font-variant-numeric: tabular-nums lining-nums;
}

.main-content .table > thead th,
.main-content .table > thead td {
  font-size: 14px;
  font-weight: 800;
  color: var(--kl-ink);
  background: transparent;
  border-bottom: 1.5px solid var(--kl-ink);
}

.main-content .table-dark {
  --bs-table-bg: transparent;
  --bs-table-color: var(--kl-ink);
  --bs-table-border-color: var(--kl-rule-soft);
}

/* alerts: a tint for meaning, ink text, one rule round the box */
.main-content .alert {
  border-radius: 12px;
  border: 1px solid;
  font-size: 16px;
  color: var(--kl-ink);
}

.main-content .alert-info, .main-content .alert-primary { background: #E6EDF2; border-color: #A9C1D1; }
.main-content .alert-success { background: #E4F1E8; border-color: #9CC9AB; }
.main-content .alert-warning { background: #FBF0CC; border-color: #E3C25A; }
.main-content .alert-danger { background: #FBE4E2; border-color: #E8A39C; }
.main-content .alert-secondary, .main-content .alert-light { background: #F2F4F6; border-color: #C5CCD0; }
.main-content .alert-dark { background: var(--kl-ink); border-color: var(--kl-ink); color: #FFFFFF; }

/* lists, tabs, pagination, meters */
.main-content .list-group-item {
  border-color: var(--kl-rule-soft);
  color: var(--kl-ink);
}

.main-content .list-group-item.active {
  background: var(--kl-ink);
  border-color: var(--kl-ink);
  color: #FFFFFF;
}

.main-content .nav-tabs {
  border-bottom: 1px solid var(--kl-rule-soft);
  gap: 4px;
}

.main-content .nav-tabs .nav-link {
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  font-weight: 400;
  background: transparent;
}

.main-content .nav-tabs .nav-link.active {
  border-bottom-color: var(--kl-ink);
  font-weight: 800;
  background: transparent;
}

.main-content .nav-pills .nav-link {
  border-radius: 10px;
}

.main-content .nav-pills .nav-link.active {
  background: var(--kl-ink);
  color: #FFFFFF !important;
}

.main-content .page-link {
  color: var(--kl-ink);
  border-color: var(--kl-rule-soft);
}

.main-content .page-item.active .page-link {
  background: var(--kl-ink);
  border-color: var(--kl-ink);
  color: #FFFFFF;
}

.main-content .progress {
  height: 10px;
  background: #DDE2E6;
  border-radius: 6px;
}

.main-content .progress-bar {
  background-color: var(--kl-ink);
}

/* menus and dialogs sit outside the panel */
.dropdown-menu {
  border: 1px solid var(--kl-rule);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(21, 25, 28, .14);
}

.dropdown-item:active {
  background: var(--kl-ink);
}

.modal-content {
  border: 1px solid var(--kl-rule);
  border-radius: 16px;
  font-family: var(--kl-reading);
}

.modal-header {
  border-bottom: 1px solid var(--kl-rule-soft);
}

.modal-header:is(.bg-primary, .bg-dark) {
  background: var(--kl-ink) !important;
}

/* ---------------------------------------------------------------- fixes every page needs */

/* the pages slide in from the side on load; never let that widen a phone's page */
html {
  overflow-x: hidden;
  overflow-x: clip;
}

/* links in ink, underlined (kept at low specificity so page styles still win) */
.main-content :where(a:not(.btn):not(.nav-link):not(.page-link):not(.dropdown-item):not(.list-group-item):not([class*="kl-"])) {
  color: var(--kl-ink);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.main-content .alert-link {
  color: var(--kl-ink);
}

/* the ink note box keeps light text */
.main-content .alert-dark :is(p, li, small, span, h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6, .text-muted, a) {
  color: #FFFFFF !important;
}

/* base.html sets card text to its own greys */
.main-content :is(.card-body, .card-title) {
  color: var(--kl-ink) !important;
}

.main-content .card-text {
  color: var(--kl-ink-2) !important;
}

/* black or coloured card outlines become the hairline */
.main-content .card:is(.border-dark, .border-secondary, .border-primary, .border-black) {
  border-color: var(--kl-rule-soft) !important;
}

/* keys as tall as the fields beside them; a disabled key reads as disabled */
.main-content .btn {
  min-height: 44px;
}

.main-content .btn-sm {
  min-height: 36px;
}

.main-content .btn:disabled,
.main-content .btn.disabled {
  background: #EDF0F2;
  border-color: #D5DBDF;
  color: var(--kl-ink-2);
  opacity: 1;
}

/* tabs: no zoom on hover (base.html animates every .nav-link) */
.main-content :is(.nav-tabs, .nav-pills) .nav-link {
  transform: none !important;
  color: var(--kl-ink);
}

/* an ink focus ring everywhere, not Bootstrap's blue glow */
.main-content :is(.nav-link, .list-group-item-action, .page-link, .accordion-button, .form-check-input):focus-visible {
  outline: 3px solid var(--kl-ink);
  outline-offset: 2px;
  box-shadow: none;
}

.main-content .accordion-button:focus {
  box-shadow: none;
}

/* code in the reading voice's colours, not Bootstrap pink */
.main-content code {
  color: var(--kl-ink);
  background: #F2F4F6;
  border-radius: 6px;
  padding: 1px 5px;
}

.main-content pre code {
  padding: 0;
  background: transparent;
}

/* plain form fields (Django forms without Bootstrap classes) look like the others */
.main-content :where(input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="number"], input[type="search"], input[type="tel"], select, textarea):not(.form-control):not(.form-select):not(.form-check-input) {
  min-height: 44px;
  padding: 8px 12px;
  border: 1.5px solid var(--kl-field);
  border-radius: 10px;
  font: inherit;
  font-size: 17px;
  color: var(--kl-ink);
  background: #FFFFFF;
  max-width: 100%;
}

/* phones: more room for the page inside the panel */
@media (max-width: 575.98px) {
  .main-content {
    margin: 76px 8px 16px;
    padding: 24px 16px 32px;
  }

  .kl-page-head h1 {
    font-size: 32px;
    line-height: 36px;
  }

  .kl-page-head .kl-intro {
    font-size: 17px;
    line-height: 25px;
  }
}

/* ---------------------------------------------------------------- pieces pages can use */

/* a page heading: left aligned, the title over one line of introduction, actions on the right */
.kl-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
  padding-bottom: 24px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--kl-rule-soft);
}

.kl-page-head h1 {
  margin: 0;
  font-size: 40px;
  line-height: 44px;
}

.kl-page-head .kl-intro {
  margin: 10px 0 0;
  max-width: 680px;
  font-size: 19px;
  line-height: 28px;
}

/* the legend voice as text: capitals drawn from the lamp */
.kl-legend {
  font-family: var(--kl-legend);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
  line-height: 1;
}

/* a small glass lamp for codes and states (HALL-1, a test result); add .is-lit when it has fired */
.kl-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  height: 34px;
  padding: 0 14px;
  border: 2px solid var(--kl-ink);
  border-radius: 11px;
  background-image:
    radial-gradient(ellipse 26% 46% at 73% 40%, rgba(255, 255, 255, .42) 0%, rgba(255, 255, 255, 0) 100%),
    linear-gradient(90deg, rgba(22, 44, 58, .30) 0%, rgba(22, 44, 58, 0) 22%, rgba(22, 44, 58, 0) 80%, rgba(22, 44, 58, .26) 100%),
    linear-gradient(180deg, rgba(22, 44, 58, .12) 0%, rgba(22, 44, 58, 0) 40%, rgba(255, 255, 255, .5) 92%);
  background-color: var(--kl-glass);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
  font-family: var(--kl-legend);
  font-weight: 900;
  font-size: 20px;              /* capitals 14 px */
  line-height: 1;
  text-transform: uppercase;
  color: var(--kl-quiet);
  white-space: nowrap;
}

.kl-chip.is-lit {
  background-image: radial-gradient(ellipse at 50% 46%, #F0B81F 0%, var(--kl-amber) 62%, #D69C00 100%);
  box-shadow: 0 0 12px 1px rgba(227, 167, 0, .38), inset 0 0 0 1px rgba(255, 243, 196, .75);
  color: var(--kl-ink);
}

/* the peach key, small: for the one action a page exists for, never more than one per page */
.kl-btn-peach {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .11) 0%, rgba(255, 255, 255, 0) 44%, rgba(122, 34, 0, 0) 60%, rgba(122, 34, 0, .08) 100%), var(--kl-peach);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .40), inset 0 -1.5px 0 rgba(122, 34, 0, .16), 0 6px 0 var(--kl-lip);
  margin-bottom: 6px;
  font-family: var(--kl-legend);
  font-weight: 900;
  font-size: 25.71px;           /* capitals 18 px */
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--kl-ink);
  cursor: pointer;
}

.kl-btn-peach:hover {
  color: var(--kl-ink);
  filter: brightness(1.04);
}

.kl-btn-peach:active {
  transform: translateY(3px);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .40), inset 0 -1.5px 0 rgba(122, 34, 0, .16), 0 3px 0 var(--kl-lip);
}

.kl-btn-peach:focus-visible {
  outline: 3px solid var(--kl-ink);
  outline-offset: 4px;
}

/* the salmon key wins over Bootstrap's .btn wherever it is used: one per page, never more */
.main-content .kl-btn-peach,
.main-content .btn.kl-btn-peach,
.modal .kl-btn-peach {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .11) 0%, rgba(255, 255, 255, 0) 44%, rgba(122, 34, 0, 0) 60%, rgba(122, 34, 0, .08) 100%), var(--kl-peach);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .40), inset 0 -1.5px 0 rgba(122, 34, 0, .16), 0 6px 0 var(--kl-lip);
  margin-bottom: 6px;
  font-family: var(--kl-legend);
  font-weight: 900;
  font-size: 25.71px;           /* capitals 18 px */
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  color: var(--kl-ink);
  opacity: 1;
}

.main-content .kl-btn-peach.kl-btn-peach-sm,
.main-content .btn.kl-btn-peach.kl-btn-peach-sm {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  font-size: 21.43px;           /* capitals 15 px */
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .40), inset 0 -1.5px 0 rgba(122, 34, 0, .16), 0 5px 0 var(--kl-lip);
  margin-bottom: 5px;
}

.main-content .kl-btn-peach:is(:hover, :focus),
.main-content .btn.kl-btn-peach:is(:hover, :focus) {
  background: linear-gradient(180deg, rgba(255, 255, 255, .11) 0%, rgba(255, 255, 255, 0) 44%, rgba(122, 34, 0, 0) 60%, rgba(122, 34, 0, .08) 100%), var(--kl-peach);
  color: var(--kl-ink);
  filter: brightness(1.04);
}

.main-content .kl-btn-peach:active,
.main-content .btn.kl-btn-peach:active {
  background: linear-gradient(180deg, rgba(255, 255, 255, .11) 0%, rgba(255, 255, 255, 0) 44%, rgba(122, 34, 0, 0) 60%, rgba(122, 34, 0, .08) 100%), var(--kl-peach);
  color: var(--kl-ink);
  transform: translateY(3px);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .40), inset 0 -1.5px 0 rgba(122, 34, 0, .16), 0 3px 0 var(--kl-lip);
}

.main-content .kl-btn-peach:focus-visible,
.main-content .btn.kl-btn-peach:focus-visible {
  outline: 3px solid var(--kl-ink);
  outline-offset: 4px;
}

.main-content .kl-btn-peach :is(i, svg, .fa, .fas, .far, .bi) {
  font-size: 17px;
}

.main-content .kl-btn-peach:is(:disabled, .disabled) {
  background: #EDF0F2;
  color: var(--kl-ink-2);
  box-shadow: inset 0 0 0 1.5px #C5CCD0;
  filter: none;
  transform: none;
}

/* a salmon key that has been pressed stays down, like a latched key: "You voted", "Acknowledged" */
.main-content .kl-btn-peach.is-latched,
.main-content .btn.kl-btn-peach.is-latched:is(:disabled, .disabled) {
  background: linear-gradient(180deg, rgba(122, 34, 0, .10) 0%, rgba(122, 34, 0, 0) 40%), var(--kl-peach);
  color: var(--kl-ink);
  box-shadow: inset 0 2px 4px rgba(122, 34, 0, .22), 0 2px 0 var(--kl-lip);
  transform: translateY(4px);
  margin-bottom: 6px;
  filter: none;
  cursor: default;
  opacity: 1;
}

@media (max-width: 575.98px) {
  .main-content .kl-btn-peach,
  .main-content .btn.kl-btn-peach {
    font-size: 22.86px;         /* capitals 16 px */
  }
}

/* ---------------------------------------------------------------- the home page */

.kl-home {
  max-width: 1280px;
  margin: 0 auto;
  padding: 72px 40px 96px;
  color: var(--kl-ink);
}

.kl-home p {
  color: var(--kl-ink) !important;
}

/* The lamps are the hero. The two columns stay — stacking them centred pushed
   the catalog key, the page's primary action, below the fold — but the weight
   between them is reversed: the wordmark drops from 208 px capitals to 60, so
   the text column becomes a caption beside the tower rather than a slab
   competing with it. The eye now lands on the lamps, which say what the site
   does, instead of on the name, which the navbar is already carrying. */
.kl-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 480px;
  column-gap: 64px;
  align-items: center;
}

.kl-hero-text {
  display: flex;
  flex-direction: column;
}

.kl-wordmark {
  margin: 0;
  font-family: var(--kl-legend);
  font-weight: 900;
  font-size: 85.71px;           /* capitals 60 px: two lamp labels */
  line-height: 0.7;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--kl-ink) !important;
  position: relative;
  top: 0.03em;                  /* puts the capitals exactly on the line box */
}

.kl-tagline {
  margin: 28px 0 0;
  max-width: 660px;
  font-size: 28px;
  line-height: 38px;
  font-weight: 400;
}

.kl-text-action {
  align-self: flex-start;
  margin-top: 26px;
  font-size: 21px;
  font-weight: 400;
  color: var(--kl-ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.kl-text-action:hover,
.kl-text-action:focus-visible {
  color: var(--kl-ink);
  text-decoration-thickness: 3px;
}

/* ---- the tower: four lamps on one key */

.kl-tower {
  width: 480px;
  position: relative;
}

.kl-lamps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.kl-lamp {
  position: relative;
  box-sizing: border-box;
  width: 400px;
  height: 100px;
  border: 3px solid var(--kl-ink);
  border-radius: 30px;
  background-image:
    url('../img/kiru/lamp-glass.svg'),
    radial-gradient(ellipse 26% 46% at 73% 40%, rgba(255, 255, 255, .42) 0%, rgba(255, 255, 255, 0) 100%),
    linear-gradient(90deg, rgba(22, 44, 58, .42) 0%, rgba(22, 44, 58, .18) 6%, rgba(22, 44, 58, 0) 19%, rgba(22, 44, 58, 0) 84%, rgba(22, 44, 58, .15) 95%, rgba(22, 44, 58, .36) 100%),
    linear-gradient(180deg, rgba(22, 44, 58, .15) 0%, rgba(22, 44, 58, 0) 40%, rgba(255, 255, 255, 0) 56%, rgba(255, 255, 255, .55) 91%, rgba(255, 255, 255, .22) 100%);
  background-color: var(--kl-glass);
  background-size: 100% 100%;
  background-origin: border-box;
  background-repeat: no-repeat;
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .9), inset 0 0 0 1.25px rgba(255, 255, 255, .5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: var(--kl-legend);
  font-weight: 900;
  font-size: 42.86px;           /* capitals 30 px: a third of the lamp */
  line-height: 1;
  text-transform: uppercase;
  color: var(--kl-quiet);
}

.kl-lamp.is-lit {
  background-image:
    url('../img/kiru/lamp-glass-lit.svg'),
    radial-gradient(ellipse at 50% 46%, #F0B81F 0%, var(--kl-amber) 62%, #D69C00 100%);
  box-shadow: 0 0 26px 2px rgba(227, 167, 0, .42), inset 0 0 0 1.25px rgba(255, 243, 196, .75);
  color: var(--kl-ink);
}

.kl-lamp svg {
  flex: none;
  display: block;
}

/* the key: the one peach thing on the page */
.kl-key {
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 480px;
  height: 124px;
  margin-top: 8px;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .11) 0%, rgba(255, 255, 255, 0) 44%, rgba(122, 34, 0, 0) 60%, rgba(122, 34, 0, .08) 100%), var(--kl-peach);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .40), inset 0 -1.5px 0 rgba(122, 34, 0, .16), 0 14px 0 var(--kl-lip);
  font-family: var(--kl-legend);
  font-weight: 900;
  font-size: 42.86px;           /* capitals 30 px, the same as the lamps */
  line-height: 0.7;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--kl-ink);
}

.kl-key span {
  display: block;
  position: relative;
  top: 0.03em;
}

.kl-key::after {
  content: '';
  position: absolute;
  left: -48px;
  right: -48px;
  bottom: -38px;
  height: 48px;
  background: radial-gradient(ellipse closest-side, rgba(21, 25, 28, .46) 0%, rgba(21, 25, 28, .26) 42%, rgba(21, 25, 28, .07) 78%, rgba(21, 25, 28, 0) 100%);
  z-index: -1;
  pointer-events: none;
}

.kl-key:hover {
  color: var(--kl-ink);
  filter: brightness(1.04);
}

.kl-key:active {
  transform: translateY(4px);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .40), inset 0 -1.5px 0 rgba(122, 34, 0, .16), 0 10px 0 var(--kl-lip);
}

.kl-key:focus-visible,
.kl-text-action:focus-visible,
.kl-key-ink:focus-visible {
  outline: 3px solid var(--kl-ink);
  outline-offset: 4px;
}

/* ---- the project */

.kl-project {
  margin-top: 112px;
  padding-top: 40px;
  border-top: 1px solid var(--kl-rule);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 480px;
  column-gap: 64px;
}

.kl-project h2 {
  margin: 0 0 16px;
  font-family: var(--kl-reading);
  font-weight: 800;
  font-size: 28px;
  line-height: 34px;
  color: var(--kl-ink) !important;
}

.kl-project p {
  margin: 0;
  max-width: 760px;
  font-size: 22px;
  line-height: 34px;
  font-weight: 400;
}

/* ---- the lab: the same section as the project, with its two keys under the text */
.kl-lab {
  margin-top: 64px;
}

.kl-lab-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.kl-lab-keys .btn {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
}

/* ---- smaller screens: one column, the tower scales as one object */

@media (max-width: 1199.98px) {
  .kl-hero,
  .kl-project {
    grid-template-columns: minmax(0, 1fr);
  }

  .kl-tower {
    margin: 56px auto 0;
  }
}

@media (max-width: 575.98px) {
  .kl-home {
    padding: 40px 16px 72px;
  }

  .kl-wordmark {
    font-size: 68.57px;         /* capitals 48 px */
  }

  .kl-tagline {
    font-size: 22px;
    line-height: 30px;
  }

  .kl-tower {
    margin-top: 44px;
    zoom: 0.6;                  /* 288 px wide: fits a 360 px phone */
  }

  .kl-project {
    margin-top: 80px;
  }

  .kl-project p {
    font-size: 19px;
    line-height: 29px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kl-key:active {
    transform: none;
  }
}
