/* ============================================================
   kileysullivan.com — "Warm Machine" system
   One stylesheet for every page. Tokens first, then components.
   Fonts: Bricolage Grotesque (display, the one webfont) over a
   system body stack. No JavaScript anywhere.
   ============================================================ */

:root {
  color-scheme: light;
  /* color */
  --paper: #F5F0E8;        /* page background */
  --card: #FFFDF8;         /* raised surfaces */
  --well: #EDE5D7;         /* inset screenshot wells */
  --ink: #262019;          /* primary text — 12.9:1 on paper */
  --sub: #5F5546;          /* secondary text — 6.5:1 on paper */
  --faint: #7C6F5B;        /* labels — 4.6:1 on paper */
  --line: rgba(38, 32, 25, .14);
  --line-soft: rgba(38, 32, 25, .08);
  --ember: #9E4515;        /* brand accent: buttons, marks */
  --ember-text: #8A3B10;   /* accent as small text — 5.5:1 on paper */
  --ember-tint: rgba(158, 69, 21, .12);
  --dark: #2A2116;         /* footer panel */
  --dark-text: #F6EFE3;
  --dark-sub: rgba(246, 239, 227, .72);
  --ember-on-dark: #EBA36A;
  /* type */
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  /* depth */
  --shadow-1: 0 1px 2px rgba(38, 32, 25, .05), 0 10px 30px rgba(38, 32, 25, .07);
  --shadow-2: 0 2px 4px rgba(38, 32, 25, .06), 0 18px 44px rgba(38, 32, 25, .13);
  --shadow-inset: 0 2px 8px rgba(38, 32, 25, .12);
  --radius: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

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

/* Paper grain: monochrome SVG noise tiled over the whole viewport.
   Kept at 4% so it reads as texture, never as a visible pattern. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

a { color: var(--ember-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ember); }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; border-radius: 4px; }

img { max-width: 100%; height: auto; }

.container { max-width: 1140px; margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2.75rem); }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--paper); padding: .6rem 1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; z-index: 10; }

/* ---------- header ---------- */
.site-header { padding-block: 1.1rem .9rem; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--ember); color: #FFF6EC;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: .95rem;
}
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; letter-spacing: -.01em; }
.site-nav { display: flex; align-items: center; gap: clamp(.9rem, 2.5vw, 1.6rem); flex-wrap: wrap; }
.site-nav a:not(.btn) { color: var(--sub); text-decoration: none; font-size: .95rem; }
.site-nav a:not(.btn):hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ---------- buttons & chips ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .72rem 1.35rem; border-radius: 12px; text-decoration: none;
  font-weight: 600; font-size: .95rem; line-height: 1.2; border: 1px solid transparent;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.btn-primary { background: var(--ember); color: #FFF6EC; box-shadow: 0 1px 2px rgba(38,32,25,.2), 0 6px 16px rgba(158,69,21,.25); }
.btn-primary:hover { background: #8A3B10; color: #FFF6EC; transform: translateY(-1px); }
.btn-ghost { background: var(--card); color: var(--ink); border-color: var(--line); box-shadow: 0 1px 2px rgba(38,32,25,.06); }
.btn-ghost:hover { color: var(--ink); border-color: rgba(38,32,25,.28); transform: translateY(-1px); }
.btn-sm { padding: .55rem 1.1rem; border-radius: 999px; font-size: .9rem; }

.status-chip {
  display: inline-flex; align-items: center; gap: .55rem;
  border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: .45rem .9rem; font-size: .82rem; color: var(--sub);
  box-shadow: 0 1px 2px rgba(38,32,25,.05);
}
.status-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ember); }

.chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.chip {
  font-size: .69rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  background: rgba(38, 32, 25, .07); color: var(--sub);
  padding: .32rem .65rem; border-radius: 999px;
}
.chip-ember { background: var(--ember-tint); color: var(--ember-text); }

/* ---------- hero ---------- */
.hero { padding-block: clamp(2.6rem, 7vw, 4.6rem) clamp(2.2rem, 5vw, 3.4rem); max-width: 60rem; }
.display {
  margin: 1.35rem 0 0;
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2.25rem, 5.8vw, 4rem); line-height: 1.05; letter-spacing: -.025em;
  text-wrap: balance;
}
.hl { box-shadow: inset 0 -.26em var(--ember-tint); }
.lede { margin: 1.35rem 0 0; font-size: clamp(1.05rem, 1.6vw, 1.14rem); line-height: 1.6; color: var(--sub); max-width: 56ch; text-wrap: pretty; }
.hero-actions { display: flex; gap: .75rem; margin-top: 1.75rem; flex-wrap: wrap; }

