/* Human Converter: design tokens and shared components.
   Every page loads this first. Taken from the design canvas:
   ground #ECEDEA, ink #121315, orange #FF5B1A, Archivo (wide, heavy display)
   and IBM Plex Mono for labels. Page-specific styles live in their own files. */

:root {
  --ground: #ECEDEA;
  --ground-2: #F4F5F2;
  --paper: #FFFFFF;
  --ink: #121315;
  --ink-2: #1E2024;
  --ink-3: #2A2D32;
  --text: #121315;
  --text-2: #2A2C30;
  --text-3: #3B3D42;
  --muted: #55585E;
  --line: #C9CBC6;
  --line-soft: #E1E2DE;
  --track: #D5D7D2;
  --orange: #FF5B1A;
  --orange-light: #FF8A5C;
  --orange-dark: #C2410C;

  /* On ink backgrounds */
  --on-ink: #ECEDEA;
  --on-ink-2: #C9CBC6;
  --on-ink-muted: #A9ACB2;
  --ink-line: #3B3D42;
  --ink-border: #5A5D63;

  --font-sans: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 24px;
  --border: 1.5px solid var(--ink);
  --gutter: clamp(16px, 4vw, 32px);
  --maxw: 1280px;

  --focus: 0 0 0 3px var(--paper), 0 0 0 6px var(--orange-dark);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--ink); }
a:hover { color: var(--orange-dark); }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--on-ink);
  padding: 10px 16px; border-radius: 999px; text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 12px; color: var(--on-ink); }

/* ---------- Layout ---------- */

