/* KD Engineering — shared styles */

:root {
  --bg: #0a0c10;
  --bg-raised: #11141a;
  --bg-card: #151920;
  --line: #232833;
  --line-strong: #2f3644;
  --text: #e8ebf0;
  --text-muted: #9aa3b2;
  --text-dim: #6b7484;
  --accent: #f5b83d;
  --accent-strong: #ffcb5c;
  --accent-ink: #1a1304;
  --accent-soft: rgba(245, 184, 61, 0.1);
  --danger: #ff7a6b;
  --ok: #5fd39a;
  --radius: 14px;
  --radius-sm: 8px;
  --wrap: 1160px;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 104px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

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

h1,
h2,
h3 {
  font-family: var(--font-head);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.4rem, 5.4vw, 4.1rem);
  font-weight: 600;
}

h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  font-weight: 600;
}

h3 {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1em;
}

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: 100;
}

.skip-link:focus {
  left: 8px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 12, 16, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 88px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

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

.brand-mark {
  width: 38px;
  height: 38px;
  flex: none;
}

.brand-logo {
  height: 60px;
  width: auto;
}

.brand-logo-lg {
  height: 76px;
}

@media (max-width: 720px) {
  .brand-logo {
    height: 50px;
  }
}

.brand small {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: -2px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav a:not(.btn) {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.15s;
}

.nav a:not(.btn):hover,
.nav a[aria-current="page"]:not(.btn) {
  color: var(--text);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  width: 44px;
  height: 44px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 600;
  padding: 13px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  background: var(--accent-strong);
  color: var(--accent-ink);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-sm {
  padding: 9px 18px;
  font-size: 0.9rem;
}

/* ---------- Shared section pieces ---------- */

section {
  padding: 104px 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--accent);
}

.section-head {
  max-width: 680px;
  margin-bottom: 56px;
}

.section-head p {
  color: var(--text-muted);
  font-size: 1.08rem;
  margin: 0;
}

.band {
  background: var(--bg-raised);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: 96px 0 104px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse 75% 70% at 70% 30%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 70% 30%, #000 0%, transparent 75%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  width: 620px;
  height: 620px;
  right: -160px;
  top: -220px;
  background: radial-gradient(circle, rgba(245, 184, 61, 0.13), transparent 65%);
  pointer-events: none;
}

.hero .wrap {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 64px;
  align-items: center;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero .lede {
  font-size: 1.18rem;
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 44px;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  list-style: none;
  padding: 0;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.93rem;
}

.hero-facts li {
  display: flex;
  align-items: center;
  gap: 9px;
}

.hero-facts li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  flex: none;
}

.hero-art {
  background: linear-gradient(160deg, var(--bg-card), var(--bg-raised));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 16px;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
}

.hero-art-head {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding-bottom: 14px;
  margin-bottom: 8px;
  border-bottom: 1px dashed var(--line-strong);
}

.sld {
  width: 100%;
  height: auto;
}

.sld .wire {
  stroke: var(--line-strong);
  stroke-width: 1.5;
  fill: none;
}

.sld .live {
  stroke: var(--accent);
  stroke-width: 1.75;
  fill: none;
  stroke-dasharray: 5 9;
  animation: flow 1.6s linear infinite;
}

.sld .node {
  fill: var(--bg);
  stroke: var(--text-muted);
  stroke-width: 1.5;
}

.sld .node-accent {
  fill: var(--bg);
  stroke: var(--accent);
  stroke-width: 1.5;
}

.sld text {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--text-muted);
  letter-spacing: 0.06em;
}

.sld text.accent {
  fill: var(--accent);
}

@keyframes flow {
  to {
    stroke-dashoffset: -28;
  }
}

/* ---------- Services ---------- */

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

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 28px;
  transition: border-color 0.2s, transform 0.2s;
}

.card:hover {
  border-color: var(--line-strong);
  transform: translateY(-3px);
}

