/* ==========================================================================
   Kontroma — kontroma.com
   Built from "Kontroma Site v2.dc.html" + handoff/{tokens,effects}.css.

   Ground rules held from the handoff:
     - Light and dark are one design. No colour is hard-coded below the
       token block.
     - Zero corner radius anywhere. The only circles are the dots of the mark.
     - Everything flush left, including labels inside buttons.
     - 2px rules separate sections; 1px hairlines only inside a panel.
     - Archivo throughout: 400 body, 600/700 labels, 800 anything structural.

   Two deliberate deviations from the handoff, both for WCAG AA — see
   README.md "Deviations from the handoff":
     1. --k-accent-btn is used for accent fills carrying small text.
     2. --k-rule-strong is used for interactive borders.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Font — self-hosted so the CSP keeps font-src 'self' and the page makes
   no third-party request. Archivo is a variable font: one file, 400–800.
   -------------------------------------------------------------------------- */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 100%;
  font-display: swap;
  src: url("fonts/archivo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 100%;
  font-display: swap;
  src: url("fonts/archivo-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

/* --------------------------------------------------------------------------
   2. Tokens

   Light is the default and lives on bare :root, so a browser with JavaScript
   off — where no data-theme attribute is ever written — still gets a complete
   palette. Dark is applied twice: once for the OS preference (unless the
   visitor has explicitly chosen light) and once for an explicit dark choice.
   That pairing is what makes "auto" work without a value of its own.
   -------------------------------------------------------------------------- */

:root {
  /* ground */
  --k-bg: #f3f2f2;
  --k-bg-grad: radial-gradient(ellipse 100% 70% at 22% -10%, #ffffff 0%, #f6f5f5 45%, #eeecec 100%);
  --k-surface: rgba(32, 30, 29, 0.035);
  --k-scrim: rgba(243, 242, 242, 0.86);

  /* ink */
  --k-ink: #201e1d;
  --k-ink-strong: #14100f;
  --k-ink-soft: #444141;
  --k-muted: #605d5d;

  /* rules */
  --k-rule: rgba(32, 30, 29, 0.42);        /* section + panel borders */
  --k-rule-strong: rgba(32, 30, 29, 0.55); /* interactive borders, >=3:1 */
  --k-rule-soft: rgba(32, 30, 29, 0.10);   /* 1px rows inside a panel */

  /* accent — one red, used sparingly */
  --k-accent: #ec3013;      /* fields and the mark core */
  --k-accent-btn: #dd2b0f;  /* accent under small text: 4.58:1 */
  --k-accent-btn-hover: #c62509;
  --k-accent-text: #ae1800; /* accent at paragraph size: 6.49:1 */
  --k-on-accent: #fffaf8;

  /* imagery */
  --k-photo-bg: #e4e2e1;
  --k-photo-filter: none;

  /* type + geometry */
  --k-font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --k-container: 1180px;
  --k-gutter: 32px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --k-bg: #0a0a0a;
    --k-bg-grad: radial-gradient(ellipse 95% 65% at 24% -5%, #1a2a3a 0%, #0d1a1f 38%, #140f08 70%, #0a0a0a 100%);
    --k-surface: rgba(242, 239, 238, 0.045);
    --k-scrim: rgba(10, 10, 10, 0.84);

    --k-ink: #f2efee;
    --k-ink-strong: #fbfaf9;
    --k-ink-soft: #ddd8d6;
    --k-muted: #b0aaa8;

    --k-rule: rgba(242, 239, 238, 0.26);
    --k-rule-strong: rgba(242, 239, 238, 0.42);
    --k-rule-soft: rgba(242, 239, 238, 0.09);

    --k-accent-text: #ff9783; /* the light ramp step: 9.43:1 on near-black */

    --k-photo-bg: #171717;
    --k-photo-filter: brightness(0.85) contrast(1.04);

    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --k-bg: #0a0a0a;
  --k-bg-grad: radial-gradient(ellipse 95% 65% at 24% -5%, #1a2a3a 0%, #0d1a1f 38%, #140f08 70%, #0a0a0a 100%);
  --k-surface: rgba(242, 239, 238, 0.045);
  --k-scrim: rgba(10, 10, 10, 0.84);

  --k-ink: #f2efee;
  --k-ink-strong: #fbfaf9;
  --k-ink-soft: #ddd8d6;
  --k-muted: #b0aaa8;

  --k-rule: rgba(242, 239, 238, 0.26);
  --k-rule-strong: rgba(242, 239, 238, 0.42);
  --k-rule-soft: rgba(242, 239, 238, 0.09);

  --k-accent-text: #ff9783;

  --k-photo-bg: #171717;
  --k-photo-filter: brightness(0.85) contrast(1.04);

  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   3. Base
   -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--k-bg);
  /* the sticky header is 58px; anchors land clear of it */
  scroll-padding-top: 72px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--k-bg);
  /* the gradient belongs to the top of the document, not the top of the
     viewport — background-attachment: fixed would drag it down the page */
  background-image: var(--k-bg-grad);
  background-repeat: no-repeat;
  color: var(--k-ink);
  font-family: var(--k-font);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, dl, dd, figure, blockquote { margin: 0; }

img { max-width: 100%; display: block; }

a { color: var(--k-accent-text); text-underline-offset: 3px; }
a:hover { color: var(--k-accent); }

:focus-visible {
  outline: 2px solid var(--k-accent);
  outline-offset: 3px;
}

::selection { background: rgba(236, 48, 19, 0.3); }

/* Numbers read character by character */
.k-tnum { font-variant-numeric: tabular-nums; }

/* Skip link — first thing in the tab order, invisible until focused */
.k-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--k-accent-btn);
  color: var(--k-on-accent);
  font-weight: 800;
  font-size: 14px;
  padding: 12px 20px;
  text-decoration: none;
}
.k-skip:focus {
  left: 0;
  color: var(--k-on-accent);
}

/* --------------------------------------------------------------------------
   4. Layout primitives
   -------------------------------------------------------------------------- */

/* Full-bleed backgrounds span the viewport; contents stay in the measure. */
.k-wrap {
  max-width: var(--k-container);
  margin: 0 auto;
  padding-inline: var(--k-gutter);
}

.k-band { border-top: 2px solid var(--k-rule); }

.k-section { padding-block: 80px; }

/* A section eyebrow: the small uppercase label that opens each band. */
.k-eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--k-muted);
  margin-bottom: 44px;
}

