/* ============================================================
   PFx Solutions — "Software, solved for x"
   Palette: deep teal ink + coral variable + warm paper
   ============================================================ */

:root {
  --ink:        #141414;   /* near-black (logo black)   */
  --ink-2:      #1f1f1f;   /* raised dark surface       */
  --paper:      #F6F5F3;   /* clean off-white           */
  --sand:       #ECEAE6;   /* light neutral mid         */
  --coral:      #E31E24;   /* PFx brand red / the variable */
  --coral-soft: #FF5057;
  --teal-text:  #5C5C5E;   /* muted gray body on paper  */
  --teal-line:  rgba(20, 20, 20, 0.12);
  --paper-dim:  rgba(246, 245, 243, 0.66);
  --paper-line: rgba(246, 245, 243, 0.16);

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

  --maxw: 1140px;
  --pad: clamp(1.25rem, 5vw, 4rem);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

.mono { font-family: var(--mono); }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  padding: 0.85em 1.5em;
  border-radius: 2px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn-solid {
  background: var(--coral);
  color: var(--paper);
}
.btn-solid:hover { background: #b81419; transform: translateY(-2px); }
.btn-ghost {
  border-color: var(--teal-line);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }
.btn-lg { font-size: 1.15rem; padding: 1em 1.8em; font-family: var(--mono); font-weight: 500; }

.btn:focus-visible,
a:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 2rem;
  padding: 1rem var(--pad);
  background: rgba(250, 246, 240, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--teal-line);
}
.brand { display: flex; align-items: baseline; gap: 0.5rem; }
.brand-mark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.brand-mark .var { color: var(--coral); font-family: var(--mono); }

/* ---------- Logo: PF[x] / SOLUTIONS ---------- */
.logo {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  gap: 0.18em;
}
.logo-mark {
  display: flex;
  align-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.logo-mark .brk { color: var(--coral); font-weight: 500; }
.logo-mark .vx  { color: var(--coral); }
.logo-sub {
  font-family: var(--mono);
  font-size: 0.5rem;
  font-weight: 500;
  letter-spacing: 0.46em;
  text-transform: uppercase;
  padding-left: 0.46em;            /* offset the trailing letter-spacing to keep it centered */
  color: var(--ink);
}
.logo--on-dark .logo-mark,
.logo--on-dark .logo-sub { color: var(--paper); }
.brand-sub {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--teal-text);
}
.nav-links {
  display: flex; gap: 1.75rem;
  margin-left: auto;
  font-size: 0.92rem;
  font-weight: 500;
}
.nav-links a { color: var(--teal-text); transition: color 0.2s; }
.nav-links a:hover { color: var(--ink); }
.nav-cta { padding: 0.6em 1.1em; font-size: 0.9rem; }

/* ---------- Graph paper background ---------- */
.grid-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--paper-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--paper-line) 1px, transparent 1px);
  background-size: 42px 42px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, #000 40%, transparent 80%);
          mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, #000 40%, transparent 80%);
  pointer-events: none;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: var(--ink);
  color: var(--paper);
  padding: clamp(4rem, 12vh, 9rem) var(--pad) clamp(5rem, 14vh, 10rem);
  overflow: hidden;
}
.hero-inner { position: relative; max-width: var(--maxw); margin: 0 auto; }
.eyebrow {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--coral-soft);
  margin-bottom: 1.6rem;
}
.hero-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.4rem, 7.5vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin-bottom: 1.8rem;
}
.hl-line { white-space: nowrap; }
.x-token {
  display: inline-block;
  vertical-align: baseline;
  position: relative;
}
.x-letter {
  display: inline-block;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.64em;
  white-space: nowrap;
  color: var(--ink);
  background: var(--coral);
  padding: 0.04em 0.22em;
  border-radius: 4px;
  box-shadow: 0 0 0 1px var(--coral), 0 12px 40px -12px var(--coral);
  animation: xpulse 4s ease-in-out infinite;
}
@keyframes xpulse {
  0%, 100% { box-shadow: 0 0 0 1px var(--coral), 0 12px 40px -16px var(--coral); }
  50%      { box-shadow: 0 0 0 1px var(--coral), 0 12px 52px -8px var(--coral); }
}
.hero-sub {
  max-width: 46ch;
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: var(--paper-dim);
  margin-bottom: 2.4rem;
}
.hero-sub em { color: var(--paper); font-style: italic; }
.mono-x {
  font-family: var(--mono);
  color: var(--coral);
  font-weight: 700;
}
.hero-sub .mono-x { background: rgba(227,30,36,0.16); padding: 0 0.25em; border-radius: 3px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 3.2rem; }
.hero-cta .btn-ghost { color: var(--paper); border-color: var(--paper-line); }
.hero-cta .btn-ghost:hover { border-color: var(--paper); }
.hero-eq {
  font-size: 0.95rem;
  color: var(--paper-line);
  letter-spacing: 0.02em;
  border-top: 1px solid var(--paper-line);
  padding-top: 1.4rem;
  display: inline-block;
}
.hero-eq .dim { color: var(--paper-dim); }
.hero-eq .hl { color: var(--coral); }

