/* Resolve Frontier — high-precision visual system */

:root {
  --void: #050505;
  --void-2: #0b0b0b;
  --void-3: #111111;
  --fg: #ededed;
  --fg-dim: #8a8a8a;
  --fg-mute: #5c5c5c;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --signal: #e6edf2;
  --hazard: #c45c3a;

  --font: "Geist", "Geist Fallback", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", "Geist Mono Fallback", ui-monospace, monospace;

  --max: 1180px;
  --nav-h: 3.75rem;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --duration: 0.65s;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font);
  font-weight: 400;
  font-size: 0.9375rem;
  line-height: 1.55;
  letter-spacing: -0.011em;
  color: var(--fg);
  background: var(--void);
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

::selection {
  background: rgba(230, 237, 242, 0.22);
  color: #fff;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ——— Field / grid atmosphere ——— */

.field {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 55% at 50% -20%, rgba(230, 237, 242, 0.05), transparent 55%),
    var(--void);
}

.field__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 75% 55% at 50% 0%, #000 10%, transparent 70%);
  opacity: 0.55;
  animation: field-drift 40s linear infinite;
}

@keyframes field-drift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 0 64px, 64px 0; }
}

/* ——— Layout ——— */

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* ——— Nav ——— */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease),
    backdrop-filter 0.4s var(--ease);
}

.nav.is-scrolled {
  background: rgba(5, 5, 5, 0.78);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-bottom-color: var(--line);
}

.nav__inner {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.nav__brand {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg);
}

.nav__brand span {
  color: var(--fg-mute);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}

.nav__links a {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 450;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-dim);
  transition: color 0.2s var(--ease);
}

.nav__links a:hover,
.nav__links a[aria-current="page"] {
  color: var(--fg);
}

.nav__cta {
  color: var(--fg) !important;
}

.nav__cta::before {
  content: "";
  display: inline-block;
  width: 0.35rem;
  height: 0.35rem;
  margin-right: 0.55rem;
  border-radius: 50%;
  background: var(--hazard);
  box-shadow: 0 0 0 0 rgba(196, 92, 58, 0.55);
  animation: pulse 2.4s var(--ease) infinite;
  vertical-align: 0.05em;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(196, 92, 58, 0.45); }
  50% { box-shadow: 0 0 0 6px rgba(196, 92, 58, 0); }
}

.nav__toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-strong);
  width: 2.5rem;
  height: 2.5rem;
  cursor: pointer;
  position: relative;
}

.nav__toggle span,
.nav__toggle span::before,
.nav__toggle span::after {
  display: block;
  width: 1rem;
  height: 1px;
  background: var(--fg);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  transition: transform 0.3s var(--ease), opacity 0.3s;
}

.nav__toggle span { top: 50%; }
.nav__toggle span::before,
.nav__toggle span::after { content: ""; left: 0; transform: none; }
.nav__toggle span::before { top: -5px; }
.nav__toggle span::after { top: 5px; }

.nav__toggle[aria-expanded="true"] span { background: transparent; }
.nav__toggle[aria-expanded="true"] span::before {
  top: 0;
  transform: rotate(45deg);
}
.nav__toggle[aria-expanded="true"] span::after {
  top: 0;
  transform: rotate(-45deg);
}

/* ——— Buttons ——— */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  padding: 0.7rem 1.15rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease),
    border-color 0.3s var(--ease);
}

.btn--primary {
  background: var(--fg);
  color: var(--void);
  border-color: var(--fg);
}

.btn--primary:hover {
  background: transparent;
  color: var(--fg);
}

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

.btn--ghost:hover {
  border-color: var(--fg-dim);
  background: rgba(255, 255, 255, 0.03);
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

/* ——— Hero ——— */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: calc(var(--nav-h) + 1.5rem) 0 3.5rem;
  overflow: hidden;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  filter: grayscale(1) contrast(1.15) brightness(0.38);
  transform: scale(1.04);
  animation: hero-drift 32s var(--ease) infinite alternate;
}

.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 5, 5, 0.55) 0%, rgba(5, 5, 5, 0.15) 40%, rgba(5, 5, 5, 0.92) 78%, var(--void) 100%),
    linear-gradient(90deg, rgba(5, 5, 5, 0.65) 0%, transparent 50%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      rgba(0, 0, 0, 0.12) 3px,
      rgba(0, 0, 0, 0.12) 4px
    );
  mix-blend-mode: multiply;
  opacity: 0.95;
}

@keyframes hero-drift {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to { transform: scale(1.1) translate3d(-1.2%, -0.8%, 0); }
}