/* ---------- sections ---------- */
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.section-title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.5rem, 3vw, 1.8rem); letter-spacing: -.01em; }
.section-link { font-weight: 600; font-size: .95rem; text-decoration: none; }

/* ---------- build cards ---------- */
.build-grid { display: grid; gap: 1.6rem; margin-top: 1.2rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .build-grid { grid-template-columns: 1fr 1fr; } }

.card {
  display: block; background: var(--card);
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  box-shadow: var(--shadow-1); text-decoration: none; color: var(--ink);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); color: var(--ink); }
.card-well { margin: 12px; background: var(--well); border-radius: var(--radius-sm); padding: 12px; }
.card-well img {
  display: block; width: 100%; height: 230px; object-fit: cover; object-position: top;
  border-radius: 7px; border: 1px solid rgba(38,32,25,.12); box-shadow: var(--shadow-inset);
}
.card-body { padding: .35rem 1.3rem 1.3rem; }
.card-title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; letter-spacing: -.01em; }
.card-body p { margin: .45rem 0 0; font-size: .9rem; line-height: 1.55; color: var(--sub); }
.card-body .chips { margin-top: .85rem; }

/* ---------- credentials band ---------- */
.creds {
  background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(38,32,25,.05);
  display: grid; grid-template-columns: 1fr;
}
@media (min-width: 760px) { .creds { grid-template-columns: 1fr 1fr 1fr; } }
.creds > div { padding: 1.4rem 1.5rem; border-top: 1px solid var(--line-soft); }
.creds > div:first-child { border-top: 0; }
@media (min-width: 760px) {
  .creds > div { border-top: 0; border-left: 1px solid var(--line-soft); }
  .creds > div:first-child { border-left: 0; }
}
.label { font-size: .69rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.creds strong { display: block; margin-top: .45rem; font-weight: 600; font-size: .95rem; }
.creds span { display: block; margin-top: .25rem; font-size: .85rem; color: var(--sub); }

/* ---------- footer ---------- */
.site-footer { margin-top: clamp(2.5rem, 6vw, 4rem); padding-bottom: 1.5rem; }
.footer-panel {
  background: var(--dark); border-radius: 20px; padding: clamp(1.8rem, 4vw, 2.75rem);
  display: flex; justify-content: space-between; align-items: flex-end; gap: 2.5rem; flex-wrap: wrap;
}
.footer-title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.7rem, 3.5vw, 2.35rem); color: var(--dark-text); letter-spacing: -.02em; }
.footer-panel p { margin: .75rem 0 0; font-size: .95rem; line-height: 1.6; color: var(--dark-sub); max-width: 44ch; }
.footer-email {
  display: inline-block; margin-top: 1.1rem; color: var(--ember-on-dark); font-weight: 600; font-size: 1rem;
  text-decoration: none; border-bottom: 1px solid rgba(235,163,106,.5); padding-bottom: 2px;
}
.footer-email:hover { color: var(--ember-on-dark); border-bottom-color: var(--ember-on-dark); }
.footer-links { display: flex; flex-direction: column; gap: .6rem; text-align: right; }
.footer-links a { color: var(--dark-sub); text-decoration: none; font-size: .95rem; }
.footer-links a:hover { color: var(--dark-text); }
.colophon { margin: 1.1rem .25rem 0; font-size: .8rem; color: var(--faint); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------- case study / prose pages ---------- */
.breadcrumb { display: inline-block; margin-top: 1.5rem; font-size: .9rem; text-decoration: none; color: var(--sub); }
.breadcrumb:hover { color: var(--ink); }
.page-hero { padding-block: 1.2rem clamp(1.6rem, 4vw, 2.6rem); max-width: 60rem; }
.page-hero .chips { margin-top: 1.2rem; }

.cs-meta {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--radius);
  overflow: hidden; margin-top: 1.8rem;
}
@media (min-width: 760px) { .cs-meta { grid-template-columns: repeat(4, 1fr); } }
.cs-meta > div { background: var(--card); padding: 1.1rem 1.25rem; }
.cs-meta strong { display: block; margin-top: .4rem; font-weight: 600; font-size: .92rem; line-height: 1.4; }

