/* ------------------------------------------------------------------
   K & O Software Solutions — design system
   Two colors: brand-blue field, warm-white paper.
   Instrument Serif (display) + IBM Plex Mono (everything else).
------------------------------------------------------------------- */

@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/InstrumentSerif-400-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/InstrumentSerif-400italic-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/IBMPlexMono-400-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/IBMPlexMono-500-latin.woff2') format('woff2');
}

:root {
  --field: #0075ff;            /* K&O brand blue — the page */
  --paper: #f7f4ec;            /* warm white — the bands */
  --hairline: rgba(247, 244, 236, 0.4);
  --hairline-ink: rgba(0, 117, 255, 0.35);
  --accent: #0075ff;           /* K&O brand blue — large/hover accents on paper only */
  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --mono: 'IBM Plex Mono', 'Courier New', monospace;
  --primary-color: #0075ff;    /* legacy token (loading ring) */
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html {
  padding: 0;
  margin: 0;
  scroll-behavior: smooth;
}

body {
  background-color: var(--field);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  padding: 0;
  margin: 0;
}

::selection {
  background: var(--paper);
  color: var(--field);
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--field);
}

::-webkit-scrollbar-thumb {
  background: var(--hairline);
  border-radius: 0;
}

a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* Blazor's FocusOnNavigate focuses the page h1 — no visible ring there. */
h1:focus,
h1:focus-visible {
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- shared devices ------------------------------------------------ */

.micro {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* --- legal / content pages (Imprint, Privacy, Intelligains) -------- */

.wrapper {
  max-width: 780px;
  margin: clamp(3rem, 8vh, 6rem) auto;
  padding: clamp(2rem, 5vw, 4rem) clamp(1.25rem, 4vw, 3.5rem);
  background: var(--paper);
  color: var(--field);
  border: 1px solid var(--field);
}

@media (max-width: 840px) {
  .wrapper {
    margin-left: 16px;
    margin-right: 16px;
  }
}

.wrapper h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.05;
  margin: 2.5rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hairline-ink);
}

.wrapper h1:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.wrapper h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(24px, 4vw, 32px);
  line-height: 1.1;
  margin: 2.25rem 0 0.75rem;
}

.wrapper h3 {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 2rem 0 0.5rem;
}

.wrapper h4 {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.65;
  margin: 0.75rem 0;
}

.wrapper p {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  margin: 0.75rem 0;
}

.wrapper b {
  font-weight: 500;
}

.wrapper a {
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-word;
}

.wrapper a:hover {
  color: var(--accent);
}

.wrapper ul {
  font-size: 13px;
  line-height: 1.65;
}

/* --- blazor infrastructure ---------------------------------------- */

.valid.modified:not([type=checkbox]) {
  outline: 1px solid #26b050;
}

.invalid {
  outline: 1px solid red;
}

.validation-message {
  color: red;
}

code {
  color: inherit;
}

/* --- engraved plates: shared frame, parallax + reveal --------------- */
/* layout/colors live in the page's scoped css; motion is global and
   only active once the script tags <html> with .motion */

.plate-frame {
  overflow: hidden;
}

.plate-frame img {
  display: block;
  width: 100%;
  height: auto;
}

html.motion .plate-frame img {
  transform: scale(1.1) translateY(var(--py, 0%));
  will-change: transform;
}

html.motion .plate {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

html.motion .plate.plate-in {
  opacity: 1;
  transform: none;
}