.card-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  margin-bottom: 22px;
}

.card-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card p {
  color: var(--text-muted);
  font-size: 0.97rem;
  margin: 0;
}

/* ---------- Why / split ---------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: start;
}

.split .section-head {
  margin-bottom: 0;
  position: sticky;
  top: 128px;
}

.split .section-head .btn {
  margin-top: 30px;
}

.reasons {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--line);
}

.reasons li {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 8px;
}

.reasons .num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  padding-top: 5px;
}

.reasons h3 {
  margin-bottom: 6px;
}

.reasons p {
  color: var(--text-muted);
  font-size: 0.98rem;
  margin: 0;
}

/* ---------- Photos ---------- */

.photo {
  position: relative;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
}

.photo img {
  width: 100%;
  height: auto;
  filter: saturate(0.85) brightness(0.92);
}

/* Soft dark edge so photos sit comfortably in the dark theme */
.photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(10, 12, 16, 0.55));
  pointer-events: none;
}

.photo-wide {
  margin-bottom: 72px;
}

.photo-wide img {
  aspect-ratio: 21 / 9;
  object-fit: cover;
  object-position: center 30%;
}

@media (max-width: 720px) {
  .photo-wide {
    margin-bottom: 48px;
  }

  .photo-wide img {
    aspect-ratio: 16 / 10;
  }
}

/* ---------- Process ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-top: 34px;
  border-top: 1px solid var(--line-strong);
}

.steps li::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}

.steps li::after {
  content: "0" counter(step);
  position: absolute;
  top: 10px;
  left: 0;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}

.steps h3 {
  margin-top: 6px;
}

.steps p {
  color: var(--text-muted);
  font-size: 0.96rem;
  margin: 0;
  padding-right: 12px;
}

/* ---------- Sectors ---------- */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.tags li {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 0.93rem;
  color: var(--text-muted);
  background: var(--bg-card);
}

/* ---------- CTA ---------- */

.cta-box {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1608 0%, var(--bg-card) 55%);
  border: 1px solid rgba(245, 184, 61, 0.28);
  border-radius: 22px;
  padding: 64px 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}

.cta-box h2 {
  margin-bottom: 10px;
}

.cta-box p {
  color: var(--text-muted);
  margin: 0;
  max-width: 520px;
}

/* ---------- Page hero (inner pages) ---------- */

.page-hero {
  padding: 84px 0 40px;
}

.page-hero p {
  color: var(--text-muted);
  font-size: 1.12rem;
  max-width: 620px;
  margin: 0;
}

/* ---------- Contact ---------- */

.contact-section {
  padding: 32px 0 112px;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 32px;
  align-items: start;
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.field {
  margin-bottom: 22px;
}

.field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
}

