/* =============================================================================
   Kevin Baker Technology — "Field Dossier" editorial redesign
   Design tokens + global system. Shared by static prototype and WP theme.
   Imported from the Claude Design project "KBakerTech website redesign".
   ========================================================================== */

:root {
  /* Palette — warm paper canvas */
  --paper:     #ECE6D8;  /* page background */
  --paper-2:   #E6DFD0;  /* card hover */
  --band:      #E4DBC7;  /* timeline / contact band */
  --ink:       #16181B;  /* primary text + dark blocks */
  --ink-2:     #3A3D42;  /* nav / strong body */
  --ink-3:     #46484D;  /* body copy */
  --ink-4:     #54565B;  /* muted body */
  --mute:      #6A6C70;  /* mono captions */
  --mute-2:    #7A7C80;  /* faint */
  --faint:     #9A9C96;  /* tags / footer headings */
  --rust:      #C8401C;  /* signal accent */
  --rust-2:    #D85128;  /* accent hover */
  --on-rust:   #F3EEE2;  /* text on rust */
  --ok:        #3F9B5A;  /* status green */
  --line:      rgba(22,24,27,0.14);
  --line-soft: rgba(22,24,27,0.10);
  --line-strong: rgba(22,24,27,0.25);

  /* Type */
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --body:  "Archivo", system-ui, -apple-system, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  /* Metrics */
  --maxw: 1240px;
  --gutter: clamp(1.25rem, 4vw, 2rem);
  --radius: 4px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

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

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

::selection { background: var(--rust); color: var(--on-rust); }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* Keyframes */
@keyframes kbt-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes kbt-grow    { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes kbt-pulse   { 0%{box-shadow:0 0 0 0 rgba(63,155,90,.45)} 70%{box-shadow:0 0 0 6px rgba(63,155,90,0)} 100%{box-shadow:0 0 0 0 rgba(63,155,90,0)} }

/* ---------- Layout primitives ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { position: relative; z-index: 1; padding-block: clamp(4rem, 8vw, 6.5rem); }
.section--tight { padding-block: clamp(3rem, 6vw, 5rem); }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- Type ---------- */
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.02em; line-height: 1.02; margin: 0; }
.display { font-family: var(--serif); font-weight: 500; font-size: clamp(2.75rem, 5.6vw, 5.1rem); line-height: 0.99; letter-spacing: -0.02em; }
.h2 { font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.02; }
.h3 { font-family: var(--serif); font-weight: 500; font-size: 1.5rem; letter-spacing: -0.01em; }
.lede { font-size: clamp(1.05rem, 1.4vw, 1.125rem); color: var(--ink-3); max-width: 560px; line-height: 1.6; }
p { margin: 0 0 1.1em; }

/* mono utility label */
.label {
  font-family: var(--mono); font-size: .75rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--rust);
}
.label--signal, .label--verify { color: var(--rust); }
.label .tick { color: var(--rust); font-size: .625rem; }

.accent { color: var(--rust); }
.muted { color: var(--ink-3); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--body); font-size: .94rem; font-weight: 600;
  padding: .95rem 1.5rem; border-radius: 2px;
  border: 1px solid var(--line-strong); color: var(--ink);
  background: transparent;
  transition: border-color .25s var(--ease), background .25s var(--ease), color .25s var(--ease), transform .15s var(--ease);
  cursor: pointer;
}
.btn .arr { font-family: var(--mono); transition: transform .25s var(--ease); }
.btn:hover { border-color: var(--ink); }
.btn:hover .arr { transform: translate(2px, -2px); }
.btn--primary { background: var(--rust); color: var(--on-rust); border-color: var(--rust); }
.btn--primary:hover { background: var(--ink); border-color: var(--ink); color: var(--on-rust); }
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--rust); outline-offset: 3px; }

