/* ==========================================================================
   Upnode Automations — core stylesheet
   Palette, type, layout tokens all defined once here.
   ========================================================================== */

:root {
  /* Greens (from the logo) */
  --forest:   #0F6E56;
  --emerald:  #1D9E75;
  --mint:     #5DCAA5;
  --mint-pale:#DCEFE7;

  /* Ink + ground */
  --ink:      #0D1512;
  --ink-soft: #3B4A44;
  --muted:    #6B7A74;
  --ground:   #F7FAF8;
  --surface:  #FFFFFF;
  --line:     #E4EEE9;

  /* Warm counter-accent — used ONLY for primary actions */
  --amber:    #E8A33D;
  --amber-dk: #C9861F;

  /* Type */
  --display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --body:    "Inter", system-ui, -apple-system, sans-serif;

  /* Scale */
  --max:   1180px;
  --gap:   clamp(1rem, 2.5vw, 2rem);
  --radius: 14px;
  --radius-lg: 22px;

  --shadow-sm: 0 1px 3px rgba(13,21,18,.06), 0 1px 2px rgba(13,21,18,.04);
  --shadow-md: 0 8px 30px rgba(13,21,18,.08);
  --shadow-lg: 0 24px 60px rgba(15,110,86,.12);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--ground);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ---------- layout helpers ---------- */
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gap); }
.section { padding-block: clamp(3.5rem, 8vw, 7rem); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }

.eyebrow {
  font-family: var(--display);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--forest);
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}
.eyebrow::before {
  content: ""; width: 22px; height: 2px; background: var(--emerald); border-radius: 2px;
}

h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.08; letter-spacing: -.02em; color: var(--ink); }
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
p  { color: var(--ink-soft); }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: var(--ink-soft); max-width: 42ch; }

/* ---------- buttons ---------- */
.btn {
  --btn-bg: var(--ink);
  --btn-fg: #fff;
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--display); font-weight: 500; font-size: 1rem;
  padding: .85rem 1.5rem; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg);
  border: 1.5px solid transparent; cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:focus-visible { outline: 3px solid var(--mint); outline-offset: 2px; }
.btn--primary { --btn-bg: var(--amber); --btn-fg: #23180a; }
.btn--primary:hover { --btn-bg: var(--amber-dk); --btn-fg:#fff; }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--emerald); background:#fff; }
.btn--lg { padding: 1.05rem 1.9rem; font-size: 1.08rem; }

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

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(12px);
  background: color-mix(in srgb, var(--ground) 90%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; height: 68px; flex-wrap: nowrap;
}
.brand {
  display: flex; align-items: center; gap: .55rem; flex-shrink: 0;
  font-family: var(--display); font-weight: 600; font-size: 1.15rem;
  letter-spacing: -.02em; white-space: nowrap;
}
.brand svg { width: 26px; height: 30px; flex-shrink: 0; }

.nav-links {
  display: flex; align-items: center; gap: 1.6rem;
  flex: 1 1 auto; justify-content: center;
}
.nav-links a {
  font-size: .92rem; color: var(--ink-soft); white-space: nowrap;
  transition: color .15s; position: relative;
}
.nav-links a:hover { color: var(--ink); }

.nav-cta { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }
.nav-cta .btn {
  padding: .58rem 1.15rem; font-size: .92rem; white-space: nowrap;
}
.nav-cta .btn:hover { transform: none; box-shadow: var(--shadow-sm); }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: .4rem; flex-shrink: 0; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; transition: .25s; }

/* Below 1180px there isn't room for six links plus a button: collapse to menu */
@media (max-width: 1180px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-links.open {
    display: flex; flex-direction: column; align-items: flex-start;
    position: absolute; top: 68px; left: 0; right: 0;
    background: var(--surface); padding: 1.25rem var(--gap) 1.5rem;
    gap: 1.1rem; border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
  }
  .nav-links.open a { font-size: 1rem; }
}
@media (max-width: 560px) {
  .nav-cta .btn { padding: .5rem .95rem; font-size: .86rem; }
  .brand { font-size: 1.05rem; }
}

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(3rem, 7vw, 6rem); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 span.accent { color: var(--forest); }
.hero .lead { margin-top: 1.4rem; }
.hero-actions { margin-top: 2.2rem; display: flex; flex-wrap: wrap; gap: 1rem; }
.hero-trust { margin-top: 2.4rem; display: flex; flex-wrap: wrap; gap: 1.4rem 2rem; align-items: center; color: var(--muted); font-size: .9rem; }
.hero-trust strong { color: var(--ink); font-family: var(--display); }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 440px; margin-inline: auto; }
}

