/* ============================================================
   KHAUTOMATE — engineering-schematic identity
   ink blue-black base · cobalt current · signal cyan pulses
   Chakra Petch display · Familjen Grotesk body · IBM Plex Mono
   ============================================================ */

:root {
  --ink:    #04070F;
  --panel:  #0A1120;
  --trace:  #1B2A47;
  --cobalt: #2E62FF;
  --cyan:   #53D8FF;
  --text:   #E8EDF7;
  --dim:    #8A94AB;

  --display: "Chakra Petch", "Familjen Grotesk", sans-serif;
  --body:    "Familjen Grotesk", system-ui, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, monospace;

  --gutter: clamp(20px, 5vw, 72px);
  --max: 1180px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
}

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.mono { font-family: var(--mono); }

a { color: inherit; }

::selection { background: var(--cobalt); color: #fff; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------------- header ---------------- */

.site-head {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--gutter);
  background: linear-gradient(to bottom, rgba(4,7,15,.92), rgba(4,7,15,0));
  pointer-events: none;
}
.site-head > * { pointer-events: auto; }

.head-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.head-mark { width: 30px; height: 30px; }
.head-word {
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .22em;
}

.head-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.head-nav a {
  text-decoration: none;
  color: var(--dim);
  transition: color .2s;
}
.head-nav a:hover { color: var(--text); }
.head-nav .head-cta {
  color: var(--cyan);
  border: 1px solid var(--trace);
  padding: 8px 14px;
  border-radius: 2px;
  transition: border-color .2s, color .2s, background .2s;
}
.head-nav .head-cta:hover {
  border-color: var(--cobalt);
  background: rgba(46, 98, 255, .12);
  color: var(--text);
}

/* ---------------- hero ---------------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
}

#schematic {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 62% 52% at 50% 46%, rgba(4,7,15,.88) 0%, rgba(4,7,15,.42) 55%, rgba(4,7,15,0) 100%);
  pointer-events: none;
}

.hero-core {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 var(--gutter);
  max-width: 860px;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: .34em;
  color: var(--cyan);
  margin-bottom: 22px;
  opacity: 0;
  animation: rise .9s .15s cubic-bezier(.2,.7,.2,1) forwards;
}

.hero-word {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(34px, 8vw, 102px);
  line-height: .96;
  letter-spacing: .04em;
  white-space: nowrap;
  margin-bottom: 26px;
}
.hero-word span {
  display: inline-block;
  opacity: 0;
  animation: rise .9s cubic-bezier(.2,.7,.2,1) forwards;
}
.hw-kh   { animation-delay: .3s; }
.hw-auto { animation-delay: .42s; color: var(--cobalt);
           text-shadow: 0 0 34px rgba(46,98,255,.55); }
.hw-mate { animation-delay: .54s; }

.hero-sub {
  color: var(--dim);
  font-size: clamp(16px, 1.6vw, 19px);
  max-width: 560px;
  margin: 0 auto 34px;
  opacity: 0;
  animation: rise .9s .7s cubic-bezier(.2,.7,.2,1) forwards;
}

.hero-ctas {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  animation: rise .9s .85s cubic-bezier(.2,.7,.2,1) forwards;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.btn {
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 14px 26px;
  border-radius: 2px;
  transition: transform .2s, box-shadow .2s, background .2s, border-color .2s;
}
.btn-solid {
  background: var(--cobalt);
  color: #fff;
  box-shadow: 0 0 0 rgba(46,98,255,0);
}
.btn-solid:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(46,98,255,.45);
}
.btn-ghost {
  border: 1px solid var(--trace);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--cobalt); background: rgba(46,98,255,.1); }

.hero-foot {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 10px;
  letter-spacing: .3em;
  color: var(--dim);
}
.tick-line {
  display: block;
  width: 46px;
  height: 1px;
  background: var(--trace);
}

/* ---------------- ticker ---------------- */

.ticker {
  border-top: 1px solid var(--trace);
  border-bottom: 1px solid var(--trace);
  overflow: hidden;
  padding: 13px 0;
  background: var(--panel);
}
.ticker-track {
  display: flex;
  gap: 34px;
  align-items: center;
  white-space: nowrap;
  width: max-content;
  font-size: 12px;
  letter-spacing: .22em;
  color: var(--dim);
  animation: slide 36s linear infinite;
}
.ticker-track i {
  font-style: normal;
  color: var(--cobalt);
  font-size: 8px;
}
@keyframes slide {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------------- sections ---------------- */

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(90px, 12vw, 150px) var(--gutter) 0;
}

.section-head { margin-bottom: clamp(42px, 6vw, 64px); }

.sec-label {
  font-size: 12px;
  letter-spacing: .3em;
  color: var(--cyan);
  margin-bottom: 14px;
}

.section h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(30px, 4.6vw, 52px);
  letter-spacing: .01em;
  line-height: 1.08;
}

