/*
Theme Name: Numisbot
Theme URI: https://numisbot.com/
Author: Matt Dinger
Description: The home of NUMI, a numismatist's assistant. The chat is front and center on the home page; Ask NUMI, Contact and account pages (ProfilePress sign in and join) have their own templates. Texts are edited under Appearance → Customize → Numisbot.
Version: 1.3.1
Requires at least: 6.2
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: numisbot
*/

/* ---------- Tokens: cobalt and white ---------- */
:root {
  --paper: #ffffff;
  --paper-2: #f2f6fd;
  --card: #ffffff;
  --ink: #0d1b3d;
  --ink-2: #33415e;
  --muted: #64708a;
  --line: #d9e2f2;
  --gold: #2a62c9;        /* accent: lighter cobalt for labels, rules and the reeded edge */
  --gold-soft: #e8effd;
  --navy: #0047ab;        /* cobalt: buttons and the chat header */
  --navy-ink: #ffffff;
  --navy-soft: #e3ecfc;
  --copper: #8a5a35;      /* only where the coin itself is */
  --ok: #1f6b45;
  --warn: #a33a22;
  --shadow: 0 1px 2px rgba(0, 41, 102, 0.06), 0 16px 40px rgba(0, 41, 102, 0.10);
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 14px;
  --wrap: 1180px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #071330;
    --paper-2: #0b1a40;
    --card: #0e2050;
    --ink: #eef3ff;
    --ink-2: #c4d0ea;
    --muted: #93a1c2;
    --line: #1f3466;
    --gold: #7aa2ff;
    --gold-soft: #16295a;
    --navy: #3d7bff;
    --navy-ink: #ffffff;
    --navy-soft: #16295a;
    --copper: #d29a6a;
    --ok: #7cc39a;
    --warn: #f0a08a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 16px 40px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.6 var(--sans); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
img { max-width: 100%; height: auto; }
a { color: var(--navy); text-underline-offset: 3px; }
a:hover { color: var(--gold); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.12; letter-spacing: -0.01em; text-wrap: balance; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); font-variation-settings: "opsz" 120; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-variation-settings: "opsz" 72; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: var(--card); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.eyebrow { font: 600 0.75rem/1.2 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin: 0 0 14px; display: flex; gap: 10px; align-items: center; }
.eyebrow::before { content: ""; width: 26px; height: 1px; background: currentColor; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 999px; font: 600 0.95rem/1 var(--sans); text-decoration: none; border: 1px solid transparent; cursor: pointer; }
.btn-solid { background: var(--navy); color: var(--navy-ink); }
.btn-solid:hover { color: var(--navy-ink); filter: brightness(1.12); }
.btn-line { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-line:hover { border-color: var(--gold); color: var(--ink); }

/* Reeded edge: the milled rim of a coin, used as a rule and a frame */
.reeded { height: 8px; background: repeating-linear-gradient(90deg, var(--gold) 0 2px, transparent 2px 6px); opacity: 0.55; }

/* ---------- Header ---------- */
.site-head { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 90%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 22px; min-height: 68px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-name { font: 600 1.35rem/1 var(--serif); letter-spacing: 0.06em; }
.brand .custom-logo { max-height: 40px; width: auto; }
.nav { flex: 1; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px 22px; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: 0.95rem; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav .current-menu-item > a, .nav .current_page_item > a { color: var(--ink); border-bottom-color: var(--gold); }
.account { display: flex; gap: 10px; align-items: center; }
.account .btn { padding: 9px 16px; font-size: 0.9rem; }
.account .hello { color: var(--muted); font-size: 0.9rem; }
@media (max-width: 760px) {
  .site-head { position: static; }
  .site-head .wrap { gap: 10px 16px; padding-block: 12px; }
  .nav { order: 3; flex-basis: 100%; }
  .nav ul { gap: 4px 18px; }
  .account { margin-left: auto; }
}

/* ---------- Home: hero with the chat ---------- */
.hero { padding: clamp(32px, 6vw, 72px) 0 clamp(40px, 6vw, 80px); background: radial-gradient(1100px 520px at 85% 0%, var(--navy-soft), transparent 70%), var(--paper); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.hero-copy { padding-top: clamp(0px, 3vw, 36px); }
.hero-copy .lede { font-size: 1.15rem; color: var(--ink-2); max-width: 34em; }
.try { margin: 26px 0 0; }
.try-label { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: 500 0.9rem/1.3 var(--sans); text-align: left; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.chip:hover { border-color: var(--gold); background: var(--gold-soft); }
.curator { display: flex; gap: 12px; align-items: center; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 0.95rem; }
.curator svg { flex: none; width: 40px; height: 40px; }
.curator .coin-thumb { flex: none; width: 48px; height: 48px; border-radius: 50%; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18); }
.curator b { color: var(--ink); }

/* The chat sits in a struck rim */
.chat-frame { position: relative; border-radius: calc(var(--radius) + 10px); padding: 10px; background: var(--card); box-shadow: var(--shadow); border: 1px solid var(--line); }
.chat-frame::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 4px; background: repeating-linear-gradient(90deg, var(--gold) 0 1.5px, transparent 1.5px 5px); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0.45; pointer-events: none; }
.chat-frame .numi-chat {
  --numi-accent: var(--navy);
  --numi-accent-ink: var(--navy-ink);
  --numi-accent-soft: var(--navy-soft);
  --numi-surface: var(--card);
  --numi-paper: var(--paper);
  --numi-ink: var(--ink);
  --numi-muted: var(--muted);
  --numi-line: var(--line);
  --numi-silver: var(--muted);
  --numi-font: var(--sans);
}
.chat-frame .numi-panel { max-width: none; height: min(620px, 78vh); border-radius: var(--radius); }
.chat-frame .numi-title { font-family: var(--serif); font-weight: 600; letter-spacing: 0.02em; }
.chat-missing { padding: 28px; text-align: center; color: var(--muted); }
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  /* On phones the chat comes right after the introduction; examples and the curator line follow it. */
  .hero-copy { display: contents; }
  .hero-copy > * { margin-bottom: 0; }
  .hero .eyebrow, .hero h1, .hero .lede { order: 1; }
  .hero .chat-frame { order: 2; margin-top: 6px; }
  .hero .try { order: 3; margin-top: 8px; }
  .hero .curator { order: 4; margin-top: 4px; }
  .chat-frame .numi-panel { height: min(560px, 80vh); }
}

/* ---------- Home: what to ask, how NUMI answers ---------- */
.band { padding: clamp(44px, 7vw, 88px) 0; }
.band-alt { background: var(--paper-2); border-block: 1px solid var(--line); }
.band-head { max-width: 640px; margin-bottom: 30px; }
.band-head p { color: var(--ink-2); }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card .mint { font: 600 0.72rem/1 var(--sans); letter-spacing: 0.14em; color: var(--gold); text-transform: uppercase; }
.card p { color: var(--ink-2); margin: 0; }
.card .ask { margin-top: auto; padding-top: 10px; }
.card .ask .chip { width: 100%; border-radius: 10px; font-size: 0.88rem; }
.how { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.coin-figure { margin: 0; display: grid; justify-items: center; gap: 14px; text-align: center; }
.coin-figure img { width: min(100%, 360px); aspect-ratio: 1; border-radius: 50%; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18), 0 22px 50px rgba(0, 41, 102, 0.22); transform: rotate(-6deg); transition: transform 0.6s ease; }
.coin-figure:hover img { transform: rotate(0deg); }
.coin-figure figcaption { font-size: 0.85rem; color: var(--muted); max-width: 30ch; }
.coin-figure figcaption b { display: block; font-family: var(--serif); font-size: 1rem; color: var(--ink); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .coin-figure img { transition: none; } }
@media (max-width: 860px) { .how { grid-template-columns: minmax(0, 1fr); } .coin-figure { order: -1; } .coin-figure img { width: min(70%, 260px); } }
.points { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px 40px; list-style: none; margin: 0; padding: 0; }
.points li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; }
.points .n { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--gold); color: var(--gold); display: grid; place-items: center; font: 600 0.85rem/1 var(--serif); }
.points b { display: block; font-family: var(--serif); font-size: 1.1rem; font-weight: 600; margin-bottom: 2px; }
.points span { color: var(--ink-2); }
/* Coin expert in your pocket: a cobalt band with a phone showing NUMI */
.pocket { position: relative; overflow: hidden; color: #fff; background: radial-gradient(900px 500px at 15% 0%, #1d63d6 0%, transparent 60%), linear-gradient(135deg, #0047ab 0%, #00307a 100%); padding: clamp(52px, 8vw, 104px) 0; }
.pocket::before { content: ""; position: absolute; inset: auto -10% -60% auto; width: 760px; height: 760px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.12); box-shadow: 0 0 0 40px rgba(255, 255, 255, 0.03), 0 0 0 80px rgba(255, 255, 255, 0.025); pointer-events: none; }
.pocket .wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.pocket .eyebrow { color: #a9c6ff; }
.pocket h2 { color: #fff; font-size: clamp(2.2rem, 4.8vw, 3.6rem); margin-bottom: 0.4em; }
.pocket-copy p { color: rgba(255, 255, 255, 0.86); font-size: 1.12rem; max-width: 36em; }
.pocket-actions { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: center; margin-top: 26px; }
.btn-light { background: #fff; color: #0047ab; }
.btn-light:hover { color: #00307a; background: #eaf1ff; }
.btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.45); }
.btn-ghost:hover { color: #fff; border-color: #fff; background: rgba(255, 255, 255, 0.08); }
.soon { display: inline-flex; align-items: center; gap: 8px; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #cfe0ff; padding: 7px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); }
.soon::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #7fe0a8; box-shadow: 0 0 0 3px rgba(127, 224, 168, 0.25); }
.phone { justify-self: center; width: min(300px, 80vw); aspect-ratio: 9 / 18.5; border-radius: 42px; padding: 11px; background: linear-gradient(160deg, #e9eef8, #b9c4d8); box-shadow: 0 30px 70px rgba(0, 12, 40, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.7); transform: rotate(3deg); }
.phone-screen { height: 100%; border-radius: 32px; overflow: hidden; background: #f4f7fd; display: flex; flex-direction: column; color: #0d1b3d; }
.phone-bar { display: flex; align-items: center; gap: 8px; padding: 30px 16px 12px; background: #0047ab; color: #fff; font: 600 0.95rem/1 var(--serif); }
.phone-mark { width: 22px; height: 22px; }
.phone-chat { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 16px 12px; font-size: 0.78rem; line-height: 1.45; }
.bub { padding: 9px 11px; border-radius: 12px; max-width: 88%; }
.bub.you { align-self: flex-end; background: #dbe7ff; border-top-right-radius: 3px; }
.bub.numi { align-self: flex-start; background: #fff; border: 1px solid #d9e2f2; border-top-left-radius: 3px; }
.phone-input { margin: 0 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 12px; border: 1px solid #d9e2f2; border-radius: 999px; background: #fff; font-size: 0.75rem; color: #7a86a0; }
.phone-input i { width: 24px; height: 24px; border-radius: 50%; background: #0047ab; }
@media (max-width: 860px) { .pocket .wrap { grid-template-columns: minmax(0, 1fr); } .phone { width: min(260px, 72vw); transform: none; } }
@media (prefers-color-scheme: dark) { .pocket { background: radial-gradient(900px 500px at 15% 0%, #12408f 0%, transparent 60%), linear-gradient(135deg, #0a2a6b 0%, #061a45 100%); } }

.cta { text-align: center; }
.cta .wrap { max-width: 720px; }
.cta p { color: var(--ink-2); }
.cta .btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
@media (max-width: 860px) { .cards { grid-template-columns: minmax(0, 1fr); } .points { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Pages ---------- */
.page-head { padding: clamp(32px, 5vw, 60px) 0 10px; }
.page-head p { color: var(--ink-2); max-width: 40em; font-size: 1.08rem; }
.page-head .eyebrow { color: var(--gold); font-size: 0.75rem; }
.prose { max-width: 720px; padding-bottom: 60px; }
.prose > * { max-width: 100%; }
.prose h2 { margin-top: 1.6em; }
.prose img { border-radius: 10px; }
.entry-wide { padding-bottom: 60px; }

/* Ask NUMI page */
.ask-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; padding-bottom: 64px; align-items: start; }
.ask-layout .chat-frame .numi-panel { height: min(760px, calc(100vh - 220px)); min-height: 480px; }
.ask-side { position: sticky; top: 92px; display: grid; gap: 18px; }
.ask-side .card { padding: 20px; }
.ask-side .chips { flex-direction: column; }
.ask-side .chip { border-radius: 10px; }
@media (max-width: 900px) { .ask-layout { grid-template-columns: minmax(0, 1fr); } .ask-side { position: static; } }

/* Account pages (ProfilePress sign in / join) and contact: a centered card */
.form-page { padding: clamp(28px, 5vw, 56px) 0 72px; }
.form-card { max-width: 520px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); padding: clamp(22px, 4vw, 40px); box-shadow: var(--shadow); }
.form-card.wide { max-width: 680px; }
.form-card h1 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); text-align: center; }
.form-card .sub { text-align: center; color: var(--ink-2); }
.form-card .reeded { margin: 4px -4px 22px; }
.form-card label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
.form-card input[type="text"], .form-card input[type="email"], .form-card input[type="password"], .form-card input[type="url"], .form-card input[type="tel"], .form-card textarea, .form-card select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font: inherit;
}
.form-card input:focus, .form-card textarea:focus, .form-card select:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: transparent; }
.form-card input[type="submit"], .form-card button[type="submit"], .form-card .pp-submit-form, .form-card .ppress-submit-button {
  width: 100%; padding: 13px 18px; border: 0; border-radius: 999px; background: var(--navy); color: var(--navy-ink); font: 600 1rem/1 var(--sans); cursor: pointer; margin-top: 6px;
}
.form-card .field { margin-bottom: 16px; }
.form-card .hint { font-size: 0.85rem; color: var(--muted); }
.form-card .switch { text-align: center; margin-top: 18px; color: var(--ink-2); font-size: 0.95rem; }
.notice { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 0.95rem; }
.notice-ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.notice-err { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ProfilePress forms inherit the card's look whatever template they use */
.form-card [class*="pp-form-container"], .form-card [class*="ppress"] { font-family: var(--sans) !important; color: var(--ink) !important; background: transparent !important; box-shadow: none !important; border: 0 !important; max-width: 100% !important; padding: 0 !important; margin: 0 !important; }
.form-card [class*="pp-form-container"] input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
.form-card [class*="ppress"] input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]) {
  width: 100% !important; padding: 12px 14px !important; border: 1px solid var(--line) !important; border-radius: 10px !important; background: var(--paper) !important; color: var(--ink) !important; font: inherit !important; height: auto !important;
}
.form-card [class*="pp-form-container"] input[type="submit"], .form-card [class*="ppress"] input[type="submit"], .form-card [class*="pp-form-container"] button, .form-card [class*="ppress"] button[type="submit"] {
  width: 100% !important; padding: 13px 18px !important; border: 0 !important; border-radius: 999px !important; background: var(--navy) !important; color: var(--navy-ink) !important; font: 600 1rem/1 var(--sans) !important; height: auto !important; text-transform: none !important;
}
.form-card [class*="pp-form-container"] a, .form-card [class*="ppress"] a { color: var(--navy) !important; }
.form-card [class*="pp-form-container"] form > *, .form-card [class*="ppress"] form > * { margin-bottom: 14px !important; }
.form-card [class*="pp-form-container"] p, .form-card [class*="pp-form-action"] { text-align: center; }
.form-card [class*="pp-form-container"] .material-icons, .form-card [class*="ppress"] .material-icons { color: var(--muted) !important; }

/* ---------- Footer ---------- */
.site-foot { border-top: 1px solid var(--line); padding: 34px 0 calc(34px + env(safe-area-inset-bottom, 0px)); color: var(--muted); font-size: 0.9rem; }
.site-foot .wrap { display: flex; gap: 14px 28px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 18px; flex-wrap: wrap; }
.site-foot a { color: var(--ink-2); text-decoration: none; }
.site-foot a:hover { color: var(--gold); }
.site-foot .fine { flex-basis: 100%; font-size: 0.82rem; }

/* WordPress basics */
.alignwide { max-width: var(--wrap); }
.alignfull { width: 100%; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.wp-block-button__link { border-radius: 999px; background: var(--navy); color: var(--navy-ink); }

/* Get the iPhone app: App Store badge and QR code */
.get-app { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 26px; margin-top: 26px; }
.app-badge { display: inline-block; line-height: 0; border-radius: 9px; }
.app-badge img { display: block; height: 48px; width: auto; }
.app-badge:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.app-qr { display: flex; align-items: center; gap: 14px; padding: 10px 16px 10px 10px; border-radius: 16px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.18); }
.app-qr-code { width: 112px; height: 112px; padding: 8px; background: #fff; border-radius: 10px; image-rendering: pixelated; }
.app-qr-text { display: grid; gap: 4px; max-width: 12.5em; font-size: 0.92rem; line-height: 1.35; color: rgba(255, 255, 255, 0.86); }
.app-qr-text b { color: #fff; font-size: 1rem; }
.app-qr-icon { width: 40px; height: 40px; border-radius: 10px; }
.app-badge-foot img { height: 40px; }
.site-foot .app-badge-foot:focus-visible { outline-color: var(--ink); }
/* On a phone the badge is the way in; a QR code you would have to scan with the same phone isn't useful. */
@media (max-width: 860px), (hover: none) and (pointer: coarse) { .app-qr { display: none; } }