/* ---------- Header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(236,230,216,0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-head__inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-block: 16px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand__mark {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  font-family: var(--mono); font-weight: 500; font-size: 15px; letter-spacing: .02em;
  color: var(--paper); background: var(--ink);
}
.brand__name { font-weight: 600; font-size: 15px; letter-spacing: -.01em; line-height: 1.05; }
.brand__sub { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; color: var(--mute); text-transform: uppercase; margin-top: 2px; font-weight: 400; }
.nav { display: flex; align-items: center; gap: 26px; }
.nav a { font-size: 14px; font-weight: 500; color: var(--ink-2); transition: color .2s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.head-cta {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--ink);
  padding: 9px 15px; border: 1px solid var(--line-strong); border-radius: 2px;
  transition: border-color .2s, background .2s, color .2s;
}
.head-cta:hover { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.head-cta:hover .dot { background: #fff; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(63,155,90,.18); }
.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(3.5rem, 6vw, 5.25rem); padding-bottom: clamp(3rem, 5vw, 4rem); }
.hero__copy { max-width: 980px; }
.hero__eyebrow { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; letter-spacing: .12em; }
.hero__eyebrow .seg { color: var(--ink-2); }
.hero h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(2.75rem, 5.6vw, 5.1rem); line-height: 0.99; letter-spacing: -0.02em; margin: 0; }
.hero h1 .soft { font-style: italic; color: var(--rust); }
.hero__lede { max-width: 560px; font-size: 1.125rem; line-height: 1.6; color: var(--ink-3); margin: 32px 0 0; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 38px; }

/* ---------- Ticker / marquee ---------- */
.marquee { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; padding-block: 14px; }
.marquee__track { display: flex; width: max-content; animation: kbt-marquee 38s linear infinite; }
.marquee__track > span { display: flex; font-family: var(--mono); font-size: 13px; letter-spacing: .04em; color: var(--ink-2); }
.marquee__item { padding-inline: 1.75rem; display: inline-flex; align-items: center; }
.marquee__item::before { content: "◆"; color: var(--rust); font-size: .55rem; margin-right: 1.75rem; }

/* ---------- Section header ---------- */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 3.5rem; flex-wrap: wrap; }
.sec-head__lead { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.sec-head .label { letter-spacing: .1em; }
.sec-head h2 { margin: 2px 0 0; }
.sec-head p { font-size: 1.0625rem; line-height: 1.6; color: var(--ink-3); margin: 6px 0 0; max-width: 580px; }
.link-arrow { display: inline-flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 13px; color: var(--ink); border-bottom: 1px solid var(--rust); padding-bottom: 4px; transition: color .2s; }
.link-arrow:hover { color: var(--rust); }

/* ---------- Capabilities ---------- */
.caps { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.cap { background: var(--paper); padding: 40px 36px; display: flex; flex-direction: column; gap: 18px; min-height: 230px; transition: background .3s var(--ease); }
.cap:hover { background: var(--paper-2); }
.cap__top { display: flex; align-items: baseline; justify-content: space-between; }
.cap__id { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; color: var(--rust); }
.cap__tag { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.cap h3 { font-size: 30px; }
.cap p { font-size: .97rem; line-height: 1.62; color: var(--ink-3); margin: 0; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: .85fr 1.15fr; gap: 64px; align-items: start; }
.portrait { position: sticky; top: 110px; }
.portrait img { width: 100%; aspect-ratio: 4/5; object-fit: cover; object-position: center 22%; border-radius: 4px; filter: grayscale(.2) contrast(1.02); }
.portrait__tag { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-family: var(--mono); font-size: 12px; color: var(--mute); }
.portrait__tag::before { content: ""; width: 18px; height: 1px; background: var(--rust); }
.about__body .label { letter-spacing: .1em; }
.about__body h2 { margin: 16px 0 28px; max-width: 640px; }
.about__body p { font-size: 1.09rem; line-height: 1.68; color: var(--ink-2); margin: 0 0 22px; max-width: 620px; }
.about__body p:last-of-type { margin-bottom: 40px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  font-family: var(--mono); font-size: 12.5px; color: var(--ink);
  border: 1px solid var(--line-strong); padding: 9px 14px; border-radius: 2px;
}
.chip::before { content: "✓"; color: var(--rust); }

/* ---------- Timeline (band) ---------- */
.timeline-band { background: var(--band); color: var(--ink); }
.timeline-band .sec-head { margin-bottom: 4.5rem; max-width: 720px; }
.timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: rgba(22,24,27,0.16); }
.tl-cell { background: var(--band); padding: 34px 26px 40px; }
.tl-year { font-family: var(--mono); font-size: 13px; color: var(--rust); margin-bottom: 6px; }
.tl-bar { height: 2px; background: rgba(200,64,28,0.55); transform-origin: left; animation: kbt-grow .9s ease-out; margin-bottom: 22px; }
.tl-cell h3 { font-size: 21px; line-height: 1.18; margin-bottom: 14px; }
.tl-cell p { font-size: .9rem; line-height: 1.6; color: var(--ink-4); margin: 0; }

/* ---------- Insights / blog cards ---------- */
.posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.post-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: var(--paper);
  transition: border-color .3s var(--ease);
}
.post-card::before { content: ""; height: 3px; background: var(--rust); }
.post-card:hover { border-color: var(--ink); }
.post-card__inner { padding: 28px 26px 30px; display: flex; flex-direction: column; gap: 14px; height: 100%; }
.post-card__meta { display: flex; align-items: center; justify-content: space-between; font-family: var(--mono); font-size: 11.5px; color: var(--mute); }
.post-card__cat { color: var(--rust); }
.post-card h3 { font-size: 23px; line-height: 1.16; letter-spacing: -.01em; }
.post-card p { font-size: .9rem; line-height: 1.6; color: var(--ink-3); margin: 0; }
.post-card__more { margin-top: auto; font-family: var(--mono); font-size: 12.5px; color: var(--ink); padding-top: 8px; }
.post-card__more .arr { transition: transform .25s var(--ease); display: inline-block; }
.post-card:hover .post-card__more .arr { transform: translateX(4px); }

/* ---------- Contact card ---------- */
.cta {
  background: var(--band); border: 1px solid var(--line); border-radius: 6px;
  padding: clamp(40px, 6vw, 84px);
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: center;
}
.cta__lead .label { letter-spacing: .1em; }
.cta__lead h2 { margin: 18px 0 22px; }
.cta__lead p { font-size: 1.09rem; line-height: 1.62; color: var(--ink-3); margin: 0; max-width: 520px; }
.cta__actions { display: flex; flex-direction: column; gap: 14px; }
.cta__btn {
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 600; font-size: 1rem; padding: 20px 24px; border-radius: 3px;
  transition: background .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease);
}
.cta__btn .arr { font-family: var(--mono); }
.cta__btn--primary { background: var(--rust); color: var(--on-rust); }
.cta__btn--primary:hover { background: var(--rust-2); }
.cta__btn--ghost { border: 1px solid var(--line-strong); color: var(--ink); }
.cta__btn--ghost:hover { border-color: var(--ink); }
.cta__note { font-family: var(--mono); font-size: 11.5px; color: var(--mute); margin: 8px 0 0; line-height: 1.5; }
/* Inline variant: a single-column callout (used at the foot of single posts), not the 2-col contact card. */
.cta--inline { display: block; }
.cta--inline h3 { margin-bottom: .6rem; }

