/* ============================================================
   Spiregy — Smartly Simple
   Light theme matched to the brand logo: black type, red accent,
   white background. No frameworks.
   ============================================================ */

:root {
  --bg:        #ffffff;
  --bg-alt:    #f7f8fa;
  --surface:   #ffffff;
  --border:    #e6e8ec;
  --text:      #14171c;
  --muted:     #5c6470;
  --accent:    #ed1c24;   /* logo red */
  --accent-dk: #c4141b;
  --grad:      linear-gradient(120deg, #ed1c24, #ff5a3c);
  --radius:    14px;
  --shadow:    0 6px 24px rgba(20, 23, 28, 0.07);
  --font:      -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

.container { width: min(1100px, 92%); margin-inline: auto; }

h1, h2, h3 { line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.2rem, 6vw, 4rem); }
h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); margin-bottom: 1rem; }
h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
p  { color: var(--muted); }

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

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  padding: 0.85rem 1.8rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:hover {
  background: var(--accent-dk);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(237, 28, 36, 0.3);
}
.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn--ghost:hover {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: none;
}
.btn--small { padding: 0.5rem 1.2rem; font-size: 0.9rem; }
.btn--full { width: 100%; }

/* ---------- Navigation ---------- */
.nav {
  /* in normal flow at the top; sticks and slides on scroll (see main.js) */
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: transform 0.3s ease;
}
.nav--hide { transform: translateY(-100%); }
.nav.nav--show { transform: translateY(0); }
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
}
.nav__logo {
  display: flex;
  align-items: center;
  /* visibility flips only after the opacity fade completes */
  transition: opacity 0.4s ease, visibility 0.4s;
}
.nav__logo img { height: 48px; width: auto; display: block; }
/* while the hero logo is on screen the bar logo stays out of the way */
.nav--logo-hidden .nav__logo { opacity: 0; visibility: hidden; }
.nav__links { display: flex; align-items: center; gap: 1.8rem; }
.nav__links a:not(.btn) {
  color: var(--muted);
  font-size: 0.95rem;
  transition: color 0.2s;
}
.nav__links a:not(.btn):hover { color: var(--accent); }

.nav__toggle {
  display: none;
  align-items: center;
  gap: 0.6rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  cursor: pointer;
  font: inherit;
}
.nav__toggle-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}
.nav__toggle-icon {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav__toggle-icon span {
  width: 18px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.nav__toggle.open .nav__toggle-icon span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav__toggle.open .nav__toggle-icon span:nth-child(2) { opacity: 0; }
.nav__toggle.open .nav__toggle-icon span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  /* small bottom pad: the next section's own top padding provides the gap */
  padding: 6rem 0 1rem;
  overflow: hidden;
  text-align: center;
}
.hero__glow {
  position: absolute;
  top: -30%; left: 50%;
  width: 900px; height: 600px;
  transform: translateX(-50%);
  background:
    radial-gradient(ellipse at center,
      rgba(237, 28, 36, 0.07) 0%,
      rgba(255, 90, 60, 0.05) 40%,
      transparent 70%);
  pointer-events: none;
}
.hero__inner { position: relative; }
.hero__logo {
  width: clamp(240px, 36vw, 360px);
  height: auto;
  margin-bottom: 2rem;
}
.hero__sub {
  max-width: 620px;
  margin: 1.4rem auto 2.2rem;
  font-size: 1.1rem;
}
.hero__cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero__stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-top: 4rem;
  list-style: none;
  flex-wrap: wrap;
}
.hero__stats li { display: flex; flex-direction: column; gap: 0.2rem; }
.hero__stats strong { font-size: 1.6rem; color: var(--accent); }
.hero__stats span { font-size: 0.85rem; color: var(--muted); }

/* ---------- Sections ---------- */
.section { padding: 6rem 0; }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section__kicker {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.8rem;
  margin-bottom: 0.8rem;
}

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: 1.4rem; margin-top: 3rem; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); }
.card__icon {
  font-size: 1.4rem;
  width: 48px; height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(237, 28, 36, 0.08);
  color: var(--accent);
  margin-bottom: 1.1rem;
  font-weight: 700;
}

/* ---------- Process steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.4rem;
  margin-top: 3rem;
  list-style: none;
  counter-reset: step;
}
.steps__item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
  box-shadow: var(--shadow);
}
.steps__num {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 0.8rem;
}

/* ---------- Why ---------- */
.why {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}
.why__list { list-style: none; display: flex; flex-direction: column; gap: 1.2rem; margin-top: 0.5rem; }
.why__list li {
  color: var(--muted);
  padding: 1.2rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
  box-shadow: var(--shadow);
}
.why__list strong { color: var(--text); }

/* ---------- Contact ---------- */
.contact {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 4rem;
  align-items: start;
}
.contact__email { margin-top: 1.5rem; font-size: 1.05rem; }

.contact__form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label { font-size: 0.9rem; font-weight: 600; }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  outline: none;
  transition: border-color 0.2s;
}
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--accent); }
.field textarea { resize: vertical; }

.hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }

.form-msg {
  padding: 0.9rem 1.1rem;
  border-radius: 10px;
  font-size: 0.95rem;
}
.form-msg--ok  { background: rgba(22, 163, 74, 0.08);  color: #15803d; border: 1px solid rgba(22, 163, 74, 0.3); }
.form-msg--err { background: rgba(237, 28, 36, 0.07);  color: var(--accent-dk); border: 1px solid rgba(237, 28, 36, 0.3); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 2rem 0; background: var(--bg-alt); }
.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.footer p { font-size: 0.9rem; display: flex; align-items: center; gap: 0.6rem; }
.footer img { height: 36px; width: auto; display: block; }
.footer strong { color: var(--text); }

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .steps   { grid-template-columns: repeat(2, 1fr); }
  .why, .contact { grid-template-columns: 1fr; gap: 2.5rem; }
}

@media (max-width: 640px) {
  .section { padding: 4rem 0; }
  .hero { padding: 7rem 0 4rem; }
  .grid--3, .steps { grid-template-columns: 1fr; }
  .hero__stats { gap: 2rem; }

  .nav__toggle { display: flex; }
  /* mobile keeps the overlay bar: hidden on load, JS reveals on scroll-up */
  .nav {
    position: fixed;
    inset: 0 0 auto 0;
    transform: translateY(-100%);
  }
  .nav__inner { height: 60px; }
  .nav__logo img { height: 36px; }
  .nav__links {
    position: absolute;
    top: 60px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1.2rem 4%;
    gap: 1.2rem;
    display: none;
  }
  .nav__links.open { display: flex; }
}