.field .opt {
  color: var(--text-dim);
  font-weight: 400;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  padding: 13px 15px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

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

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239aa3b2' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  padding-right: 42px;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-dim);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field.invalid input,
.field.invalid select,
.field.invalid textarea {
  border-color: var(--danger);
}

.field .error {
  display: none;
  color: var(--danger);
  font-size: 0.84rem;
  margin-top: 6px;
}

.field.invalid .error {
  display: block;
}

.form-foot {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.form-note {
  color: var(--text-dim);
  font-size: 0.86rem;
  margin: 0;
  flex: 1;
  min-width: 220px;
}

.form-status {
  display: none;
  margin-top: 22px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(95, 211, 154, 0.35);
  background: rgba(95, 211, 154, 0.08);
  color: var(--ok);
  font-size: 0.95rem;
}

.form-status.show {
  display: block;
}

.form-status.error {
  border-color: rgba(255, 122, 107, 0.4);
  background: rgba(255, 122, 107, 0.08);
  color: var(--danger);
}

/* Hidden anti-spam field */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.info-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.info-list li {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.info-list li:first-child {
  padding-top: 0;
}

.info-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.info-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.info-value {
  color: var(--text);
  font-size: 1.02rem;
}

.info-value a {
  color: var(--text);
}

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

.aside-stack {
  display: grid;
  gap: 20px;
}

.panel-tight {
  padding: 30px;
}

.panel-tight h3 {
  margin-bottom: 14px;
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.checklist li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 9px;
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 10px;
  height: 1.5px;
  background: var(--accent);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 56px 0 36px;
  color: var(--text-muted);
  font-size: 0.93rem;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--line);
}

.footer-top p {
  max-width: 360px;
  margin: 14px 0 0;
}

.footer-links {
  display: flex;
  gap: 64px;
  flex-wrap: wrap;
}

.footer-links h4 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 14px;
}

.footer-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: var(--text-muted);
}

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

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 26px;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ---------- Reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  section {
    padding: 76px 0;
  }

  .hero {
    padding: 64px 0 76px;
  }

  .hero .wrap,
  .split,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .split .section-head {
    position: static;
  }

  .card-grid,
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .steps {
    row-gap: 44px;
  }

  .cta-box {
    padding: 44px 32px;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  .wrap {
    padding: 0 18px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    position: absolute;
    top: 88px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--line);
    padding: 8px 18px 20px;
    display: none;
  }

  .nav.open {
    display: flex;
  }

  .nav a:not(.btn) {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
  }

  .nav .btn {
    margin-top: 16px;
  }

  .card-grid,
  .steps,
  .form-row {
    grid-template-columns: 1fr;
  }

  .form-row {
    gap: 0;
  }

  .panel {
    padding: 26px 20px;
  }

  .cta-box {
    padding: 36px 24px;
  }
}

/* ---------- Phone quick-action bar ---------- */

.mobile-bar {
  display: none;
}

@media (max-width: 720px) {
  html {
    scroll-padding-top: 84px;
  }

  body {
    /* leave room for the fixed quick-action bar */
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    overflow-x: hidden;
  }

  .site-header .wrap {
    height: 72px;
  }

  .nav {
    top: 72px;
    max-height: calc(100vh - 72px);
    overflow-y: auto;
  }

  section {
    padding: 60px 0;
  }

  .hero {
    padding: 44px 0 60px;
  }

  h1 {
    font-size: clamp(2rem, 9vw, 2.6rem);
  }

  h2 {
    font-size: clamp(1.55rem, 6.6vw, 2rem);
  }

  .hero .lede {
    font-size: 1.05rem;
    margin-bottom: 28px;
  }

  .eyebrow {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    margin-bottom: 16px;
  }

  .hero-actions {
    flex-direction: column;
    margin-bottom: 32px;
  }

  .hero-actions .btn,
  .cta-box .btn,
  .form-foot .btn {
    width: 100%;
  }

  .hero-facts {
    flex-direction: column;
    gap: 10px;
  }

  .hero-art {
    padding: 16px 14px 10px;
  }

  .section-head {
    margin-bottom: 36px;
  }

  .card {
    padding: 24px 22px;
  }

  .card-icon {
    margin-bottom: 16px;
  }

  .reasons li {
    grid-template-columns: 38px 1fr;
    padding: 22px 0;
  }

  .tags li {
    padding: 8px 14px;
    font-size: 0.88rem;
  }

  .page-hero {
    padding: 44px 0 28px;
  }

  .contact-section {
    padding: 16px 0 64px;
  }

  .panel-tight {
    padding: 24px 20px;
  }

  .form-note {
    min-width: 0;
    flex-basis: 100%;
  }

  .info-value,
  .footer-links a {
    overflow-wrap: anywhere;
  }

  .footer-links {
    gap: 32px 48px;
  }

  .site-footer {
    padding: 44px 0 28px;
  }

  .mobile-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 10px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    background: rgba(10, 12, 16, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }

  .mobile-bar .btn {
    padding: 13px 12px;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .sld .live {
    animation: none;
  }

  .card:hover {
    transform: none;
  }
}