/* ---------- Footer ---------- */
.site-foot { border-top: 1px solid var(--line); position: relative; z-index: 1; }
.foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; padding: 56px 0 40px; }
.foot-col .brand { margin-bottom: 16px; }
.foot-col .brand__mark { width: 34px; height: 34px; font-size: 14px; }
.foot-col > p { font-size: 14px; line-height: 1.6; color: var(--ink-4); margin: 0; max-width: 300px; }
.foot-col h4 { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin: 0 0 16px; font-weight: 500; }
.foot-col h4 + a, .foot-links { display: flex; flex-direction: column; gap: 10px; }
.foot-col a:not(.brand) { color: var(--ink-2); font-size: 14px; transition: color .2s; }
.foot-col a:not(.brand):hover { color: var(--rust); }
.foot-links a { color: var(--ink-2); font-size: 14px; transition: color .2s; }
.foot-links a:hover { color: var(--rust); }
.foot-bar { border-top: 1px solid var(--line-soft); }
.foot-bar__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 20px 0; font-family: var(--mono); font-size: 11.5px; color: var(--mute-2); flex-wrap: wrap; }
.foot-status { display: inline-flex; align-items: center; gap: 8px; }
.foot-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }

/* ---------- Page hero (inner pages / blog) ---------- */
.page-hero { padding-block: clamp(3.5rem, 6vw, 5.5rem) clamp(2rem, 4vw, 3rem); border-bottom: 1px solid var(--line); }
.page-hero .label { display: block; margin-bottom: 1.2rem; }
.page-hero h1 { font-size: clamp(2.4rem, 5vw, 4rem); margin-bottom: 1rem; }
.page-hero p { color: var(--ink-3); max-width: 56ch; line-height: 1.6; }

/* ---------- Blog list ---------- */
.blog-grid { display: grid; grid-template-columns: 1fr 320px; gap: clamp(2rem,4vw,3.5rem); align-items: start; }
.blog-list { display: flex; flex-direction: column; }
.blog-item { display: grid; grid-template-columns: 90px 1fr; gap: 1.6rem; padding: 2rem 0; border-bottom: 1px solid var(--line); transition: background .25s; }
.blog-item:first-child { padding-top: 0; }
.blog-item:hover { background: rgba(200,64,28,0.03); }
.blog-item__date { font-family: var(--mono); font-size: .75rem; color: var(--rust); letter-spacing: .04em; line-height: 1.5; }
.blog-item__date .d { display: block; font-family: var(--serif); font-weight: 500; font-size: 1.9rem; color: var(--ink); letter-spacing: -.02em; }
.blog-item h2 { font-size: 1.6rem; margin-bottom: .6rem; transition: color .2s; }
.blog-item:hover h2 { color: var(--rust); }
.blog-item p { color: var(--ink-3); margin: 0 0 .8rem; font-size: 1rem; line-height: 1.6; }
.blog-item__meta { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--mute); }
.blog-item__meta .cat { color: var(--rust); }
.aside { position: sticky; top: 100px; display: flex; flex-direction: column; gap: 1.4rem; }
.aside__box { border: 1px solid var(--line); border-radius: 4px; background: var(--band); padding: 1.4rem; }
.aside__box h3 { font-family: var(--mono); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); margin-bottom: 1rem; font-weight: 500; }
.topic { display: flex; justify-content: space-between; padding: .5rem 0; border-bottom: 1px solid var(--line-soft); font-size: .95rem; color: var(--ink-2); transition: color .2s; }
.topic:last-child { border-bottom: 0; }
.topic:hover { color: var(--rust); }
.topic span { font-family: var(--mono); color: var(--mute); font-size: .8rem; }

