/* Resource Algorithm Careers: design tokens and components */
:root {
  --ink: #0B1F3A;
  --ink-2: #13294B;
  --accent: #C2410C;
  --accent-hover: #A3360A;
  --accent-tint: #FFF1E8;
  --accent-border: #F6CDB5;
  --accent-text: #9A3412;
  --bg: #F5F6F8;
  --card: #FFFFFF;
  --border: #E3E6EB;
  --muted: #5B6472;
  --success: #0F766E;
  --success-bg: #ECFDF5;
  --error: #B42318;
  --error-bg: #FEF3F2;
  --radius-card: 12px;
  --radius-ctl: 8px;
  --max: 1160px;
  --font-head: 'Space Grotesk', 'Segoe UI', Arial, sans-serif;
  --font-body: 'Inter', 'Segoe UI', Arial, sans-serif;
}

*, *::before, *::after { 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: 15px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1 0 auto; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem); font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 600; }
h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 .75em; }
a { color: var(--accent-text); text-underline-offset: 2px; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.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: 16px; top: -48px; z-index: 100; background: var(--card); color: var(--ink); padding: 10px 14px; border-radius: var(--radius-ctl); }
.skip-link:focus { top: 12px; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .container { padding: 0 24px; } }
.muted { color: var(--muted); }

