/* Pearl Prove — "proof desk" identity.
   Warm paper + ink + wax-seal red + brass. Distinct from the studio (lavender),
   commerce (mint), forge (amber), vault (sapphire), exchange (rose-gold),
   portfolio (slate) and rig (gunmetal) identities. */

:root {
  --paper: #f4ecdc;
  --paper-2: #efe4cc;
  --card: #fbf7ec;
  --ink: #221a12;
  --ink-soft: #57493a;
  --ink-faint: #6f6350;
  --line: #dccfae;
  --wax: #9c2b2e;          /* wax-seal red */
  --wax-deep: #7a1f22;
  --brass: #7d5f16;        /* brass */
  --brass-soft: #c9a24a;
  --green: #2f7a3d;
  --radius: 12px;
  --wrap: 1080px;
}

* { box-sizing: border-box; }

html { background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 20% -10%, rgba(169,126,31,.10), transparent 60%),
    radial-gradient(1000px 420px at 90% 0%, rgba(156,43,46,.07), transparent 55%),
    var(--paper);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--ink-soft); }
.small { font-size: .86em; }
code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .86em;
  background: rgba(34,26,18,.07);
  padding: .1em .35em;
  border-radius: 5px;
  word-break: break-all;
}

/* topbar */
.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(251,247,236,.85);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.topbar-in { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; padding-bottom: 12px; }
.brand { text-decoration: none; color: var(--ink); display: flex; align-items: baseline; gap: 10px; }
.pearl-glyph { color: var(--wax); font-size: 1.25em; }
.brand-name { font-size: 1.35em; font-weight: bold; letter-spacing: .01em; }
.brand-tag { color: var(--ink-faint); font-style: italic; font-size: .92em; }
.topnav { display: flex; gap: 16px; align-items: center; font-size: .95em; }
.topnav a { color: var(--ink-soft); text-decoration: none; }
.topnav a:hover { color: var(--wax); }
@media (max-width: 720px) {
  .topbar-in { flex-wrap: wrap; gap: 6px 14px; }
  .brand-tag { display: none; } /* topbar must fit 375px: brand + nav share the row */
  .topnav { gap: 12px; font-size: .88em; flex-wrap: wrap; }
}
.net-badge {
  border: 1px solid var(--brass-soft); color: var(--brass);
  border-radius: 999px; padding: 2px 12px; font-size: .82em; font-style: italic;
  background: rgba(169,126,31,.08);
}

/* hero */
.hero { padding: 44px 0 8px; }
.hero h1 { font-size: clamp(1.9em, 4vw, 2.7em); line-height: 1.15; margin: 0 0 14px; font-weight: bold; }
.hero h1 .accent { color: var(--wax); }
.lede { font-size: 1.08em; color: var(--ink-soft); max-width: 62ch; }
.honest-note {
  margin-top: 18px; padding: 14px 18px; border-left: 4px solid var(--brass);
  background: var(--card); border-radius: 0 var(--radius) var(--radius) 0;
  border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  max-width: 76ch;
}

/* tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 0; border-bottom: 2px solid var(--line); }
.tab {
  font: inherit; background: none; border: none; cursor: pointer;
  padding: 10px 20px; color: var(--ink-soft); border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--wax); border-bottom-color: var(--wax); font-weight: bold; }

/* panels */
.panel {
  background: var(--card); border: 1px solid var(--line); border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 26px 28px 30px; margin-bottom: 34px;
  box-shadow: 0 10px 30px rgba(34,26,18,.06);
}
.panel h2 { margin: 0 0 6px; font-size: 1.5em; }
.panel h3 { margin: 4px 0 10px; font-size: 1.12em; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
@media (max-width: 820px) { .grid2 { grid-template-columns: 1fr; } }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 820px) { .grid3 { grid-template-columns: 1fr; } }

label { display: block; margin: 14px 0 4px; font-weight: bold; font-size: .95em; }
input, textarea, select {
  width: 100%; margin-top: 6px; padding: 10px 12px; font: inherit; font-size: .95em;
  border: 1px solid var(--line); border-radius: 8px; background: #fffdf7; color: var(--ink);
}
input:focus, textarea:focus { outline: 2px solid var(--brass-soft); border-color: var(--brass); }
textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85em; resize: vertical; }