.hero__content {
  position: relative;
  z-index: 1;
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.hero__code {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: rise 0.9s var(--ease) 0.1s forwards;
}

.hero__code i {
  font-style: normal;
  color: var(--hazard);
  margin-right: 0.55rem;
}

.hero__brand {
  font-family: var(--font);
  font-weight: 500;
  font-size: clamp(2.75rem, 8.5vw, 5.75rem);
  line-height: 0.92;
  letter-spacing: -0.045em;
  color: var(--fg);
  margin-bottom: 1.5rem;
  max-width: 12ch;
  opacity: 0;
  animation: rise 1s var(--ease) 0.2s forwards;
}

.hero__brand span {
  display: block;
  color: var(--fg-dim);
  font-weight: 400;
}

.hero__rule {
  width: 2.5rem;
  height: 1px;
  background: var(--fg);
  margin-bottom: 1.35rem;
  transform: scaleX(0);
  transform-origin: left;
  animation: rule 0.8s var(--ease) 0.55s forwards;
}

@keyframes rule {
  to { transform: scaleX(1); }
}

.hero__headline {
  font-size: clamp(1.05rem, 2.1vw, 1.25rem);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.02em;
  color: var(--fg);
  max-width: 28ch;
  margin-bottom: 0.85rem;
  opacity: 0;
  animation: rise 0.95s var(--ease) 0.4s forwards;
}

.hero__lede {
  font-size: 0.9375rem;
  color: var(--fg-dim);
  max-width: 38ch;
  margin-bottom: 2rem;
  opacity: 0;
  animation: rise 0.95s var(--ease) 0.5s forwards;
}

.hero .btn-group {
  opacity: 0;
  animation: rise 0.95s var(--ease) 0.65s forwards;
}

.hero__meta {
  position: absolute;
  right: max(1rem, calc((100% - var(--max)) / 2));
  bottom: 3.5rem;
  z-index: 1;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-mute);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  opacity: 0;
  animation: rise 1s var(--ease) 0.9s forwards;
}

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

/* ——— Sections ——— */

.section {
  padding: 6.5rem 0;
  position: relative;
  border-top: 1px solid var(--line);
}

.section--tight {
  padding: 4.5rem 0;
}

.section--panel {
  background: var(--void-2);
}

.kicker {
  display: block;
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin-bottom: 1rem;
}

.kicker::before {
  content: "// ";
  color: var(--hazard);
}

.section__title {
  font-weight: 500;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  margin-bottom: 1.25rem;
  max-width: 16ch;
}

.section__text {
  color: var(--fg-dim);
  max-width: 42ch;
  font-size: 0.9375rem;
}

.section__text + .section__text {
  margin-top: 0.85rem;
}

.section__head {
  margin-bottom: 3.5rem;
}

.section__head--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: end;
}

.reveal {
  opacity: 0;
  transform: translateY(1.1rem);
  transition: opacity var(--duration) var(--ease), transform var(--duration) var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ——— Thesis ——— */

.thesis {
  padding: 4.5rem 0;
  border-top: 1px solid var(--line);
}

.thesis__quote {
  font-weight: 500;
  font-size: clamp(1.45rem, 3.4vw, 2.15rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
  max-width: 18ch;
  color: var(--fg);
}

.thesis__aside {
  margin-top: 1.25rem;
  color: var(--fg-dim);
  max-width: 40ch;
  font-size: 0.9375rem;
}

/* ——— Steps / protocol ——— */

.protocol {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.protocol__row {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1.5rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--line);
  transition: background 0.35s var(--ease);
}

.protocol__row:hover {
  background: rgba(255, 255, 255, 0.015);
}

.protocol__idx {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--fg-mute);
  padding-top: 0.3rem;
}

.protocol__title {
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 0.45rem;
}

.protocol__text {
  color: var(--fg-dim);
  max-width: 52ch;
  font-size: 0.9rem;
}

/* ——— Capability matrix ——— */

.matrix {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.matrix__cell {
  padding: 1.75rem 1.5rem 1.75rem 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-height: 11rem;
}

.matrix__cell:nth-child(odd) {
  padding-right: 1.75rem;
  padding-left: 0;
}

.matrix__cell:nth-child(even) {
  padding-left: 1.75rem;
}

.matrix__id {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin-bottom: 0.85rem;
}

.matrix__title {
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 0.55rem;
}

.matrix__text {
  color: var(--fg-dim);
  font-size: 0.875rem;
  max-width: 36ch;
}

.matrix__list {
  list-style: none;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.matrix__list li {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
  color: var(--fg-dim);
  padding-left: 0.85rem;
  position: relative;
}

.matrix__list li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--hazard);
}

.matrix__more {
  margin-top: 2rem;
}

/* ——— Clients strip ——— */

.roster {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.roster__item {
  background: var(--void);
  padding: 1.75rem 1.25rem;
  min-height: 8.5rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: background 0.35s var(--ease);
}

.roster__item:hover {
  background: var(--void-3);
}

.roster__label {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin-bottom: 0.55rem;
}

.roster__title {
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

/* ——— Visual break ——— */

.break {
  position: relative;
  height: clamp(14rem, 36vw, 24rem);
  overflow: hidden;
  border-block: 1px solid var(--line);
}

.break img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.2) brightness(0.4);
}

.break__caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2rem;
  background: linear-gradient(transparent, rgba(5, 5, 5, 0.92));
}