/* ---------- Header / footer ---------- */
.site-header { background: var(--ink); color: #fff; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-height: 44px; }
.brand:hover { color: #fff; }
.brand-mark { width: 40px; height: 40px; border-radius: 8px; background: #fff; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; flex: none; }
.brand-mark img { width: 40px; height: 40px; display: block; }
.brand-name { font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; letter-spacing: .01em; }
.brand-divider { width: 1px; height: 22px; background: rgba(255,255,255,.35); }
.brand-sub { font-family: var(--font-head); font-weight: 500; color: #F6CDB5; }
.header-link { color: #fff; text-decoration: none; font-size: .9rem; display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; white-space: nowrap; }
.header-link:hover { color: #F6CDB5; text-decoration: underline; }
@media (max-width: 520px) {
  .brand-name { font-size: .95rem; }
  .header-link { font-size: .8rem; }
  .brand-divider, .brand-sub { display: none; }
}
.site-footer { border-top: 1px solid var(--border); background: var(--card); margin-top: 48px; }
.footer-inner { padding-top: 20px; padding-bottom: 20px; color: var(--muted); font-size: .85rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.footer-inner p { margin: 0; }
.footer-inner a { color: var(--muted); display: inline-flex; min-height: 44px; align-items: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 18px; border-radius: var(--radius-ctl);
  border: 1px solid transparent; font: 600 .95rem/1.2 var(--font-body); text-decoration: none;
  cursor: pointer; transition: background-color .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-2); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); color: #fff; }
.btn-outline { background: var(--card); color: var(--ink); border-color: var(--border); }
.btn-outline:hover { border-color: var(--ink); color: var(--ink); }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { background: #912018; color: #fff; }
.btn-sm { min-height: 44px; padding: 8px 12px; font-size: .875rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }
.link-like { color: var(--accent-text); text-decoration: underline; }
.btn-link { background: none; border: 0; padding: 0 4px; min-height: 44px; color: var(--accent-text); font: inherit; text-decoration: underline; cursor: pointer; }

/* ---------- Cards, badges, chips ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; border: 1px solid; }
.badge-open { color: var(--success); background: var(--success-bg); border-color: #A7E3D0; }
.badge-closed { color: var(--muted); background: var(--bg); border-color: var(--border); }
.badge-failed { color: var(--error); background: var(--error-bg); border-color: #F9C7C2; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); font-size: .85rem; }
.chip-ctc { background: var(--accent-tint); border-color: var(--accent-border); color: var(--accent-text); font-weight: 600; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Home ---------- */
.hero { background: var(--ink); color: #fff; padding: 40px 0 48px; }
.hero h1 { color: #fff; max-width: 760px; }
.hero p { color: #D6DDE8; max-width: 760px; font-size: 1.02rem; margin: 0; }
.search-panel { margin-top: -28px; padding: 16px; display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .search-panel { grid-template-columns: 2fr 1fr 1fr; align-items: end; } }
.results-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 24px 0 12px; color: var(--muted); font-size: .9rem; }
.results-bar p { margin: 0; }
.job-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; list-style: none; padding: 0; margin: 0; }
@media (max-width: 360px) { .job-grid { grid-template-columns: 1fr; } }
.job-card { padding: 20px; display: flex; flex-direction: column; gap: 10px; height: 100%; }
.job-card h2 { font-size: 1.12rem; margin: 0; }
.job-card .company { color: var(--muted); font-weight: 500; margin: 0; }
.job-card .facts-inline { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.job-card .summary { color: var(--ink); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.job-card .card-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.job-card .card-meta { font-size: .8rem; color: var(--muted); line-height: 1.4; }
.empty-card { padding: 32px 24px; text-align: center; }
.empty-card .btn { margin-top: 8px; }
.skeleton { background: linear-gradient(90deg, #eceef2 25%, #f5f6f8 50%, #eceef2 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 6px; }
@keyframes sk { to { background-position: -200% 0; } }
.sk-title { height: 22px; width: 68%; }
.sk-sub { height: 16px; width: 45%; }
.sk-body { height: 60px; }
.m0 { margin: 0 !important; }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } * { scroll-behavior: auto !important; transition: none !important; } }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label, .field .label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.req { color: var(--accent); }
.optional { color: var(--muted); font-weight: 400; font-size: .85rem; }
.hint { color: var(--muted); font-size: .82rem; margin: -2px 0 4px; }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="url"], input[type="search"], select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid #C9CED6; border-radius: var(--radius-ctl);
  background: #fff; color: var(--ink); font: 400 15px/1.4 var(--font-body);
}
textarea { resize: vertical; min-height: 96px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.field.has-error input, .field.has-error select, .field.has-error textarea, .field.has-error .dropzone { border-color: var(--error); background: #fff; }
.field-error { color: var(--error); font-size: .85rem; margin: 4px 0 0; }
.field-row { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
@media (min-width: 480px) { .field-row { grid-template-columns: 1fr 1fr; } }
.checkbox { display: flex; gap: 10px; align-items: flex-start; }
.checkbox input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.checkbox label { font-weight: 400; font-size: .88rem; margin: 0; }
.form-alert { padding: 12px 14px; border-radius: var(--radius-ctl); background: var(--error-bg); color: var(--error); border: 1px solid #F9C7C2; margin-bottom: 14px; font-size: .9rem; }
.form-alert.info { background: var(--accent-tint); color: var(--accent-text); border-color: var(--accent-border); }
.form-note { color: var(--muted); font-size: .8rem; text-align: center; margin: 10px 0 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.dropzone { position: relative; border: 1.5px dashed #B8BEC8; border-radius: var(--radius-ctl); background: #FAFBFC; transition: border-color .15s, background .15s; }
.dropzone:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.dropzone.dragging { border-color: var(--accent); background: var(--accent-tint); }
.dropzone-label { display: flex !important; flex-direction: column; align-items: center; gap: 2px; padding: 18px 12px; cursor: pointer; text-align: center; font-weight: 500 !important; margin: 0 !important; min-height: 44px; }
.dropzone-title { font-size: .92rem; }
.dropzone-hint { color: var(--muted); font-size: .8rem; font-weight: 400; }
.dropzone-file { color: var(--success); font-size: .85rem; font-weight: 600; word-break: break-all; }
.more-fields { margin: 6px 0 14px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 4px 0; }
.more-fields summary { cursor: pointer; font-weight: 600; font-size: .9rem; min-height: 44px; display: flex; align-items: center; gap: 6px; }
.more-fields[open] summary { margin-bottom: 8px; }
.cf-turnstile { margin: 4px 0 14px; min-height: 65px; }

/* ---------- Job page ---------- */
.job-page { padding-top: 16px; }
.back-link { margin: 0 0 12px; }
.back-link a { display: inline-flex; min-height: 44px; align-items: center; gap: 6px; text-decoration: none; font-weight: 500; }
.job-layout { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }
@media (min-width: 960px) { .job-layout { grid-template-columns: minmax(0, 1fr) 380px; } .apply-panel { position: sticky; top: 16px; } }
.job-details { padding: 24px; }
@media (min-width: 768px) { .job-details { padding: 32px; } }
.job-head { margin-bottom: 16px; }
.job-head h1 { margin: 6px 0 4px; }
.job-company { font-size: 1.05rem; color: var(--muted); font-weight: 500; margin: 0 0 6px; }
.job-meta { color: var(--muted); font-size: .88rem; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.job-meta strong { color: var(--ink); font-weight: 600; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 0 0 24px; padding: 16px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-ctl); }
.fact dt { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.fact dd { margin: 2px 0 0; font-weight: 600; }
.job-section { margin-top: 24px; }
.job-section ul { padding-left: 20px; margin: 0 0 .75em; }
.job-section li { margin-bottom: 4px; }
.share { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.share-label { font-weight: 600; margin-right: 4px; }
.copy-status { color: var(--success); font-size: .85rem; font-weight: 600; }
.apply-panel { padding: 20px; }
@media (min-width: 768px) { .apply-panel { padding: 24px; } }
.panel-title { font-size: 1.2rem; }
.apply-success { text-align: center; padding: 12px 0; }
.apply-success:focus { outline: none; }
.success-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--success-bg); color: var(--success); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.preview-banner { background: var(--accent-tint); color: var(--accent-text); border-bottom: 1px solid var(--accent-border); text-align: center; padding: 10px 16px; font-weight: 600; }
.narrow-page { max-width: 720px; padding-top: 40px; }

/* ---------- Content pages ---------- */
.prose { padding: 24px; }
@media (min-width: 768px) { .prose { padding: 40px; } }
.prose h2 { margin-top: 1.4em; }
.prose ul { padding-left: 20px; }

/* ---------- Admin ---------- */
.admin-bar { background: var(--card); border-bottom: 1px solid var(--border); }
.admin-bar .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; min-height: 56px; }
.admin-bar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.admin-bar nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: var(--radius-ctl); text-decoration: none; color: var(--ink); font-weight: 500; }
.admin-bar nav a[aria-current="page"] { background: var(--bg); font-weight: 600; }
.admin-user { color: var(--muted); font-size: .88rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.admin-main { padding-top: 24px; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.page-head h1 { margin: 0; font-size: 1.6rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat { padding: 16px 18px; }
.stat .stat-label { color: var(--muted); font-size: .85rem; font-weight: 500; }
.stat .stat-value { font-family: var(--font-head); font-size: 2rem; font-weight: 700; line-height: 1.1; margin-top: 4px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar input[type="search"] { max-width: 320px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap:focus-visible { outline: 3px solid var(--accent); }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 880px; }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
table.data th { background: var(--bg); font-weight: 600; font-size: .82rem; color: var(--muted); white-space: nowrap; position: sticky; top: 0; }
table.data td.num { text-align: right; }
table.data tr:last-child td { border-bottom: 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.row-actions .btn { min-height: 36px; padding: 6px 10px; font-size: .82rem; }
@media (pointer: coarse) { .row-actions .btn { min-height: 44px; } }
.cell-title { font-weight: 600; }
.cell-sub { color: var(--muted); font-size: .8rem; }

dialog { border: 1px solid var(--border); border-radius: var(--radius-card); padding: 0; width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 24px); color: var(--ink); }
dialog::backdrop { background: rgba(11, 31, 58, .55); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--card); z-index: 1; }
.dialog-head h2 { margin: 0; }
.dialog-body { padding: 20px; }
.dialog-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 16px 20px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--card); }
.dialog-small { width: min(460px, calc(100vw - 24px)); }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.form-section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 8px 0 10px; padding-top: 8px; border-top: 1px solid var(--border); }
.internal { background: #FAFBFC; border: 1px dashed var(--border); border-radius: var(--radius-ctl); padding: 12px 12px 0; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--radius-ctl); z-index: 1000; max-width: calc(100vw - 32px); font-weight: 500; }
.toast.error { background: var(--error); }
.notice { padding: 12px 14px; border-radius: var(--radius-ctl); border: 1px solid var(--accent-border); background: var(--accent-tint); color: var(--accent-text); margin-bottom: 16px; font-size: .9rem; }
