/* ==========================================================================
   Truity Cloud Solutions — brand stylesheet
   Tokens taken directly from the Truity Brand Guidebook (2025).
   Do not add colours or typefaces outside the approved palette.
   ========================================================================== */

/* --- Sofia Pro (brand primary typeface) ---------------------------------
   Self-hosted. woff2 first (smallest), woff fallback for older browsers.
   font-display: swap — text shows immediately in the fallback, then swaps
   to Sofia Pro when it loads, so copy is never invisible.
   LICENCE: web/self-hosting use must be covered by TSG's Sofia Pro licence.
   See README §2.2.
   ------------------------------------------------------------------------ */
@font-face {
  font-family: "Sofia Pro";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/sofia-pro-regular.woff2") format("woff2"),
       url("../fonts/sofia-pro-regular.woff") format("woff");
}
@font-face {
  font-family: "Sofia Pro";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/sofia-pro-bold.woff2") format("woff2"),
       url("../fonts/sofia-pro-bold.woff") format("woff");
}

:root {
  /* --- Primary palette (guidebook p.22) --- */
  --slate:  #31414a;
  --blue:   #5894bb;
  --green:  #77c0b1;
  --yellow: #e3e034;
  /* --- Accent colour: use sparingly, never as a large field --- */
  --orange: #f47b28;

  /* --- Derived neutrals (NOT in the guidebook; tints of slate for UI surfaces) --- */
  --paper:      #ffffff;
  --mist:       #f3f6f7;
  --mist-line:  #dfe6e9;
  --slate-deep: #26343b;
  --ink:        #31414a;
  --ink-soft:   #5c6b73;

  /* --- Type --- */
  /* Sofia Pro self-hosted (see @font-face above). Calibri is the guidebook's
     approved system fallback; the rest cover platforms without Calibri. */
  --font-display: "Sofia Pro", Calibri, "Segoe UI", system-ui,
                  -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-body:    "Sofia Pro", Calibri, "Segoe UI", system-ui,
                  -apple-system, "Helvetica Neue", Arial, sans-serif;

  /* --- Rhythm --- */
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --max:    1180px;
  --radius: 14px;
}

/* --------------------------------------------------------------- reset -- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

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

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

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--yellow); color: var(--slate);
  padding: 0.75rem 1.25rem; font-weight: 700;
}
.skip-link:focus { left: 0; }

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

/* ---------------------------------------------------------------- type -- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 1.6rem + 3.6vw, 4.1rem); }
h2 { font-size: clamp(1.85rem, 1.35rem + 2.1vw, 2.85rem); }
h3 { font-size: clamp(1.15rem, 1.02rem + 0.55vw, 1.4rem); letter-spacing: -0.01em; }
p  { margin: 0 0 1.1em; max-width: 62ch; }

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--slate);
  margin: 0 0 1.1rem;
  display: block;
}
.on-slate .eyebrow, .eyebrow--yellow { color: var(--yellow); }

.lede { font-size: clamp(1.08rem, 1rem + 0.5vw, 1.32rem); line-height: 1.55; color: var(--ink-soft); }
.on-slate .lede { color: rgba(255,255,255,0.82); }

.rule {
  width: 62px; height: 4px; border: 0; margin: 0 0 1.75rem;
  background: var(--yellow); border-radius: 2px;
}

/* -------------------------------------------------------------- header -- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--slate);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; min-height: 74px;
}
.brand { display: inline-flex; align-items: center; }
.brand img { width: 132px; }

.nav-toggle {
  display: none; background: none; border: 1px solid rgba(255,255,255,0.3);
  color: #fff; border-radius: 8px; padding: 0.5rem 0.75rem;
  font: inherit; font-size: 0.9rem; cursor: pointer;
}

.nav { display: flex; align-items: center; gap: 1.9rem; }
.nav a {
  color: rgba(255,255,255,0.86); text-decoration: none;
  font-size: 0.95rem; font-weight: 500; padding: 0.4rem 0;
  border-bottom: 2px solid transparent; transition: color 0.18s, border-color 0.18s;
}
.nav a:hover { color: #fff; border-bottom-color: var(--yellow); }
.nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--yellow); }

@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .nav {
    position: absolute; inset: 74px 0 auto 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--slate); padding: 0.5rem var(--gutter) 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.12);
  }
  .nav[hidden] { display: none; }
  .nav a { width: 100%; padding: 0.85rem 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
  .nav .btn { margin-top: 0.9rem; }
}

/* ------------------------------------------------------------ buttons -- */
.btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-display); font-weight: 700; font-size: 0.98rem;
  padding: 0.82rem 1.5rem; border-radius: 999px; border: 2px solid transparent;
  text-decoration: none; cursor: pointer; transition: transform 0.15s, background 0.18s, color 0.18s, border-color 0.18s;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--yellow); color: var(--slate); }
