/* July AI — AI Red Team job post + application.
   Layout follows a plain job-board post (title, details sidebar, Overview /
   Application tabs). Brand tokens come from www.gojuly.ai
   (julyai7.github.io: web/tailwind.config.js, web/src/index.css). */

:root {
  color-scheme: light;
  --bg: #fffefa;
  --surface: #ffffff;
  --sand: #f2ede4;
  --ink: #10131f;
  --body: #2b2e3a;
  --muted: #5d606c;
  --line: rgba(16, 19, 31, .1);
  --line-soft: rgba(16, 19, 31, .07);
  --accent: #1d3fae;
  --accent-soft: rgba(29, 63, 174, .07);
  --link: #1e4fd8;
  --error: #b42318;

  --font-serif: 'Young Serif', Georgia, serif;
  --font-sans: 'Archivo', system-ui, -apple-system, sans-serif;
  --font-logo: 'Calistoga', Georgia, serif;
  --silk: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button { font: inherit; }

.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: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 999px;
  background: var(--ink); color: var(--bg); text-decoration: none;
}
.skip-link:focus { top: 16px; }
:focus-visible { outline: 2px solid rgba(29, 63, 174, .5); outline-offset: 2px; }

/* ---------- Page frame ---------- */

.page { max-width: 1024px; margin: 0 auto; padding: 0 24px; }

.topbar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 32px 0 0;
}
.back {
  justify-self: start;
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; margin-left: -8px; border-radius: 50%;
  color: var(--accent); text-decoration: none;
  transition: background-color .3s var(--silk);
}
.back:hover { background: var(--accent-soft); }
.logo {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 5px 6px;
  font: 400 21px/1 var(--font-logo);
  color: var(--ink);
  border: 1px solid var(--ink);
  -webkit-text-stroke: .4px var(--ink);
  text-decoration: none; white-space: nowrap;
}

.title-row { padding: 52px 0 0; }
.title-row h1 {
  font: 400 clamp(28px, 3.4vw, 34px)/1.15 var(--font-serif);
  letter-spacing: -0.018em;
  text-wrap: balance;
}
.title-row p { margin-top: 6px; color: var(--muted); font-size: 15.5px; }

.layout {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  column-gap: 32px;
  padding-bottom: 72px;
}

/* ---------- Sidebar ---------- */

.sidebar { padding-top: 76px; }
.details { margin: 0; position: sticky; top: 24px; }
.detail { padding: 14px 4px 16px; border-bottom: 1px solid var(--line); }
.detail:first-child { padding-top: 0; }
.detail dt { font-size: 13px; font-weight: 500; color: var(--muted); }
.detail dd { margin: 4px 0 0; font-size: 16.5px; color: var(--ink); }

/* ---------- Tabs ---------- */

.tabs { display: flex; border-bottom: 1px solid var(--line-soft); margin-top: 22px; }
.tab {
  width: 200px; padding: 12px 0 14px;
  border: 0; background: none; text-align: left;
  font-size: 17px; font-weight: 500; color: var(--muted);
  text-decoration: none; cursor: pointer;
  box-shadow: inset 0 -2px 0 transparent;
  transition: color .3s var(--silk), box-shadow .3s var(--silk);
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.panel { padding-top: 30px; }
.panel[hidden] { display: none; }
.panel:focus { outline: none; }

/* ---------- Overview copy ---------- */

.copy { color: var(--body); font-size: 16.5px; line-height: 1.65; }
.copy h2 { font-size: 21px; font-weight: 600; line-height: 1.3; color: var(--ink); margin: 40px 0 8px; letter-spacing: -0.005em; }
.copy h2:first-child { margin-top: 0; }
.copy h3 { font-size: 16.5px; font-weight: 600; color: var(--ink); margin: 20px 0 6px; }
.copy p + p { margin-top: 10px; }
.copy strong { color: var(--ink); font-weight: 600; }
.copy a { color: var(--link); text-underline-offset: 3px; }
.copy ul { margin: 8px 0 0; padding-left: 22px; }
.copy li { padding-left: 4px; }
.copy li + li { margin-top: 6px; }
.copy li::marker { color: var(--muted); }
.copy .lead { font-size: 19px; line-height: 1.5; color: var(--ink); }

/* `.copy .apply-btn` outranks `.copy a`, which would otherwise turn the label link-blue. */
.copy .apply-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 52px; margin-top: 44px;
  border-radius: 999px; border: 1px solid var(--link);
  background: var(--link); color: #fff;
  font-size: 16px; font-weight: 600; letter-spacing: .01em;
  text-decoration: none; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 10px 24px -14px rgba(30, 79, 216, .6);
  transition: background-color .4s var(--silk), border-color .4s var(--silk), transform .4s var(--silk);
}
.copy .apply-btn:hover { background: var(--accent); border-color: var(--accent); transform: translateY(-1px); }

/* ---------- Footer ---------- */

.footer {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 24px 0 40px; border-top: 1px solid var(--line);
  font-size: 13.5px; color: var(--muted);
}
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--ink); }

/* ---------- Application form ---------- */

