/* KPi site styles. Mobile first. */
:root {
  --navy: #05204a;
  --coral: #f7717d;
  --bg: #fcfffc;
  --tint: #f1f4f1;
  --line: #d9e0d9;
  --text: #1c2733;
  --muted: #4a5663;
  --serif: "DM Serif Display", Georgia, "Times New Roman", serif; /* headings; single weight (400) + italic */
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --max: 68rem;
  --measure: 40rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); text-underline-offset: 0.18em; }
a:hover { color: var(--navy); text-decoration-color: var(--coral); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 {
  font-family: var(--serif);
  color: var(--navy);
  line-height: 1.15;
  font-weight: 400;
  margin: 0 0 0.6em;
  letter-spacing: 0;
}
h1 { font-size: clamp(2.2rem, 7.5vw, 3.75rem); }
h2 { font-size: clamp(1.7rem, 5vw, 2.4rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1.1em; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }
.measure { max-width: var(--measure); }
section { padding: 3.5rem 0; }
.tint { background: var(--tint); }
.dark { background: var(--navy); color: var(--bg); }
.dark h2, .dark h3 { color: var(--bg); }
.dark a { color: var(--bg); }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy);
  margin: 0 0 0.9rem;
}
.dark .eyebrow { color: var(--coral); }
.lede { font-size: 1.2rem; color: var(--muted); }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--navy); color: var(--bg); padding: 0.6rem 1rem; z-index: 10;
}
.skip:focus { left: 0; color: var(--bg); }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 0.5rem 1.5rem; padding-top: 0.75rem; padding-bottom: 0.75rem;
}
.brand img { height: 2.6rem; width: auto; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-items: center; }
.site-nav a { text-decoration: none; font-weight: 500; padding: 0.4rem 0; }
.site-nav a:hover { text-decoration: underline; }
.site-nav .nav-cta {
  display: inline-flex; align-items: center; gap: 0.35rem; min-height: 2.75rem;
  padding: 0.4rem 1rem; border: 2px solid var(--navy); border-radius: 0.4rem;
  background: var(--navy); color: #fff; font-weight: 600; text-decoration: none;
}
.site-nav .nav-cta:hover { background: transparent; color: var(--navy); text-decoration: none; }
@media (max-width: 47.99rem) {
  .site-header .wrap { gap: 0.25rem 0.75rem; }
  .brand img { height: 2.6rem; }
  .site-nav { gap: 0.25rem 0.8rem; font-size: 0.95rem; }
  .site-nav .nav-cta { padding: 0.35rem 0.8rem; }
}
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--coral); text-decoration-thickness: 3px; }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--coral); color: var(--navy);
  font-weight: 600; font-size: 1.05rem;
  padding: 0.85rem 1.6rem; border-radius: 0.4rem;
  text-decoration: none; border: 2px solid var(--coral);
  cursor: pointer; font-family: var(--sans);
}
.btn:hover { background: var(--navy); color: var(--bg); border-color: var(--navy); }
.dark .btn:hover { background: var(--bg); color: var(--navy); border-color: var(--bg); }
.btn.secondary { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn.secondary:hover { background: var(--navy); color: var(--bg); }

/* Hero */
.hero { padding: 3.5rem 0 4rem; }
.hero h1 { max-width: 20ch; text-wrap: balance; }
.hero .lede { max-width: 34rem; margin-bottom: 1.8rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }

/* Lists and cards */
.cols { display: grid; gap: 1.5rem; }
.card {
  background: var(--bg); border: 1px solid var(--line);
  border-top: 4px solid var(--navy); border-radius: 0.35rem; padding: 1.5rem;
}
.card h3 { margin-bottom: 0.4em; }
.card p:last-child { margin-bottom: 0; }
.checks { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.checks li { padding-left: 1.9rem; position: relative; margin-bottom: 0.9rem; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 0.5em;
  width: 0.9rem; height: 0.9rem; border-radius: 50%;
  background: conic-gradient(var(--coral) 0 28%, var(--navy) 0);
}
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; position: relative; padding: 0 0 1.5rem 3.2rem; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -0.1rem;
  width: 2.2rem; height: 2.2rem; border-radius: 50%;
  background: var(--navy); color: var(--bg);
  font-family: var(--serif); font-weight: 400; display: grid; place-items: center;
}
.steps h3 { margin-bottom: 0.2em; }

/* About */

/* Form */
form { display: grid; gap: 1rem; max-width: 34rem; }
label { font-weight: 600; display: block; margin-bottom: 0.3rem; }
input, textarea {
  width: 100%; font: inherit; color: var(--text);
  padding: 0.7rem 0.8rem; border: 2px solid #8a96a3; border-radius: 0.35rem; background: #fff;
}
textarea { min-height: 9rem; resize: vertical; }
.hp { position: absolute; left: -999px; }
.contact-grid { display: grid; gap: 2.5rem; }

/* CTA band */
.cta { text-align: left; }
.cta p { max-width: 36rem; }

/* Footer */
.site-footer { background: var(--tint); color: var(--text); border-top: 4px solid var(--navy); padding: 2rem 0; font-size: 0.95rem; }
.site-footer a { color: var(--navy); }
.site-footer p { margin: 0 0 0.3rem; }

@media (min-width: 48rem) {
  body { font-size: 1.125rem; }
  section { padding: 5rem 0; }
  .hero { padding: 5.5rem 0 6rem; }
  .wrap { padding: 0 2rem; }
  .brand img { height: 3.25rem; }
  .cols.two { grid-template-columns: repeat(2, 1fr); }
  .cols.three { grid-template-columns: repeat(3, 1fr); }
  .contact-grid { grid-template-columns: 1fr 1.2fr; gap: 4rem; }
}

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

/* =====================================================================
   Homepage (body.home). Editorial direction: quiet interface, with the
   illustration and the type carrying the personality.
   ===================================================================== */
.home { --tint: #f4f5f2; --line: #dcdfda; --header-h: 4.3rem;
  /* Display coral: a slightly deeper coral for large coral text only (3:1+ on near-white).
     Contrast adjustment, not a brand change; official coral stays #F7717D. */
  --coral-display: #f0586a; }

/* Hero */
.home .home-hero {
  display: flex; flex-direction: column;
  min-height: min(calc(100svh - var(--header-h) - 3rem), 37.5rem);
  padding: 1.5rem 0 0.5rem;
}
.hero-main { flex: 1; display: flex; align-items: center; }
.hero-main .hero-grid { width: 100%; }
/* Section-transition chevron: one shared shape (SVG symbol #chev), navy, 28px wide, 3.5px stroke, inside a 44px target.
   No animation. Smooth scrolling comes from html { scroll-behavior } and is off for reduced motion. */
.next-link {
  display: flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem;
  margin: 1.25rem auto 1.5rem; color: var(--navy); text-decoration: none; border-radius: 0.4rem;
}
.next-link .chev { display: block; }
.next-link:hover .chev { transform: translateY(2px); }
.next-link:hover { background: rgba(5, 32, 74, 0.06); }
.home-hero .next-link { margin-top: 1rem; }
/* The chevron replaces the last section's bottom padding so the rhythm adds little height. */
.chapter.has-next { padding-bottom: 0.5rem; }
.hero-grid { display: grid; gap: 1rem; }
.home h1 {
  font-size: clamp(2.6rem, 12.5vw, 3.6rem);
  line-height: 1.04; letter-spacing: -0.01em; max-width: none; margin: 0 0 0.6rem;
}
.home h1 .line { display: block; }
.home h1 .stuck { font-style: italic; color: var(--coral-display); }
/* Picker section: its own quiet neutral band below the hero */
.picker { background: var(--tint); }
.hero-art { margin: 0; justify-self: center; width: min(100%, 18.5rem, 46svh); }
.hero-art img { width: 100%; height: auto; }

/* Problem picker. State 1: four illustrated cards. State 2: one focused response. */
.problems { display: grid; gap: 1rem; }
.problems[hidden], .panel[hidden] { display: none; }
.problem {
  position: relative; display: flex; flex-direction: column;
  background: #fff; color: var(--navy);
  border: 1px solid var(--line); border-radius: 0.75rem; padding: 1.1rem 1.15rem 1.25rem;
}
.problem figure { position: relative; margin: 0 0 0.9rem; width: 100%; max-width: 14rem; aspect-ratio: 3 / 2; }
/* Images fill a fixed 3:2 box and are fitted inside it, so differently shaped art never changes card height. */
.problem img, .panel-art img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; object-position: left center; }
.problem-text { display: flex; flex-direction: column; flex: 1; }
.problem h3 { font-size: 1.2rem; line-height: 1.2; margin: 0 0 0.4em; }
.problem .support { margin: 0; color: var(--muted); font-size: 0.975rem; line-height: 1.5; }

/* Without JavaScript: every problem and its response is shown in full. */
.problem .response { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.response p { max-width: 42rem; }
.response-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin: 1.25rem 0 0; }
.btn-navy {
  display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.75rem; padding: 0.5rem 1.2rem;
  border: 2px solid var(--navy); border-radius: 0.4rem; background: var(--navy); color: #fff;
  font-weight: 600; font-size: 1.02rem; text-decoration: none;
}
.btn-navy:hover { background: transparent; color: var(--navy); }
.text-link { font-weight: 600; color: var(--navy); }

/* With JavaScript: the whole card is one button; the response replaces the grid. */
.js .problem { cursor: pointer; }
.js .problem .response { display: none; }
.js .problem h3 button {
  font: inherit; color: inherit; background: none; border: 0; padding: 0;
  text-align: left; cursor: pointer; letter-spacing: inherit;
}
.js .problem h3 button::after { content: ""; position: absolute; inset: -1px; border-radius: 0.75rem; }
.js .problem h3 button:focus-visible { outline: none; }
.js .problem h3 button:focus-visible::after { outline: 3px solid var(--navy); outline-offset: 3px; }
.js .problem:hover { border-color: #7d8a99; box-shadow: 0 2px 10px rgba(5, 32, 74, 0.08); }
.go { display: none; }
.js .go {
  display: block; position: relative; margin: 0.8rem 0 0 auto; width: 2rem; height: 2rem;
  border: 1.5px solid var(--navy); border-radius: 50%; color: var(--navy);
}
.go::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 0.5rem; height: 0.5rem;
  border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: translate(-65%, -50%) rotate(45deg);
}
.js .problem:hover .go { background: var(--navy); color: #fff; }

/* Focused response panel */
.panel {
  position: relative; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--coral);
  border-radius: 0.75rem; padding: 1.5rem 1.25rem 1.6rem; max-width: var(--max);
}
.panel { scroll-margin-top: 1rem; }
.panel:focus { outline: none; }
.panel:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }
.panel-art { display: none; position: relative; margin: 0; }
.panel h3 { font-size: clamp(1.5rem, 5.5vw, 1.9rem); line-height: 1.15; margin: 0 2.75rem 1rem 0; }
.panel .response-body p { font-size: 1.05rem; }
.panel-close {
  position: absolute; top: 0.6rem; right: 0.6rem; width: 2.75rem; height: 2.75rem; padding: 0;
  display: grid; place-items: center; background: transparent; color: var(--navy);
  border: 0; border-radius: 0.4rem; cursor: pointer;
}
.panel-close:hover { background: var(--tint); }
.panel-close:focus-visible { outline: 3px solid var(--navy); outline-offset: 1px; }
.panel-close svg { width: 1.25rem; height: 1.25rem; }
@media (prefers-reduced-motion: no-preference) {
  .js .problems:not([hidden]), .panel:not([hidden]) { animation: reveal 0.18s ease-out; }
  @keyframes reveal { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}

/* Project examples and cards outside the hero: quiet */
.home .card { background: #fff; border: 1px solid var(--line); border-radius: 0.75rem; }

@media (min-width: 40rem) {
  .problems { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .problem { padding: 1.25rem 1.35rem 1.35rem; }
  .problem figure { max-width: none; }
  .problem h3 { font-size: 1.3rem; }
  .hero-art { width: min(100%, 24rem); }
  .panel { padding: 1.75rem 1.75rem 1.9rem; }
}
@media (min-width: 48rem) {
  .home { --header-h: 4.85rem; }
}
@media (min-width: 56rem) {
  /* Two-column hero owns about one viewport; capped so tall screens do not gain empty space. */
  .home .home-hero { min-height: min(calc(100svh - var(--header-h)), 50rem); padding: 2rem 0 0.75rem; }
  .hero-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    grid-template-areas: "text art";
    column-gap: 3rem; align-items: center;
  }
  .hero-text { grid-area: text; }
  .hero-art { grid-area: art; width: 100%; max-width: 36rem; justify-self: end; }
  .home h1 { font-size: clamp(3.5rem, 5.3vw, 4.5rem); }
}

/* Picker, desktop: illustration beside the text on cards and in the response. */
@media (min-width: 64rem) {
  .problems { gap: 1.25rem; }
  .problem { display: grid; grid-template-columns: 12.5rem 1fr; column-gap: 1.25rem; align-items: center; padding: 1.25rem 1.4rem; }
  .problem figure { grid-column: 1; margin: 0; max-width: none; }
  .problem img, .panel-art img { object-position: center; }
  .problem-text { grid-column: 2; }
  .problem .response { grid-column: 1 / -1; }
  .panel { display: grid; grid-template-columns: 16rem 1fr; column-gap: 2.5rem; align-items: start; padding: 2rem 2.25rem 2.25rem; }
  .panel-art { display: block; grid-column: 1; grid-row: 1 / span 3; aspect-ratio: 3 / 2; align-self: center; }
  .panel h3, .panel .response-body { grid-column: 2; }
}

/* =====================================================================
   Vertical problem cards (approved layout) (headline, illustration, supporting
   line, arrow bottom-right). To restore the horizontal cards, remove the
   class "problems--stack" from the .problems element in index.html; the
   horizontal rules above are untouched.
   ===================================================================== */
.problems--stack .problem {
  display: grid; grid-template-columns: 1fr 2rem; column-gap: 1rem; align-content: start; align-items: stretch;
  padding: 1.25rem 1.3rem 1.2rem;
}
.problems--stack .problem-text { display: contents; }
.problems--stack .problem h3 { grid-column: 1 / -1; grid-row: 1; margin: 0 0 0.75rem; font-size: 1.25rem; }
.problems--stack .problem figure {
  grid-column: 1 / -1; grid-row: 2; width: 100%; max-width: none; aspect-ratio: auto; height: 7.5rem; margin: 0 0 0.85rem;
}
.problems--stack .problem img { object-position: center; }
.problems--stack .problem .support { grid-column: 1; grid-row: 3; align-self: end; }
.problems--stack .go { grid-column: 2; grid-row: 3; align-self: end; margin: 0; }
.problems--stack .problem .response { grid-column: 1 / -1; grid-row: 4; }
@media (min-width: 40rem) {
  .problems--stack .problem { padding: 1.4rem 1.5rem 1.3rem; }
  .problems--stack .problem h3 { font-size: 1.4rem; min-height: 2.4em; }
  .problems--stack .problem figure { height: 10.5rem; margin-bottom: 1rem; }
}
@media (min-width: 64rem) {
  .problems--stack .problem { display: grid; grid-template-columns: 1fr 2rem; column-gap: 1rem; align-items: stretch; padding: 1.4rem 1.5rem 1.3rem; }
  .problems--stack .problem figure { grid-column: 1 / -1; margin: 0 0 1rem; }
}

/* =====================================================================
   Conversation chapters: services examples, About, Contact.
   One shared heading language: DM Serif Display, navy, with a single
   coral italic word. Coral here is #E84E63 (3.66:1 on near-white, 3.37:1
   on the tint) because these headings are large text (3:1 needed).
   ===================================================================== */
.home { --coral-heading: #e84e63; }
.chapter { padding: 3.5rem 0 4rem; }
.chapter-title {
  font-size: clamp(2.1rem, 8.4vw, 3.1rem); line-height: 1.08; letter-spacing: -0.005em;
  margin: 0 0 0.6rem; color: var(--navy); max-width: 16ch;
}
.chapter-title em { font-style: italic; color: var(--coral-heading); }
.chapter-lede { font-size: 1.1rem; color: var(--muted); max-width: 28rem; margin: 0 0 1.5rem; }

/* Services: numbered, ruled examples (not cards, not packages) */
.chapter-split { display: grid; gap: 2rem; }
.examples { list-style: none; margin: 0; padding: 0; counter-reset: ex; border-top: 1px solid var(--navy); }
.examples li {
  counter-increment: ex; position: relative; padding: 1.4rem 0 1.5rem 2.6rem; border-bottom: 1px solid var(--line);
}
.examples li::before {
  content: counter(ex); position: absolute; left: 0; top: 1.4rem;
  font-family: var(--serif); font-size: 1.5rem; line-height: 1.1; color: var(--muted);
}
.examples h3 { font-size: 1.5rem; margin: 0 0 0.35rem; }
.examples p { margin: 0; max-width: 38rem; }
.example-link { margin: 0.8rem 0 0 !important; font-weight: 600; }

/* About: a personal introduction, photo first */
/* About: heading, portrait, biography, sayings. One column on phones; two columns from 48rem. */
.chapter .about { display: grid; gap: 1.25rem; grid-template-areas: "head" "photo" "text" "sayings"; }
.about-title { grid-area: head; margin-bottom: 0; }
.about-photo { grid-area: photo; display: block; width: 100%; max-width: 14rem; border-radius: 0.5rem; }
.about-text { grid-area: text; max-width: 40rem; }
.about-text > p { margin: 0 0 1.15rem; }
.about-text > p:last-child { margin-bottom: 0; }
.sayings-group {
  grid-area: sayings; max-width: 40rem; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--coral);
  border-radius: 0.6rem; padding: 1rem 1.15rem 0.5rem; box-shadow: 0 1px 3px rgba(5, 32, 74, 0.06);
}
.sayings-lead { font-family: var(--sans); font-weight: 600; font-size: 0.95rem; line-height: 1.4; color: var(--navy); margin: 0 0 0.35rem; }
.sayings { list-style: none; margin: 0; padding: 0; }
.sayings li { font-family: var(--sans); font-weight: 500; font-size: 0.95rem; line-height: 1.5; color: var(--navy); padding: 0.55rem 0; border-top: 1px solid var(--line); }
.sayings .aside { font-weight: 400; font-size: 0.85em; color: var(--muted); white-space: nowrap; }

@media (min-width: 48rem) {
  .chapter { padding: 5rem 0 5.5rem; }
  .chapter-title { font-size: clamp(2.6rem, 4.4vw, 3.6rem); }
  .examples li { padding-left: 3.4rem; }
  .examples li::before { font-size: 1.7rem; }
  .examples h3 { font-size: 1.65rem; }
}
@media (min-width: 56rem) {
  .chapter-split { grid-template-columns: 5fr 7fr; gap: 4.5rem; align-items: start; }
  .chapter-head { position: sticky; top: 2rem; }
}
.picker .chapter-title { max-width: none; }
.picker .chapter-lede { margin-bottom: 1.75rem; }

/* About, wider screens: portrait and sayings stack in the left column, heading and biography in the right. Nothing sticky. */
@media (min-width: 48rem) {
  .chapter .about {
    grid-template-columns: 15rem 1fr; column-gap: 2.5rem; row-gap: 1.25rem; align-items: start;
    grid-template-areas: "photo head" "photo text" "sayings text";
    grid-template-rows: auto auto 1fr; /* extra bio height goes to the last row, so the sayings sit right under the portrait */
  }
  .about-photo { max-width: none; }
  .about-title { align-self: end; }
  .sayings-group { max-width: none; }
}
@media (min-width: 56rem) {
  .chapter .about { grid-template-columns: 19rem 1fr; column-gap: 4rem; }
}

/* Contact form: sending state and submission messages */
.btn:disabled { opacity: 0.65; cursor: progress; }
.form-status { margin: 0; padding: 0.9rem 1rem; border-radius: 0.4rem; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--coral); color: var(--navy); font-weight: 500; }
.form-status[hidden] { display: none; }
.form-status a { color: var(--navy); font-weight: 700; }
.form-error { border-left-color: var(--navy); }
.form-error:focus { outline: 3px solid var(--navy); outline-offset: 2px; }

/* Footer privacy line */
.site-footer .privacy { margin-top: 0.8rem; font-size: 0.85rem; color: var(--muted); }
.site-footer .privacy a { color: var(--navy); }
