/* WilliamFrank — brand stylesheet (first-draft site)
   Copper-led, editorial, serif. Source Serif 4 + Source Sans 3.
   Filled W on light; outline W on dark. White dominant; copper is the signature, not the flood. */

:root {
  --copper: #A56330;
  --copper-light: #C98E54;
  --burnt: #6E4220;
  --cream: #F7F1E8;
  --shark: #212323;
  --patina: #5F8B7A;
  --white: #FFFFFF;

  --ink: var(--shark);
  --muted: #5b5d5d;
  --rule: #e7e1d6;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --measure: 40rem;        /* reading width */
  --measure-wide: 46rem;   /* slightly wider editorial blocks */
  --wide: 64rem;           /* page width */
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: var(--serif); color: var(--ink); font-weight: 600; line-height: 1.18; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 600; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1.15rem; }
a { color: var(--copper); text-decoration: none; }
a:hover { color: var(--burnt); text-decoration: underline; text-underline-offset: 3px; }
strong { font-weight: 600; }
em { font-style: italic; }

.eyebrow {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--copper);
  margin: 0 0 1rem;
}

.lead { font-size: 1.22rem; color: var(--muted); font-family: var(--serif); font-style: italic; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 1.5rem; }
.measure { max-width: var(--measure); }
.measure-wide { max-width: var(--measure-wide); }
section { padding: 4.5rem 0; }
.rule { height: 1px; background: var(--rule); border: 0; margin: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(150%) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.site-header .bar { display: flex; align-items: center; justify-content: space-between; padding: 0.7rem 1.5rem; max-width: var(--wide); margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 0.6rem; }
.brand img { height: 62px; width: auto; display: block; }
.nav { display: flex; align-items: center; gap: 1.6rem; }
.nav a { color: var(--ink); font-size: 0.95rem; font-weight: 600; }
.nav a:hover { color: var(--copper); text-decoration: none; }
.nav .cta { background: var(--copper); color: #fff; padding: 0.5rem 1rem; border-radius: 2px; }
.nav .cta:hover { background: var(--burnt); color: #fff; }
@media (max-width: 640px){ .nav { gap: 1rem; } .nav .hide-sm { display:none; } .brand img { height: 52px; } }

/* ---------- Hero ---------- */
.hero { background: var(--cream); border-bottom: 1px solid var(--rule); position: relative; overflow: hidden; }
.hero .wrap { padding-top: 5rem; padding-bottom: 5rem; position: relative; z-index: 1; }
.hero h1 { max-width: 30ch; margin: 0 0 1.4rem; }
.hero .lead { max-width: 46ch; }
.hero-watermark { position: absolute; right: 10%; top: 50%; transform: translateY(-50%); width: 400px; max-width: 36%; opacity: 0.13; pointer-events: none; z-index: 0; }
@media (max-width: 760px){ .hero-watermark { right: 50%; transform: translate(50%, -50%); width: 300px; max-width: 78%; opacity: 0.06; } }

/* ---------- Buttons ---------- */
.btn { display: inline-block; font-family: var(--sans); font-weight: 700; font-size: 0.95rem; padding: 0.7rem 1.4rem; border-radius: 2px; cursor: pointer; }
.btn-primary { background: var(--copper); color: #fff; }
.btn-primary:hover { background: var(--burnt); color: #fff; text-decoration: none; }
.btn-ghost { border: 1px solid var(--copper); color: var(--copper); background: transparent; }
.btn-ghost:hover { background: var(--copper); color: #fff; text-decoration: none; }
.btn-row { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.8rem; }

/* ---------- Essay / article ---------- */
.article { padding-top: 3.5rem; padding-bottom: 4.5rem; }
.article .measure { margin: 0 auto; }
.article h1 { margin-bottom: 0.6rem; }
.article .byline { color: var(--muted); font-size: 0.95rem; margin-bottom: 2.2rem; }
.article h2 { margin: 2.6rem 0 0.9rem; }
.article p { font-size: 1.075rem; }
.article .standfirst { font-family: var(--serif); font-style: italic; font-size: 1.25rem; color: var(--muted); border-left: 3px solid var(--copper); padding-left: 1.1rem; margin: 0 0 2.2rem; }

/* companion-format links on an essay (listen / discuss) */
.companions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 0 0 2.4rem; }
.companions .clabel { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-right: 0.2rem; }
.chip { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.45rem 0.9rem; border-radius: 999px; border: 1px solid var(--rule); font-size: 0.85rem; font-weight: 600; color: var(--ink); background: #fff; }
a.chip { transition: border-color .15s, color .15s; }
a.chip:hover { border-color: var(--copper); color: var(--copper); text-decoration: none; }
.chip svg { width: 15px; height: 15px; fill: currentColor; }
.chip.soon { color: var(--muted); cursor: default; }
.chip.soon .tag { font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.8; margin-left: 0.1rem; }

/* ---------- Cards / lists ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.4rem; }
.card { border: 1px solid var(--rule); border-radius: 3px; padding: 1.5rem; background: #fff; display: block; }
.card .eyebrow { margin-bottom: 0.5rem; }
.card h3 { margin: 0 0 0.5rem; }
.card p { color: var(--muted); font-size: 0.98rem; margin: 0; }
.card.feature { border-color: var(--copper); background: var(--cream); }

/* clickable cards */
a.card { transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
a.card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(33,35,35,0.10); border-color: var(--copper); text-decoration: none; }
.card-cta { display: inline-flex; align-items: center; gap: 0.35rem; margin-top: 1.1rem; font-weight: 700; font-size: 0.9rem; color: var(--copper); }
.card-cta .arrow { transition: transform .15s ease; }
a.card:hover .card-cta .arrow { transform: translateX(4px); }
.card .soon { display: inline-block; margin-top: 1.1rem; font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

.essay-list { list-style: none; padding: 0; margin: 0; }
.essay-list li { padding: 1.5rem 0; border-bottom: 1px solid var(--rule); }
.essay-list li:first-child { padding-top: 0; }
.essay-list h3 { margin: 0 0 0.35rem; }
.essay-list .meta { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; }
.essay-list p { color: var(--muted); margin: 0.4rem 0 0; }

/* theme filter (content page) — left rail */
.content-layout { display: grid; grid-template-columns: 210px 1fr; gap: 2.6rem; margin-top: 2rem; align-items: start; }
.filter-rail { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 0.15rem; }
.filter-rail .frail-label { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.6rem; }
.fbtn { font-family: var(--sans); font-weight: 600; font-size: 0.93rem; text-align: left; padding: 0.5rem 0.85rem; border: 0; border-left: 2px solid transparent; border-radius: 0 6px 6px 0; background: transparent; color: var(--muted); cursor: pointer; transition: color .15s, background .15s, border-color .15s; }
.fbtn:hover { color: var(--copper); }
.fbtn.on { color: var(--ink); font-weight: 700; background: var(--cream); border-left-color: var(--copper); }
@media (max-width: 760px) {
  .content-layout { grid-template-columns: 1fr; gap: 1.2rem; }
  .filter-rail { position: static; flex-direction: row; flex-wrap: wrap; gap: 0.5rem; }
  .filter-rail .frail-label { flex-basis: 100%; margin-bottom: 0.1rem; }
  .fbtn { border: 1px solid var(--rule); border-radius: 999px; padding: 0.45rem 0.95rem; font-size: 0.85rem; }
  .fbtn.on { background: var(--copper); color: #fff; border-color: var(--copper); }
}

/* ---------- WilliamFrank — the AI (chat interface) ---------- */
.ai-panel { background: var(--shark); color: var(--cream); border-radius: 6px; padding: 2.5rem; }
.ai-head { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 0.6rem; }
.ai-head img { width: 44px; height: 44px; display: block; }
.ai-head .eyebrow { color: var(--copper-light); margin: 0; }
.ai-panel h2 { color: #fff; margin: 0.2rem 0 0.6rem; }
.ai-panel p.sub { color: #cfcac0; max-width: none; }
.ai-window { background: #1b1d1d; border: 1px solid #3a3d3d; border-radius: 10px; padding: 1.3rem; margin-top: 1.6rem; }
.ai-msg { display: flex; gap: 0.7rem; margin-bottom: 1rem; align-items: flex-start; }
.ai-msg:last-of-type { margin-bottom: 0; }
.ai-msg .who { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.68rem; font-weight: 700; }
.ai-msg.user .who { background: #3a3d3d; color: #cfcac0; }
.ai-msg.bot .who { background: var(--copper); color: #fff; }
.ai-msg .bubble { border-radius: 9px; padding: 0.7rem 0.95rem; font-size: 0.96rem; line-height: 1.5; }
.ai-msg.user .bubble { background: #262828; color: #fff; }
.ai-msg.bot .bubble { background: #2c2e2e; color: #d8d4cc; }
.ai-inputrow { display: flex; gap: 0.6rem; margin-top: 1.2rem; }
.ai-inputrow input { flex: 1; background: #262828; border: 1px solid #3a3d3d; border-radius: 7px; padding: 0.75rem 0.95rem; color: #fff; font-family: var(--sans); font-size: 0.96rem; }
.ai-inputrow input::placeholder { color: #8f8b83; }
.ai-send { background: var(--copper); border: 0; color: #fff; border-radius: 7px; padding: 0 1.2rem; font-weight: 700; cursor: not-allowed; }
.ai-note { display: block; margin-top: 0.9rem; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--copper-light); }

/* ---------- Subscribe ---------- */
.subscribe { background: var(--cream); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.sub-form { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.2rem; }
.sub-form input { flex: 1 1 240px; padding: 0.7rem 0.9rem; border: 1px solid #d8d0c2; border-radius: 2px; font-family: var(--sans); font-size: 1rem; background: #fff; }
.sub-form .note { flex-basis: 100%; color: var(--muted); font-size: 0.8rem; margin-top: 0.3rem; }
.sub-social { display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem; margin-top: 1.6rem; }
.sub-social .label { font-size: 0.9rem; color: var(--muted); flex-basis: 100%; margin-bottom: 0.2rem; }
.sub-social a { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--rule); background: #fff; display: grid; place-items: center; color: var(--shark); transition: transform .15s, border-color .15s, color .15s; }
.sub-social a:hover { border-color: var(--copper); color: var(--copper); transform: translateY(-2px); text-decoration: none; }
.sub-social a svg { width: 18px; height: 18px; fill: currentColor; display: block; }

/* ---------- Footer ---------- */
.site-footer { background: var(--shark); color: #cfcac0; padding: 3rem 0 2.4rem; }
.site-footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.site-footer img.lockup { height: 44px; margin-bottom: 1rem; }
.site-footer h4 { color: #fff; font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; margin: 0 0 0.8rem; }
.site-footer a { color: #cfcac0; display: block; margin-bottom: 0.5rem; font-size: 0.95rem; }
.site-footer a:hover { color: var(--copper-light); text-decoration: none; }
.site-footer .social a { display: block; margin-right: 0; }
.site-footer .disclaimer a { display: inline; color: #cfcac0; text-decoration: underline; }
.site-footer .disclaimer a:hover { color: var(--copper-light); }
.site-footer .disclaimer { grid-column: 1 / -1; border-top: 1px solid #3a3d3d; margin-top: 1.4rem; padding-top: 1.4rem; font-size: 0.82rem; color: #8f8b83; }
@media (max-width: 720px){ .site-footer .wrap { grid-template-columns: 1fr; } }


/* ---------- Custom contact form ---------- */
.wf-form { max-width: 34rem; margin-top: 1.4rem; }
.wf-form .wf-row { display: flex; gap: 0.8rem; }
.wf-form .wf-row .wf-field { flex: 1; }
.wf-field { display: flex; flex-direction: column; gap: 0.28rem; margin-bottom: 0.85rem; }
.wf-field > span { font-size: 0.8rem; font-weight: 600; color: var(--ink); }
.wf-field > span em { font-weight: 400; font-style: normal; color: var(--muted); }
.wf-form input, .wf-form select, .wf-form textarea {
  width: 100%; font-family: var(--sans); font-size: 0.95rem; color: var(--ink);
  padding: 0.5rem 0.65rem; border: 1px solid var(--rule); border-radius: 4px; background: #fff;
}
.wf-form select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%235b5d5d' stroke-width='1.3' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.6rem center; padding-right: 1.8rem; }
.wf-form textarea { resize: vertical; min-height: 5.5rem; line-height: 1.5; }
.wf-form input:focus, .wf-form select:focus, .wf-form textarea:focus { outline: none; border-color: var(--copper); box-shadow: 0 0 0 2px rgba(165,99,48,0.15); }
.wf-form button[type=submit] { margin-top: 0.2rem; }
.wf-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.wf-form-status { margin: 0.8rem 0 0; font-size: 0.9rem; min-height: 1.2em; }
.wf-form-status.ok { color: var(--patina); font-weight: 600; }
.wf-form-status.err { color: #b3402e; }
.wf-form .note { display: block; margin-top: 0.6rem; }
@media (max-width: 560px) { .wf-form .wf-row { flex-direction: column; gap: 0; } }