.sec-note {
  color: var(--dim);
  margin-top: 14px;
  max-width: 460px;
}

/* modules */

.modules {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.module {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--trace);
  border-radius: 3px;
  padding: 34px 28px 38px;
  transition: transform .25s, border-color .25s;
}
.module:hover {
  transform: translateY(-4px);
  border-color: var(--cobalt);
}

/* schematic corner ticks */
.mod-frame::before,
.mod-frame::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--cobalt);
  border-style: solid;
  opacity: .9;
}
.mod-frame::before {
  top: -1px; left: -1px;
  border-width: 2px 0 0 2px;
}
.mod-frame::after {
  bottom: -1px; right: -1px;
  border-width: 0 2px 2px 0;
}

.mod-tag {
  font-size: 11px;
  letter-spacing: .26em;
  color: var(--cyan);
  margin-bottom: 18px;
}

.module h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 21px;
  margin-bottom: 12px;
}

.module p:last-child {
  color: var(--dim);
  font-size: 15.5px;
}

/* lab list */

.lab-list { list-style: none; }

.lab-row {
  display: grid;
  grid-template-columns: 200px 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 26px 4px;
  border-top: 1px solid var(--trace);
  transition: background .2s;
}
.lab-row:last-child { border-bottom: 1px solid var(--trace); }
.lab-row:hover {
  background: linear-gradient(to right, rgba(46,98,255,.07), transparent 70%);
}
.lab-row:hover .lab-name { transform: translateX(12px); }

.lab-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: .08em;
  transition: transform .25s cubic-bezier(.2,.7,.2,1);
}

.lab-desc { color: var(--dim); font-size: 15.5px; }

.lab-status {
  font-size: 11px;
  letter-spacing: .2em;
  padding: 7px 13px;
  border-radius: 2px;
  text-decoration: none;
  white-space: nowrap;
}
.lab-status.is-live {
  color: var(--cyan);
  border: 1px solid rgba(83,216,255,.35);
  transition: background .2s, color .2s;
}
.lab-status.is-live:hover {
  background: rgba(83,216,255,.14);
  color: #fff;
}
.lab-status.is-priv {
  color: var(--dim);
  border: 1px dashed var(--trace);
}

/* ---------------- contact ---------------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 90px);
  align-items: start;
}

.contact-copy p:not(.sec-label) {
  color: var(--dim);
  margin-top: 16px;
  max-width: 420px;
}

.contact-alt {
  font-size: 12px;
  letter-spacing: .14em;
}
.contact-alt a {
  color: var(--cyan);
  text-decoration-color: rgba(83,216,255,.4);
  text-underline-offset: 4px;
}

.contact-form {
  display: grid;
  gap: 20px;
  background: var(--panel);
  border: 1px solid var(--trace);
  border-radius: 3px;
  padding: 34px 30px;
}

.contact-form .hp { position: absolute; left: -9999px; }

.contact-form label {
  display: grid;
  gap: 9px;
}
.contact-form label span {
  font-size: 10.5px;
  letter-spacing: .24em;
  color: var(--dim);
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  background: var(--ink);
  border: 1px solid var(--trace);
  border-radius: 2px;
  color: var(--text);
  font-family: var(--body);
  font-size: 15.5px;
  padding: 13px 14px;
  transition: border-color .2s;
  resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--cobalt);
}
.contact-form ::placeholder { color: #55607a; }

.btn-send {
  border: 0;
  cursor: pointer;
  justify-self: start;
}

.form-note {
  font-size: 11.5px;
  letter-spacing: .12em;
  color: var(--cyan);
  min-height: 1em;
}

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

.site-foot {
  margin-top: clamp(100px, 13vw, 170px);
  padding: 0 var(--gutter) 46px;
}

.foot-line {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--cobalt), transparent);
  margin-bottom: 52px;
  max-width: var(--max);
  margin-inline: auto;
  margin-bottom: 52px;
}

.foot-grid {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
  flex-wrap: wrap;
}

.foot-story {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.25;
}

.foot-meta {
  display: flex;
  gap: 26px;
  font-size: 11px;
  letter-spacing: .18em;
  color: var(--dim);
  flex-wrap: wrap;
}
.foot-meta a {
  color: var(--dim);
  text-decoration: none;
  transition: color .2s;
}
.foot-meta a:hover { color: var(--cyan); }

/* ---------------- reveal on scroll ---------------- */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1);
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* ---------------- responsive ---------------- */

@media (max-width: 900px) {
  .modules { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .lab-row { grid-template-columns: 130px 1fr auto; }
}

@media (max-width: 640px) {
  .head-nav a:not(.head-cta) { display: none; }
  .lab-row {
    grid-template-columns: 1fr auto;
    grid-template-areas: "name status" "desc desc";
    row-gap: 8px;
  }
  .lab-name { grid-area: name; }
  .lab-desc { grid-area: desc; }
  .lab-status { grid-area: status; }
  .hero-sub { font-size: 15.5px; }
}
