/* =========================================================================
   Minimal Software — site styles
   Hand-written, dependency-free. Edit freely.
   ========================================================================= */

/* ---- Design tokens ---- */
:root {
  --ink: #16161a;
  --ink-soft: #3f3f48;
  --muted: #6b6b76;
  --line: #e7e4dd;
  --line-strong: #d8d4ca;
  --bg: #ffffff;
  --tint: #f6f5f1;
  --accent: #1f6f6b;
  --accent-dark: #185955;
  --accent-tint: #eaf2f1;

  --maxw: 1080px;
  --maxw-narrow: 720px;
  --radius: 14px;
  --radius-sm: 9px;

  --font-serif: ui-serif, "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--ink);
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
p { color: var(--ink-soft); }
ul { list-style: none; padding: 0; }

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

section[id] { scroll-margin-top: 84px; }

/* ---- Layout helpers ---- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2rem);
}
.narrow { max-width: var(--maxw-narrow); }
.center { text-align: center; }

.section { padding-block: clamp(3.5rem, 8vw, 7rem); }
.section-tint { background: var(--tint); border-block: 1px solid var(--line); }

/* ---- Skip link ---- */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 0 0 8px 0; z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); font-weight: 600; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 14px; height: 14px; background: transparent; border: 2.5px solid var(--accent); border-radius: 2px; transform: rotate(45deg); }
.brand-name { font-family: var(--font-serif); font-size: 1.35rem; letter-spacing: -0.01em; }
.site-nav { display: flex; align-items: center; gap: 1.5rem; }
.site-nav a { color: var(--muted); font-size: .95rem; }
.site-nav a:hover { color: var(--ink); }
.nav-cta {
  color: var(--ink) !important; border: 1px solid var(--line-strong);
  padding: .45rem .9rem; border-radius: 999px; font-weight: 500;
}
.nav-cta:hover { border-color: var(--ink); background: var(--ink); color: #fff !important; }

@media (max-width: 460px) {
  .site-nav a:not(.nav-cta) { display: none; }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .85rem 1.5rem; border-radius: var(--radius-sm);
  font-weight: 500; font-size: 1rem; border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }

/* ---- Hero ---- */
.hero { padding-block: clamp(4rem, 12vw, 8rem); }
.eyebrow, .section-kicker {
  text-transform: uppercase; letter-spacing: .14em; font-size: .76rem; font-weight: 600;
  color: var(--accent); margin-bottom: 1.1rem;
}
.hero h1 { font-size: clamp(2.4rem, 6.2vw, 4rem); max-width: 16ch; }
.lede {
  font-size: clamp(1.12rem, 2.2vw, 1.4rem); line-height: 1.5; color: var(--ink-soft);
  max-width: 46ch; margin-top: 1.4rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.hero-actions.center { justify-content: center; }
.hero-meta { margin-top: 2.4rem; font-size: .95rem; color: var(--muted); max-width: 52ch; }

/* ---- Section typography ---- */
.section h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); max-width: 20ch; margin-bottom: .4rem; }
.narrow h2 { margin-bottom: 1.2rem; }
.section-intro { font-size: 1.12rem; color: var(--ink-soft); max-width: 56ch; margin-top: .8rem; }
.narrow p + p { margin-top: 1.1rem; }
.emphasis {
  font-family: var(--font-serif); font-size: clamp(1.2rem, 2.6vw, 1.6rem);
  line-height: 1.35; color: var(--ink); margin-top: 2rem;
  padding-left: 1.2rem; border-left: 3px solid var(--accent);
}

/* ---- Two-column cards (Services) ---- */
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 2.4rem; }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.9rem; }
.card h3 { font-size: 1.3rem; margin-bottom: 1.1rem; }
.ticks li { position: relative; padding-left: 1.7rem; margin-bottom: .8rem; color: var(--ink-soft); }
.ticks li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--accent); font-weight: 700; }
.ticks li:last-child { margin-bottom: 0; }

