/* ==========================================================================
   FourBitCrew — site styles
   Palette and type mirror the original brand system:
     accent  hsl(194.7, 100%, 40%)   ink hsl(240, 8.2%, 19.2%)
     deep    hsl(210, 91.1%, 22%)    light hsl(0, 0%, 94.9%)
   ========================================================================== */

:root {
  --white: #ffffff;
  --ink: #2d2d35;
  --ink-soft: #55555f;
  --accent: #009acc;
  --accent-hover: #007ba3;
  --deep: #05386b;
  --light: #f2f2f2;
  --line: rgba(45, 45, 53, 0.12);

  --font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;

  --maxw: 1320px;
  --maxw-medium: 980px;
  --maxw-narrow: 760px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --section-y: clamp(4rem, 9vw, 8rem);
  --header-h: 108px;

  --radius: 6px;
  --shadow: 0 18px 48px rgba(45, 45, 53, 0.12);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------- reset -- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; border: 0; }
a { color: inherit; }
button { font: inherit; }

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5em;
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.015em;
}

h1 { font-size: clamp(2.25rem, 5.2vw, 4rem); }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.85rem); }
h3 { font-size: clamp(1.4rem, 2.6vw, 2rem); }
h4 { font-size: clamp(1.05rem, 1.5vw, 1.25rem); font-weight: 600; }

p { margin: 0 0 1.25rem; }
p:last-child { margin-bottom: 0; }

ul { margin: 0; padding: 0; }

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

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

/* ------------------------------------------------------------ utilities -- */

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--medium { max-width: var(--maxw-medium); }
.wrap--narrow { max-width: var(--maxw-narrow); }

.center { text-align: center; }
.lead { font-size: clamp(1.02rem, 1.35vw, 1.18rem); }

