/* ============================================================
   Foundry Web Studio
   Design tokens
   ============================================================ */
:root {
  /* Brand palette */
  --bg:        #0B0C10;  /* near black, page background */
  --mint:      #3DDC97;  /* primary accent and buttons */
  --blue:      #5B8DEF;  /* secondary accent and hover states */
  --text:      #F2F4F7;  /* headings and body text */

  /* Derived neutrals for a layered dark surface */
  --surface:   #14161C;  /* raised panels and cards */
  --surface-2: #181B22;  /* hover surface */
  --muted:     #9AA3B2;  /* secondary text */
  --line:      rgba(242, 244, 247, 0.09);  /* hairline borders */
  --line-2:    rgba(242, 244, 247, 0.16);  /* stronger hairline */

  /* Type */
  --display: "Space Grotesk", system-ui, sans-serif;
  --body:    "Inter", system-ui, sans-serif;
  --mono:    "Space Mono", ui-monospace, monospace;

  /* Layout */
  --maxw: 1120px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section-pad: clamp(5rem, 11vw, 8.5rem);
  --radius: 14px;

  /* Functional color for form validation errors */
  --error: #FF6B6B;
}

/* ============================================================
   Reset and base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--text);
}

p { margin: 0; }

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

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

::selection {
  background: var(--mint);
  color: var(--bg);
}

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

/* ============================================================
   Layout helpers
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.section-head {
  max-width: 640px;
  margin-bottom: clamp(2.5rem, 5vw, 3.75rem);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mint);
  margin-bottom: 1.25rem;
}
.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 2px;
  background: var(--mint);
  display: inline-block;
}

.section-head h2 {
  font-size: clamp(1.9rem, 4.2vw, 3rem);
}

.section-head .lead {
  margin-top: 1.1rem;
  color: var(--muted);
  font-size: 1.0625rem;
  max-width: 52ch;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.975rem;
  letter-spacing: -0.01em;
  padding: 0.85rem 1.5rem;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.22s ease, color 0.22s ease,
              border-color 0.22s ease, transform 0.22s ease;
}

.btn-primary {
  background: var(--mint);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--blue);
  color: var(--text);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-2);
}
.btn-ghost:hover {
  border-color: var(--blue);
  color: var(--blue);
  transform: translateY(-2px);
}

.btn .arrow {
  transition: transform 0.22s ease;
}
.btn:hover .arrow { transform: translateX(3px); }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 12, 16, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}
.site-header.scrolled {
  background: rgba(11, 12, 16, 0.82);
  border-bottom-color: var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

/* Wordmark */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand .mark { width: 26px; height: 26px; flex: none; }
.brand .sub {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding-left: 0.55rem;
  margin-left: 0.1rem;
  border-left: 1px solid var(--line-2);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  font-size: 0.95rem;
  color: var(--muted);
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--text); }