@media (max-width: 720px) { .cols-2 { grid-template-columns: 1fr; } }

/* ---- Four-up mini grid (How I work) ---- */
.cols-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; margin-top: 2.4rem; }
.mini { padding-top: 1.1rem; border-top: 2px solid var(--ink); }
.mini h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.mini p { font-size: .96rem; color: var(--muted); }

@media (max-width: 880px) { .cols-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .cols-4 { grid-template-columns: 1fr; } }

/* ---- Writeup cards (Recent work + Track record) ---- */
.wgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 2.4rem; }
.wcard {
  display: flex; flex-direction: column; gap: .55rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.7rem; background: var(--bg); color: var(--ink);
  transition: border-color .15s ease, transform .08s ease, box-shadow .15s ease;
}
.wcard:hover {
  border-color: var(--line-strong); transform: translateY(-2px);
  box-shadow: 0 14px 34px -24px rgba(20, 20, 30, .5); color: var(--ink);
}
.wcard-org { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; color: var(--accent); }
.wcard h3 { font-size: 1.24rem; line-height: 1.2; }
.wcard-summary { color: var(--ink-soft); font-size: 1rem; flex: 1 1 auto; }
.wcard-more { font-weight: 500; color: var(--accent); font-size: .95rem; margin-top: .3rem; }

@media (max-width: 720px) { .wgrid { grid-template-columns: 1fr; } }

/* ---- Testimonials ---- */
.quotes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-top: 2.4rem; }
@media (max-width: 820px) { .quotes-grid { grid-template-columns: 1fr; } }
.quotes { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 2.4rem; }
.quote {
  display: flex; flex-direction: column; gap: 1.1rem;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 1.9rem; background: var(--bg);
}
.quote blockquote { font-family: var(--font-serif); font-size: 1.18rem; line-height: 1.45; color: var(--ink); }
.quote figcaption { display: flex; flex-direction: column; gap: .15rem; }
.quote-name { font-weight: 600; color: var(--ink); }
.quote-meta { font-size: .92rem; color: var(--muted); }

@media (max-width: 720px) { .quotes { grid-template-columns: 1fr; } }

/* ---- About ---- */
.about-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: clamp(2rem, 5vw, 4rem); margin-top: 2rem; }
.about-body p + p { margin-top: 1.1rem; }
.portrait { display: block; width: 100%; max-width: 220px; border-radius: var(--radius); border: 1px solid var(--line); margin-bottom: 1.6rem; }
.about-side h3 { font-size: .95rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink); margin-bottom: .9rem; }
.about-side h3 + ul { margin-bottom: 1.8rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chips li { font-size: .9rem; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .8rem; background: var(--bg); }
.facts li { color: var(--ink-soft); padding: .35rem 0; border-bottom: 1px solid var(--line); }
.facts li:last-child { border-bottom: 0; }
.facts strong { color: var(--ink); font-family: var(--font-serif); }

@media (max-width: 760px) { .about-grid { grid-template-columns: 1fr; } }

/* ---- Ask (AI chat widget) ---- */
.chat {
  margin-top: 2rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); padding: 1.25rem;
  box-shadow: 0 1px 2px rgba(20, 20, 30, .04), 0 18px 40px -30px rgba(20, 20, 30, .4);
}
.chat-log { display: flex; flex-direction: column; gap: .7rem; max-height: 340px; overflow-y: auto; padding: .25rem; }
.chat-msg { max-width: 85%; padding: .7rem 1rem; border-radius: 14px; font-size: 1rem; line-height: 1.45; }
.chat-msg p { margin: 0; color: inherit; }
.chat-msg-bot { align-self: flex-start; background: var(--tint); color: var(--ink); border-bottom-left-radius: 5px; }
.chat-msg-user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 5px; }

.chat-typing { display: inline-flex; gap: 4px; align-items: center; }
.chat-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: chat-blink 1.2s infinite both; }
.chat-typing span:nth-child(2) { animation-delay: .2s; }
.chat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes chat-blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }

