/* KEA Design — site styles. Built by build.py; do not edit files in dist/. */

@font-face {
  font-family: "Archivo";
  src: url("archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Layout: left-aligned 12-column grid. The hero is a circuit board (solder-mask
     green, gold pads, silkscreen type); reading sections sit on silkscreen white;
     the contact panel is a gold pad. One typeface, three widths. */
  --mask: #0e3b2e;        /* solder mask */
  --mask-deep: #082a20;   /* board shadow side */
  --trace: #2b7a5e;       /* copper under mask */
  --pad: #e3b34c;         /* ENIG gold pad */
  --silk: #f4f2ea;        /* silkscreen white */
  --ink: #0f231c;         /* text on light */
  --on-mask-muted: #a9c6b9;
  --on-silk-muted: #4a5e55;
  --rule-silk: #d3d1c2;

  --font: "Archivo", system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  --sec-pad: clamp(64px, 9vw, 120px);
  --focus: var(--pad);
  color-scheme: only light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--mask);
  color: var(--silk);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1.5px; }
p, h1, h2, h3, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: 1180px; margin-inline: auto; padding-inline: var(--gutter); }
.skip {
  position: absolute; left: var(--gutter); top: -100px; z-index: 20;
  background: var(--pad); color: var(--ink); padding: 10px 16px; border-radius: 8px; font-weight: 650;
}
.skip:focus { top: 12px; }

/* Type scale */
.h1 { font-size: clamp(2.05rem, 1.1rem + 3.7vw, 4rem); font-weight: 760; font-stretch: 115%; line-height: 1.04; letter-spacing: -0.015em; text-wrap: balance; }
.h2 { font-size: clamp(1.7rem, 1.1rem + 2.2vw, 2.75rem); font-weight: 720; font-stretch: 115%; line-height: 1.08; letter-spacing: -0.01em; text-wrap: balance; }
.h3 { font-size: 1.3rem; font-weight: 680; font-stretch: 108%; line-height: 1.2; text-wrap: balance; }
.lead { font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem); line-height: 1.5; max-width: 62ch; }
.silklabel { font-size: 0.84rem; font-stretch: 82%; font-weight: 560; letter-spacing: 0.035em; line-height: 1.3; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 22px; border-radius: 10px; border: 2px solid transparent;
  font: inherit; font-weight: 680; font-stretch: 105%; line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn--pad { background: var(--pad); color: var(--ink); }
.btn--pad:hover { background: #f0c566; }
.btn--silk { border-color: var(--silk); color: var(--silk); background: transparent; }
.btn--silk:hover { background: var(--silk); color: var(--mask); }
.btn--ink { background: var(--ink); color: var(--silk); }
.btn--ink:hover { background: var(--mask); }
.btn--inkline { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn--inkline:hover { background: var(--ink); color: var(--silk); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--mask); border-bottom: 1px solid var(--trace); }
.site-header__row { display: flex; align-items: center; gap: 20px; min-height: 68px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; white-space: nowrap; }
.wordmark__mark { width: 31px; height: 28px; flex: none; }
.wordmark__text { font-size: 1.36rem; font-weight: 700; font-stretch: 105%; letter-spacing: 0.01em; line-height: 1; }
.wordmark__text span { font-weight: 400; font-stretch: 100%; letter-spacing: 0; color: #cfe0d8; }
.site-nav { display: flex; gap: 26px; margin-left: auto; }
.site-nav a { text-decoration: none; font-weight: 540; }
.site-nav a:hover { text-decoration: underline; }
.lang { display: flex; gap: 2px; border: 1px solid var(--trace); border-radius: 8px; padding: 2px; }
.lang a { text-decoration: none; padding: 5px 9px; border-radius: 6px; color: var(--on-mask-muted); }
.lang a:hover { color: var(--silk); }
.lang a[aria-current="true"] { background: var(--silk); color: var(--mask); }
.site-header .btn { min-height: 40px; padding: 8px 16px; }

/* Hero: the board */
.hero { padding-block: clamp(20px, 3vw, 40px) clamp(48px, 7vw, 96px); }
.board {
  position: relative;
  border: 1.5px solid var(--trace); border-radius: 22px;
  padding: clamp(52px, 6vw, 84px) clamp(22px, 5vw, 72px) clamp(28px, 4vw, 56px);
  display: grid; gap: clamp(36px, 5vw, 64px);
}
.board__hole {
  position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 5px solid var(--pad); background: var(--mask-deep);
}
.board__hole--tl { top: 14px; left: 14px; }
.board__hole--tr { top: 14px; right: 14px; }
.board__hole--bl { bottom: 14px; left: 14px; }
.board__hole--br { bottom: 14px; right: 14px; }
.hero__copy { display: grid; gap: 24px; max-width: 980px; }
.hero__copy .lead { color: var(--on-mask-muted); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; }

/* Signal chain */
.chainwrap { --chain-gap: 24px; --chain-pad: 64px; position: relative; }
.chain { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--chain-gap); }
.chain__item { position: relative; display: grid; gap: 6px; align-content: start; }
.chain__item:not(:last-child)::before {
  content: ""; position: absolute; top: calc(var(--chain-pad) / 2 - 1px); left: var(--chain-pad);
  width: calc(100% - var(--chain-pad) + var(--chain-gap)); height: 2px; background: var(--trace);
}
.chain__pad {
  position: relative; z-index: 2; width: var(--chain-pad); height: var(--chain-pad); margin-bottom: 10px;
  display: grid; place-items: center; background: var(--mask); border: 1.5px solid var(--trace); border-radius: 12px;
}
.chain__pad svg { width: 40px; height: 40px; display: block; }
.chain__ref { color: var(--pad); }
.chain__name { font-size: 1.1rem; font-weight: 680; font-stretch: 108%; line-height: 1.2; }
.chain__text { color: var(--on-mask-muted); font-size: 0.95rem; line-height: 1.4; }
.chain__pulse {
  position: absolute; z-index: 1; top: calc(var(--chain-pad) / 2 - 5px); left: calc(var(--chain-pad) / 2);
  width: 10px; height: 10px; border-radius: 50%; background: var(--pad);
  box-shadow: 0 0 0 5px rgba(227, 179, 76, 0.22);
  animation: pulse-h 7s linear infinite;
}
@keyframes pulse-h {
  from { left: calc(var(--chain-pad) / 2); }
  to { left: calc(80% + var(--chain-gap) * 0.8 + var(--chain-pad) / 2); }
}
@keyframes pulse-v {
  from { top: calc(var(--chain-pad) / 2); }
  to { top: calc(100% - var(--chain-pad)); }
}

/* Title block */
.titleblock { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--trace); border: 1px solid var(--trace); }
.titleblock__cell { background: var(--mask); padding: 14px 18px; display: grid; gap: 2px; }
.titleblock dt { color: var(--on-mask-muted); }
.titleblock dd { font-weight: 640; line-height: 1.3; }

/* Sections */
.sec { padding-block: var(--sec-pad); }
.sec--silk { background: var(--silk); color: var(--ink); --focus: var(--mask); }
.sec--deep { background: var(--mask-deep); color: var(--silk); }
.sec--pad { background: var(--pad); color: var(--ink); --focus: var(--ink); }
.sec__head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px 32px; align-items: end; margin-bottom: clamp(32px, 5vw, 64px); }
.sec__head .h2 { grid-column: span 6; }
.sec__head .sec__intro { grid-column: span 6; max-width: 52ch; }
.sec--silk .sec__intro { color: var(--on-silk-muted); }
.sec--deep .sec__intro { color: var(--on-mask-muted); }