/* The divider rule shared by the fact row and the principles: a left border
   on every cell but the first, becoming a top border once the grid has
   collapsed to a single column. */
.k-cell {
  border-left: 2px solid var(--k-rule);
  padding-inline: 30px;
}
.k-cell--first {
  border-left: 0;
  padding-inline: 0 30px;
}
@media (max-width: 900px) {
  .k-cell {
    border-left: 0;
    border-top: 2px solid var(--k-rule);
    padding: 22px 0 0;
  }
  .k-cell--first { border-top: 0; padding: 0; }
}

/* --------------------------------------------------------------------------
   5. Header
   -------------------------------------------------------------------------- */

.k-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--k-scrim);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--k-rule);
}

.k-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 13px;
}

.k-lockup {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--k-ink);
  flex: none;
}
.k-lockup:hover { color: var(--k-ink); }
.k-lockup__word {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.15em;
}

.k-header__right {
  display: flex;
  align-items: center;
  gap: 28px;
}

.k-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.k-nav a { color: var(--k-ink); text-decoration: none; }
.k-nav a:hover { color: var(--k-accent-text); }

/* Under 860px the nav would crowd the lockup; the anchors are all reachable
   by scrolling, so the row keeps only the lockup and the theme switch. */
@media (max-width: 860px) {
  .k-nav { display: none; }
}