.chat-suggestions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.chat-chip {
  font: inherit; font-size: .9rem; color: var(--ink-soft); background: var(--bg);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: .4rem .85rem; cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.chat-chip:hover { border-color: var(--accent); color: var(--accent); }

.chat-form { display: flex; gap: .6rem; margin-top: 1rem; }
.chat-input {
  flex: 1 1 auto; padding: .8rem 1rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--bg);
}
.chat-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.chat-send { flex: 0 0 auto; }

.chat-lead { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.chat-lead-label { font-size: .95rem; color: var(--ink-soft); margin-bottom: .6rem; }
.chat-lead-row { display: flex; gap: .6rem; }
.chat-fineprint { margin-top: 1rem; font-size: .82rem; color: var(--muted); }

@media (max-width: 520px) {
  .chat-form, .chat-lead-row { flex-direction: column; align-items: stretch; }
  .chat-msg { max-width: 92%; }
}
@media (prefers-reduced-motion: reduce) {
  .chat-typing span { animation: none; opacity: .5; }
}

/* ---- Contact ---- */
.section-contact { background: var(--accent-tint); border-block: 1px solid var(--line); }
.section-contact h2, .section-contact .section-intro { margin-inline: auto; }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--line); padding-block: 2rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.4rem; color: var(--muted); font-size: .92rem; }
.footer-inner .brand-name { color: var(--ink); font-size: 1.05rem; }
.footer-link { color: var(--muted); }
.footer-link:hover { color: var(--ink); }
.footer-copy { margin-left: auto; }

@media (max-width: 520px) { .footer-copy { margin-left: 0; } }

/* ---- Smart-search hero (the single point of entry) ---- */
.search-hero {
  min-height: calc(86svh - 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* asymmetric padding nudges the block slightly above true centre (optical centre),
     and the reduced height lets the next section peek to invite scrolling */
  padding-top: clamp(1.5rem, 4vw, 2.5rem);
  padding-bottom: clamp(4rem, 10vw, 7rem);
}
.hero-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 3.6vw, 2.1rem);
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: .9rem;
}
.hero-orient {
  font-size: 1rem; color: var(--muted); line-height: 1.5;
  max-width: 44ch; margin: 0 auto 1.8rem;
}

.smartsearch { width: 100%; max-width: 600px; }

.search-bar {
  display: flex; align-items: center; gap: .5rem;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: .4rem .4rem .4rem 1.3rem;
  box-shadow: 0 1px 2px rgba(20,20,30,.04), 0 22px 50px -34px rgba(20,20,30,.55);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 1px 2px rgba(20,20,30,.04), 0 22px 50px -30px rgba(31,111,107,.5);
}
.search-input {
  flex: 1 1 auto; min-width: 0;
  border: none; background: transparent;
  font: inherit; font-size: 1.08rem; color: var(--ink);
  padding: .65rem 0;
}
.search-input::placeholder { color: var(--muted); }
.search-input:focus { outline: none; }
.search-go {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: none; border-radius: 999px;
  background: var(--accent); color: #fff; cursor: pointer;
  transition: background .15s ease, transform .05s ease;
}
.search-go:hover { background: var(--accent-dark); }
.search-go:active { transform: scale(.95); }

/* Results panel (appears on submit) */
.search-results { margin-top: 1.6rem; text-align: left; }
.search-asked {
  font-size: .9rem; color: var(--muted); margin-bottom: .7rem;
  padding-left: .2rem;
}
.search-asked span { color: var(--ink-soft); font-style: italic; }
.answer-card {
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.2rem, 3vw, 1.6rem);
  color: var(--ink-soft);
  line-height: 1.65;
}
.answer-card p + p { margin-top: .9rem; }