.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  color: var(--accent);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* The reference sets the hero kicker in sentence case, not spaced caps. */
.hero .eyebrow {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.98rem;
  color: #fff;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -100px;
  z-index: 200;
  background: var(--accent);
  color: #fff;
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* -------------------------------------------------------------- buttons -- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.95rem 2rem;
  border: 2px solid transparent;
  border-radius: 0;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease),
    border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn:hover { background: var(--accent-hover); transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--ghost {
  background: transparent;
  border-color: currentColor;
  color: inherit;
}
.btn--ghost:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.btn--light { background: #fff; color: var(--accent); }
.btn--light:hover { background: var(--ink); color: #fff; }

.btn--sm { padding: 0.72rem 1.6rem; font-size: 0.8rem; }

/* `.nav a` (0,0,1,1) outweighs `.btn`/`.btn--sm` (0,0,1,0), so the button's own
   padding never applied and it rendered with no horizontal padding at all.
   Matching on `.nav a.btn` (0,0,2,1) puts it back, and adds separation from the
   nav links so the button reads as its own element. */
.nav a.btn {
  padding: 0.72rem 1.6rem;
  margin-left: 0.65rem;
  text-transform: uppercase;
}

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

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: background-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.site-header__inner {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand { display: block; flex: none; }
.brand img {
  height: 78px;
  width: auto;
  transition: filter 0.3s var(--ease);
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 2.5vw, 2.25rem);
}

.nav a {
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  position: relative;
  padding: 0.25rem 0;
}

.nav a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.nav a:not(.btn):hover::after,
.nav a[aria-current="page"]::after { transform: scaleX(1); }

/* transparent state, sitting on top of a dark hero */
.site-header[data-state="top"] { background: transparent; color: #fff; }

/* Solid state is dark, matching the previous site — which also keeps the logo
   readable, since the wordmark half of the mark is light. */
.site-header[data-state="solid"] {
  background: rgba(45, 45, 53, 0.97);
  color: #fff;
  box-shadow: 0 10px 30px rgba(45, 45, 53, 0.18);
  backdrop-filter: saturate(180%) blur(8px);
}

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 7px;
}
.nav-toggle span {
  display: block;
  width: 26px; height: 2px;
  background: currentColor;
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4.5px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }

  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    color: var(--ink);
    padding: 0.5rem var(--gutter) 2rem;
    box-shadow: 0 20px 40px rgba(45, 45, 53, 0.14);
    transform: translateY(-140%);
    transition: transform 0.32s var(--ease);
  }
  .nav[data-open="true"] { transform: translateY(0); }
  .nav a { padding: 1rem 0; border-bottom: 1px solid var(--line); font-size: 1rem; }
  .nav a.btn { margin-top: 1.25rem; margin-left: 0; border-bottom: 0; justify-content: center; }
  .nav a:not(.btn)::after { display: none; }
}

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

.section {
  padding-block: var(--section-y);
  position: relative;
}

.section--white { background: var(--white); color: var(--ink); }
.section--light { background: var(--light); color: var(--ink); }
.section--dark { background: var(--ink); color: #fff; }
.section--dark .eyebrow { color: #fff; opacity: 0.75; }
.section--bright { background: var(--accent); color: #fff; }
.section--bright .eyebrow { color: #fff; }

.section--dark-bold { background: var(--ink); color: #fff; }
.section--dark-bold h1,
.section--dark-bold h2,
.section--dark-bold h3 { color: var(--accent); }

.section--tight { padding-block: clamp(2.75rem, 5vw, 4.5rem); }

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

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(520px, 78vh, 820px);
  padding-block: calc(var(--header-h) + 3rem) 4rem;
  color: #fff;
  background: var(--ink);
  overflow: hidden;
  isolation: isolate;
}

.hero--tall { min-height: clamp(600px, 88vh, 900px); }
.hero--short { min-height: clamp(400px, 58vh, 620px); }

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%; height: 100%;
  object-fit: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    180deg,
    rgba(45, 45, 53, 0.82) 0%,
    rgba(45, 45, 53, 0.64) 45%,
    rgba(45, 45, 53, 0.78) 100%
  );
}

.hero__inner { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.hero__content { max-width: 58rem; }
.hero--center { text-align: center; }
.hero--center .hero__content { margin-inline: auto; }

.hero h1 { margin-bottom: 1.1rem; text-wrap: balance; }
.hero p { color: rgba(255, 255, 255, 0.88); }
.hero .btn { margin-top: 2rem; }

/* ------------------------------------------------------- split / cards -- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}

.split--media-right .split__media { order: 2; }

.split__media img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.split__media--phone { display: flex; justify-content: center; }
.split__media--phone img { max-width: 340px; box-shadow: 0 24px 60px rgba(45, 45, 53, 0.22); }

.split__body h2 { margin-bottom: 1rem; }

@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; }
  .split--media-right .split__media { order: 0; }
}

/* ---------------------------------------------------------------- grids -- */

.grid { display: grid; gap: clamp(1.75rem, 3.5vw, 3rem); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 900px) { .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) {
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
}

/* stat blocks */
.stat h4 { color: var(--accent); font-size: clamp(1.05rem, 1.5vw, 1.3rem); margin: 0; }
.stat { border-top: 3px solid var(--accent); padding-top: 1.1rem; }

/* icon feature cards */
.feature { display: flex; flex-direction: column; gap: 0.85rem; }
.feature__icon { width: 56px; height: 56px; object-fit: contain; }
.feature h4 { margin: 0; }
.feature p { color: var(--ink-soft); font-size: 0.97rem; margin: 0; }
.section--dark .feature p { color: rgba(255, 255, 255, 0.8); }

/* numbered journey steps */
.steps { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 2rem; }
.steps li { display: flex; gap: 0.9rem; align-items: flex-start; }
.steps .num {
  flex: none;
  width: 2rem; height: 2rem;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
}
.steps h4 { margin: 0; font-size: 1rem; line-height: 1.4; }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

/* checkmark list */
.checks { list-style: none; display: grid; gap: 1rem; }
.checks li { display: flex; gap: 0.85rem; align-items: flex-start; }
.checks svg { flex: none; width: 1.4rem; height: 1.4rem; color: var(--accent); margin-top: 0.15rem; }
.checks h4 { margin: 0; font-size: 1.05rem; }

/* technology logo strip */
.logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(2rem, 6vw, 5rem);
}
.logos img {
  height: 54px;
  width: auto;
  opacity: 0.7;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.logos img:hover { opacity: 1; transform: translateY(-3px); }

/* ------------------------------------------------------ portfolio cards -- */

.app-card { align-items: center; }
.app-card .split__body h3 { margin-bottom: 0.75rem; }
.app-card p { color: var(--ink-soft); }

/* -------------------------------------------------------- app hero band -- */

.band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  text-align: center;
}
.band img {
  width: clamp(96px, 12vw, 132px);
  border-radius: 22%;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}
.band h3 { margin: 0; font-size: clamp(1.15rem, 2.2vw, 1.75rem); font-weight: 500; }

/* --------------------------------------------------------- feature rows -- */

.feature-row + .feature-row { border-top: 1px solid var(--line); }
.feature-row h2 {
  font-size: clamp(1.4rem, 2.6vw, 2.15rem);
  font-weight: 500;
  line-height: 1.32;
  text-wrap: balance;
}

/* --------------------------------------------------------------- prose -- */

.prose h2 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); margin-top: 2.5rem; }
.prose h2:first-child { margin-top: 0; }
.prose p { color: var(--ink-soft); }
.prose ul { padding-left: 1.25rem; margin: 0 0 1.25rem; color: var(--ink-soft); }
.prose li { margin-bottom: 0.4rem; }
.prose a { color: var(--accent); }

/* ---------------------------------------------------------------- form -- */

.form { display: grid; gap: 1.25rem; }
.form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
@media (max-width: 620px) { .form__row { grid-template-columns: 1fr; } }

.field { display: grid; gap: 0.45rem; }
.field label { font-size: 0.85rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }

.field input,
.field textarea {
  font: inherit;
  width: 100%;
  padding: 0.85rem 1rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 154, 204, 0.18);
}
.field textarea { min-height: 170px; resize: vertical; }