.progress { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.progress[hidden] { display: none; }
.progress-track { flex: 1; height: 3px; border-radius: 3px; background: var(--accent-soft); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--accent); transition: width .6s var(--silk); }
.progress-label { font-size: 13px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

form { margin: 0; }
.step[hidden] { display: none; }
.step.is-entering { animation: step-in .45s var(--silk); }
.step.is-entering.is-back { animation-name: step-in-back; }
@keyframes step-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes step-in-back { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

.q-num { font-size: 13px; font-weight: 600; color: var(--accent); letter-spacing: .02em; }
.q-num .req { color: var(--muted); font-weight: 500; }
.q-title { margin-top: 6px; font-size: 22px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; text-wrap: balance; }
.q-title:focus { outline: none; }
.q-desc { margin-top: 8px; color: var(--muted); font-size: 15.5px; line-height: 1.6; max-width: 62ch; }
.q-body { margin-top: 22px; }

.intro p { margin-top: 8px; color: var(--body); font-size: 16.5px; line-height: 1.65; max-width: 60ch; }
.meta {
  display: flex; flex-wrap: wrap; gap: 10px 24px;
  margin: 20px 0 0; padding: 0; list-style: none;
  color: var(--ink); font-size: 14.5px; font-weight: 500; line-height: 1.4;
}
.meta li { display: inline-flex; align-items: center; gap: 8px; }
.meta svg { flex: none; color: var(--accent); position: relative; top: -1px; }
.done-mark {
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  margin-bottom: 16px;
}

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field + .field, .row + .field { margin-top: 18px; }
.row > .field + .field { margin-top: 0; }
.lbl { display: block; font-size: 14.5px; font-weight: 600; margin-bottom: 6px; }
.lbl .opt { font-weight: 400; color: var(--muted); }
.input, .textarea {
  width: 100%;
  font: 400 16px/1.4 var(--font-sans); color: var(--ink);
  background: var(--surface);
  border: 1px solid rgba(16, 19, 31, .16);
  border-radius: 10px;
  padding: 11px 13px;
  transition: border-color .25s var(--silk), box-shadow .25s var(--silk);
}
.input::placeholder, .textarea::placeholder { color: rgba(93, 96, 108, .65); }
.input:hover, .textarea:hover { border-color: rgba(16, 19, 31, .28); }
.input:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(29, 63, 174, .12); }
.textarea { min-height: 150px; resize: vertical; }
.input[aria-invalid="true"] { border-color: var(--error); }

.choices { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.choices.cols-2 { grid-template-columns: 1fr 1fr; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice label {
  display: flex; align-items: center; gap: 12px;
  min-height: 46px; padding: 9px 14px 9px 10px;
  background: var(--surface);
  border: 1px solid rgba(16, 19, 31, .13);
  border-radius: 10px;
  font-size: 15.5px; line-height: 1.3;
  cursor: pointer;
  transition: border-color .25s var(--silk), background-color .25s var(--silk), box-shadow .25s var(--silk);
}
.choice label:hover { border-color: rgba(29, 63, 174, .45); }
.key {
  flex: none; width: 24px; height: 24px; border-radius: 6px;
  display: grid; place-items: center;
  border: 1px solid rgba(16, 19, 31, .15);
  font-size: 11.5px; font-weight: 600; color: var(--muted);
  transition: all .25s var(--silk);
}
.choice .check { margin-left: auto; opacity: 0; color: var(--accent); transition: opacity .25s var(--silk); }
.choice input:checked + label { border-color: var(--accent); background: rgba(29, 63, 174, .04); box-shadow: inset 0 0 0 1px var(--accent); }
.choice input:checked + label .key { background: var(--accent); border-color: var(--accent); color: #fff; }
.choice input:checked + label .check { opacity: 1; }
.choice input:focus-visible + label { box-shadow: 0 0 0 3px rgba(29, 63, 174, .2); border-color: var(--accent); }
/* Plain square checkbox (no letter key), used on the last step. */
.box {
  flex: none; width: 18px; height: 18px; margin: 1px 2px 0 4px; border-radius: 4px;
  display: grid; place-items: center;
  border: 1.5px solid rgba(16, 19, 31, .35); background: var(--surface);
  color: transparent;
  transition: background-color .2s var(--silk), border-color .2s var(--silk), color .2s var(--silk);
}
.checkbox-label { align-items: flex-start; }
.choice input:checked + label .box { background: var(--accent); border-color: var(--accent); color: #fff; }
.other-input { margin-top: 10px; }
.other-input[hidden] { display: none; }

.terms {
  margin-top: 16px; padding: 14px 16px;
  background: rgba(242, 237, 228, .6); border-radius: 10px;
  font-size: 14px; line-height: 1.6; color: var(--muted);
}

.link-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; margin-bottom: 16px;
  border: 1px solid rgba(16, 19, 31, .13); border-radius: 10px;
  text-decoration: none;
  transition: border-color .25s var(--silk), background-color .25s var(--silk);
}
.link-row:hover { border-color: var(--accent); background: rgba(29, 63, 174, .03); }
.link-row strong { display: block; font-size: 15.5px; font-weight: 600; }
.link-row .u { font-size: 13.5px; color: var(--muted); word-break: break-all; }
.link-row svg { margin-left: auto; flex: none; color: var(--accent); }
.how { margin: 0 0 18px; padding-left: 22px; color: var(--body); font-size: 15.5px; line-height: 1.55; }
.how li + li { margin-top: 6px; }
.email-echo:not(:empty)::before { content: " ("; }
.email-echo:not(:empty)::after { content: ")"; }
.email-echo { font-weight: 600; color: var(--ink); }
.callout { padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--ink); font-size: 15px; font-weight: 500; }
.intro .how { margin-bottom: 0; }
.intro .how + p { margin-top: 22px; }
a.btn { text-decoration: none; }

.drop {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  gap: 4px; min-height: 150px; padding: 22px;
  border: 1.5px dashed rgba(16, 19, 31, .2);
  border-radius: 10px;
  background: var(--surface);
  transition: border-color .25s var(--silk), background-color .25s var(--silk);
  cursor: pointer;
}
.drop[hidden] { display: none; }
.drop:hover, .drop.is-over { border-color: var(--accent); background: rgba(29, 63, 174, .03); }
.drop:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(29, 63, 174, .12); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop .icon { color: var(--accent); margin-bottom: 4px; }
.drop strong { font-weight: 600; font-size: 15.5px; }
.drop strong u { color: var(--link); text-decoration: none; }
.drop small { color: var(--muted); font-size: 13.5px; }
.drop[aria-invalid="true"] { border-color: var(--error); }
.file-chip {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px 10px 12px;
  background: var(--surface); border: 1px solid rgba(16, 19, 31, .13); border-radius: 10px;
}
.file-chip[hidden] { display: none; }
.file-chip .fi { width: 36px; height: 36px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; font-size: 11px; font-weight: 700; }
.file-chip .fn { min-width: 0; flex: 1; }
.file-chip .fn strong { display: block; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip .fn small { color: var(--muted); font-size: 13px; }
.icon-btn {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer;
}
.icon-btn:hover { color: var(--error); border-color: rgba(180, 35, 24, .35); }

.error { display: flex; align-items: center; gap: 8px; margin-top: 14px; color: var(--error); font-size: 14px; font-weight: 500; }
.error[hidden] { display: none; }
.field-error { margin-top: 5px; color: var(--error); font-size: 13.5px; font-weight: 500; }
.field-error:empty { display: none; }

.actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 28px; }
.actions[hidden] { display: none; }
.actions .right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.hint { font-size: 13px; color: var(--muted); }
.hint kbd { font: 600 12px var(--font-sans); padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line); background: var(--surface); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px; border-radius: 999px;
  border: 1px solid var(--link); background: var(--link); color: #fff;
  font-size: 15px; font-weight: 600; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 8px 20px -12px rgba(30, 79, 216, .6);
  transition: background-color .4s var(--silk), border-color .4s var(--silk);
}
.btn:hover { background: var(--accent); border-color: var(--accent); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn-quiet {
  display: inline-flex; align-items: center; gap: 6px;
  height: 44px; padding: 0 12px 0 8px; border-radius: 999px;
  border: 0; background: transparent; color: var(--muted);
  font-size: 15px; font-weight: 500; cursor: pointer;
  transition: color .25s var(--silk), background-color .25s var(--silk);
}
.btn-quiet:hover { color: var(--ink); background: rgba(16, 19, 31, .05); }
.btn-quiet[hidden] { display: none; }
.btn-link { color: var(--link); text-decoration: none; font-weight: 600; font-size: 15px; }
.spinner { width: 15px; height: 15px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.notice { margin-top: 28px; padding: 11px 14px; border-radius: 8px; background: #fff5e0; color: #7a4b00; font-size: 13.5px; line-height: 1.5; }
.notice[hidden] { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Small screens ---------- */

@media (max-width: 820px) {
  .page { padding: 0 16px; }
  .topbar { padding-top: 20px; }
  .title-row { padding-top: 32px; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { padding-top: 20px; order: 0; }
  .details { position: static; display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; }
  .detail, .detail:first-child { padding: 12px 0; }
  .main { order: 1; }
  .tab { width: auto; flex: 1; text-align: center; }
  .row, .choices.cols-2 { grid-template-columns: 1fr; }
  .hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .step.is-entering { animation: none; }
  * { transition-duration: .01ms !important; }
}

/* ---------- Saved drafts ---------- */
.save-state { font-size: 13px; color: var(--muted); white-space: nowrap; }
.save-state:empty { display: none; }
.save-state.is-error { color: var(--error); }
.link-btn {
  padding: 0; border: 0; background: none; font: inherit; font-weight: 600;
  color: var(--link); cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--accent); }
.field-note { margin-top: 6px; font-size: 13.5px; color: var(--muted); }
.field-note .link-btn { font-weight: 500; }
.input[readonly] { background: rgba(16, 19, 31, .03); color: var(--muted); }
.file-chip .spinner { flex: none; border-color: rgba(29, 63, 174, .18); border-top-color: var(--accent); }
.spinner[hidden] { display: none; }