/* ---------- The variable / explainer ---------- */
.solve {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(4rem, 10vh, 7rem) var(--pad);
  display: block;
}
.solve-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.kicker {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--coral);
  margin-bottom: 1.1rem;
}
.solve-def h2 {
  font-family: var(--display);
  font-size: clamp(4rem, 12vw, 7rem);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 1.8rem;
}
.big-pf { color: var(--ink); }
.big-x { color: var(--coral); font-family: var(--mono); }
.legend { list-style: none; display: grid; gap: 1rem; }
.legend li { display: flex; gap: 1rem; align-items: baseline; }
.legend-key {
  flex: 0 0 2.4rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
}
.legend-key.var-key { color: var(--coral); }
.legend-val { color: var(--teal-text); font-size: 0.98rem; }
.solve-copy p {
  font-size: clamp(1.1rem, 2.4vw, 1.45rem);
  color: var(--ink);
  margin-bottom: 1.3rem;
  line-height: 1.5;
}
.solve-copy p:last-child { margin-bottom: 0; color: var(--teal-text); }

/* ---------- Section heads ---------- */
.section-head { max-width: 60ch; margin-bottom: 3rem; }
.section-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin-bottom: 1rem;
}
.section-lead { color: var(--teal-text); font-size: 1.1rem; max-width: 52ch; }

/* ---------- Solutions ---------- */
.solutions {
  background: var(--sand);
  padding: clamp(4rem, 10vh, 7rem) var(--pad);
}
.solutions .section-head { margin-left: auto; margin-right: auto; max-width: var(--maxw); width: 100%; }
.cards {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
.card {
  background: var(--paper);
  border: 1px solid var(--teal-line);
  border-radius: 4px;
  padding: 2rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--coral);
  box-shadow: 0 24px 50px -28px rgba(20,20,20,0.4);
}
.card-eq {
  font-size: 0.82rem;
  color: var(--teal-text);
  margin-bottom: 1.4rem;
  letter-spacing: 0.01em;
}
.card-eq .hl { color: var(--coral); font-weight: 700; }
.card h3 {
  font-family: var(--display);
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.7rem;
}
.card p { color: var(--teal-text); font-size: 0.98rem; }

/* ---------- Process ---------- */
.process {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(4rem, 10vh, 7rem) var(--pad);
}
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  counter-reset: step;
}
.step {
  border-top: 2px solid var(--ink);
  padding-top: 1.2rem;
  position: relative;
}
.step-no {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--coral);
  margin-bottom: 1.2rem;
  letter-spacing: 0.05em;
}
.step h3 {
  font-family: var(--display);
  font-size: 1.3rem;
  margin-bottom: 0.6rem;
}
.step p { color: var(--teal-text); font-size: 0.95rem; }

/* ---------- About ---------- */
.about {
  background: var(--ink);
  color: var(--paper);
  padding: clamp(4rem, 10vh, 7rem) var(--pad);
}
.about-grid {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 7vw, 6rem);
  align-items: start;
}
.about .kicker { color: var(--coral-soft); }
.about-lead .section-title { color: var(--paper); }
.about-lead p { color: var(--paper-dim); font-size: 1.08rem; margin-top: 1.2rem; }
.principles { list-style: none; display: grid; gap: 1.8rem; }
.principles li { display: flex; gap: 1.2rem; align-items: flex-start; }
.prin-x {
  flex: 0 0 auto;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--coral);
  width: 2.2rem; height: 2.2rem;
  display: grid; place-items: center;
  border-radius: 4px;
  margin-top: 0.1rem;
}
.principles h3 {
  font-family: var(--display);
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
  color: var(--paper);
}
.principles p { color: var(--paper-dim); font-size: 0.96rem; }

