/* site.css — shared design system for the whole site: the marketing
   pages (landing page + /data-policy, /team, /guide, /methodology) and
   the app itself (static/index.html, served at /app). Page-specific
   rules (hero motion, job cards, auth forms, ...) live in each page's
   own <style> block and build on the tokens/components defined here. */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400&family=Public+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  /* Color — see the design plan: institute orange used sparingly,
     cool off-white ground (deliberately not cream), warm charcoal ink. */
  --bg: #FAFAF8;
  --surface: #F3F1EC;
  --ink: #1C1F26;
  --ink-secondary: #6B7280;
  --border: #E4E1DB;
  --accent: #F2703C;
  --accent-hover: #D85F2C;
  --accent-ink: #FFFFFF;
  --success: #2D8A5F;
  --success-bg: #E7F3ED;
  --error: #C0392B;
  --error-bg: #FBEAE8;
  --focus-ring: #F2703C;

  /* Type */
  --font-display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-body: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Consolas, monospace;

  --measure: 42rem;
  --measure-wide: 56rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161B;
    --surface: #1B1E25;
    --ink: #F2F1ED;
    --ink-secondary: #9AA1AC;
    --border: #2C2F38;
    --accent: #F2874F;
    --accent-hover: #FF9A63;
    --accent-ink: #14161B;
    --success: #4CAE80;
    --success-bg: #17271F;
    --error: #E0776A;
    --error-bg: #2B1917;
    --focus-ring: #F2874F;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 500;
  line-height: 1.2;
  text-wrap: balance;
  margin: 0;
}

p { margin: 0; }

code, pre, .mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

img { max-width: 100%; display: block; }

/* --- layout shell shared by every marketing page --- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.site-header.is-scrolled {
  border-bottom-color: transparent;
  box-shadow: 0 4px 20px -10px rgba(0, 0, 0, 0.18);
}

.site-header-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.wordmark .placeholder-flag { color: var(--accent); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.site-nav a {
  position: relative;
  text-decoration: none;
  font-size: 0.9rem;
  color: var(--ink-secondary);
  white-space: nowrap;
  padding-bottom: 3px;
}

.site-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transition: right 0.25s ease;
}

.site-nav a:hover { color: var(--ink); }
.site-nav a:hover::after, .site-nav a.current::after { right: 0; }

.site-nav a.current { color: var(--ink); font-weight: 600; }

.site-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 38px;
  height: 38px;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
}
.nav-toggle:hover { border-color: var(--ink-secondary); }

/* Collapse the nav + account/actions behind a hamburger toggle below this
   width - the header otherwise wraps into an increasingly cramped mess of
   links as the viewport narrows (worst on /app, whose nav-account content
   is dynamic/variable-width). Toggle button is the LAST child of
   .site-header-inner, so justify-content: space-between still lands it
   opposite the wordmark once the nav/actions in between are hidden. */
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }

  .site-nav,
  .site-nav-actions,
  #nav-account {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding-top: 4px;
  }

  /* #nav-account's own page (static/index.html) redefines #nav-account
     unconditionally in its own <style> block, loaded after this
     stylesheet - same ID specificity, later source order would otherwise
     win and silently defeat the collapse on that one page. !important
     here is a deliberate, narrow override of that one competing rule,
     not a general pattern used elsewhere in this stylesheet. */
  #nav-account { display: none !important; align-items: flex-start !important; }

  .site-header.nav-open .site-nav,
  .site-header.nav-open .site-nav-actions,
  .site-header.nav-open #nav-account {
    display: flex !important;
  }

  .site-nav a { padding: 4px 0; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 3px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 55%, transparent);
}

.btn-quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--border);
}
.btn-quiet:hover { border-color: var(--ink-secondary); }

.btn-outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn-outline:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-color: var(--accent-hover);
  color: var(--accent-hover);
}

main { max-width: 72rem; margin: 0 auto; padding: 0 24px; flex: 1 0 auto; width: 100%; }

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 96px;
}

.site-footer-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 32px 24px 48px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
  color: var(--ink-secondary);
  font-size: 0.85rem;
}

.site-footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
.site-footer a { text-decoration: none; color: var(--ink-secondary); }
.site-footer a:hover { color: var(--ink); }

/* --- structural devices: eyebrow + margin mark --- */

.eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.section {
  padding-left: 20px;
  border-left: 2px solid var(--border);
}

.section + .section { margin-top: 64px; }

/* --- the recurring motif: label / status chip / reasoning --- */

.chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 2px 9px;
  border-radius: 2px;
  white-space: nowrap;
}