.row { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

.btn {
  font: inherit; font-size: .95em; cursor: pointer; border-radius: 8px;
  padding: 10px 18px; border: 1px solid var(--line); background: #fffdf7; color: var(--ink);
}
.btn:hover { border-color: var(--brass); }
.btn.primary { background: var(--wax); border-color: var(--wax-deep); color: #fff; font-weight: bold; }
.btn.primary:hover { background: var(--wax-deep); }
.btn.mode.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.mode-switch { display: flex; gap: 10px; margin: 16px 0 6px; }

/* proof walk */
.walk {
  border: 1px dashed var(--line); border-radius: 8px; padding: 14px 16px;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .82em;
  max-height: 420px; overflow-y: auto; background: #fffdf7; min-height: 120px;
}
.walk .step { margin: 0 0 10px; padding-bottom: 10px; border-bottom: 1px dotted var(--line); }
.walk .step:last-child { border-bottom: none; margin-bottom: 0; }
.walk .lvl { color: var(--brass); font-weight: bold; }
.walk .dir-l { color: var(--wax); font-weight: bold; }
.walk .dir-r { color: var(--green); font-weight: bold; }
.walk .h { word-break: break-all; }

/* verdicts */
.verdict {
  margin-top: 22px; padding: 16px 20px; border-radius: var(--radius);
  font-size: 1.05em; border: 2px solid;
}
.verdict.ok { border-color: var(--green); background: rgba(47,122,61,.08); }
.verdict.bad { border-color: var(--wax); background: rgba(156,43,46,.08); }
.verdict .big { font-size: 1.3em; font-weight: bold; display: block; margin-bottom: 4px; }
.verdict.ok .big { color: var(--green); }
.verdict.bad .big { color: var(--wax); }

.resultbox {
  margin-top: 20px; padding: 18px 20px; border: 1px solid var(--line);
  border-radius: var(--radius); background: #fffdf7;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85em;
  overflow-x: auto;
}
.resultbox .kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; margin: 8px 0; }
.resultbox .k { color: var(--ink-soft); font-family: Georgia, serif; }
.resultbox .v { word-break: break-all; }
.bigroot {
  font-size: 1.05em; background: rgba(169,126,31,.10); border: 1px solid var(--brass-soft);
  border-radius: 8px; padding: 12px 14px; margin: 10px 0; word-break: break-all;
}
.proofdump { white-space: pre-wrap; margin-top: 12px; }

.fieldgrid { display: grid; grid-template-columns: 170px minmax(0,1fr); gap: 8px 16px; margin: 12px 0; }
.fieldgrid .k { color: var(--ink-soft); font-family: Georgia, serif; }
.fieldgrid .v { word-break: break-all; overflow-wrap: anywhere; min-width: 0; } /* 64-hex values must wrap on small screens */
.fieldgrid .v { word-break: break-all; }
.workline { margin-top: 12px; padding: 12px 14px; border-radius: 8px; font-weight: bold; }
.workline.pass { background: rgba(47,122,61,.10); border: 1px solid var(--green); color: var(--green); }
.workline.fail { background: rgba(156,43,46,.10); border: 1px solid var(--wax); color: var(--wax); }

/* method cards */
.method { margin: 10px 0 40px; }
.method h2 { font-size: 1.4em; margin-bottom: 14px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px;
}
.card h3 { margin: 0 0 8px; color: var(--wax); font-size: 1.05em; }
.card p { margin: 0; font-size: .95em; color: var(--ink-soft); }

/* footer */
.sitefoot { border-top: 1px solid var(--line); padding: 26px 0 46px; margin-top: 10px; }
.foot-grid { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.sitefoot a { color: var(--wax); }
.donate .addr { cursor: pointer; display: inline-block; margin-left: 8px; }
.donate .addr:hover { border-color: var(--brass); }
.copied { color: var(--green); margin-left: 8px; font-size: .9em; }

.err { color: var(--wax); font-weight: bold; margin-top: 12px; }
.spin { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Keyboard focus: a visible ring in this app's accent on every interactive element (fleet focus-visible pass). */
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

/* Skip link: the first Tab stop on the page — parked off-screen until keyboard focus reveals it (fleet skip-link pass). */
.skip-link { position: absolute; left: 12px; top: -64px; z-index: 1000; padding: 10px 16px; border: 2px solid var(--brass-soft); border-radius: 8px; background: #0b0e14; color: var(--brass-soft); font-weight: 700; text-decoration: none; transition: top .15s ease; }
.skip-link:focus-visible { top: 12px; }
main:focus { outline: none; }

/* Reduced motion: when the OS asks for reduced motion, animations and transitions finish near-instantly and scrolling is not smoothed (fleet reduced-motion pass). Near-zero durations — not animation: none — so fade-ins still land on their end state and no content can be stranded invisible. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Touch targets (fleet WCAG 2.5.8 pass): standalone nav links measured 22-24px tall in the fleet probe — pad them past the 24px minimum. */
.topnav a { padding: 4px 6px; }
