/* ============================================================================
   brand.css — "Warm Operator" shared design system for kylerenke.ai
   Single source of truth for the site's look. Link this from every page:
     <link rel="stylesheet" href="/styles/brand.css" />
   Homepage-specific and resource-specific layout can layer on top.
   See brand-kit.md for the full token reference + positioning spine.
   ========================================================================== */

:root {
  --bg: #F5F2EE;            /* warm cream — section color A */
  --bg-alt: #EBE4D9;        /* deeper cream — section color B */
  --surface: #FBFAF8;       /* card surface */
  --surface-line: #E7E1D7;  /* card border */
  --accent: #C97145;        /* terracotta */
  --accent-dark: #AB5A33;   /* hover */
  --peach-1: #F2994A;       /* card gradient top */
  --peach-2: #F6BE84;       /* card gradient bottom */
  --peach-soft: #F7E4D2;    /* soft tint chips / bands */
  --espresso: #23262B;      /* slate — dark CTA band + footer */
  --cream-on-dark: #F3ECE3; /* text on espresso */
  --ink: #1A1A1A;
  --ink-soft: #737373;
  --ink-mute: #9A958C;
  --radius: 16px;
  --max: 1180px;
  --shadow-card: 0 16px 36px rgba(36,28,23,0.09);
  --shadow-photo: 0 28px 70px rgba(201,113,69,0.28);
  --font-display: 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Manrope', system-ui, -apple-system, sans-serif;
  --fs-base: 16px;
  --h-weight: 700;
  --h-scale: 1;
  --h-tracking: -0.05em;
  --sec-pad: 68px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* grain overlay — warmth + depth over flat cream */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: 0.04; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
header.nav, main, footer { position: relative; z-index: 2; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 28px; }
/* narrow, centered column for resource detail pages — one width for everything */
.wrap.wrap-res { max-width: 860px; }
.orange { color: var(--accent); }
h1, h2, h3, .display { font-family: var(--font-display); }

/* ===== buttons (pill) ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body);
  font-weight: 600; font-size: 15px; padding: 11px 24px; border-radius: 999px;
  border: 1.5px solid transparent; cursor: pointer;
  transition: transform .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease; white-space: nowrap;
}
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(26,26,26,0.22); }
.btn-orange { background: var(--accent); color: #fff; }
.btn-orange:hover { background: var(--accent-dark); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(201,113,69,0.32); }
.btn-orange-outline { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-orange-outline:hover { background: var(--accent); color: #fff; }
.btn-cream { background: var(--cream-on-dark); color: var(--espresso); }
.btn-cream:hover { background: #fff; transform: translateY(-2px); }
.btn-text { font-weight: 600; font-size: 15px; color: var(--ink); padding: 11px 6px; }
.btn-text:hover { color: var(--accent); }

.eyebrow {
  font-family: var(--font-body);
  font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent);
}

/* ===================== NAV ===================== */
header.nav {
  position: sticky; top: 0; z-index: 50; background: rgba(245,242,238,0.82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--surface-line);
  padding-top: env(safe-area-inset-top);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 18px; font-family: var(--font-display); }
.brand .av {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  background: var(--peach-soft); border: 1.5px solid var(--surface-line);
}
.nav-links { display: none; gap: 30px; align-items: center; }
.nav-links a { font-size: 15px; font-weight: 500; color: var(--ink); position: relative; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -5px; height: 2px; width: 0;
  background: var(--accent); transition: width .2s ease;
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-right { display: flex; align-items: center; gap: 14px; }
.nav-cta { display: none; }
@media (min-width: 940px) {
  .nav-links { display: flex; }
  .nav-cta { display: inline-flex; }
}
.menu-btn {
  display: inline-flex; flex-direction: column; gap: 5px; justify-content: center;
  width: 44px; height: 44px; border: 1px solid var(--surface-line); border-radius: 12px;
  background: var(--surface); cursor: pointer; padding: 0 11px;
}
@media (min-width: 940px) { .menu-btn { display: none; } }
.menu-btn span { height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-menu {
  display: none; flex-direction: column; gap: 4px;
  padding: 10px 28px 22px; border-bottom: 1px solid var(--surface-line);
  background: rgba(245,242,238,0.97);
}
.mobile-menu.open { display: flex; }
.mobile-menu a { padding: 12px 4px; font-size: 17px; font-weight: 500; border-bottom: 1px solid var(--surface-line); }
.mobile-menu a:last-of-type { border-bottom: 0; }
.mobile-menu .btn { margin-top: 12px; }

/* ===================== SECTIONS ===================== */
section { padding: var(--sec-pad) 0; position: relative; }
.bg-a { background: var(--bg); }
.bg-b { background: var(--bg-alt); }
.band-soft { background: var(--peach-soft); }

.centered { text-align: center; max-width: 720px; margin: 0 auto 52px; }
.centered .eyebrow { display: block; margin-bottom: 18px; }
.centered h2 { font-size: calc(clamp(33px, 4.8vw, 52px) * var(--h-scale)); font-weight: var(--h-weight); letter-spacing: var(--h-tracking); line-height: 1.08; }
.centered p { margin-top: 18px; color: var(--ink-soft); font-size: 18px; }

/* ===================== CARDS (library grid) ===================== */
.cards { display: grid; grid-template-columns: 1fr; gap: 26px; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: var(--surface); border: 1px solid var(--surface-line); border-radius: var(--radius);
  overflow: hidden; transition: transform .18s ease, box-shadow .18s ease; display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-card); }
.card-thumb {
  aspect-ratio: 16/10; background: linear-gradient(150deg, var(--peach-1), var(--peach-2));
  display: grid; place-items: center; font-size: 46px; overflow: hidden;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; align-self: stretch; justify-self: stretch; }
.card-body { padding: 22px 22px 26px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.cat { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.card-body h3 { font-size: 20px; font-weight: 600; line-height: 1.25; }
.card-body p { color: var(--ink-soft); font-size: 15px; }

/* ===================== FOOTER ===================== */
footer { background: var(--espresso); padding: 50px 0 calc(40px + env(safe-area-inset-bottom)); }
.foot-inner { display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between; align-items: center; }
footer .brand { color: var(--cream-on-dark); }
footer .brand .av { border-color: rgba(243,236,227,0.2); }
.foot-links { display: flex; gap: 22px; flex-wrap: wrap; }
.foot-links a { color: #C9BDB0; font-size: 14px; }
.foot-links a:hover { color: var(--cream-on-dark); }
.foot-copy { color: #8A7E72; font-size: 14px; }

/* ===================== RESOURCE DETAIL PAGE ===================== */
/* Tight, prompt-first layout (Mav-style). Resource pages run on ONE continuous
   background; only the newsletter strip is a tinted band. */
.res-hero { padding: 44px 0 4px; }
.res-back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: 14px; font-weight: 600; margin-bottom: 22px; }
.res-back:hover { color: var(--accent); }
/* simple text meta line: TYPE · read time · date */
.res-meta-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13px; font-weight: 600; color: var(--ink-mute); }
.res-meta-top .cat { color: var(--accent); text-transform: uppercase; letter-spacing: .08em; }
.res-meta-top .dot { opacity: .6; }
/* legacy chips still available if a page prefers them */
.chip { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); background: var(--peach-soft); padding: 5px 12px; border-radius: 999px; }
.chip-mute { color: var(--ink-mute); background: transparent; border: 1px solid var(--surface-line); }
.res-hero h1 { font-size: calc(clamp(28px, 3.6vw, 42px) * var(--h-scale)); line-height: 1.1; font-weight: var(--h-weight); letter-spacing: var(--h-tracking); }
.res-hero .res-lead { margin-top: 12px; font-size: 17px; line-height: 1.55; color: var(--ink-soft); }
.res-actions { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* article container — readable column */
.res-body { padding: 24px 0 8px; }
.prose { max-width: 100%; }
.prose h2 { font-size: clamp(20px, 2.4vw, 26px); font-weight: var(--h-weight); letter-spacing: var(--h-tracking); line-height: 1.2; margin: 30px 0 10px; }
.prose h3 { font-size: 17px; font-weight: 700; margin: 22px 0 8px; }
.prose p { color: var(--ink-soft); font-size: 16px; line-height: 1.6; margin: 0 0 14px; }
.prose ul, .prose ol { color: var(--ink-soft); font-size: 16px; margin: 0 0 14px; padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--ink); }
.prose a { color: var(--accent); font-weight: 600; }
.prose a:hover { text-decoration: underline; }

/* standalone section heading between blocks ("The Full Prompt", "How to Set It Up") */
.res-h2 { font-family: var(--font-display); font-size: clamp(21px, 2.6vw, 28px); font-weight: var(--h-weight); letter-spacing: var(--h-tracking); line-height: 1.15; margin: 6px 0 12px; }

/* numbered step list — tighter, with optional bold lead label */
.steps { list-style: none; counter-reset: step; padding: 0; max-width: 100%; }
.steps li { counter-increment: step; position: relative; padding: 0 0 14px 46px; color: var(--ink-soft); font-size: 16px; line-height: 1.55; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -1px;
  width: 30px; height: 30px; border-radius: 50%; background: var(--peach-soft); color: var(--accent);
  font-weight: 700; font-family: var(--font-display); display: grid; place-items: center; font-size: 14px;
}
.step-label { display: block; font-weight: 700; color: var(--ink); margin-bottom: 2px; }

/* callout card — wrap a section (e.g. "How to use it") to make it stand out */
.res-callout { background: var(--surface); border: 1px solid var(--surface-line); border-radius: var(--radius); padding: 26px 30px; margin: 18px 0; box-shadow: var(--shadow-card); }
.res-callout > .res-h2:first-child { margin-top: 0; }
.res-callout .steps { margin: 0; }
.res-callout .steps li:last-child { padding-bottom: 0; }
@media (max-width: 600px) { .res-callout { padding: 22px 20px; } }

/* ===== prompt / code block (light, header row + clipboard copy) ===== */
.promptbox { margin: 16px 0; border: 1px solid var(--surface-line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.promptbox-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--surface-line); background: #fff; }
.promptbox-label { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-mute); }
.promptbox-copy { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; cursor: pointer; font-family: var(--font-body); font-size: 13px; font-weight: 600; color: var(--ink-soft); padding: 4px 8px; border-radius: 8px; }
.promptbox-copy:hover { color: var(--accent); background: var(--peach-soft); }
.promptbox-copy svg { width: 15px; height: 15px; }
.promptbox-copy.copied { color: var(--accent); }
.promptbox-body { padding: 16px 18px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; line-height: 1.7; color: var(--ink); white-space: pre-wrap; word-break: break-word; max-height: 440px; overflow: auto; background: #EFEBE4; }

/* responsive video embed (16:9) */
.video-embed { position: relative; max-width: 100%; aspect-ratio: 16/9; margin: 20px 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-card); background: var(--espresso); }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* embedded interactive tool shell */
.res-tool { max-width: 100%; margin: 4px 0; }

/* ===== PDF download callout (top = horizontal; bottom = centered) ===== */
.pdf-callout {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--surface-line); border-radius: 14px;
  padding: 15px 20px; max-width: 100%; margin: 18px 0;
}
.pdf-callout .pc-left { display: flex; align-items: center; gap: 14px; }
.pdf-callout .pc-ic { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 10px; background: var(--peach-soft); color: var(--accent); display: grid; place-items: center; font-size: 19px; }
.pdf-callout .pc-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.pdf-callout .pc-free { font-family: var(--font-body); font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--accent); }
.pdf-callout .pc-sub { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }
.pdf-callout--bottom { flex-direction: column; text-align: center; gap: 4px; padding: 30px 24px; max-width: 560px; margin: 28px auto 0; }
.pdf-callout--bottom .pc-ic { margin: 0 auto 8px; }
.pdf-callout--bottom .pc-title { justify-content: center; font-size: 20px; }
.pdf-callout--bottom .pc-sub { font-size: 14px; }
.pdf-callout--bottom .btn { margin-top: 14px; }

/* inline newsletter strip (reusable on any page) */
.news-strip { background: var(--peach-soft); }
.news-strip .ns-inner { text-align: center; max-width: 640px; margin: 0 auto; }
.news-strip h2 { font-size: calc(clamp(28px, 4vw, 42px) * var(--h-scale)); font-weight: var(--h-weight); letter-spacing: var(--h-tracking); line-height: 1.1; }
.news-strip p { margin-top: 14px; color: var(--ink-soft); font-size: 17px; }
.news-form { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.news-form input {
  flex: 1; min-width: 240px; max-width: 340px; padding: 14px 18px; border-radius: 12px;
  background: #fff; border: 1px solid var(--surface-line); font-size: 15px; font-family: inherit;
}
.news-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(201,113,69,0.15); }
.news-meta { margin-top: 16px; color: var(--ink-mute); font-size: 13px; }

/* related resources */
.related-head { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: var(--h-tracking); margin-bottom: 22px; }

/* ===================== LIBRARY GRID PAGE ===================== */
.lib-head { padding: 56px 0 8px; text-align: center; max-width: 720px; margin: 0 auto; }
.lib-head .eyebrow { display: block; margin-bottom: 16px; }
.lib-head h1 { font-size: calc(clamp(34px, 5vw, 56px) * var(--h-scale)); line-height: 1.06; font-weight: var(--h-weight); letter-spacing: var(--h-tracking); }
.lib-head p { margin-top: 16px; color: var(--ink-soft); font-size: 18px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 32px auto 8px; max-width: 900px; }
.filter-btn {
  font-family: var(--font-body); font-size: 14px; font-weight: 600; padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--surface-line); background: var(--surface); color: var(--ink-soft); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.filter-btn:hover { color: var(--ink); }
.filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.lib-note { text-align: center; color: var(--ink-soft); font-size: 16px; margin-top: 40px; }

/* ===================== MOTION ===================== */
@keyframes riseIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
.rise { opacity: 0; animation: riseIn .7s cubic-bezier(.2,.7,.3,1) forwards; }
.d1 { animation-delay: .05s; } .d2 { animation-delay: .15s; } .d3 { animation-delay: .25s; }
.d4 { animation-delay: .35s; } .d5 { animation-delay: .45s; }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1); }
.reveal.in { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise, .reveal { opacity: 1 !important; transform: none !important; animation: none !important; transition: none !important; }
  .btn:hover, .card:hover, .socials a:hover { transform: none !important; }
}