.prose { max-width: 68ch; }
.prose h2 {
  margin: 2.6rem 0 0; font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.35rem, 2.6vw, 1.6rem); letter-spacing: -.01em;
}
.prose h2::before { content: ""; display: block; width: 34px; border-top: 3px solid var(--ember); margin-bottom: .9rem; border-radius: 2px; }
.prose p { margin: .9rem 0 0; color: #453B2F; }
.prose ul, .prose ol { margin: .9rem 0 0; padding-left: 1.3rem; color: #453B2F; }
.prose li { margin-top: .5rem; }
.prose li::marker { color: var(--ember); font-weight: 700; }

.outcome-card {
  margin-top: 1.1rem; background: var(--card); border: 1px solid var(--line-soft);
  border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 1.3rem 1.5rem;
}
.outcome-card ul { margin: 0; padding-left: 1.25rem; }
.outcome-card li { margin-top: .5rem; }
.outcome-card li:first-child { margin-top: 0; }

.shot { margin: 1.4rem 0 0; background: var(--well); border-radius: var(--radius-sm); padding: 14px; }
.shot img { display: block; width: 100%; border-radius: 7px; border: 1px solid rgba(38,32,25,.12); box-shadow: var(--shadow-inset); }
.shot figcaption { margin-top: .7rem; font-size: .82rem; color: var(--sub); }

.private-banner {
  display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
  margin-top: 1.6rem; background: var(--ember-tint); border: 1px solid rgba(158,69,21,.25);
  border-radius: var(--radius-sm); padding: .8rem 1.1rem; font-size: .9rem; color: var(--ember-text);
}

/* ---------- about ---------- */
.about-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 860px) { .about-grid { grid-template-columns: minmax(0, 1fr) 320px; gap: 3.5rem; } }
.fact-card {
  background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius);
  box-shadow: var(--shadow-1); padding: 1.4rem 1.5rem;
}
.fact-card > div + div { margin-top: 1.15rem; padding-top: 1.15rem; border-top: 1px solid var(--line-soft); }
.fact-card strong { display: block; margin-top: .4rem; font-weight: 600; font-size: .95rem; }
.fact-card span { display: block; margin-top: .2rem; font-size: .85rem; color: var(--sub); }

.timeline { list-style: none; margin: 1.4rem 0 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 1.4rem 1.5rem; }
.timeline li:last-child { padding-bottom: .2rem; }
.timeline li::before {
  content: ""; position: absolute; left: -6px; top: .42em;
  width: 10px; height: 10px; border-radius: 50%; background: var(--ember);
  border: 2px solid var(--paper);
}
.timeline .label { display: block; }
.timeline p { margin: .3rem 0 0; color: #453B2F; }

/* ---------- gated page ---------- */
.gate-wrap { display: grid; place-items: center; padding-block: clamp(2.5rem, 8vw, 5.5rem); }
.gate-card {
  width: min(30rem, 100%); background: var(--card); border: 1px solid var(--line-soft);
  border-radius: 20px; box-shadow: var(--shadow-2); padding: clamp(1.8rem, 4vw, 2.6rem);
  text-align: center;
}
.gate-lock {
  width: 52px; height: 52px; margin-inline: auto; border-radius: 14px;
  background: var(--ember-tint); color: var(--ember-text);
  display: grid; place-items: center;
}
.gate-card h1 { margin: 1.2rem 0 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.5rem, 3.5vw, 1.9rem); letter-spacing: -.015em; text-wrap: balance; }
.gate-card > p { margin: .8rem 0 0; font-size: .95rem; line-height: 1.6; color: var(--sub); text-wrap: pretty; }
.gate-form { margin-top: 1.6rem; text-align: left; }
.gate-form label { display: block; font-size: .69rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.gate-input {
  width: 100%; margin-top: .5rem; padding: .8rem 1rem;
  border: 1px solid var(--line); border-radius: 12px; background: var(--paper);
  font: inherit; color: var(--ink);
}
.gate-input:focus-visible { outline: 2px solid var(--ember); outline-offset: 1px; border-color: transparent; }
.gate-form .btn { width: 100%; justify-content: center; margin-top: .8rem; }
.gate-contents { margin-top: 1.7rem; padding-top: 1.4rem; border-top: 1px solid var(--line-soft); }
.gate-contents .chips { justify-content: center; margin-top: .7rem; }
.gate-error { margin: .7rem 0 0; font-size: .88rem; color: #8A2413; }