.nav-cta { display: inline-flex; align-items: center; gap: 1.5rem; }
.nav-cta .btn { padding: 0.6rem 1.1rem; font-size: 0.9rem; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text);
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  padding-top: clamp(4rem, 9vw, 7rem);
  padding-bottom: clamp(4.5rem, 9vw, 7rem);
  overflow: hidden;
}
.hero::before {
  /* soft mint glow, top right */
  content: "";
  position: absolute;
  top: -20%;
  right: -10%;
  width: 55vw;
  height: 55vw;
  max-width: 720px;
  max-height: 720px;
  background: radial-gradient(circle, rgba(61, 220, 151, 0.16), transparent 62%);
  pointer-events: none;
  z-index: 0;
}
.hero::after {
  /* faint blue glow, lower left, for balance */
  content: "";
  position: absolute;
  bottom: -25%;
  left: -15%;
  width: 50vw;
  height: 50vw;
  max-width: 640px;
  max-height: 640px;
  background: radial-gradient(circle, rgba(91, 141, 239, 0.10), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.hero .container { position: relative; z-index: 1; }

.hero-inner { max-width: 860px; }

.hero h1 {
  font-size: clamp(2.7rem, 7.5vw, 5.25rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.0;
}
.hero h1 .accent { color: var(--mint); }

.hero .subhead {
  margin-top: 1.6rem;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.55;
  color: var(--muted);
  max-width: 46ch;
}

.hero-actions {
  margin-top: 2.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

/* Technical proof readout: the signature element */
.readout {
  margin-top: 2.6rem;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.25rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  padding: 0.75rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(20, 22, 28, 0.5);
}
.readout .dot { color: var(--line-2); }
.readout b { color: var(--text); font-weight: 700; }
.readout .live { color: var(--mint); }

/* ============================================================
   Services: what is included
   ============================================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.85rem;
  transition: border-color 0.25s ease, transform 0.25s ease,
              background-color 0.25s ease;
}
.card:hover {
  border-color: var(--blue);
  background: var(--surface-2);
  transform: translateY(-4px);
}
.card .icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: rgba(61, 220, 151, 0.12);
  color: var(--mint);
  margin-bottom: 1.25rem;
}
.card .icon svg { width: 20px; height: 20px; }
.card h3 {
  font-size: 1.18rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.55rem;
}
.card p {
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.6;
}

/* ============================================================
   Process: numbered sequence
   ============================================================ */
.steps {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}
.step {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: clamp(1rem, 4vw, 3rem);
  align-items: start;
  padding: 2rem 0;
  border-bottom: 1px solid var(--line);
  transition: padding-left 0.25s ease;
}
.step:hover { padding-left: 0.5rem; }
.step .num {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--mint);
  padding-top: 0.2rem;
}
.step h3 {
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}
.step p {
  color: var(--muted);
  font-size: 1rem;
  max-width: 60ch;
}

/* ============================================================
   Why us: comparison
   ============================================================ */
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}
.compare-col {
  border-radius: var(--radius);
  padding: clamp(1.6rem, 4vw, 2.4rem);
  border: 1px solid var(--line);
}
.compare-col.them {
  background: transparent;
}
.compare-col.us {
  background: var(--surface);
  border-color: rgba(61, 220, 151, 0.28);
}
.compare-col h3 {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 1.4rem;
}
.compare-col.them h3 { color: var(--muted); }
.compare-col.us h3 { color: var(--mint); }
.compare-col ul { list-style: none; margin: 0; padding: 0; }
.compare-col li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.7rem 0;
  font-size: 1rem;
  border-top: 1px solid var(--line);
}
.compare-col li:first-child { border-top: none; }
.compare-col .ico {
  flex: none;
  margin-top: 0.15rem;
  width: 18px;
  height: 18px;
}
.compare-col.them li { color: var(--muted); }
.compare-col.them .ico { color: #5b6170; }
.compare-col.us .ico { color: var(--mint); }

/* ============================================================
   Testimonials
   ============================================================ */
.quotes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.quote {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.85rem;
  display: flex;
  flex-direction: column;
}
.quote p {
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 1.5rem;
}
.quote .by {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.quote .by b { color: var(--mint); font-weight: 700; }

/* ============================================================
   Contact and form
   ============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.contact-intro h2 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  letter-spacing: -0.03em;
}
.contact-intro .lead {
  margin-top: 1.1rem;
  color: var(--muted);
  max-width: 44ch;
}
.contact-details {
  list-style: none;
  margin: 2.25rem 0 0;
  padding: 0;
}
.contact-details li {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}
.contact-details li:first-child { border-top: none; }
.contact-details .k {
  flex: none;
  width: 4.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.contact-details a:hover { color: var(--mint); }

/* Form card */
.contact-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(1.75rem, 4vw, 2.5rem);
}

.field { margin-bottom: 1.15rem; }
.field label {
  display: block;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.55rem;
}
.field label .optional {
  text-transform: none;
  letter-spacing: 0;
  color: #5b6170;
  font-size: 0.78rem;
}

.field input,
.field textarea {
  width: 100%;
  font-family: var(--body);
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 0.8rem 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input::placeholder,
.field textarea::placeholder { color: #5b6170; }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(61, 220, 151, 0.16);
}

/* Error state */
.field.invalid input,
.field.invalid textarea {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.14);
}
.field-error {
  display: none;
  margin-top: 0.5rem;
  font-size: 0.84rem;
  color: var(--error);
}
.field.invalid .field-error { display: block; }

.btn-block { width: 100%; margin-top: 0.5rem; }

.form-note {
  margin-top: 0.9rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #5b6170;
  text-align: center;
}

/* Sending state on the submit button */
.contact-form.sending .btn-label { opacity: 0.6; }
.contact-form.sending #cf-submit { pointer-events: none; }

/* Success state */
.form-success {
  text-align: center;
  padding: 1rem 0.5rem 0.5rem;
  animation: success-in 0.5s ease both;
}
.form-success h3 {
  font-size: 1.5rem;
  margin: 1.4rem 0 0.6rem;
}
.form-success p {
  color: var(--muted);
  max-width: 38ch;
  margin: 0 auto 1.6rem;
}

@keyframes success-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* Animated checkmark */
.check-wrap {
  width: 88px;
  height: 88px;
  margin: 0 auto;
}
.check-svg {
  width: 100%;
  height: 100%;
}
.check-circle {
  fill: none;
  stroke: var(--mint);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 208;
  stroke-dashoffset: 208;
  animation: draw-circle 0.55s ease forwards;
}
.check-mark {
  fill: none;
  stroke: var(--mint);
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 52;
  stroke-dashoffset: 52;
  animation: draw-mark 0.35s 0.5s ease forwards;
}

@keyframes draw-circle { to { stroke-dashoffset: 0; } }
@keyframes draw-mark   { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  .check-circle, .check-mark { animation: none; stroke-dashoffset: 0; }
  .form-success { animation: none; }
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: clamp(3rem, 6vw, 4.5rem) 2.5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
}
.footer-brand .brand { margin-bottom: 1rem; }
.footer-brand p {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 34ch;
}
.footer-col h4 {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 0.6rem; }
.footer-col a, .footer-col span {
  color: var(--text);
  font-size: 0.95rem;
  transition: color 0.2s ease;
}
.footer-col a:hover { color: var(--mint); }

.socials { display: flex; gap: 0.6rem; margin-top: 0.25rem; }
.socials a {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.socials a:hover {
  color: var(--mint);
  border-color: var(--blue);
  transform: translateY(-2px);
}
.socials svg { width: 18px; height: 18px; }

.footer-bottom {
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

/* ============================================================
   Scroll reveal
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }
.reveal.d4 { transition-delay: 0.32s; }
.reveal.d5 { transition-delay: 0.40s; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .quotes { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-cta .btn-cta-text { display: none; }
  .nav-toggle { display: inline-flex; }
  .brand .sub { display: none; }

  .grid { grid-template-columns: 1fr; }
  .compare { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }

  /* Mobile menu panel */
  .nav-links.open {
    display: flex;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.5rem var(--gutter) 1rem;
    background: rgba(11, 12, 16, 0.97);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
  }
  .nav-links.open li { width: 100%; }
  .nav-links.open a {
    display: block;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--line);
    width: 100%;
    font-size: 1.05rem;
  }
}

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

/* ============================================================
   Form request error banner
   ============================================================ */
.form-error-banner {
  margin-bottom: 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(255, 107, 107, 0.4);
  background: rgba(255, 107, 107, 0.08);
  border-radius: 10px;
  color: var(--error);
  font-size: 0.9rem;
}
.form-error-banner a { color: var(--error); text-decoration: underline; }
