/* ==========================================================================
   GmbH — below-the-fold styles.
   Every value comes from a token declared in the critical block in index.html.
   No gradients, no blur, no drop shadows on content; separation is done with
   1px rules and the --paper-2 fill.
   ========================================================================== */

/* --------------------------------------------------------------------------
   TYPE HELPERS
   -------------------------------------------------------------------------- */
.h-500 {
  font-size: clamp(25px, 3.2vw, 31px);
  margin-top: var(--s-2);
}

.h-400 {
  font-size: var(--fs-400);
}

/* Invisible landing points that keep old deep links (#ai, #lineup, #stack,
   #categories, #portal, #core27, #support) resolving after the restructure. */
.anchor-alias {
  display: block;
  height: 0;
  scroll-margin-top: calc(var(--nav-h) + var(--s-4));
}

[id] {
  scroll-margin-top: calc(var(--nav-h) + var(--s-4));
}

/* Unverified content is marked in the page itself, so it cannot ship by
   accident. Removing the class is the last step before launch. */
.todo {
  display: inline-block;
  padding: 2px var(--s-2);
  border: 1px dashed var(--rule-2);
  border-radius: var(--r-sm);
  background: var(--paper-2);
  color: var(--ink-3);
  font-size: var(--fs-100);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

/* --------------------------------------------------------------------------
   LANGUAGE + THEME CONTROLS

   Deliberately not in the header: that is a 1:1 restore of the original
   navbar. They live in the footer and in the mobile drawer instead, and are
   sized and labelled to be found without hunting — full language name and
   theme name, not a bare glyph.
   -------------------------------------------------------------------------- */
.pref-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  height: 38px;
  padding-inline: var(--s-3);
  border: 1px solid var(--rule-2);
  border-radius: var(--r-pill);
  background: var(--paper);
  font-size: var(--fs-100);
  font-weight: 600;
  color: var(--ink);
  transition: border-color var(--t), background-color var(--t);
}

.pref-btn:hover {
  border-color: var(--ink);
  background: var(--paper-2);
}

:root[data-theme="light"] .i-moon,
:root[data-theme="dark"] .i-sun {
  display: none;
}

.lang {
  position: relative;
}

.lang-menu {
  position: absolute;
  top: calc(100% + var(--s-1));
  right: 0;
  z-index: var(--z-header);
  min-width: 170px;
  padding: var(--s-1);
  border: var(--rule-w) solid var(--rule);
  border-radius: var(--r-md);
  background: var(--paper);
  box-shadow: var(--shadow-dropdown);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t), visibility var(--t);
}

.lang-up .lang-menu {
  top: auto;
  bottom: calc(100% + var(--s-1));
}

.lang.open .lang-menu {
  opacity: 1;
  visibility: visible;
}

.lang-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  width: 100%;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm);
  font-size: var(--fs-100);
  color: var(--ink-2);
  text-align: left;
  transition: background-color var(--t), color var(--t);
}

.lang-opt:hover {
  background: var(--paper-2);
  color: var(--ink);
}

.lang-opt[aria-current="true"] {
  color: var(--ink);
  font-weight: 700;
}

.lang-opt[aria-current="true"]::after {
  content: "";
  width: 5px;
  height: 9px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg) translateY(-1px);
}