/* ---------- funnel signature ---------- */
.funnel { background: var(--ink); color: #fff; border-radius: var(--radius-lg); padding: clamp(1.5rem, 3vw, 2.5rem); }
.funnel h2 { color: #fff; }
.funnel .muted { color: #9db3aa; }

/* ---------- pillar cards ---------- */
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; }
.pillar {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem 1.4rem; position: relative; overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.pillar:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--mint); }
.pillar .num { font-family: var(--display); font-size: .8rem; color: var(--emerald); font-weight: 600; letter-spacing: .1em; }
.pillar h3 { margin: .8rem 0 .5rem; }
.pillar p { font-size: .95rem; }
.pillar ul { list-style: none; margin-top: 1rem; display: grid; gap: .45rem; }
.pillar li { font-size: .86rem; color: var(--muted); padding-left: 1.1rem; position: relative; }
.pillar li::before { content: ""; position: absolute; left: 0; top: .55em; width: 5px; height: 5px; border-radius: 50%; background: var(--mint); }
.pillar .node-corner { position: absolute; top: -20px; right: -20px; width: 90px; height: 90px; opacity: .06; }

@media (max-width: 980px) { .pillars { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .pillars { grid-template-columns: 1fr; } }

/* ---------- industry chips ---------- */
.industries { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.8rem; }
.chip {
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: .55rem 1.1rem; font-size: .9rem; color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: .5rem;
  transition: border-color .15s, color .15s;
}
.chip:hover { border-color: var(--emerald); color: var(--ink); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--emerald); }

/* ---------- steps / how it works ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; margin-top: 2.5rem; }
.step { position: relative; padding-top: 1.5rem; }
.step .step-num {
  font-family: var(--display); font-weight: 600; font-size: 2.6rem; color: var(--mint-pale);
  line-height: 1; position: absolute; top: -.4rem; left: 0;
}
.step h3 { position: relative; margin-bottom: .5rem; }
.step p { font-size: .95rem; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

/* ---------- calculator teaser ---------- */
.calc-teaser {
  background: linear-gradient(135deg, var(--forest), var(--emerald));
  color: #fff; border-radius: var(--radius-lg); padding: clamp(2rem, 5vw, 3.5rem);
  display: grid; grid-template-columns: 1.3fr .7fr; gap: 2rem; align-items: center;
}
.calc-teaser h2 { color: #fff; }
.calc-teaser p { color: rgba(255,255,255,.86); }
.calc-teaser .btn--primary { --btn-bg: #fff; --btn-fg: var(--forest); }
.calc-teaser .btn--primary:hover { --btn-bg: var(--ground); }
@media (max-width: 760px) { .calc-teaser { grid-template-columns: 1fr; } }

/* ---------- website tiers ---------- */
.tiers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; margin-top: 2.5rem; }
.tier {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem 1.4rem; display: flex; flex-direction: column;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.tier:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--mint); }
.tier.featured { border-color: var(--emerald); box-shadow: var(--shadow-md); }
.tier .badge { align-self: flex-start; background: var(--mint-pale); color: var(--forest); font-family: var(--display); font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: .3rem .7rem; border-radius: 999px; margin-bottom: .9rem; }
.tier h3 { margin-bottom: .3rem; }
.tier .price { font-family: var(--display); font-size: 1.6rem; font-weight: 600; color: var(--ink); margin: .6rem 0; }
.tier .price small { display:block; font-size: .78rem; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.tier ul { list-style: none; margin: 1rem 0 1.5rem; display: grid; gap: .5rem; flex: 1; }
.tier li { font-size: .88rem; color: var(--ink-soft); padding-left: 1.4rem; position: relative; }
.tier li::before { content: "✓"; position: absolute; left: 0; color: var(--emerald); font-weight: 700; }
@media (max-width: 980px) { .tiers { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 520px) { .tiers { grid-template-columns: 1fr; } }

/* ---------- price note (editable placeholder) ---------- */
.price-note {
  background: #FFF8EC; border: 1px dashed var(--amber); border-radius: 10px;
  padding: .5rem .8rem; font-size: .78rem; color: var(--amber-dk); margin-top: .6rem;
}

/* ---------- risk reversal band ---------- */
.reversal { background: var(--ink); color: #fff; border-radius: var(--radius-lg); padding: clamp(2rem,5vw,3.5rem); text-align: center; }
.reversal h2 { color: #fff; max-width: 20ch; margin-inline: auto; }
.reversal p { color: #9db3aa; max-width: 52ch; margin: 1rem auto 0; }

/* ---------- CTA final ---------- */
.cta-final { text-align: center; }
.cta-final h2 { max-width: 18ch; margin: 0 auto 1rem; }
.cta-final .lead { margin: 0 auto 2rem; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: #c8d6d0; padding-block: 3.5rem 2rem; margin-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; }
.site-footer h4 { color: #fff; font-size: .95rem; margin-bottom: 1rem; letter-spacing: .04em; }
.site-footer a { color: #a9beb6; font-size: .9rem; display: block; padding: .25rem 0; transition: color .15s; }
.site-footer a:hover { color: #fff; }
.footer-brand svg { width: 34px; height: 38px; }
.footer-brand p { color: #8ba49b; font-size: .9rem; margin-top: 1rem; max-width: 30ch; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 2.5rem; padding-top: 1.5rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; font-size: .82rem; color: #7e9890; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- section heading block ---------- */
.section-head { max-width: 52ch; margin-bottom: 2.5rem; }
.section-head h2 { margin: .8rem 0 1rem; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .eyebrow { justify-content: center; }

/* ---------- booking ---------- */
.call-types { display:grid; grid-template-columns:repeat(2,1fr); gap:1.1rem; max-width:760px; margin:0 auto 2rem; }
.call-type {
  background:var(--surface); border:1px solid var(--line); border-radius:var(--radius);
  padding:1.6rem 1.4rem; position:relative;
  transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  /* reset button defaults */
  width:100%; text-align:left; font-family:inherit; cursor:pointer;
  display:flex; flex-direction:column; align-items:flex-start;
}
.call-type:hover { transform:translateY(-3px); box-shadow:var(--shadow-md); border-color:var(--mint); }
.call-type:focus-visible { outline:3px solid var(--mint); outline-offset:3px; }
.call-type--featured { border-color:var(--emerald); box-shadow:var(--shadow-sm); }
.ct-badge {
  display:inline-block; background:var(--mint-pale); color:var(--forest);
  font-family:var(--display); font-size:.7rem; font-weight:600; letter-spacing:.08em;
  text-transform:uppercase; padding:.28rem .7rem; border-radius:999px; margin-bottom:.8rem;
}
.call-type h3 { margin-bottom:.5rem; }
.call-type p { font-size:.93rem; margin-bottom:1rem; }
.ct-length {
  display:inline-flex; align-items:center; gap:.4rem;
  font-family:var(--display); font-size:.85rem; font-weight:500; color:var(--forest);
  background:var(--ground); border:1px solid var(--line);
  padding:.35rem .85rem; border-radius:999px;
}
.ct-book {
  margin-top:1rem; font-family:var(--display); font-size:.9rem; font-weight:600;
  color:var(--forest); transition:transform .2s ease;
}
.call-type:hover .ct-book { transform:translateX(3px); }
@media (max-width:640px){ .call-types { grid-template-columns:1fr; } }

/* ---------- clickable service cards ---------- */
.svc-card, .pillar { cursor: pointer; }
.svc-card:focus-visible, .pillar:focus-visible { outline: 3px solid var(--mint); outline-offset: 3px; }
.svc-more {
  display:inline-flex; align-items:center; gap:.3rem; margin-top:.9rem;
  font-family:var(--display); font-size:.82rem; font-weight:500; color:var(--forest);
}
.svc-more .chev { transition: transform .2s ease; }
.svc-card:hover .svc-more .chev, .pillar:hover .svc-more .chev { transform: translateX(3px); }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(13,21,18,.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem; opacity: 0; pointer-events: none; transition: opacity .22s ease;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  max-width: 620px; width: 100%; max-height: 86vh; overflow-y: auto;
  padding: clamp(1.5rem, 4vw, 2.5rem); position: relative;
  box-shadow: 0 30px 80px rgba(13,21,18,.28);
  transform: translateY(16px) scale(.98); transition: transform .25s cubic-bezier(.16,1,.3,1);
}
.modal-backdrop.open .modal { transform: none; }
.modal-close {
  position: absolute; top: 1rem; right: 1rem; width: 34px; height: 34px;
  border-radius: 50%; border: 1px solid var(--line); background: var(--ground);
  cursor: pointer; font-size: 1.1rem; line-height: 1; color: var(--ink-soft);
  display: grid; place-items: center; transition: background .15s, border-color .15s;
}
.modal-close:hover { background: #fff; border-color: var(--emerald); color: var(--ink); }
.modal .m-pillar {
  font-family: var(--display); font-size: .72rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--forest);
  background: var(--mint-pale); padding: .3rem .7rem; border-radius: 999px;
  display: inline-block; margin-bottom: .9rem;
}
.modal h3 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-bottom: 1.4rem; }
.modal .m-block { margin-bottom: 1.3rem; }
.modal .m-label {
  font-family: var(--display); font-size: .78rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  display: block; margin-bottom: .4rem;
}
.modal .m-block p { font-size: .98rem; line-height: 1.65; }
.modal .m-worth {
  background: var(--ground); border-left: 3px solid var(--emerald);
  border-radius: 0 10px 10px 0; padding: 1rem 1.1rem;
}
.modal .m-worth p { color: var(--ink); font-weight: 500; }
.modal .m-typical {
  font-size: .88rem; color: var(--muted); font-style: italic;
  padding-top: 1rem; border-top: 1px solid var(--line);
}
.modal-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.6rem; }

/* ---------- systems pricing ---------- */
.sys-tiers { display:grid; grid-template-columns:repeat(3,1fr); gap:1.1rem; margin-top:2.5rem; }
.sys-tier {
  background:var(--surface); border:1px solid var(--line); border-radius:var(--radius);
  padding:1.7rem 1.5rem; display:flex; flex-direction:column;
  transition:transform .2s, box-shadow .2s, border-color .2s;
}
.sys-tier:hover { transform:translateY(-4px); box-shadow:var(--shadow-md); border-color:var(--mint); }
.sys-tier.featured { border-color:var(--emerald); box-shadow:var(--shadow-md); }
.sys-tier .badge {
  align-self:flex-start; background:var(--mint-pale); color:var(--forest);
  font-family:var(--display); font-size:.72rem; font-weight:600; letter-spacing:.08em;
  text-transform:uppercase; padding:.3rem .7rem; border-radius:999px; margin-bottom:.9rem;
}
.sys-tier h3 { margin-bottom:.5rem; }
.sys-tier > p { font-size:.93rem; margin-bottom:1rem; }
.sys-tier .quote-line {
  font-family:var(--display); font-size:1.15rem; font-weight:600; color:var(--forest);
  margin:.4rem 0 .3rem;
}
.sys-tier .quote-sub { font-size:.8rem; color:var(--muted); margin-bottom:1rem; }
.sys-tier ul { list-style:none; display:grid; gap:.5rem; flex:1; margin-bottom:1.5rem; }
.sys-tier li { font-size:.88rem; color:var(--ink-soft); padding-left:1.4rem; position:relative; }
.sys-tier li::before { content:"✓"; position:absolute; left:0; color:var(--emerald); font-weight:700; }
@media (max-width:900px){ .sys-tiers { grid-template-columns:1fr; } }

/* ---------- interest field ---------- */
.interest-field select {
  width:100%; padding:.9rem 1rem; border:1px solid var(--line); border-radius:10px;
  font:inherit; background:#fff; color:var(--ink); cursor:pointer;
}
.interest-field select:focus-visible { outline:3px solid var(--mint); outline-offset:2px; }

/* ---------- contact form ---------- */
.contact-form {
  max-width: 520px; margin: 2rem auto 0; text-align: left;
  display: grid; gap: 1rem;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-input {
  width: 100%; min-width: 0;               /* min-width:0 is the overflow fix */
  padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; background: #fff; color: var(--ink);
}
.form-input:focus-visible { outline: 3px solid var(--mint); outline-offset: 2px; border-color: var(--emerald); }
.form-textarea { resize: vertical; min-height: 96px; }
.contact-form .btn { justify-content: center; }
#formMsg { font-size: .88rem; text-align: center; min-height: 1.2em; }

/* stack the name/business row on narrow screens */
@media (max-width: 520px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ---------- global overflow guard ----------
   stops any stray wide element forcing a horizontal scroll / zoom-out on mobile */
html, body { overflow-x: hidden; max-width: 100%; }