.btn--primary:hover { background: #eeeb4b; }
.btn--ghost { border-color: rgba(255,255,255,0.45); color: #fff; }
.btn--ghost:hover { border-color: var(--yellow); color: var(--yellow); }
.btn--slate { background: var(--slate); color: #fff; }
.btn--slate:hover { background: var(--slate-deep); }
.btn--outline { border-color: var(--slate); color: var(--slate); }
.btn--outline:hover { background: var(--slate); color: #fff; }
.btn__arrow { transition: transform 0.18s; }
.btn:hover .btn__arrow { transform: translateX(3px); }

/* ------------------------------------------------------------ sections -- */
.section { padding: clamp(3.5rem, 2rem + 6vw, 6.5rem) 0; position: relative; }
.section--mist  { background: var(--mist); }
.section--slate { background: var(--slate); color: #fff; }
.section--slate h2, .section--slate h3 { color: #fff; }
.section--tight { padding-block: clamp(2.5rem, 1.5rem + 4vw, 4.25rem); }

.section-head { max-width: 720px; margin-bottom: clamp(2rem, 1.2rem + 2.5vw, 3.25rem); }

/* --------------------------------------------- signature: circle field -- */
/* The overlapping circle motif from the logomark, used as a dynamic design
   element (guidebook p.18). Circles bleed off the edge and never sit behind
   body copy at a size that harms contrast. */
.circle-field { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.circle-field span { position: absolute; border-radius: 50%; display: block; }
.circle-field .c-yellow { background: var(--yellow); }
.circle-field .c-green  { background: var(--green); }
.circle-field .c-blue   { background: var(--blue); }

/* bottom-left cluster, stacked yellow → green → blue, as used throughout the
   guidebook. Solid fills, cropped by the section edge. */
.circle-field--corner .c-yellow { width: 240px; height: 240px; left: -96px;  bottom: -18px; }
.circle-field--corner .c-green  { width: 240px; height: 240px; left: -36px;  bottom: -108px; }
.circle-field--corner .c-blue   { width: 268px; height: 268px; left: 44px;   bottom: -176px; }
@media (max-width: 900px) {
  .circle-field--corner span { opacity: 0.35; }
}

.section > .wrap, .hero > .wrap { position: relative; z-index: 1; }

/* ---------------------------------------------------------------- hero -- */
.hero {
  background: var(--slate); color: #fff; position: relative; overflow: hidden;
  padding: clamp(3.5rem, 2rem + 7vw, 7rem) 0 clamp(3.5rem, 2rem + 6vw, 6rem);
}
.hero__grid {
  display: grid; gap: clamp(2.5rem, 1rem + 5vw, 4.5rem);
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
}
@media (max-width: 900px) { .hero__grid { grid-template-columns: 1fr; } }

.hero h1 { color: #fff; }
.hero h1 em { font-style: normal; color: var(--yellow); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2rem; }

.hero__note {
  margin-top: 2.4rem; padding-top: 1.4rem; border-top: 1px solid rgba(255,255,255,0.16);
  font-size: 0.92rem; color: rgba(255,255,255,0.72); max-width: 46ch;
}
.hero__note strong { color: #fff; }

/* --- the convergence figure --------------------------------------------
   The logomark drawn at scale: two circles meeting, the overlap rendered in
   brand green exactly as it appears in the mark. Two inputs, one shared area.
   ---------------------------------------------------------------------- */
.converge { width: 100%; max-width: 430px; margin-inline: auto; display: block; }
.converge .cv-a, .converge .cv-b {
  transform-box: fill-box; transform-origin: center;
  animation: cv-slide 1100ms cubic-bezier(0.2, 0.8, 0.28, 1) both;
}
.converge .cv-a { --dx: -78px; animation-delay: 150ms; }
.converge .cv-b { --dx:  78px; animation-delay: 260ms; }
.converge .cv-overlap { animation: cv-fade 700ms ease-out 900ms both; }

@keyframes cv-slide {
  from { transform: translateX(var(--dx)); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes cv-fade { from { opacity: 0; } to { opacity: 1; } }

.converge__legend {
  list-style: none; margin: 1.5rem auto 0; padding: 0; max-width: 400px;
  display: grid; gap: 0.55rem; font-size: 0.88rem; line-height: 1.45;
  color: rgba(255,255,255,0.78);
}
.converge__legend li { display: grid; grid-template-columns: 15px 1fr; gap: 0.7rem; align-items: start; }
.converge__legend i {
  width: 13px; height: 13px; border-radius: 50%; margin-top: 0.35em; display: block;
}
.converge__legend .k-yellow { background: var(--yellow); }
.converge__legend .k-blue   { background: var(--blue); }
.converge__legend .k-green  { background: var(--green); }
.converge__legend strong { color: #fff; font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  .converge .cv-a, .converge .cv-b, .converge .cv-overlap { animation: none; opacity: 1; }
}

/* --------------------------------------------------------------- cards -- */
.grid { display: grid; gap: 1.25rem; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.card {
  background: var(--paper); border: 1px solid var(--mist-line);
  border-radius: var(--radius); padding: 1.6rem 1.5rem;
  display: flex; flex-direction: column;
}
.section--mist .card { background: var(--paper); }
.section--slate .card {
  background: #3a4b55; border-color: rgba(255,255,255,0.14); color: #fff;
}
.card h3 { margin-bottom: 0.5rem; }
.card p { margin-bottom: 0; color: var(--ink-soft); font-size: 0.97rem; }
.section--slate .card p { color: rgba(255,255,255,0.78); }

.card__mark {
  width: 40px; height: 34px; margin-bottom: 1.05rem; display: block;
  background: url("../img/truity-logomark.png") left center / contain no-repeat;
}

/* --- app library rows --- */
.apps { border-top: 1px solid var(--mist-line); margin-top: 0.5rem; }
.app-row {
  display: grid; grid-template-columns: 1fr auto; gap: 1rem 2rem;
  align-items: baseline; padding: 1.15rem 0;
  border-bottom: 1px solid var(--mist-line);
}
.app-row__name { font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; margin: 0; }
.app-row__desc { grid-column: 1 / -1; margin: 0.15rem 0 0; color: var(--ink-soft); font-size: 0.95rem; max-width: 70ch; }
.app-row a { color: var(--slate); text-underline-offset: 3px; }

.status {
  font-family: var(--font-display); font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0.34rem 0.7rem; border-radius: 999px; white-space: nowrap;
}
.status--live    { background: var(--orange); color: #fff; }
.status--build   { background: var(--mist); color: var(--ink-soft); border: 1px solid var(--mist-line); }
.status--planned { background: transparent; color: var(--ink-soft); border: 1px dashed var(--mist-line); }

/* ---------------------------------------------------------- split rows -- */
.split {
  display: grid; gap: clamp(2rem, 1rem + 4vw, 4rem);
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  align-items: center;
}
.split + .split { margin-top: clamp(2.5rem, 1.5rem + 4vw, 4.5rem); }
.split__media {
  background: var(--mist); border: 1px solid var(--mist-line);
  border-radius: var(--radius); padding: 1.75rem;
}
.section--slate .split__media { background: #3a4b55; border-color: rgba(255,255,255,0.14); }

/* --- flow diagram used on the CPQ pages --- */
.flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
/* Wide variant: single centered column, constrained width for readability. */
.flow--wide { max-width: 640px; margin-inline: auto; }
.flow li {
  display: grid; grid-template-columns: 30px 1fr; gap: 0.9rem; align-items: start;
  font-size: 0.97rem;
}
.flow b {
  font-family: var(--font-display); font-size: 0.8rem; line-height: 30px;
  text-align: center; background: var(--slate); color: #fff; border-radius: 50%;
  width: 30px; height: 30px;
}
.section--slate .flow b { background: var(--yellow); color: var(--slate); }

/* ------------------------------------------------------------- lists --- */
/* Bullets are positioned rather than gridded: a grid here would turn every
   inline <strong> and its trailing text into separate grid items. */
.ticks { list-style: none; margin: 0 0 1.4rem; padding: 0; display: block; }
.ticks li { position: relative; padding-left: 30px; margin-bottom: 0.65rem; }
.ticks li:last-child { margin-bottom: 0; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 0.48em;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--green); box-shadow: 6px 0 0 -3px var(--yellow);
}

/* -------------------------------------------------------- testimonial -- */
.quote {
  max-width: 880px; margin-inline: auto; text-align: center;
}
.quote blockquote {
  margin: 0 0 1.4rem; padding: 0;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2.1rem); line-height: 1.28;
  letter-spacing: -0.01em; text-wrap: balance;
}
.section--slate .quote blockquote { color: #fff; }
.quote blockquote .mark { color: var(--yellow); }
.quote figcaption {
  font-size: 0.95rem; color: var(--ink-soft);
}
.section--slate .quote figcaption { color: rgba(255,255,255,0.72); }
.quote figcaption strong { color: var(--slate); font-weight: 700; }
.section--slate .quote figcaption strong { color: #fff; }

/* ---------------------------------------------------------------- CTA -- */
.cta { background: var(--slate-deep); color: #fff; position: relative; overflow: hidden; }
.cta .wrap { padding-block: clamp(3rem, 2rem + 4vw, 5rem); }
.cta__grid { display: grid; gap: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.cta h2 { color: #fff; }

/* ---------------------------------------------------------------- form -- */
.form { display: grid; gap: 1rem; }
.field { display: grid; gap: 0.35rem; }
.field label { font-size: 0.85rem; font-weight: 600; letter-spacing: 0.02em; }
.field input, .field select, .field textarea {
  font: inherit; font-size: 0.98rem; padding: 0.72rem 0.85rem;
  border-radius: 9px; border: 1px solid rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.07); color: #fff;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: rgba(255,255,255,0.45); }
.field select option { color: var(--ink); }
.form__note { font-size: 0.82rem; color: rgba(255,255,255,0.62); margin: 0; }

/* Honeypot: positioned off-screen rather than display:none, so assistive
   tech can still read the "leave blank" label to a human, while bots that
   auto-fill every field trip it. Never make this visible. */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px; overflow: hidden;
}

/* -------------------------------------------------------------- footer -- */
.site-footer { background: var(--slate-deep); color: rgba(255,255,255,0.72); font-size: 0.92rem; }
.site-footer .wrap { padding-block: 2.75rem 2rem; }
.site-footer__grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.site-footer img { width: 122px; margin-bottom: 1rem; }
.site-footer h4 {
  font-size: 0.76rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--yellow); margin: 0 0 0.85rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.site-footer a { color: rgba(255,255,255,0.8); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer__base {
  margin-top: 2.25rem; padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,0.12);
  display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; justify-content: space-between;
  font-size: 0.84rem; color: rgba(255,255,255,0.55);
}

/* -------------------------------------------------------- scroll reveal -- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover { transform: none; }
}