/* --------------------------------------------------------------------------
   6. Theme switch
   -------------------------------------------------------------------------- */

.k-theme {
  display: flex;
  border: 2px solid var(--k-rule-strong);
  flex: none;
}

.k-theme button {
  font-family: inherit;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 7px 11px;
  cursor: pointer;
  border: 0;
  border-right: 2px solid var(--k-rule-strong);
  background: transparent;
  color: var(--k-muted);
}
.k-theme button:last-child { border-right: 0; }
.k-theme button:hover { color: var(--k-ink); }
.k-theme button[aria-pressed="true"] {
  background: var(--k-accent-btn);
  color: var(--k-on-accent);
}

/* --------------------------------------------------------------------------
   7. Buttons — one size, two variants, flush-left labels
   -------------------------------------------------------------------------- */

.k-btnrow {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.k-btn {
  display: inline-flex;
  align-items: center;
  font-weight: 800;
  font-size: 14px;
  line-height: 1.2;
  padding: 12px 20px;
  text-decoration: none;
  border: 2px solid transparent;
  transition: background-color 120ms linear, color 120ms linear;
}

.k-btn--primary {
  background: var(--k-accent-btn);
  color: var(--k-on-accent);
}
.k-btn--primary:hover {
  background: var(--k-accent-btn-hover);
  color: var(--k-on-accent);
}

.k-btn--secondary {
  border-color: var(--k-rule-strong);
  color: var(--k-ink);
}
.k-btn--secondary:hover {
  background: var(--k-surface);
  color: var(--k-ink);
}

@media (prefers-reduced-motion: reduce) {
  .k-btn { transition: none; }
}

/* --------------------------------------------------------------------------
   8. Motion — the two effects, and there are no others

   The dot field is a tiled PNG animated on background-position: composited,
   never a layout repaint. One tile height per cycle, so the loop is seamless.
   -------------------------------------------------------------------------- */

@keyframes k-drift {
  from { background-position: center 0; }
  to   { background-position: center -240px; }
}

@keyframes k-float {
  0%, 100% { transform: translateY(-10px); }
  50%      { transform: translateY(10px); }
}

.k-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("assets/dot-tile-ink.png");
  background-repeat: repeat;
  background-size: 141px 240px;
  background-position: center 0;
  opacity: 0.10;
  animation: k-drift 26s linear infinite;
  /* fades toward the edges so it never fights the type */
  -webkit-mask-image: radial-gradient(ellipse 78% 74% at 50% 50%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 78% 74% at 50% 50%, #000 30%, transparent 100%);
}

.k-mark {
  background-image: url("assets/mark-dots-ink.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* The field and the mark swap artwork with the theme rather than being tinted. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .k-field {
    background-image: url("assets/dot-tile-light.png");
    opacity: 0.085;
  }
  :root:not([data-theme="light"]) .k-mark {
    background-image: url("assets/mark-dots-light.png");
  }
}
:root[data-theme="dark"] .k-field {
  background-image: url("assets/dot-tile-light.png");
  opacity: 0.085;
}
:root[data-theme="dark"] .k-mark {
  background-image: url("assets/mark-dots-light.png");
}

.k-float { animation: k-float 9s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .k-field, .k-float { animation: none; }
}

/* --------------------------------------------------------------------------
   9. Hero

   No entrance animation on the h1. It is the largest above-the-fold element
   and an opacity: 0 start measurably costs PageSpeed.
   -------------------------------------------------------------------------- */

.k-hero {
  position: relative;
  overflow: hidden;
  padding: 104px 0 84px;
}
.k-hero > .k-wrap { position: relative; z-index: 2; }
/* texture only behind the hero; the signal band carries it a shade stronger */
.k-hero .k-field { opacity: 0.05; }

.k-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--k-muted);
  margin-bottom: 44px;
}