/* Loading shimmer */
.answer-shimmer {
  display: block; height: .85rem; border-radius: 5px;
  background: linear-gradient(90deg, var(--line) 25%, var(--line-strong) 37%, var(--line) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
  margin-bottom: .7rem;
}
.answer-shimmer:last-child { margin-bottom: 0; }
.answer-shimmer.short { width: 55%; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* Surfaced curated writeups */
.result-cards { display: flex; flex-direction: column; gap: .7rem; margin-top: .9rem; }
.result-card {
  display: block;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 1rem 1.1rem; background: var(--bg); color: var(--ink);
  transition: border-color .15s ease, transform .08s ease, box-shadow .15s ease;
}
.result-card:hover {
  border-color: var(--line-strong); transform: translateY(-1px); color: var(--ink);
  box-shadow: 0 12px 28px -22px rgba(20, 20, 30, .5);
}
.result-org {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .1em;
  font-weight: 600; color: var(--accent);
}
.result-card h3 { font-size: 1.08rem; line-height: 1.25; margin: .2rem 0 .4rem; }
/* The system's factual relevance note — visually distinct from the curated summary. */
.result-why {
  font-size: .9rem; color: var(--ink-soft); line-height: 1.5;
  padding-left: .7rem; border-left: 2px solid var(--accent);
  margin-bottom: .5rem;
}
.result-summary { font-size: .92rem; color: var(--muted); line-height: 1.5; }
.result-more { display: inline-block; margin-top: .55rem; font-size: .88rem; font-weight: 500; color: var(--accent); }

.search-lead { margin-top: 1.1rem; }
.search-lead-label { font-size: .95rem; color: var(--ink-soft); margin-bottom: .6rem; }
.search-lead-row { display: flex; gap: .6rem; }
.search-lead-row .search-input {
  flex: 1 1 auto; padding: .7rem 1rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font-size: 1rem;
}
.search-lead-row .search-input:focus { border-color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .answer-shimmer { animation: none; }
}
@media (max-width: 520px) {
  .search-lead-row { flex-direction: column; align-items: stretch; }
}

/* ---- About (redesigned: brief + optional quotes side-by-side) ---- */
.about-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}
.about-solo .about-brief { max-width: 600px; }
.about-brief .portrait { margin-bottom: 1.4rem; }
.about-brief h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 1rem; }
.about-brief p + p { margin-top: 1rem; }
.about-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.6rem; }
.about-quotes { display: flex; flex-direction: column; gap: 1.2rem; }

.btn-sm { padding: .6rem 1.1rem !important; font-size: .9rem !important; }

@media (max-width: 760px) { .about-split { grid-template-columns: 1fr; } }

/* ---- Writeup detail page ---- */
.wdetail { padding-block: clamp(2.5rem, 7vw, 5rem); }
.wback { margin-bottom: 1.4rem; }
.wback a { color: var(--muted); font-size: .95rem; }
.wback a:hover { color: var(--ink); }
.wdetail h1 { font-size: clamp(2rem, 5vw, 3rem); margin-top: .5rem; max-width: 24ch; }
.wdetail .lede { margin-top: 1.1rem; max-width: 60ch; }

.at-a-glance {
  background: var(--tint); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.4rem, 4vw, 2rem); margin: 2.4rem 0;
}
.aag-title { text-transform: uppercase; letter-spacing: .12em; font-size: .76rem; font-weight: 600; color: var(--accent); margin-bottom: 1.1rem; }
.at-a-glance dl { display: grid; gap: 1.1rem; }
.at-a-glance dt { font-family: var(--font-serif); font-size: 1.02rem; color: var(--ink); margin-bottom: .25rem; }
.at-a-glance dd { color: var(--ink-soft); }

.prose { margin-top: 1.6rem; }
.prose h2 { font-size: clamp(1.25rem, 2.6vw, 1.5rem); margin: 2.2rem 0 .55rem; }
.prose p { max-width: 68ch; margin-bottom: 1.15rem; line-height: 1.75; color: var(--ink-soft); }
.prose p:last-child { margin-bottom: 0; }

.wcta { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.wcta p { font-family: var(--font-serif); font-size: 1.25rem; color: var(--ink); margin-bottom: 1rem; }