/* --------------------------------------------------------------------------
   DRAWER
   -------------------------------------------------------------------------- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: var(--z-drawer);
  display: flex;
  flex-direction: column;
  padding: var(--s-4);
  background: var(--paper);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t), visibility var(--t);
}

.drawer.open {
  opacity: 1;
  visibility: visible;
}

.drawer-brand,
.footer-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.drawer-brand .brand-mark,
.footer-mark .brand-mark {
  height: 30px;
}

.drawer-brand .brand-tag,
.footer-mark .brand-tag {
  color: var(--ink-3);
}

.drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--s-4);
  border-bottom: var(--rule-w) solid var(--rule);
}

.drawer-x {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: var(--rule-w) solid var(--rule);
  border-radius: var(--r-sm);
}

.drawer-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding-top: var(--s-4);
}

.drawer-link {
  padding-block: var(--s-4);
  border-bottom: var(--rule-w) solid var(--rule);
  font-size: var(--fs-400);
  font-weight: 500;
  letter-spacing: var(--ls-head);
}

.drawer-link:hover {
  color: var(--brand);
}

.drawer-prefs {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  padding-top: var(--s-5);
}

.pref {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-3);
}

.seg {
  display: inline-flex;
  border: 1px solid var(--rule-2);
  border-radius: var(--r-pill);
  overflow: hidden;
}

.seg-b {
  padding: 9px var(--s-3);
  font-size: var(--fs-100);
  font-weight: 500;
  color: var(--ink-2);
  transition: background-color var(--t), color var(--t);
}

.seg-b + .seg-b {
  border-left: var(--rule-w) solid var(--rule);
}

.seg-b:hover {
  color: var(--ink);
}

.seg-b[aria-pressed="true"] {
  background: var(--solid);
  color: var(--solid-ink);
}

/* --------------------------------------------------------------------------
   SPLIT LAYOUT — asymmetric 4/8, used by services, licensing and contact.
   Each instance varies its own rhythm so the three do not read as one
   repeated template.
   -------------------------------------------------------------------------- */
.split {
  display: grid;
  gap: var(--s-5);
}

.split-aside {
  align-self: start;
}

/* Source order is list-then-heading so the desktop mirror needs no
   reordering; on mobile the heading is pulled back above the list. */
.split-rev .split-aside {
  order: -1;
}

@media (min-width: 900px) {
  .split-rev .split-aside {
    order: 0;
  }
}

.split-note {
  margin-top: var(--s-3);
  max-width: 42ch;
  color: var(--ink-2);
}

.split-aside .link {
  margin-top: var(--s-4);
}

.block-head {
  margin-bottom: var(--s-5);
}

/* ------------------------------------------------------------ services -- */
.block-services {
  padding-block: var(--s-8);
}

.rows {
  border-top: var(--rule-w) solid var(--rule);
}

.row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-3);
  padding-block: var(--s-4);
  border-bottom: var(--rule-w) solid var(--rule);
}

.row-n {
  font-size: var(--fs-100);
  font-weight: 500;
  color: var(--ink-3);
  padding-top: 4px;
}

/* The sector the scenario belongs to, above its title. */
.row-k {
  display: block;
  margin-bottom: var(--s-1);
}

.row-t {
  font-size: var(--fs-300);
  font-weight: 600;
}

.row-d {
  margin-top: var(--s-2);
  max-width: var(--measure);
  color: var(--ink-2);
}

/* What changes in the work — the payoff line, carried over from the scenario
   block, so it has to outweigh the description it follows. */
.row-r {
  margin-top: var(--s-2);
  max-width: var(--measure);
  font-weight: 700;
}

/* --------------------------------------------------------- development -- */
.block-dev {
  padding-block: var(--s-8);
}

.dev-grid {
  display: grid;
  gap: var(--s-5) var(--s-6);
}

.dev-item {
  border-top: var(--rule-w) solid var(--rule);
  padding-top: var(--s-3);
}

.dev-t {
  font-size: var(--fs-300);
  font-weight: 600;
}

.dev-d {
  margin-top: var(--s-2);
  max-width: 46ch;
  color: var(--ink-2);
}

/* Cases. Used by the scenario block in #services; the same classes also cover
   the still-hidden development scaffold, where `[hidden]` in the critical CSS
   keeps the block out of the page until it has real content. */
.cases {
  display: grid;
  gap: var(--s-5);
  margin-top: var(--s-7);
  padding-top: var(--s-6);
  border-top: var(--rule-w) solid var(--rule);
}

/* With a head above, the rule belongs to the head, not to the grid. */
.cases-head {
  margin-top: var(--s-7);
  padding-top: var(--s-6);
  border-top: var(--rule-w) solid var(--rule);
}

.cases-head + .cases {
  margin-top: var(--s-5);
  padding-top: 0;
  border-top: 0;
}

/* Each case carries its own rule: five items on a three-track grid leave a
   short last row, and the rules keep it reading as a list rather than as a
   grid with a hole in it. */
.case {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-2);
  border-top: var(--rule-w) solid var(--rule);
  padding-top: var(--s-3);
}

.case-t {
  font-size: var(--fs-300);
  font-weight: 600;
}

.case-d {
  color: var(--ink-2);
}

.case-r {
  font-weight: 700;
}