.k-hero h1 {
  font-size: clamp(40px, 6.2vw, 80px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.035em;
  max-width: 20ch;
  margin-bottom: 34px;
  color: var(--k-ink-strong);
  text-wrap: pretty;
}

.k-hero__lead {
  font-size: 20px;
  line-height: 1.55;
  max-width: 58ch;
  color: var(--k-ink-soft);
  margin-bottom: 44px;
}

/* --------------------------------------------------------------------------
   10. Fact row
   -------------------------------------------------------------------------- */

.k-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 30px 0;
  padding-block: 34px;
}

.k-fact__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--k-muted);
  margin-bottom: 10px;
}

.k-fact__value {
  font-weight: 800;
  font-size: 23px;
  line-height: 1.2;
}
.k-fact__value--accent { color: var(--k-accent-text); }

/* --------------------------------------------------------------------------
   11. What we build
   -------------------------------------------------------------------------- */

.k-product {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 56px;
  align-items: start;
}

.k-product h2 {
  font-size: clamp(32px, 3.6vw, 46px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin-bottom: 22px;
  color: var(--k-ink-strong);
}

.k-product__lead {
  font-size: 18px;
  line-height: 1.6;
  max-width: 52ch;
  color: var(--k-ink-soft);
  margin-bottom: 20px;
}

.k-product__body {
  font-size: 16px;
  line-height: 1.6;
  max-width: 52ch;
  color: var(--k-ink-soft);
  margin-bottom: 30px;
}

/* The platform panel. Four rows, and they state the truth of the day. */
.k-panel {
  border: 2px solid var(--k-rule-strong);
  padding: 26px;
  background: var(--k-surface);
}

.k-panel__grid {
  display: grid;
  grid-template-columns: 1fr auto;
}

.k-panel__head {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--k-muted);
  padding-bottom: 14px;
}
.k-panel__head--right { text-align: right; }

.k-panel__name,
.k-panel__status {
  font-size: 15px;
  padding: 13px 0;
  border-top: 1px solid var(--k-rule-soft);
}
.k-panel__name { font-weight: 600; color: var(--k-ink); }
.k-panel__status { text-align: right; color: var(--k-ink-soft); }

.k-panel__note {
  font-size: 13px;
  line-height: 1.5;
  color: var(--k-muted);
  margin-top: 18px;
}

/* --------------------------------------------------------------------------
   12. How we work
   -------------------------------------------------------------------------- */

.k-principles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 44px 0;
}

.k-principle.k-cell--first { padding-right: 38px; }
@media (max-width: 900px) { .k-principle.k-cell--first { padding-right: 0; } }

.k-principle__num {
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--k-accent-text);
  margin-bottom: 16px;
}

.k-principle h3 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.12;
  max-width: 22ch;
  margin-bottom: 14px;
  color: var(--k-ink-strong);
}

.k-principle p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--k-ink-soft);
}

/* --------------------------------------------------------------------------
   13. Signal band + poster statement
   -------------------------------------------------------------------------- */

.k-signal {
  position: relative;
  overflow: hidden;
  height: 420px;
}
.k-signal .k-field { opacity: 0.055; }

.k-signal__mark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200px;
  height: 200px;
  margin: -100px 0 0 -100px;
  pointer-events: none;
}

/* The only place red runs as a field. */
.k-poster {
  background: var(--k-accent);
  color: var(--k-on-accent);
}
.k-poster > .k-wrap { padding-block: 88px; }
.k-poster p {
  font-weight: 800;
  font-size: clamp(30px, 4.6vw, 60px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  max-width: 26ch;
  text-wrap: pretty;
}

/* --------------------------------------------------------------------------
   14. The people
   -------------------------------------------------------------------------- */

.k-people {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 44px;
}

.k-portrait {
  border: 2px solid var(--k-rule);
  background: var(--k-photo-bg);
  filter: grayscale(1) contrast(1.08);
}
.k-portrait img {
  width: 100%;
  height: auto;
  filter: var(--k-photo-filter);
}

.k-person__caption {
  border-bottom: 2px solid var(--k-rule);
  padding: 20px 0 18px;
}
.k-person__caption h3 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin-bottom: 7px;
  color: var(--k-ink-strong);
}
.k-person__role {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--k-muted);
  /* one role wraps to two lines and the other does not; reserving both keeps
     the rule under each name on the same baseline */
  min-height: 3.2em;
}
@media (max-width: 900px) {
  .k-person__role { min-height: 0; }
}

