/* ============================================================
   FERCAM — Proposal D
   Dark engineering aesthetic. US-based. No artwork, one system map.
   ============================================================ */

:root {
  --bg: #060709;
  --panel: #0b0d11;
  --panel-2: #0e1116;
  --line: #191c22;
  --line-2: #23272f;
  --ink: #f2f4f6;
  --ink-2: #a8afba;
  --ink-3: #6e7681;
  --red: #e1251b;
  --steel: #4c9aff;

  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Inter Tight', 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;

  --wrap: 1380px;
  --gutter: clamp(20px, 4.4vw, 60px);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, address { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--steel); outline-offset: 4px; border-radius: 2px; }
::selection { background: var(--red); color: #fff; }

.d-wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.d-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.d-label .flag { flex: none; }
.d-label .us-tag { color: var(--red); }
.d-label b { color: var(--ink); font-weight: 500; }

/* ---------- header ---------- */
.d-head {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  padding-block: 20px;
  background: linear-gradient(to bottom, rgba(6,7,9,.9), rgba(6,7,9,0));
  transition: background-color .3s var(--ease), padding .3s var(--ease), border-color .3s var(--ease);
  border-bottom: 1px solid transparent;
}
.d-head.is-scrolled {
  padding-block: 13px;
  background: rgba(6,7,9,.94);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.d-head__inner { display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.d-brand { display: flex; align-items: center; min-height: 44px; }
.d-brand img { height: 30px; width: auto; }
.d-nav { display: flex; align-items: center; gap: 32px; }
.d-nav a {
  font-size: 13.5px;
  color: var(--ink-2);
  padding-block: 6px;
  transition: color .18s var(--ease);
}
.d-nav a:hover { color: var(--ink); }
.d-head__cta {
  display: inline-flex; align-items: center; gap: 9px;
  min-height: 42px; padding: 0 18px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink);
  transition: background-color .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
}
.d-head__cta:hover { background: #12151b; border-color: #31363f; transform: translateY(-1px); }
.d-head__cta svg { width: 15px; height: 15px; }

/* ---------- hero ---------- */
.d-hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding-top: clamp(96px, 13vh, 140px);
  padding-bottom: 22px;
  overflow: hidden;
  isolation: isolate;
}
.d-grid {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 88px 88px;
  -webkit-mask-image: radial-gradient(120% 80% at 70% 30%, #000 10%, transparent 76%);
  mask-image: radial-gradient(120% 80% at 70% 30%, #000 10%, transparent 76%);
  pointer-events: none;
}
.d-glow {
  position: absolute;
  z-index: -1;
  width: 70vw; max-width: 900px; aspect-ratio: 1;
  right: -18vw; top: -26vw;
  background: radial-gradient(circle, rgba(225,37,27,.14), transparent 62%);
  filter: blur(24px);
  pointer-events: none;
}
.d-hero__grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 27rem);
  gap: clamp(32px, 5vw, 76px);
  align-items: center;
}
.d-hero h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.7rem, 5.5vw, 4.9rem);
  line-height: .98;
  letter-spacing: -.04em;
  margin: 20px 0 0;
  max-width: 17ch;
  text-wrap: balance;
}
.d-hero__sub {
  margin-top: 24px;
  color: var(--ink-2);
  font-size: clamp(1rem, 1.3vw, 1.14rem);
  max-width: 44ch;
}
.d-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.d-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 24px;
  border-radius: 8px;
  font-size: 14.5px;
  border: 1px solid transparent;
  transition: transform .18s var(--ease), background-color .18s var(--ease),
              border-color .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease);
}
.d-btn:hover { transform: translateY(-2px); }
.d-btn:active { transform: translateY(1px); }
.d-btn--red { background: var(--red); color: #fff; }
.d-btn--red:hover { background: #f23227; box-shadow: 0 18px 40px -22px rgba(225,37,27,.9); }
.d-btn--ghost { border-color: var(--line-2); color: var(--ink); }
.d-btn--ghost:hover { border-color: #343a44; background: #101319; }
.d-btn svg { width: 16px; height: 16px; }

/* ---------- system map panel ---------- */
.d-map {
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: 0 40px 90px -60px #000;
  overflow: hidden;
}
.d-map__head,
.d-map__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 14px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: #0a0c10;
}
.d-map__head { border-bottom: 1px solid var(--line); }
.d-map__foot { border-top: 1px solid var(--line); }
.d-map__live { display: inline-flex; align-items: center; gap: 7px; color: #cfd5de; }
.d-map__live i {
  width: 6px; height: 6px; border-radius: 50%;
  background: #3ecf6a;
  box-shadow: 0 0 9px rgba(62,207,106,.8);
}
.d-map__body {
  position: relative;
  padding: 18px 14px 8px;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 22px 22px;
}
.d-map svg { width: 100%; height: auto; }
.d-map .node rect {
  fill: #101419;
  stroke: #333a45;
  stroke-width: 1;
}
.d-map .node--accent rect { stroke: #6b3530; }
.d-map .node text {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .13em;
  fill: #c3cad4;
}
.d-map .node--accent text { fill: #ffa79e; }
.d-map .link { stroke: #3d4551; stroke-width: 1.1; fill: none; }
.d-map .link--live { stroke: rgba(225,37,27,.65); stroke-dasharray: 3 7; animation: flow 6s linear infinite; }
.d-map .dot { fill: #3ecf6a; }
@keyframes flow { to { stroke-dashoffset: -100; } }

/* ---------- rail ---------- */
.d-rail { padding-bottom: 22px; }
.d-rail__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.d-rail__inner b { color: var(--ink-2); font-weight: 500; }

/* ---------- sections ---------- */
.d-section { padding-block: clamp(70px, 9vw, 120px); border-top: 1px solid var(--line); }
.d-h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.8rem, 3.4vw, 2.7rem);
  line-height: 1.04;
  letter-spacing: -.03em;
  text-wrap: balance;
}
.d-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 44px; }
.d-step {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px 22px 24px;
  background: linear-gradient(180deg, #0b0e12, #080a0d);
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.d-step:hover { border-color: #2c323b; transform: translateY(-2px); }
.d-step__n {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--red);
}
.d-step h3 {
  font-family: var(--display);
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: -.02em;
  margin: 14px 0 8px;
}
.d-step p { color: var(--ink-2); font-size: .93rem; }

.d-stack {
  display: flex; flex-wrap: wrap; gap: 10px 22px;
  padding-block: clamp(26px, 4vw, 38px);
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .04em;
  color: var(--ink-3);
}
.d-stack span { position: relative; padding-left: 14px; }
.d-stack span::before {
  content: "";
  position: absolute; left: 0; top: .58em;
  width: 4px; height: 4px; background: var(--red);
}

/* ---------- brands ---------- */
.d-brands { border-top: 1px solid var(--line); padding-block: clamp(32px, 4vw, 46px); }
.d-brands__inner { display: flex; align-items: center; gap: clamp(20px, 4vw, 54px); flex-wrap: wrap; }
.d-brands__list { display: flex; align-items: center; gap: clamp(24px, 3.6vw, 50px); flex-wrap: wrap; }
.d-brands__list li { display: flex; align-items: center; opacity: .66; transition: opacity .18s var(--ease); }
.d-brands__list li:hover { opacity: 1; }
.d-brands__list img { height: 23px; width: auto; }
.d-brands__list li:nth-child(2) img { height: 25px; }
.d-brands__list li:nth-child(4) img { height: 27px; }
.d-brands__list .is-wordmark {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.d-brands__list .is-wordmark b { color: var(--red); font-weight: 700; }

/* ---------- cta ---------- */
.d-cta { padding-block: clamp(70px, 9vw, 116px); border-top: 1px solid var(--line); }
.d-cta h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -.035em;
  max-width: 20ch;
  text-wrap: balance;
}
.d-cta p { margin-top: 18px; color: var(--ink-2); max-width: 48ch; }

/* ---------- footer ---------- */
.d-footer { border-top: 1px solid var(--line); padding-top: clamp(44px, 5vw, 64px); }
.d-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(0, .62fr));
  gap: 32px;
  padding-bottom: clamp(36px, 4.5vw, 54px);
}
.d-footer__brand img { height: 30px; width: auto; margin-bottom: 16px; }
.d-footer__brand p { color: var(--ink-3); font-size: .9rem; max-width: 30ch; }
.d-footer h3 {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 14px;
}
.d-footer li + li { margin-top: 9px; }
.d-footer a, .d-footer address, .d-footer li span {
  font-style: normal;
  font-size: .92rem;
  color: var(--ink-2);
  line-height: 1.55;
  transition: color .16s var(--ease);
}
.d-footer a:hover { color: var(--ink); }
.d-footer__bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding-block: 20px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #5a616b;
}
.d-footer__bottom .us { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-3); }

/* ---------- motion ---------- */
[data-enter] { opacity: 0; transform: translateY(12px); animation: dEnter .8s var(--ease) forwards; }
[data-enter="2"] { animation-delay: .09s; }
[data-enter="3"] { animation-delay: .18s; }
[data-enter="4"] { animation-delay: .27s; }
[data-enter="5"] { animation-delay: .36s; }
@keyframes dEnter { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0ms !important;
    transition-duration: .001ms !important;
  }
  [data-enter] { opacity: 1; transform: none; }
  .d-map .link--live { animation: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .d-hero { min-height: auto; padding-top: 120px; padding-bottom: 34px; }
  .d-hero__grid { grid-template-columns: minmax(0, 1fr); }
  .d-hero h1 { max-width: 20ch; }
  .d-map { max-width: 30rem; }
  .d-steps { grid-template-columns: minmax(0, 1fr); }
  .d-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .d-nav { display: none; }
  .d-brand img { height: 26px; }
  .d-head__cta { width: 44px; min-height: 44px; padding: 0; justify-content: center; font-size: 0; gap: 0; }
  .d-head__cta svg { width: 18px; height: 18px; }
  .d-hero h1 { font-size: clamp(2.3rem, 10.6vw, 3.2rem); }
  .d-actions .d-btn { width: 100%; }
  .d-rail__inner { flex-direction: column; align-items: flex-start; gap: 8px; }
  .d-footer__grid { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .d-footer a, .d-footer address, .d-footer li span { display: inline-flex; align-items: center; min-height: 44px; }
  .d-footer__bottom { flex-direction: column; align-items: flex-start; }
}