.case .link {
  margin-top: var(--s-2);
}

/* ------------------------------------------------------------- process -- */
/* Tighter than its neighbours on purpose — this section is a reference
   list, not a pitch, so it gets less air. */
.block-process {
  padding-block: var(--s-6);
  background: var(--paper-2);
  border-top: var(--rule-w) solid var(--rule);
  border-bottom: var(--rule-w) solid var(--rule);
}

.steps {
  display: grid;
  gap: var(--s-5);
}

.step {
  border-top: 2px solid var(--ink);
  padding-top: var(--s-3);
}

.step-n {
  display: block;
  font-size: var(--fs-100);
  font-weight: 600;
  color: var(--ink-3);
}

.step-t {
  margin-top: var(--s-2);
  font-size: var(--fs-300);
  font-weight: 600;
}

.step-d {
  margin-top: var(--s-2);
  font-size: var(--fs-100);
  line-height: 1.6;
  color: var(--ink-2);
}

/* ----------------------------------------------------------- licensing -- */
.block-licensing {
  padding-block: var(--s-8);
}

.vendors {
  width: 100%;
  border-collapse: collapse;
}

.vendors tr {
  border-bottom: var(--rule-w) solid var(--rule);
}

.vendors tr:first-child {
  border-top: var(--rule-w) solid var(--rule);
}

.vendors th,
.vendors td {
  padding-block: var(--s-3);
  text-align: left;
  font-weight: 400;
  vertical-align: baseline;
}

.vendors th {
  width: 40%;
  font-weight: 700;
  padding-right: var(--s-3);
}

.vendors td {
  color: var(--ink-2);
}

/* --------------------------------------------------------------- logo wall --
   Square tiles whose logo is swapped on a timer, one tile at a time. All of
   the tiles ship in the markup, so the wall is complete and static without
   JavaScript; js/app.js only rotates what is already on the page.

   It sits under the aside copy, so it stays a fixed 4x4 at every breakpoint
   and is capped in width: a block that tracked the column width would tower
   over the paragraph above it on a wide screen.
   -------------------------------------------------------------------------- */
.logo-wall {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-2);
  max-width: 280px;
  margin-top: var(--s-5);
}

.logo-cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  background: var(--paper-2);
  /* The clipping frame: during a swap two slots are stacked here and both
     slide, so whatever leaves the square must be cut off. */
  overflow: hidden;
}

.logo-slot {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* A box wider than it is tall, not a square: `contain` keeps the square marks
   at 44% of the tile either way, while a wordmark like Kaspersky is free to
   use the extra width instead of shrinking to a smudge. */
.logo-wall img {
  width: 84%;
  height: 44%;
  object-fit: contain;
  /* An SVG in <img> is an isolated document and ignores currentColor, so the
     marks always paint black. Invert them for the dark theme. */
  filter: grayscale(100%);
  opacity: 0.7;
}

:root[data-theme="dark"] .logo-wall img {
  filter: grayscale(100%) invert(1);
}

/* Brands with no established standalone glyph fall back to a name plate, so a
   tile can never read as empty. */
.logo-name {
  font-size: var(--fs-100);
  font-weight: 600;
  letter-spacing: var(--ls-label);
  color: var(--ink-3);
  text-transform: uppercase;
}


/* ------------------------------------------------------------- contact -- */
.block-contact {
  padding-block: var(--s-8);
}

.contacts {
  margin-top: var(--s-5);
  display: grid;
  gap: var(--s-3);
}

.contacts dd {
  margin-top: var(--s-1);
}

.contact-link {
  border-bottom: 1px solid var(--rule-2);
  padding-bottom: 1px;
  transition: color var(--t), border-color var(--t);
}

.contact-link:hover {
  color: var(--brand);
  border-color: var(--brand);
}

.form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-4);
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.field label {
  font-size: var(--fs-100);
  font-weight: 500;
  color: var(--ink-2);
}

.field input,
.field select,
.field textarea {
  padding: 10px var(--s-3);
  border: 1px solid var(--rule-2);
  border-radius: var(--r-sm);
  background: var(--paper);
  transition: border-color var(--t);
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--ink-3);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.field textarea {
  resize: vertical;
  min-height: 96px;
}

.form-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-3);
}

