/* ============================================================
   Positive Rate Engineering
   Palette: flight-deck navy, morning sky, signal azure, amber
   ============================================================ */

:root {
  --ink:        #0F1D2E;
  --ink-soft:   #47597280;
  --body:       #3D5068;
  --sky:        #E4ECF3;
  --paper:      #F7FAFC;
  --line:       #C9D8E5;
  --azure:      #1466C7;
  --azure-dark: #0E4E99;
  --amber:      #E39A2C;
  --danger:     #B4351F;

  --wrap: 1120px;
  --radius: 4px;

  --display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

/* ── Base ──────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--display);
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
}

p { margin: 0 0 1.1em; }
a { color: var(--azure-dark); }

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

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

.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;
}

.skip-link {
  position: absolute; left: -999px; top: 8px;
  background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: var(--radius); z-index: 100;
}
.skip-link:focus { left: 12px; }

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}

/* ── Shared type ───────────────────────────────────────── */

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--azure-dark);
  margin: 0 0 14px;
}

.section-title { font-size: clamp(28px, 4vw, 40px); }

.section-lede {
  font-size: 18px;
  max-width: 52ch;
}

/* ── Buttons ───────────────────────────────────────────── */

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  padding: 13px 24px;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.btn-primary {
  background: var(--azure);
  border-color: var(--azure);
  color: #fff;
}
.btn-primary:hover { background: var(--azure-dark); border-color: var(--azure-dark); }

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--ink); }

/* ── Header ────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 250, 252, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.brand-mark { width: 26px; height: 26px; color: var(--azure); flex: none; }
.brand-suffix { font-weight: 500; color: var(--body); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}
.site-nav a:hover { color: var(--azure-dark); }

.nav-cta {
  background: var(--ink);
  color: #fff !important;
  padding: 9px 16px;
  border-radius: var(--radius);
}
.nav-cta:hover { background: var(--azure-dark); }

.nav-toggle {
  display: none;
  background: none;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  width: 42px; height: 38px;
  cursor: pointer;
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 18px; height: 2px;
  background: var(--ink);
  margin-inline: auto;
  content: "";
}
.nav-toggle-bars::before { transform: translateY(-6px); }
.nav-toggle-bars::after  { transform: translateY(4px); }

/* ── Hero ──────────────────────────────────────────────── */

.hero {
  background: linear-gradient(180deg, var(--sky) 0%, var(--paper) 100%);
  border-bottom: 1px solid var(--line);
  padding: clamp(48px, 8vw, 96px) 0 clamp(56px, 8vw, 104px);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.hero h1 {
  font-size: clamp(44px, 7vw, 76px);
  font-weight: 700;
  margin-bottom: 20px;
}

.lede {
  font-size: clamp(18px, 2vw, 20px);
  max-width: 46ch;
  margin-bottom: 28px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Signature: the climb trace */

.instrument { margin: 0; }

.trace {
  width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
}

.trace .grid line { stroke: var(--line); stroke-width: 1; }
.trace .ticks text,
.trace .trace-label,
.trace .trace-value {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  fill: #6C7F94;
}
.trace .ticks text { text-anchor: end; }
.trace .trace-value { fill: var(--azure-dark); font-weight: 500; }

.trace-line {
  stroke-dasharray: 520;
  stroke-dashoffset: 520;
  animation: draw 1.6s cubic-bezier(.4,.1,.3,1) .2s forwards;
}
.trace-fill { opacity: 0; animation: fadeIn .8s ease 1.3s forwards; }
.trace-dot  { opacity: 0; animation: fadeIn .4s ease 1.6s forwards; }

@keyframes draw   { to { stroke-dashoffset: 0; } }
@keyframes fadeIn { to { opacity: 1; } }

.instrument-cap {
  font-size: 15px;
  line-height: 1.6;
  color: var(--body);
  margin-top: 16px;
  padding-left: 14px;
  border-left: 2px solid var(--amber);
}

/* ── Sections ──────────────────────────────────────────── */

.section { padding: clamp(56px, 8vw, 96px) 0; }
.section-alt {
  background: var(--sky);
  border-block: 1px solid var(--line);
}

/* Services */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 36px;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--azure);
  border-radius: var(--radius);
  padding: 26px 24px;
}
.card h3 { font-size: 19px; margin-bottom: 10px; }
.card p  { margin: 0; font-size: 16px; }

/* How I work */

.how-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: none;
}
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
}
.checklist li:first-child { padding-top: 0; }
.checklist li:last-child  { border-bottom: 0; }

.check-text { flex: 1; min-width: 0; }
.checklist strong { display: block; color: var(--ink); font-weight: 600; }

.check {
  flex: none;
  width: 20px; height: 20px;
  margin-top: 3px;
  border: 1.5px solid var(--azure);
  border-radius: 3px;
  position: relative;
}
.check::after {
  content: "";
  position: absolute;
  left: 6px; top: 2px;
  width: 5px; height: 10px;
  border: solid var(--azure);
  border-width: 0 2px 2px 0;
  transform: rotate(42deg);
}

/* About */

.about-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

.portrait img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.portrait-note {
  font-family: var(--mono);
  font-size: 12px;
  color: #7A8A9C;
  margin: 8px 0 0;
}

/* ── Contact form ──────────────────────────────────────── */

.contact-wrap { max-width: 640px; }

.contact-form { margin-top: 28px; }

.field { margin-bottom: 20px; }

.field label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.optional { font-weight: 400; color: #7A8A9C; }

.field input,
.field textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 13px;
}
.field input:focus,
.field textarea:focus { border-color: var(--azure); }
.field textarea { resize: vertical; }

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] { border-color: var(--danger); }

.error {
  font-size: 14px;
  color: var(--danger);
  margin: 6px 0 0;
  min-height: 0;
}

.form-status {
  font-size: 15px;
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius);
  display: none;
}
.form-status.is-shown { display: block; }
.form-status.is-ok {
  background: #fff;
  border: 1px solid var(--azure);
  color: var(--ink);
}

/* ── Footer ────────────────────────────────────────────── */

.site-footer {
  background: var(--ink);
  color: #A9BCD0;
  padding: 36px 0;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
}
.footer-brand {
  font-family: var(--display);
  font-weight: 600;
  color: #fff;
  margin: 0 0 4px;
}
.footer-line {
  font-size: 14px;
  margin: 0 0 4px;
}
.footer-meta { text-align: right; }

/* ── Scroll reveal ─────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ── Responsive ────────────────────────────────────────── */

@media (max-width: 860px) {
  .hero-grid,
  .how-grid,
  .about-grid { grid-template-columns: 1fr; }

  .about-grid .portrait { max-width: 300px; }

  .nav-toggle { display: block; }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 8px 24px 20px;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 12px 0; }
  .nav-cta { text-align: center; margin-top: 8px; }

  .header-inner { position: relative; }

  .footer-meta { text-align: left; }
}

@media (max-width: 420px) {
  .brand-suffix { display: none; }
}

/* ── Reduced motion ────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .trace-line,
  .trace-fill,
  .trace-dot {
    animation: none;
    stroke-dashoffset: 0;
    opacity: 1;
  }

  .reveal { opacity: 1; transform: none; transition: none; }

  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
