/* ============================================================
   Cognexis — Design tokens
   Layout concept: single-column editorial scroll. Hero states
   the thesis, then problem -> process -> offer -> candidates ->
   footer, each a full-bleed band alternating bg/bg-alt so the
   page reads in clear sections without borders or cards.
   ============================================================ */

:root {
  /* color */
  --bg: #f7f4ee;
  --bg-alt: #efeadf;
  --ink: #1a1d19;
  --ink-muted: #5c6057;
  --accent: #2f6b57;
  --accent-ink: #163b2f;
  --line: #ddd6c7;

  /* type */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }
[hidden] { display: none !important; }

a {
  color: inherit;
  text-decoration: none;
}

.wrap {
  max-width: 1440px;
  margin: 0 auto;
  padding-inline: clamp(20px, 5vw, 64px);
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0;
  text-wrap: balance;
  letter-spacing: -0.01em;
}

p { margin: 0; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 18px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: clamp(24px, 4vw, 48px);
  min-width: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 32px);
  min-width: 0;
}

.nav-links a:not(.btn) {
  font-size: 0.95rem;
  color: var(--ink-muted);
  white-space: nowrap;
}

.nav-links a:not(.btn):hover { color: var(--ink); }

.nav-cta {
  padding-inline: 34px;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 6px 0;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  border: none;
  appearance: none;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #f7f4ee;
}

.btn-primary:hover { transform: translateY(-1px); opacity: 0.92; }

.btn-ghost {
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn-ghost:hover { border-color: var(--ink-muted); }

/* ---------- sections ---------- */

section { padding-block: clamp(64px, 11vw, 120px); }
.band-alt { background: var(--bg-alt); }

.hero {
  padding-top: clamp(72px, 13vw, 140px);
}

.hero h1 {
  font-size: clamp(2.3rem, 5.2vw, 4rem);
  max-width: 18ch;
}

.hero-sub {
  margin-top: 24px;
  font-size: 1.15rem;
  color: var(--ink-muted);
  max-width: 54ch;
}

.hero-actions {
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}

/* ---------- section heads ---------- */

.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  margin-bottom: clamp(32px, 5vw, 56px);
}

.section-head h2 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  max-width: 20ch;
}

.section-head h2.no-wrap {
  max-width: none;
  white-space: nowrap;
}

.section-head .lede {
  max-width: 34ch;
  color: var(--ink-muted);
  font-size: 1.02rem;
  min-width: 0;
}

.section-head-stack {
  flex-direction: column;
  align-items: flex-start;
}

.section-head-stack .lede {
  max-width: 60ch;
  margin-top: 4px;
}

/* Explore page: no hero above this section anymore, so it's the first
   thing on the page — needs page-intro spacing, not another full section's
   worth of top padding stacked on top of nothing. */
#role-listings {
  padding-top: clamp(56px, 10vw, 96px);
}

/* "Explore Cognexis" is a small intro label, not the page's main heading —
   "Roles we're actively sourcing for" (h2) is what states the page's
   purpose, so it's the dominant heading instead. */
.explore-page-head h1 {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 8px;
}

.explore-page-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
  line-height: 1.15;
  color: var(--ink);
  margin: 0;
}

/* ---------- problem list ---------- */

.problem-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  border-top: 1px solid var(--line);
}

.problem-item {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  padding-right: 24px;
  min-width: 0;
}

.problem-item p:first-child {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.problem-item p:last-child {
  color: var(--ink-muted);
  font-size: 0.95rem;
}

/* ---------- process ---------- */

.process-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--line);
}

.process-item {
  border-bottom: 1px solid var(--line);
}

.process-trigger {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  width: 100%;
  padding-block: 26px;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.process-index {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--accent-ink);
}

.process-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
}

.process-panel {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.25s ease, opacity 0.2s ease;
}

.process-panel > p {
  overflow: hidden;
  color: var(--ink-muted);
  max-width: 56ch;
  padding-left: 80px;
}

.process-item:hover .process-panel,
.process-item:focus-within .process-panel,
.process-item.is-open .process-panel {
  grid-template-rows: 1fr;
  opacity: 1;
  padding-bottom: 26px;
}

/* ---------- compare table ---------- */

.table-scroll {
  overflow-x: auto;
}

.compare-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}

.compare-table th,
.compare-table td {
  text-align: left;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 0.98rem;
}