/* Services */
.svc { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px 32px; padding-block: 28px; border-top: 1px solid var(--rule-silk); }
.svc:first-of-type { border-top: 2px solid var(--ink); }
.svc__name { grid-column: span 3; }
.svc__text { grid-column: span 5; max-width: 60ch; }
.svc__tech { grid-column: span 4; color: var(--on-silk-muted); display: grid; gap: 4px; align-content: start; }
.svc__tech p { font-size: 0.95rem; line-height: 1.45; }

/* Work */
.flag { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px 32px; padding-block: 32px 56px; border-top: 2px solid var(--pad); }
.flag__id { grid-column: span 5; display: grid; gap: 8px; align-content: start; }
.flag__name { font-size: clamp(3.2rem, 1.6rem + 6.5vw, 6.5rem); font-weight: 840; font-stretch: 125%; line-height: 0.95; letter-spacing: -0.02em; color: var(--pad); }
.flag__body { grid-column: span 7; display: grid; gap: 18px; align-content: start; max-width: 62ch; }
.flag__body .lead { color: var(--silk); }
.kind { color: var(--on-mask-muted); font-weight: 540; }
.did { display: grid; gap: 2px; color: var(--on-mask-muted); font-size: 0.97rem; }
.did .silklabel { color: var(--pad); }
.cases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 56px; }
.case { display: grid; gap: 10px; align-content: start; padding-block: 24px 40px; border-top: 1px solid var(--trace); }
.case__link { font-weight: 620; }