/* ---------- Contact ---------- */
.contact {
  position: relative;
  background: var(--coral);
  color: var(--paper);
  padding: clamp(4.5rem, 12vh, 8rem) var(--pad);
  overflow: hidden;
  text-align: center;
}
.contact .grid-bg {
  background-image:
    linear-gradient(rgba(0,0,0,0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.16) 1px, transparent 1px);
}
.contact-inner { position: relative; max-width: 40ch; margin: 0 auto; }
.contact-eq {
  font-size: 0.9rem;
  color: rgba(246,245,243,0.72);
  margin-bottom: 1.5rem;
  letter-spacing: 0.02em;
}
.contact-eq .hl { color: var(--paper); font-weight: 700; }
.contact-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 1.3rem;
}
.x-static { font-family: var(--mono); }
.contact-sub {
  font-size: 1.1rem;
  color: rgba(246,245,243,0.85);
  margin-bottom: 2.4rem;
}
.contact .btn-solid {
  background: var(--paper);
  color: var(--ink);
}
.contact .btn-solid:hover { background: #fff; }
.contact-fine {
  margin-top: 1.4rem;
  font-size: 0.9rem;
  color: rgba(246,245,243,0.75);
}

/* ---------- Contact form ---------- */
.contact-form {
  display: grid;
  gap: 1.1rem;
  text-align: left;
  margin-top: 0.5rem;
}
.hp { position: absolute; left: -9999px; }
.field { display: grid; gap: 0.4rem; }
.field label {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: rgba(246,245,243,0.92);
}
.field input,
.field textarea {
  font-family: var(--body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid transparent;
  border-radius: 3px;
  padding: 0.75em 0.85em;
  width: 100%;
  resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input::placeholder,
.field textarea::placeholder { color: #9a9a9c; }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(20,20,20,0.25);
}
.contact .contact-submit {
  margin-top: 0.4rem;
  background: var(--ink);
  color: var(--paper);
  width: 100%;
}
.contact .contact-submit:hover { background: #000; }

/* ---------- Thank-you page ---------- */
.thanks {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  background: var(--ink);
  color: var(--paper);
  padding: var(--pad);
  overflow: hidden;
}
.thanks-inner { position: relative; max-width: 42ch; }
.thanks-eq { color: var(--paper-dim); font-size: 0.9rem; margin-bottom: 1.4rem; letter-spacing: 0.02em; }
.thanks-eq .hl { color: var(--coral); font-weight: 700; }
.thanks-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(3rem, 10vw, 5.5rem);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 1.2rem;
}
.thanks-sub { color: var(--paper-dim); font-size: 1.1rem; margin-bottom: 2.2rem; }

/* ---------- Footer ---------- */
.footer {
  background: var(--ink);
  color: var(--paper);
  padding: 3rem var(--pad);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
}
.footer-brand { display: flex; align-items: baseline; gap: 0.7rem; }
.footer .brand-mark { color: var(--paper); }
.footer-tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--paper-dim);
}
.footer-meta { margin-left: auto; color: var(--paper-dim); font-size: 0.92rem; }
.footer-meta a { color: var(--coral-soft); }
.footer-meta a:hover { color: var(--paper); }
.footer-meta .dot { margin: 0 0.5rem; }
.footer-copy { color: var(--paper-line); font-size: 0.8rem; width: 100%; padding-top: 1rem; border-top: 1px solid var(--paper-line); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .solve-grid { grid-template-columns: 1fr; gap: 2rem; }
  .cards { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .about-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .steps { grid-template-columns: 1fr; }
  .footer-meta { margin-left: 0; width: 100%; }
  /* Too narrow to keep the long phrases beside "solved for" — let the
     variable drop to its own line, but never split the phrase itself. */
  .hl-line { white-space: normal; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