.compare-table thead th {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--ink-muted);
  padding-bottom: 14px;
}

.compare-table tbody td:first-child {
  color: var(--ink-muted);
}

.compare-table tbody td:last-child {
  font-family: var(--font-display);
  color: var(--accent-ink);
}

.compare-table th:first-child,
.compare-table td:first-child {
  padding-left: 0;
}

/* ---------- verticals ---------- */

.vertical-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  margin-top: clamp(28px, 4vw, 44px);
}

.vertical-item {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  padding-right: 24px;
  min-width: 0;
}

.vertical-item p:first-child {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.vertical-item p:last-child {
  color: var(--ink-muted);
  font-size: 0.95rem;
}

/* ---------- hire form ---------- */

.hire-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 28px;
  max-width: 780px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.form-row-wide {
  grid-column: 1 / -1;
}

.form-row label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.form-row input,
.form-row textarea {
  font-family: var(--font-body);
  font-size: 0.98rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 12px 14px;
  resize: vertical;
}

.form-row input:focus,
.form-row textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.form-note {
  font-size: 0.85rem;
  color: var(--ink-muted);
  max-width: 36ch;
}

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--line);
  padding-block: 40px;
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
}

.footer-left { max-width: 40ch; min-width: 0; }

.footer-left .logo { display: block; margin-bottom: 10px; }

.footer-left p {
  color: var(--ink-muted);
  font-size: 0.92rem;
}

.footer-right {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  font-size: 0.92rem;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 120px;
}

.footer-col .eyebrow { margin-bottom: 4px; }

.footer-col a { color: var(--ink-muted); }
.footer-col a:hover { color: var(--ink); }

.footer-bottom {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-muted);
}

/* ---------- role listings (uniform grid) ---------- */

.role-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.role-tile {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  min-width: 0;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.role-tile:hover,
.role-tile:focus-within {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.tile-card-link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-height: 96px;
  padding: 18px 20px;
  flex: 1;
  color: inherit;
  text-decoration: none;
}

.tile-card-link h3 {
  font-size: 1rem;
  line-height: 1.3;
}

.tile-rate {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.tile-apply-btn {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 8px 20px;
  text-decoration: none;
  text-align: center;
}

.tile-apply-btn:hover {
  background: var(--line);
}

.role-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

.role-chip {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
}

.role-chip-rate {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- role detail page (role.html) ---------- */

.role-detail-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

#role-content h1 {
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  max-width: 26ch;
}

.role-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 48px;
  align-items: start;
}

.role-layout .role-main {
  min-width: 0;
}

.role-layout .role-sidebar {
  position: sticky;
  top: 24px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 28px;
}

.role-layout .role-sidebar h2 {
  font-size: 1.2rem;
  margin-bottom: 4px;
}

#role-content .role-sourcing-note {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px 18px;
  font-size: 0.92rem;
  color: var(--ink-muted);
  margin-top: 24px;
  max-width: 68ch;
}

#role-body {
  max-width: 68ch;
  margin-top: 32px;
}

#role-body h3 {
  font-size: 1.1rem;
  margin: 28px 0 10px;
}

#role-body p {
  color: var(--ink-muted);
}

#role-body ul {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--ink-muted);
}

.role-quals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 32px;
}

/* ---------- apply form (shared CTA + role detail) ---------- */

.apply-band .apply-form {
  margin-top: 8px;
  width: 100%;
}

.apply-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 420px;
}

.apply-form .form-row {
  text-align: left;
}

.apply-form .form-actions {
  grid-column: unset;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.apply-form .btn { margin-top: 0; }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .hire-form { grid-template-columns: 1fr; }
  .vertical-list { grid-template-columns: repeat(2, 1fr); }
  .role-grid { grid-template-columns: repeat(2, 1fr); }
  .role-layout { grid-template-columns: 1fr; }
  .role-layout .role-sidebar { position: static; }
}

@media (max-width: 700px) {
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 20px clamp(20px, 5vw, 48px) 24px;
  }
  .nav-links { display: none; }
  .nav-links.is-open { display: flex; }
  .nav-toggle { display: inline-flex; }
  .process-trigger { grid-template-columns: 32px minmax(0, 1fr); gap: 14px; }
  .process-panel > p { padding-left: 46px; }
  .vertical-list { grid-template-columns: 1fr; }
  .role-grid { grid-template-columns: 1fr; }
}