/* Process */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 32px 28px; }
.step { counter-increment: step; display: grid; gap: 8px; align-content: start; border-top: 2px solid var(--ink); padding-top: 14px; }
.step::before { content: counter(step); font-size: 2.6rem; font-weight: 820; font-stretch: 125%; line-height: 1; color: var(--trace); }
.step p { color: var(--on-silk-muted); font-size: 0.98rem; line-height: 1.5; }
.studio { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 32px; margin-top: clamp(48px, 7vw, 96px); }
.studio__main { grid-column: span 7; display: grid; gap: 16px; align-content: start; }
.studio__main p { max-width: 60ch; }
.studio__terms { grid-column: span 5; display: grid; gap: 14px; align-content: start; }
.terms { display: grid; gap: 10px; }
.terms li { display: grid; grid-template-columns: 14px 1fr; gap: 12px; align-items: baseline; }
.terms li::before { content: ""; width: 12px; height: 12px; background: var(--pad); border: 1.5px solid var(--ink); border-radius: 2px; transform: translateY(1px); }

/* FAQ */
.faq { margin-top: clamp(48px, 7vw, 96px); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px 32px; }
.faq .h2 { grid-column: span 4; }
.faq__list { grid-column: span 8; }
.faq details { border-top: 1px solid var(--rule-silk); }
.faq details:last-of-type { border-bottom: 1px solid var(--rule-silk); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 44px 18px 0; position: relative; font-weight: 660; font-size: 1.1rem; line-height: 1.3; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 12px; font-size: 1.6rem; font-weight: 500; line-height: 1.2; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding: 0 44px 20px 0; color: var(--on-silk-muted); max-width: 64ch; }

/* Contact */
.contact { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 40px 48px; }
.contact__form { grid-column: span 7; display: grid; gap: 18px; }
.contact__side { grid-column: span 5; display: grid; gap: 22px; align-content: start; }
.contact__intro { max-width: 46ch; }
.field { display: grid; gap: 6px; }
.field--pair { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field label { font-weight: 640; }
.field .hint { font-size: 0.92rem; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--silk);
  border: 1.5px solid var(--ink); border-radius: 8px; padding: 12px 14px; height: 52px;
}
.field textarea { height: auto; min-height: 140px; resize: vertical; }
.contact__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.contact__note { font-size: 0.92rem; max-width: 56ch; }
.contact__status { font-weight: 640; overflow-wrap: anywhere; }
.contact__status:empty { display: none; }
.direct { display: grid; gap: 14px; border-top: 2px solid var(--ink); padding-top: 18px; }
.direct div { display: grid; gap: 0; }
.direct dd { font-weight: 660; font-size: 1.1rem; overflow-wrap: anywhere; }

/* Footer */
.site-footer { background: var(--mask-deep); border-top: 1px solid var(--trace); padding-block: 48px; color: var(--on-mask-muted); font-size: 0.96rem; }
.site-footer__row { display: flex; flex-wrap: wrap; gap: 28px 56px; justify-content: space-between; }
.site-footer .wordmark { color: var(--silk); margin-bottom: 6px; }
.site-footer__col { display: grid; gap: 6px; align-content: start; }
.site-footer a:hover { color: var(--silk); }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 4px 18px; }

/* 404 */
.notfound { min-height: 60vh; display: grid; align-content: center; gap: 20px; padding-block: var(--sec-pad); }

/* Tablet */
@media (max-width: 960px) {
  .site-nav { display: none; }
  .lang { margin-left: auto; }
  /* 12-column grids collapse to one column: their fixed gaps alone would overflow a phone. */
  .sec__head, .flag, .studio, .faq, .contact { grid-template-columns: minmax(0, 1fr); }
  .sec__head > *, .flag > *, .studio > *, .faq > *, .contact > * { grid-column: auto; }
  .svc__name { grid-column: 1 / -1; }
  .svc__text { grid-column: span 7; }
  .svc__tech { grid-column: span 5; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Chain goes vertical before it gets cramped */
@media (max-width: 860px) {
  .chain { grid-template-columns: 1fr; gap: 22px; }
  .chain__item { grid-template-columns: var(--chain-pad) 1fr; column-gap: 18px; row-gap: 2px; }
  .chain__pad { grid-row: 1 / span 3; margin-bottom: 0; }
  .chain__item:not(:last-child)::before {
    top: var(--chain-pad); left: calc(var(--chain-pad) / 2 - 1px);
    width: 2px; height: calc(100% - var(--chain-pad) + 22px);
  }
  .chain__pulse { left: calc(var(--chain-pad) / 2 - 5px); animation-name: pulse-v; }
  .titleblock { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Phone */
@media (max-width: 640px) {
  .site-header__row { gap: 10px; }
  .site-header .btn { display: none; }
  .svc { grid-template-columns: minmax(0, 1fr); }
  .svc > * { grid-column: auto; }
  .cases { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .step { grid-template-columns: 56px 1fr; column-gap: 8px; }
  .step::before { grid-row: 1 / span 2; }
  .field--pair { grid-template-columns: 1fr; }
  .titleblock { grid-template-columns: 1fr; }
  .hero__cta .btn, .contact__actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .chain__pulse { animation: none; display: none; }
  .btn { transition: none; }
}