.chip-direct { background: var(--error-bg); color: var(--error); }
.chip-indirect { background: #FBF1E6; color: #A15C1F; }
.chip-internal { background: var(--surface); color: var(--ink-secondary); border: 1px solid var(--border); }
.chip-not-pii { background: var(--success-bg); color: var(--success); }
.chip-neutral { background: var(--surface); color: var(--ink-secondary); border: 1px solid var(--border); }

.row-item {
  display: grid;
  grid-template-columns: minmax(140px, 220px) auto 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 14px 10px;
  margin: 0 -10px;
  border-radius: 2px;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.2s ease;
}

.row-item:hover { background-color: color-mix(in srgb, var(--accent) 6%, transparent); }

.row-item:last-child { border-bottom: none; }

.row-item .row-label {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink);
}

.row-item .row-reasoning {
  font-size: 0.92rem;
  color: var(--ink-secondary);
  grid-column: 1 / -1;
}

@media (min-width: 640px) {
  .row-item .row-reasoning { grid-column: 3; }
}

/* --- format list --- */

.format-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.format-chip {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 6px 12px;
  color: var(--ink);
  background: var(--surface);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.format-chip:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 6px 14px -8px color-mix(in srgb, var(--accent) 45%, transparent);
}

/* --- process steps --- */
/* A thread connects the numbered badges top to bottom, since this is a
   real ordered sequence (see the skill's numbered-markers carve-out) -
   not a decorative rail; it visually IS the sequence. */

.step-list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.step-list::before {
  content: '';
  position: absolute;
  left: 1.25rem;
  top: 1.25rem;
  bottom: 1.25rem;
  width: 1px;
  background: var(--border);
}

.step {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 16px;
}

.step-number {
  position: relative;
  z-index: 1;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--accent);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.step:hover .step-number { background: var(--accent); color: var(--accent-ink); }

.step h3 { font-size: 1.05rem; margin-bottom: 4px; }
.step p { color: var(--ink-secondary); font-size: 0.95rem; }

/* --- FAQ --- */

.faq-item + .faq-item { margin-top: 24px; }
.faq-item summary {
  font-family: var(--font-display);
  font-size: 1.05rem;
  cursor: pointer;
  color: var(--ink);
  list-style: none;
  transition: color 0.15s ease;
}
.faq-item summary:hover { color: var(--accent); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
  content: '+';
  color: var(--accent);
  font-family: var(--font-body);
  font-weight: 700;
  margin-right: 10px;
  display: inline-block;
  width: 0.8em;
}
.faq-item[open] summary::before { content: '–'; }
.faq-item p { margin-top: 10px; color: var(--ink-secondary); padding-left: 1.5em; }

/* --- contact form --- */

.contact-form { display: flex; flex-direction: column; gap: 14px; max-width: 32rem; }
.contact-form label { font-size: 0.85rem; color: var(--ink-secondary); display: block; margin-bottom: 4px; }
.contact-form input, .contact-form textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg);
  color: var(--ink);
}
.contact-form textarea { resize: vertical; min-height: 100px; }

/* --- prose (markdown-rendered content pages) --- */

.prose {
  max-width: var(--measure);
  font-size: 1.02rem;
}

.prose img {
  width: 112px;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
  margin-top: 32px;
}

.team-member {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-top: 32px;
}
.team-member img { margin-top: 0; flex-shrink: 0; }
.prose .team-member h3 { margin: 0 0 6px; }
.team-member p { margin: 4px 0; }
.team-member a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 480px) {
  .team-member { flex-direction: column; }
}
.prose h1 { font-size: 2.1rem; margin-bottom: 8px; }
.prose h2 { font-size: 1.45rem; margin: 48px 0 12px; }
.prose h3 { font-size: 1.1rem; margin: 32px 0 8px; }
.prose p { margin: 14px 0; color: var(--ink); }
.prose p, .prose li { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.3em; margin: 14px 0; }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--ink-secondary); }
.prose strong { font-weight: 600; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.prose blockquote {
  margin: 20px 0;
  padding: 4px 0 4px 18px;
  border-left: 2px solid var(--accent);
  color: var(--ink-secondary);
  font-style: italic;
}
.prose code {
  background: var(--surface);
  padding: 1px 5px;
  border-radius: 2px;
  font-size: 0.88em;
}
.prose pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 14px 16px;
  overflow-x: auto;
}
.prose pre code { background: none; padding: 0; }
.prose table {
  border-collapse: collapse;
  width: 100%;
  margin: 20px 0;
  font-size: 0.9rem;
  overflow-x: auto;
  display: block;
}
.prose th, .prose td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}
.prose th { font-weight: 600; background: var(--surface); }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 40px 0; }

.prose-meta {
  color: var(--ink-secondary);
  font-size: 0.85rem;
  margin-bottom: 32px;
}

.placeholder-note {
  border: 1px dashed var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg));
  border-radius: 3px;
  padding: 14px 16px;
  font-size: 0.9rem;
  color: var(--ink);
  margin: 20px 0;
}
.placeholder-note strong { color: var(--accent); }