.form-note {
  margin: 0;
  font-size: var(--fs-100);
  color: var(--ink-2);
}

.form-note[data-state="error"] {
  color: #b3261e;
}

:root[data-theme="dark"] .form-note[data-state="error"] {
  color: #ff8a80;
}

.btn[aria-busy="true"] {
  opacity: 0.6;
  pointer-events: none;
}

/* Honeypot: off-screen rather than display:none, which some bots skip. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: var(--rule-w) solid var(--rule);
  padding-top: var(--s-6);
  padding-bottom: var(--s-4);
}

.footer-grid {
  display: grid;
  gap: var(--s-5);
  padding-bottom: var(--s-6);
}

.footer-line {
  margin-top: var(--s-2);
  font-size: var(--fs-100);
  color: var(--ink-3);
  max-width: 32ch;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.footer-link {
  font-size: var(--fs-100);
  color: var(--ink-2);
  transition: color var(--t);
}

.footer-link:hover {
  color: var(--ink);
}

.subscribe-row {
  display: flex;
  gap: var(--s-2);
  margin-top: var(--s-2);
}

.subscribe input {
  flex: 1;
  min-width: 0;
  padding: 10px var(--s-3);
  border: 1px solid var(--rule-2);
  border-radius: var(--r-sm);
  background: var(--paper);
  font-size: var(--fs-100);
  transition: border-color var(--t);
}

.subscribe input:focus {
  border-color: var(--brand);
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.subscribe .btn {
  font-size: var(--fs-100);
  padding-inline: var(--s-3);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-3);
  padding-top: var(--s-4);
  border-top: var(--rule-w) solid var(--rule);
  font-size: var(--fs-100);
  color: var(--ink-3);
}

.footer-prefs {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

/* A labelled row above the controls, so the switchers read as a feature
   rather than as legal small print. */
.prefs-block {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--s-2);
  padding: var(--s-4) 0 0;
}

.pref-btn-quiet {
  height: 34px;
  border-color: transparent;
  font-weight: 500;
  color: var(--ink-2);
}

.pref-btn-quiet:hover {
  border-color: var(--rule-2);
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   TOASTS — the only transient UI left on the page.
   -------------------------------------------------------------------------- */
.toasts {
  position: fixed;
  left: var(--s-4);
  bottom: var(--s-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  pointer-events: none;
}

.toast {
  max-width: min(380px, calc(100vw - var(--s-7)));
  padding: var(--s-3) var(--s-4);
  border: var(--rule-w) solid var(--rule);
  border-radius: var(--r-pill);
  background: var(--paper);
  box-shadow: var(--shadow-overlay);
  font-size: var(--fs-100);
  color: var(--ink);
  opacity: 0;
  transition: opacity var(--t);
}

.toast.show {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   RESPONSIVE
   -------------------------------------------------------------------------- */
@media (min-width: 600px) {
  .cases {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s-5) var(--s-6);
  }

  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s-5) var(--s-4);
  }

  .form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-wide {
    grid-column: 1 / -1;
  }

  .contacts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-nav {
    justify-self: end;
    text-align: right;
  }
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: 4fr 8fr;
    gap: var(--s-7);
  }

  /* Development mirrors the layout: list left, heading right. */
  .split-rev {
    grid-template-columns: 8fr 4fr;
  }

  .dev-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cases {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--s-6);
  }

  /* Contact leans the other way: the form needs the width, the copy does not. */
  .split-contact {
    grid-template-columns: 5fr 7fr;
  }

  .steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--s-4);
  }


  .contacts {
    grid-template-columns: minmax(0, 1fr);
  }

  .row {
    grid-template-columns: 56px 1fr;
    gap: var(--s-4);
    padding-block: var(--s-5);
  }

  .footer-grid {
    grid-template-columns: 4fr 4fr 4fr;
  }

  .footer-nav {
    justify-self: center;
    text-align: left;
  }
}

/* --------------------------------------------------------------------------
   REDUCED MOTION — only two transforms exist on the page; drop them.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  ::before,
  ::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------------------
   PRINT
   -------------------------------------------------------------------------- */
@media print {
  .site-header,
  .drawer,
  .toasts,
  .footer-prefs,
  .subscribe {
    display: none !important;
  }

  .section {
    padding-block: var(--s-4);
  }
}
