/* ============================================
   JAMES KARANJA DIGITAL — Design System
   Direction: engineered / architectural operator
   ============================================ */

:root {
  /* Palette — ink blue + warm paper + a single brass accent */
  --ink:        #0E1B2A;   /* near-black blue, primary text + dark sections */
  --ink-2:      #16293D;   /* slightly lifted ink for panels */
  --paper:      #F6F3EC;   /* warm paper background */
  --paper-2:    #ECE7DB;   /* deeper paper for alternating bands */
  --brass:      #B98A3E;   /* single accent — restrained, premium */
  --brass-2:    #D7A95A;   /* lighter brass for hovers */
  --line:       #C9C2B2;   /* hairline on paper */
  --line-dark:  #2A3D52;   /* hairline on ink */
  --muted:      #5C6470;   /* secondary text on paper */
  --muted-d:    #9BA8B8;   /* secondary text on ink */
  --white:      #FBFAF6;

  /* Type */
  --display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --serif:   "Newsreader", Georgia, "Times New Roman", serif;
  --body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:    "IBM Plex Mono", "Courier New", monospace;

  /* Scale */
  --w: 1200px;
  --gap: clamp(1rem, 3vw, 2.5rem);
  --section-y: clamp(4rem, 9vw, 8rem);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

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

/* ---------- Layout primitives ---------- */
.wrap { width: 100%; max-width: var(--w); margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 3rem); }
.section { padding: var(--section-y) 0; position: relative; }
.section--ink { background: var(--ink); color: var(--white); }
.section--paper2 { background: var(--paper-2); }