.break__caption p {
  font-size: clamp(1.15rem, 2.3vw, 1.55rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  max-width: 28ch;
  line-height: 1.25;
}

/* ——— Note / boundaries ——— */

.note {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 2.5rem;
  padding: 3.5rem 0 0;
}

.note__title {
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.note__body {
  color: var(--fg-dim);
  font-size: 0.9rem;
}

.note__body p + p {
  margin-top: 0.85rem;
}

/* ——— Page hero (inner) ——— */

.page-hero {
  padding: calc(var(--nav-h) + 4rem) 0 3rem;
  border-bottom: 1px solid var(--line);
}

.page-hero__title {
  font-weight: 500;
  font-size: clamp(2.25rem, 6.5vw, 3.75rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  margin-bottom: 1.1rem;
  max-width: 14ch;
}

.page-hero__lede {
  color: var(--fg-dim);
  max-width: 42ch;
  font-size: 1rem;
}

/* ——— Contact ——— */

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 3rem;
  align-items: start;
}

.contact-aside__title {
  font-weight: 500;
  font-size: clamp(1.65rem, 3.5vw, 2.25rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1rem;
  max-width: 14ch;
}

.contact-aside__text {
  color: var(--fg-dim);
  margin-bottom: 2rem;
  max-width: 36ch;
}

.contact-meta {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.contact-meta li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.contact-meta__label {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-mute);
}

.contact-meta a:hover {
  color: var(--signal);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  padding: 1.5rem;
  background: var(--void-2);
  border: 1px solid var(--line);
}

.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.15rem;
}

.field-input {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field-input label {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-mute);
}

.field-input input,
.field-input textarea,
.field-input select {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-strong);
  padding: 0.7rem 0;
  outline: none;
  border-radius: 0;
  appearance: none;
  transition: border-color 0.25s;
}

.field-input input:focus,
.field-input textarea:focus,
.field-input select:focus {
  border-bottom-color: var(--fg);
}

.field-input textarea {
  min-height: 7.5rem;
  resize: vertical;
}

.form__note {
  font-size: 0.75rem;
  color: var(--fg-mute);
  line-height: 1.5;
  font-family: var(--mono);
  letter-spacing: 0.02em;
}

.form__status {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--hazard);
  min-height: 1.1rem;
}

/* ——— CTA ——— */

.cta {
  padding: 6rem 0;
  border-top: 1px solid var(--line);
}

.cta__title {
  font-weight: 500;
  font-size: clamp(1.85rem, 4.5vw, 2.85rem);
  letter-spacing: -0.035em;
  line-height: 1.05;
  max-width: 14ch;
  margin-bottom: 1rem;
}

.cta__text {
  color: var(--fg-dim);
  max-width: 38ch;
  margin-bottom: 1.75rem;
}

/* ——— Footer ——— */

.footer {
  padding: 3.5rem 0 2rem;
  border-top: 1px solid var(--line);
}

.footer__top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

.footer__brand {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.footer__tag {
  color: var(--fg-mute);
  font-size: 0.875rem;
  max-width: 28ch;
}

.footer__col-title {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin-bottom: 0.9rem;
}

.footer__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.footer__links a {
  color: var(--fg-dim);
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer__links a:hover {
  color: var(--fg);
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  color: var(--fg-mute);
}

.footer__legal {
  max-width: 52ch;
  line-height: 1.55;
  letter-spacing: 0.02em;
}

/* ——— Responsive ——— */

@media (max-width: 900px) {
  .section__head--split,
  .note,
  .contact-layout,
  .footer__top {
    grid-template-columns: 1fr;
  }

  .matrix {
    grid-template-columns: 1fr;
  }

  .matrix__cell:nth-child(odd),
  .matrix__cell:nth-child(even) {
    padding-left: 0;
    padding-right: 0;
  }

  .roster {
    grid-template-columns: 1fr 1fr;
  }

  .hero__meta {
    display: none;
  }

  .form__row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .nav__toggle {
    display: block;
  }

  .nav__links {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.35rem 1rem 1.25rem;
    background: rgba(5, 5, 5, 0.97);
    border-bottom: 1px solid var(--line);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
  }

  .nav__links.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav__links li {
    width: 100%;
    border-bottom: 1px solid var(--line);
  }

  .nav__links a {
    display: block;
    padding: 0.95rem 0;
  }

  .roster {
    grid-template-columns: 1fr;
  }

  .protocol__row {
    grid-template-columns: 3rem 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

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

  .hero__media img,
  .field__grid {
    animation: none;
  }
}