/* ---------- Single post ---------- */
.article { max-width: 720px; margin-inline: auto; }
.article__body { font-size: 1.15rem; line-height: 1.75; color: var(--ink-2); }
.article__body h2 { font-size: 2rem; margin: 2.6rem 0 1rem; color: var(--ink); }
.article__body h3 { font-size: 1.5rem; margin: 2.2rem 0 .8rem; color: var(--ink); }
.article__body p { margin: 0 0 1.4em; }
.article__body a { color: var(--rust); text-decoration: underline; text-underline-offset: 3px; }
.article__body blockquote { border-left: 2px solid var(--rust); margin: 1.8rem 0; padding: .4rem 0 .4rem 1.4rem; color: var(--ink); font-family: var(--serif); font-style: italic; font-size: 1.5rem; line-height: 1.4; font-weight: 500; }
.article__body code { font-family: var(--mono); font-size: .88em; background: var(--band); padding: .15em .4em; border-radius: 3px; color: var(--rust); }
.article__body ul { padding-left: 1.2rem; }
.article__body li { margin-bottom: .5rem; }

/* ---------- Scroll reveal (only hides when JS is on) ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js [data-reveal] { opacity: 1; transform: none; } }

/* ---------- Pagination (blog) ---------- */
.pagination { margin-top: 2.5rem; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.pagination .page-numbers { font-family: var(--mono); font-size: .82rem; color: var(--ink-2); border: 1px solid var(--line-strong); border-radius: 2px; padding: .55rem .85rem; transition: border-color .2s, color .2s; }
.pagination a.page-numbers:hover { color: var(--ink); border-color: var(--ink); }
.pagination .page-numbers.current { color: var(--on-rust); background: var(--rust); border-color: var(--rust); }

/* ---------- WP comments (minimal) ---------- */
.comment-list { list-style: none; padding: 0; margin: 2rem 0; }
.comment-list li { border-top: 1px solid var(--line); padding: 1.2rem 0; }
.comment-respond { margin-top: 2rem; }
.comment-form input[type=text], .comment-form input[type=email], .comment-form input[type=url], .comment-form textarea { width: 100%; background: #fff; border: 1px solid var(--line-strong); border-radius: 2px; color: var(--ink); padding: .7rem .9rem; font-family: var(--body); margin-bottom: 1rem; }
.comment-form .submit { font-family: var(--body); background: var(--rust); color: var(--on-rust); border: 0; border-radius: 2px; padding: .85rem 1.5rem; font-weight: 600; cursor: pointer; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero h1 { font-size: clamp(2.5rem, 8vw, 3.6rem); }
  .about { grid-template-columns: 1fr; gap: 2.5rem; }
  .portrait { position: static; max-width: 420px; }
  .timeline { grid-template-columns: repeat(2, 1fr); }
  .cta { grid-template-columns: 1fr; gap: 32px; }
  .blog-grid { grid-template-columns: 1fr; }
  .aside { position: static; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .nav, .head-cta { display: none; }
  .nav-toggle { display: inline-grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line-strong); border-radius: 2px; background: transparent; color: var(--ink); font-family: var(--mono); font-size: 1.2rem; cursor: pointer; }
  .nav--open { display: flex; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: flex-start; gap: 0; background: var(--paper); border-bottom: 1px solid var(--line); padding: .5rem var(--gutter) 1rem; }
  .nav--open a { padding: .7rem 0; width: 100%; border-bottom: 1px solid var(--line-soft); }
}
@media (max-width: 620px) {
  .caps { grid-template-columns: 1fr; }
  .posts { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .blog-item { grid-template-columns: 1fr; gap: .6rem; }
  .hero__actions .btn, .hero__actions { width: 100%; }
}