/* Collapses to nothing until Turnstile renders into it, so the form spacing is
   unchanged while the widget is unconfigured or running in invisible mode. */
.turnstile-mount:empty { display: none; }

.form__note { font-size: 0.85rem; color: var(--ink-soft); }
.form__status { font-size: 0.95rem; font-weight: 500; min-height: 1.5rem; }
.form__status[data-tone="ok"] { color: #1a7f4b; }
.form__status[data-tone="err"] { color: #b3261e; }

.contact-details { display: grid; gap: 1.5rem; align-content: start; }
.contact-details a { color: var(--accent); text-decoration: none; font-weight: 500; }
.contact-details a:hover { text-decoration: underline; }
.contact-details h3 { font-size: 1.05rem; margin-bottom: 0.25rem; }

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

.site-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.75);
  padding-block: clamp(3rem, 6vw, 4.5rem);
  font-size: 0.92rem;
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
@media (max-width: 760px) { .site-footer__grid { grid-template-columns: 1fr; } }

.site-footer img { height: 62px; width: auto; }
.site-footer h4 {
  color: #fff;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.site-footer ul { list-style: none; display: grid; gap: 0.6rem; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }

.site-footer__bottom {
  margin-top: clamp(2.25rem, 5vw, 3.5rem);
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  font-size: 0.85rem;
}

/* ----------------------------------------------------------- 404 / misc -- */

.notfound { display: grid; place-items: center; min-height: 70vh; text-align: center; }

/* ------------------------------------------------------------- reveal -- */

/* Scroll reveal is opt-in: the `js` class is only set by the inline script in
   <head>, so with scripting off every .reveal block stays plainly visible. */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