/* The note sits on the baseline of the two name blocks. */
.k-people__note {
  max-width: 34ch;
  align-self: end;
  padding-bottom: 18px;
}
.k-people__note p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--k-ink-soft);
}
@media (max-width: 900px) {
  .k-people__note { align-self: start; padding-bottom: 0; }
}

/* --------------------------------------------------------------------------
   15. Company — the dry, essential block. Reviewers scroll straight here.
   -------------------------------------------------------------------------- */

.k-company {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0 56px;
}

.k-def {
  border-top: 2px solid var(--k-rule);
  padding: 18px 0;
}
.k-def dt {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--k-muted);
  margin-bottom: 7px;
}
.k-def dd {
  font-size: 17px;
  line-height: 1.6;
  color: var(--k-ink);
}

/* --------------------------------------------------------------------------
   16. Careers — built, and off behind one flag. See index.html.
   -------------------------------------------------------------------------- */

.k-careers h2 {
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 800;
  letter-spacing: -0.028em;
  line-height: 1.12;
  max-width: 24ch;
  margin-bottom: 22px;
  color: var(--k-ink-strong);
}
.k-careers__body {
  font-size: 17px;
  line-height: 1.6;
  max-width: 52ch;
  color: var(--k-ink-soft);
  margin-bottom: 30px;
}

/* --------------------------------------------------------------------------
   17. Footer — links out to the policies, never duplicates them
   -------------------------------------------------------------------------- */

.k-foot {
  background: var(--k-surface);
}

.k-foot__cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 40px;
  padding: 64px 0 44px;
}

.k-foot__lockup {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 16px;
  text-decoration: none;
  color: var(--k-ink-strong);
}
.k-foot__lockup span {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.15em;
}

.k-foot__id {
  font-size: 14px;
  line-height: 1.65;
  color: var(--k-ink-soft);
}

.k-foot__head {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--k-muted);
  margin-bottom: 16px;
}

.k-foot__links {
  display: flex;
  flex-direction: column;
  gap: 11px;
  font-size: 14px;
}
.k-foot__links a { color: var(--k-ink); text-decoration: none; }
.k-foot__links a:hover { color: var(--k-accent-text); text-decoration: underline; }

.k-foot__legal {
  font-size: 13px;
  color: var(--k-muted);
  padding-bottom: 48px;
}

/* --------------------------------------------------------------------------
   18. Narrow screens — the grids collapse on their own; only the largest
   paddings need trimming.
   -------------------------------------------------------------------------- */

@media (max-width: 700px) {
  :root { --k-gutter: 22px; }

  /* the lockup and the three-segment switch do not both fit at 375px at
     full size; the switch gives up the space, the wordmark keeps it */
  .k-header__row { gap: 12px; }
  .k-header__right { gap: 12px; }
  .k-theme button { font-size: 10px; padding: 6px 8px; }
  .k-lockup__word { font-size: 15px; letter-spacing: 0.12em; }

  .k-hero { padding: 72px 0 60px; }
  .k-section { padding-block: 60px; }
  .k-poster > .k-wrap { padding-block: 64px; }
  .k-signal { height: 300px; }
  .k-hero__lead { font-size: 18px; }
  .k-kicker { margin-bottom: 32px; }
  .k-eyebrow { margin-bottom: 32px; }
}

@media print {
  .k-header, .k-signal, .k-field, .k-theme, .k-skip { display: none !important; }
  body { background: #fff; color: #000; }
}