/* Eyebrow / labels — structural, mono, encodes section index */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.4rem;
}
.eyebrow::before {
  content: "";
  width: 28px; height: 1px;
  background: var(--brass);
  display: inline-block;
}
.section--ink .eyebrow { color: var(--brass-2); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.08; letter-spacing: -0.02em; }
.h-display {
  font-size: clamp(2.6rem, 6.5vw, 5.2rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.035em;
}
h2.h-section { font-size: clamp(2rem, 4.5vw, 3.4rem); letter-spacing: -0.03em; }
.serif-accent { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
.lede { font-size: clamp(1.1rem, 2vw, 1.4rem); line-height: 1.5; color: var(--muted); max-width: 46ch; }
.section--ink .lede { color: var(--muted-d); }
p { max-width: 64ch; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--body); font-weight: 600; font-size: 0.98rem;
  padding: 0.95rem 1.7rem;
  border-radius: 2px;
  text-decoration: none;
  transition: all 0.35s var(--ease);
  cursor: pointer; border: 1px solid transparent;
  letter-spacing: 0.01em;
}
.btn--primary { background: var(--brass); color: var(--ink); }
.btn--primary:hover { background: var(--brass-2); transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.section--ink .btn--ghost { color: var(--white); border-color: var(--muted-d); }
.section--ink .btn--ghost:hover { background: var(--white); color: var(--ink); border-color: var(--white); }
.btn .arrow { transition: transform 0.35s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(246,243,236,0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { font-family: var(--display); font-weight: 600; font-size: 1.15rem; letter-spacing: -0.02em; text-decoration: none; color: var(--ink); display: flex; align-items: baseline; gap: 0.5rem; }
.brand .dot { color: var(--brass); }
.nav__links { display: flex; gap: 2rem; align-items: center; }
.nav__links a { text-decoration: none; color: var(--ink); font-size: 0.92rem; font-weight: 500; transition: color 0.25s; position: relative; }
.nav__links a:hover { color: var(--brass); }
.nav__links a.active { color: var(--brass); }
.nav__cta { background: var(--ink); color: var(--paper) !important; padding: 0.6rem 1.2rem; border-radius: 2px; }
.nav__cta:hover { background: var(--brass); color: var(--ink) !important; }
.nav__toggle { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; padding: 8px; }
.nav__toggle span { width: 24px; height: 2px; background: var(--ink); transition: 0.3s; }

@media (max-width: 860px) {
  .nav__links {
    position: fixed; inset: 72px 0 auto 0;
    background: var(--paper); flex-direction: column;
    padding: 2rem; gap: 1.5rem; border-bottom: 1px solid var(--line);
    transform: translateY(-120%); transition: transform 0.4s var(--ease); align-items: flex-start;
  }
  .nav__links.open { transform: translateY(0); }
  .nav__toggle { display: flex; }
}

/* ---------- Blueprint grid signature ---------- */
.blueprint {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image:
    linear-gradient(var(--line-dark) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-dark) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 70% 30%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 70% 30%, #000 0%, transparent 75%);
}

/* ---------- Hero ---------- */
.hero { background: var(--ink); color: var(--white); position: relative; overflow: hidden; padding: clamp(5rem,11vw,9rem) 0 clamp(4rem,8vw,7rem); }
.hero__inner { position: relative; z-index: 2; }
.hero h1 { max-width: 16ch; margin-bottom: 1.8rem; }
.hero h1 .serif-accent { color: var(--brass-2); }
.hero__lede { color: var(--muted-d); font-size: clamp(1.1rem,1.7vw,1.35rem); max-width: 52ch; margin-bottom: 2.4rem; }
.hero__cta { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 3.5rem; }
.hero__meta { display: flex; gap: 2.2rem; flex-wrap: wrap; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.08em; color: var(--muted-d); text-transform: uppercase; border-top: 1px solid var(--line-dark); padding-top: 1.6rem; }
.hero__meta b { color: var(--brass-2); font-weight: 500; }

/* ---------- Stat band ---------- */
.stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.stat { background: var(--paper); padding: 2rem 1.6rem; }
.stat__num { font-family: var(--display); font-size: clamp(2.2rem,4vw,3.2rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1; color: var(--ink); }
.stat__num .unit { color: var(--brass); }
.stat__label { font-size: 0.86rem; color: var(--muted); margin-top: 0.7rem; line-height: 1.4; }
@media (max-width:760px){ .stats { grid-template-columns: repeat(2,1fr);} }

/* Stat-band overlap: desktop-only refinement, neutralised on mobile */
.stat-band-wrap { padding-top: 0; padding-bottom: 0; transform: translateY(-50%); margin-bottom: -3rem; }
@media (max-width: 760px) {
  .stat-band-wrap { transform: none; padding: 2.5rem 0; margin-bottom: 0; }
}

/* ---------- Generic grid ---------- */
.grid { display: grid; gap: var(--gap); }
.grid--2 { grid-template-columns: repeat(2,1fr); }
.grid--3 { grid-template-columns: repeat(3,1fr); }
@media (max-width:900px){ .grid--3 { grid-template-columns: 1fr; } .grid--2 { grid-template-columns: 1fr; } }

.split { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(2rem,5vw,5rem); align-items: start; }
@media (max-width:900px){ .split { grid-template-columns: 1fr; gap: 2rem; } }

/* ---------- Cards ---------- */
.card { background: var(--paper); border: 1px solid var(--line); padding: 2rem; border-radius: 3px; transition: all 0.4s var(--ease); position: relative; }
.card:hover { border-color: var(--brass); transform: translateY(-4px); box-shadow: 0 18px 40px -24px rgba(14,27,42,0.35); }
.card__idx { font-family: var(--mono); font-size: 0.8rem; color: var(--brass); letter-spacing: 0.1em; }
.card h3 { font-size: 1.3rem; margin: 0.9rem 0 0.7rem; }
.card p { font-size: 0.96rem; color: var(--muted); }
.card__price { font-family: var(--mono); font-size: 0.82rem; color: var(--ink); margin-top: 1.2rem; padding-top: 1.2rem; border-top: 1px solid var(--line); letter-spacing: 0.04em; }

/* problem cards on ink */
.section--ink .card { background: var(--ink-2); border-color: var(--line-dark); }
.section--ink .card:hover { border-color: var(--brass-2); }
.section--ink .card h3 { color: var(--white); }
.section--ink .card p { color: var(--muted-d); }

/* ---------- Process timeline ---------- */
.steps { display: grid; gap: 0; }
.step { display: grid; grid-template-columns: 80px 1fr; gap: 2rem; padding: 2.2rem 0; border-top: 1px solid var(--line); align-items: start; }
.step:last-child { border-bottom: 1px solid var(--line); }
.step__n { font-family: var(--mono); font-size: 1rem; color: var(--brass); padding-top: 0.3rem; }
.step h3 { font-size: 1.45rem; margin-bottom: 0.6rem; }
.step p { color: var(--muted); }
@media (max-width:600px){ .step { grid-template-columns: 1fr; gap: 0.6rem; } }

/* ---------- Quote / credibility ---------- */
.pull { font-family: var(--serif); font-size: clamp(1.5rem,3.4vw,2.6rem); line-height: 1.28; letter-spacing: -0.01em; max-width: 22ch; }
.pull .serif-accent { color: var(--brass); }

/* ---------- Credential block ---------- */
.cred { display: flex; gap: 1.4rem; align-items: flex-start; padding: 1.8rem; border: 1px solid var(--line-dark); border-radius: 3px; background: var(--ink-2); }
.cred__seal { flex-shrink: 0; }
.cred h4 { color: var(--white); font-size: 1.05rem; margin-bottom: 0.4rem; }
.cred p { color: var(--muted-d); font-size: 0.92rem; }

/* ---------- CTA band ---------- */
.cta-band { text-align: center; }
.cta-band h2 { max-width: 18ch; margin: 0 auto 1.4rem; }
.cta-band .lede { margin: 0 auto 2.4rem; }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: var(--muted-d); padding: 4rem 0 2.5rem; border-top: 1px solid var(--line-dark); }
.footer__top { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 2rem; padding-bottom: 3rem; border-bottom: 1px solid var(--line-dark); }
@media (max-width:760px){ .footer__top { grid-template-columns: 1fr 1fr; gap: 2rem; } }
.footer .brand { color: var(--white); margin-bottom: 1rem; }
.footer__col h5 { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--brass-2); margin-bottom: 1.1rem; }
.footer__col a { display: block; color: var(--muted-d); text-decoration: none; font-size: 0.92rem; margin-bottom: 0.6rem; transition: color 0.25s; }
.footer__col a:hover { color: var(--white); }
.footer__bot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding-top: 2rem; font-size: 0.82rem; }
.footer__bot p { color: var(--muted-d); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Page hero (interior) ---------- */
.phero { background: var(--ink); color: var(--white); padding: clamp(4rem,8vw,6.5rem) 0 clamp(3rem,6vw,4.5rem); position: relative; overflow: hidden; }
.phero h1 { font-size: clamp(2.4rem,5vw,4rem); max-width: 18ch; margin-bottom: 1.2rem; position: relative; z-index: 2; }
.phero .lede { color: var(--muted-d); position: relative; z-index: 2; }
.phero .eyebrow { position: relative; z-index: 2; }

/* ---------- Misc ---------- */
.center { text-align: center; }
.mt-1 { margin-top: 1rem; } .mt-2 { margin-top: 2rem; } .mt-3 { margin-top: 3rem; }
.list-check { list-style: none; margin-top: 1.4rem; }
.list-check li { padding-left: 1.8rem; position: relative; margin-bottom: 0.9rem; color: var(--muted); }
.section--ink .list-check li { color: var(--muted-d); }
.list-check li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 9px; height: 9px; border: 1.5px solid var(--brass); transform: rotate(45deg); }

/* ---------- Portrait frame (About) ---------- */
.portrait {
  position: relative;
  aspect-ratio: 4/5;
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
  background: var(--ink);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portrait__tag {
  position: absolute; left: 0; bottom: 0;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em;
  color: var(--paper); background: rgba(14,27,42,0.82);
  padding: 0.5rem 0.9rem; text-transform: uppercase;
  backdrop-filter: blur(6px);
}
/* graceful state if no photo yet: blueprint panel with monogram */
.portrait--empty {
  display: flex; align-items: center; justify-content: center;
  background:
    linear-gradient(var(--line-dark) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-dark) 1px, transparent 1px),
    var(--ink);
  background-size: 40px 40px, 40px 40px, auto;
}
.portrait--empty::after {
  content: "JK"; font-family: var(--display); font-weight: 600;
  font-size: 3.5rem; color: var(--brass-2); letter-spacing: -0.03em;
}