.wrap { max-width: var(--maxw); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.wrap-narrow { max-width: 960px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.section { padding-top: clamp(64px, 9vw, 104px); padding-bottom: clamp(64px, 9vw, 104px); }
.section-paper { background: var(--paper); border-top: var(--border); border-bottom: var(--border); }
.section-ink { background: var(--ink); color: var(--on-ink); }
.section-orange { background: var(--orange); color: var(--ink); border-top: var(--border); }
[hidden] { display: none !important; }

/* ---------- Type ---------- */

.display {
  font-stretch: 125%;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.02;
}
.h-hero { font-size: clamp(56px, 10vw, 148px); line-height: 0.92; letter-spacing: -0.03em; }
.h-section { font-size: clamp(32px, 4vw, 52px); max-width: 980px; }
.h-card { font-size: clamp(24px, 2.4vw, 30px); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.eyebrow-accent { color: var(--orange-dark); }
.section-ink .eyebrow { color: var(--on-ink-muted); }
.mono { font-family: var(--font-mono); }
.lede { font-size: clamp(20px, 2vw, 24px); line-height: 1.4; color: var(--text-2); max-width: 560px; }
.muted { color: var(--text-3); }
.small { font-size: 15px; }
.tiny { font-size: 13px; }

/* ---------- Header and footer ---------- */

.site-header { border-bottom: var(--border); background: var(--ground); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 18px; padding-bottom: 18px; }

.logo {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink);
  font-stretch: 125%; font-weight: 800; font-size: 17px; letter-spacing: 0.04em;
}
.logo:hover { color: var(--ink); }
.logo svg { width: 26px; height: 26px; flex: none; }

.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; font-size: 15px; font-weight: 500; }
.site-nav a { text-decoration: none; }

.site-footer { background: var(--ink); color: var(--on-ink-2); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; padding-top: 40px; padding-bottom: 40px; font-size: 15px; }
.site-footer a { color: var(--on-ink-2); }
.site-footer a:hover { color: var(--orange-light); }
.site-footer .footer-name { font-stretch: 125%; font-weight: 800; letter-spacing: 0.04em; color: var(--on-ink); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 22px; border-radius: 999px; border: 1.5px solid transparent;
  font-family: inherit; font-size: 16px; font-weight: 700; line-height: 1.1;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-lg { min-height: 56px; padding: 0 30px; font-size: 18px; }
.btn-xl { min-height: 60px; padding: 0 32px; font-size: 20px; font-weight: 800; }
.btn-block { display: flex; width: 100%; }

.btn-primary { background: var(--orange); color: var(--ink); }
.btn-primary:hover { background: #ff6d33; color: var(--ink); }
.btn-dark { background: var(--ink); color: var(--on-ink); }
.btn-dark:hover { background: #26282c; color: var(--on-ink); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--paper); color: var(--ink); }
.btn-paper { background: var(--paper); color: var(--ink); border-color: var(--ink); font-size: 15px; font-weight: 600; padding: 0 18px; }
.btn-paper:hover { background: var(--ground-2); color: var(--ink); }
.btn-light { background: var(--on-ink); color: var(--ink); }
.btn-light:hover { background: #fff; color: var(--ink); }
.section-ink .btn-outline, .card-ink .btn-outline { color: var(--on-ink); border-color: var(--on-ink); }

.btn-link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0; background: none; border: none;
  font-family: inherit; font-size: 15px; color: inherit; text-decoration: underline; text-underline-offset: 4px; cursor: pointer;
}
.btn-link:hover { color: var(--orange-dark); }
.section-ink .btn-link:hover, .card-ink .btn-link:hover { color: var(--orange-light); }

/* ---------- Cards, pills and chips ---------- */

.card { background: var(--paper); border: var(--border); border-radius: var(--radius-lg); padding: 28px; }
.card-ink { background: var(--ink); color: var(--on-ink); border-radius: var(--radius-lg); padding: 28px; }
.card-outline { border: var(--border); border-radius: var(--radius-lg); padding: 28px; }

.pill {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  border: var(--border); border-radius: 999px; background: transparent;
  font-family: inherit; font-size: 15px; font-weight: 500; color: var(--ink);
  text-decoration: none; cursor: pointer;
}
.pill:hover { background: var(--paper); color: var(--ink); }

.chip { display: inline-flex; align-items: center; border-radius: 999px; padding: 6px 12px; font-size: 14px; background: var(--ground); color: var(--ink); }
.chip-outline { background: transparent; border: 1px solid var(--line); }
.card-ink .chip-outline, .section-ink .chip-outline { border-color: #4A4D53; color: var(--on-ink); }
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }

.tag-mono {
  flex: none; font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--orange-dark); border: 1px solid var(--orange-dark); border-radius: 999px; padding: 3px 9px;
}

.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--orange); flex: none; }
@media (prefers-reduced-motion: no-preference) {
  .live-dot.is-pulsing { animation: hc-pulse 1.6s ease-in-out infinite; }
}
@keyframes hc-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- Forms ---------- */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .label { font-size: 14px; font-weight: 600; }
.input, .select, .textarea {
  min-height: 48px; padding: 0 14px; width: 100%;
  background: var(--paper); color: var(--ink);
  border: var(--border); border-radius: var(--radius-sm);
  font-size: 16px;
}
.textarea { padding: 12px 14px; min-height: 160px; resize: vertical; line-height: 1.5; }
.select { padding: 0 12px; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { box-shadow: var(--focus); border-radius: var(--radius-sm); }
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--orange-dark); }
.field-hint { font-size: 13px; color: var(--muted); }
.field-error { font-size: 14px; color: var(--orange-dark); font-weight: 600; }

/* Inputs on ink backgrounds */
.on-ink .input, .on-ink .select { background: var(--ink-2); color: var(--on-ink); border-color: var(--ink-border); }
.on-ink .field label, .on-ink .label { color: var(--on-ink-2); font-weight: 500; }
.on-ink .field-hint { color: var(--on-ink-muted); }

/* ---------- Notices ---------- */

.notice {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px;
  border: var(--border); border-radius: var(--radius-sm); background: var(--paper); font-size: 15px;
}
.notice-error { border-color: var(--orange-dark); }
.notice-error::before { content: ''; flex: none; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--orange-dark); }

/* ---------- Dialog (hire and plan forms) ---------- */

dialog.hc-dialog {
  width: min(720px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: var(--border);
  border-radius: var(--radius-lg); background: var(--paper); color: var(--ink); overflow: auto;
}
dialog.hc-dialog::backdrop { background: rgba(18, 19, 21, .55); }

/* ---------- Cookie banner ---------- */

.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; max-width: 720px; margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 16px 20px;
  background: var(--ink); color: var(--on-ink); border-radius: var(--radius); font-size: 15px;
}
.cookie-banner p { flex: 1 1 320px; color: var(--on-ink-2); }
.cookie-banner a { color: var(--on-ink); }
.cookie-banner .cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; }
