/* =========================================================
   JBU — Core Team Recruitment
   Editorial "casting call" look: ink + paper, one vermilion accent.
   Self-contained: does not use style.css.
   ========================================================= */

:root {
    --ink: #111110;
    --ink-2: #1a1917;
    --ink-line: rgba(255, 255, 255, 0.12);
    --ink-text: #ece7de;
    --ink-muted: #9b968c;

    --paper: #f2eee6;
    --paper-2: #e8e2d6;
    --card: #fbf9f5;
    --text: #161513;
    --muted: #6d6961;
    --line: #d8d0c2;
    --line-strong: #bfb5a3;

    --accent: #c8372d;
    --accent-dark: #a32a21;
    --open: #2f6b3f;
    --wa: #1f7a45;

    --serif: 'Instrument Serif', 'Times New Roman', serif;
    --sans: 'Inter Tight', 'Inter', system-ui, -apple-system, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    --wrap: 1120px;
    --radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.55;
    color: var(--text);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.kicker {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    height: 48px; padding: 0 22px;
    border-radius: 999px; border: 1px solid transparent;
    font-size: 15px; font-weight: 500; letter-spacing: 0.005em;
    text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn svg { flex-shrink: 0; }
.btn-light { background: var(--ink-text); color: var(--ink); }
.btn-light:hover { background: #fff; }
.btn-outline-light { border-color: rgba(236, 231, 222, 0.35); color: var(--ink-text); }
.btn-outline-light:hover { border-color: var(--ink-text); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--accent); }
.btn-ink:disabled { background: var(--paper-2); color: var(--muted); cursor: not-allowed; }

/* ---------- Header + hero (ink) ---------- */
.top { background: var(--ink); color: var(--ink-text); }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 22px; padding-bottom: 22px; border-bottom: 1px solid var(--ink-line); }
.masthead .logo img { height: 42px; width: auto; }
.masthead-actions { display: flex; align-items: center; gap: 18px; }
.back-link { font-size: 14px; color: var(--ink-muted); text-decoration: none; }
.back-link:hover { color: var(--ink-text); }
.masthead .btn { height: 40px; padding: 0 18px; font-size: 14px; }

.hero { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 64px; padding-top: 84px; padding-bottom: 96px; align-items: end; }
.hero .kicker { color: var(--ink-muted); margin-bottom: 28px; }
.hero-title {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(48px, 7.2vw, 96px);
    line-height: 0.98;
    letter-spacing: -0.02em;
    color: #f6f2ea;
}
.hero-title em { font-style: italic; color: #fff; }
.hero-title .accent { color: var(--accent); font-style: italic; }
.hero-lede { margin-top: 28px; max-width: 540px; font-size: 18px; line-height: 1.6; color: #c9c3b8; }
.hero-cta { display: flex; gap: 12px; margin-top: 36px; flex-wrap: wrap; }

.facts { border-top: 1px solid var(--ink-line); }
.fact { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--ink-line); }
.fact dt { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted); padding-top: 2px; }
.fact dd { font-size: 15px; color: var(--ink-text); line-height: 1.5; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-muted); margin-right: 8px; vertical-align: 1px; }
.status-dot.live { background: #4f9a63; }

/* ---------- Sections (paper) ---------- */
.section { padding: 96px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-bottom: 48px; flex-wrap: wrap; }
.section-head .kicker { color: var(--accent); margin-bottom: 14px; }
.section-title { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 5.2vw, 64px); line-height: 1; letter-spacing: -0.015em; }
.section-title em { font-style: italic; }
.section-note { max-width: 360px; color: var(--muted); font-size: 15px; }

/* Principles */
.principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--text); }
.principle { padding: 28px 32px 8px 0; }
.principle + .principle { padding-left: 32px; border-left: 1px solid var(--line); }
.principle .num { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.principle h3 { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.1; margin: 18px 0 12px; }
.principle p { color: var(--muted); font-size: 15px; line-height: 1.65; }

/* Roles accordion */
.roles { border-top: 1px solid var(--text); }
.role { border-bottom: 1px solid var(--line); }
.role-row {
    width: 100%; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto 40px; align-items: center; gap: 16px;
    padding: 24px 0; background: none; border: none; text-align: left; cursor: pointer;
}
.role-num { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.role-name { font-family: var(--serif); font-size: clamp(26px, 3.2vw, 38px); line-height: 1.1; letter-spacing: -0.01em; }
.role-state { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--open); display: inline-flex; align-items: center; gap: 8px; }
.role-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.role.is-closed .role-state { color: var(--muted); }
.role-state { flex-direction: column; align-items: flex-end; gap: 7px; text-align: right; }
.role-state.is-off { flex-direction: row; align-items: center; }
.role-state:not(.is-off)::before { display: none; }
.spots-text { white-space: nowrap; }
.spots-bar { display: block; width: 132px; height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
.spots-bar span { display: block; height: 100%; background: var(--open); border-radius: 3px; }
.role-state.is-low { color: var(--accent); }
.role-state.is-low .spots-bar span { background: var(--accent); }
.role.is-closed .role-name { color: var(--muted); }
.role-toggle {
    width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-strong);
    display: grid; place-items: center; color: var(--text);
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.role-toggle svg { transition: transform 0.2s ease; }
.role-row:hover .role-toggle { border-color: var(--text); }
.role-row[aria-expanded="true"] .role-toggle { background: var(--text); border-color: var(--text); color: var(--paper); }
.role-row[aria-expanded="true"] .role-toggle svg { transform: rotate(45deg); }
.role.is-picked .role-name { color: var(--accent); }

.role-panel { display: grid; grid-template-columns: 64px minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; padding: 0 0 36px; }
.role-panel[hidden] { display: none; }
.role-summary { grid-column: 2; font-size: 19px; line-height: 1.6; color: #2b2925; }
.role-duties { grid-column: 3; padding-left: 32px; }
.role-duties .kicker { color: var(--muted); margin-bottom: 14px; display: block; }
.role-duties ol { list-style: none; counter-reset: duty; }
.role-duties li { counter-increment: duty; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.5; }
.role-duties li::before { content: counter(duty, decimal-leading-zero); font-family: var(--mono); font-size: 12px; color: var(--accent); padding-top: 3px; }
.role-actions { grid-column: 2 / -1; padding-top: 8px; }

.roles-loading { padding: 32px 0; color: var(--muted); }
.workflow-rule { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; margin-top: 40px; padding: 28px 32px; background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; }
.workflow-rule .kicker { color: var(--accent); padding-top: 4px; }
.workflow-text { font-size: 17px; line-height: 1.65; color: #2b2925; }

/* Process */
.process { background: var(--paper-2); }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; counter-reset: step; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.step .kicker { color: var(--accent); }
.step h3 { font-family: var(--serif); font-weight: 400; font-size: 30px; margin: 20px 0 10px; line-height: 1.1; }
.step p { color: var(--muted); font-size: 15px; line-height: 1.6; }

/* ---------- Form ---------- */
.apply { scroll-margin-top: 16px; }
.apply-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); gap: 64px; align-items: start; }
.apply-intro { position: sticky; top: 32px; }
.apply-intro .kicker { color: var(--accent); margin-bottom: 14px; }
.apply-intro p { margin-top: 20px; color: var(--muted); font-size: 16px; line-height: 1.65; }
.apply-intro ul { list-style: none; margin-top: 28px; border-top: 1px solid var(--line); }
.apply-intro li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.apply-intro li span:first-child { color: var(--muted); }

.form-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 8px 36px 36px; }
fieldset { border: none; padding: 28px 0 8px; }
fieldset + fieldset { border-top: 1px solid var(--line); }
legend { float: left; width: 100%; display: flex; align-items: baseline; gap: 14px; padding: 0; margin-bottom: 22px; }
legend + * { clear: both; }
legend .kicker { color: var(--accent); }
legend .legend-title { font-family: var(--serif); font-size: 28px; line-height: 1.1; }

.field { margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
label, .label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 8px; color: var(--text); }
.optional { color: var(--muted); font-weight: 400; }
.input {
    width: 100%; height: 52px; padding: 0 16px;
    background: #fff; border: 1px solid var(--line-strong); border-radius: 10px;
    font-size: 16px; color: var(--text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none; appearance: none;
}
.input::placeholder { color: #a49d90; }
.input:hover { border-color: #a89e8b; }
.input:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px rgba(17, 17, 16, 0.08); }
select.input {
    cursor: pointer; padding-right: 44px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23161513' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 16px center;
}
select.input:invalid { color: #a49d90; }
select.input option { color: var(--text); }
textarea.input { height: auto; min-height: 132px; padding: 14px 16px; line-height: 1.55; resize: vertical; }
.hint { margin-top: 6px; font-size: 13px; color: var(--muted); }
.hint.ok { color: var(--open); }
.hint.err { color: var(--accent-dark); }
.hint:empty { display: none; }
.phone-wrap { position: relative; }
.phone-prefix { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-size: 16px; color: var(--muted); pointer-events: none; }
.phone-wrap .input { padding-left: 56px; }
.verify-row { display: flex; gap: 10px; }
.verify-row .input { flex: 1; min-width: 0; }
.verify-btn { height: 52px; border-radius: 10px; padding: 0 20px; flex-shrink: 0; }
.verify-btn:disabled { background: var(--paper-2); color: var(--muted); cursor: not-allowed; }
.input[readonly] { background: #f6f2ea; color: var(--muted); }
.otp-box { margin-top: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #f6f2ea; }
.otp-msg { font-size: 14px; color: #3a3732; margin-bottom: 12px; }
.otp-input { letter-spacing: 0.4em; font-family: var(--mono); font-size: 18px; }
.otp-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; }
.link-btn { background: none; border: none; padding: 0; font-size: 14px; color: var(--text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:disabled { color: var(--muted); text-decoration: none; cursor: default; }
.verified-note { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 14px; font-weight: 500; color: var(--open); }
.verified-note[hidden], .otp-box[hidden], .verify-btn[hidden] { display: none; }
.otp-input:placeholder-shown { letter-spacing: normal; font-family: var(--sans); font-size: 16px; }
.verified-note .link-btn { margin-left: 6px; font-weight: 400; }
.role-brief { display: none; margin-top: 10px; padding: 14px 16px; border-left: 2px solid var(--accent); background: #f6f2ea; font-size: 14px; line-height: 1.6; color: #3a3732; border-radius: 0 8px 8px 0; }
.role-brief.show { display: block; }

.choice { margin-bottom: 22px; }
.choice-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice-option { position: relative; display: block; margin: 0; cursor: pointer; }
.choice-option input { position: absolute; opacity: 0; pointer-events: none; }
.choice-option span {
    display: flex; align-items: center; justify-content: center; gap: 10px; height: 52px;
    border: 1px solid var(--line-strong); border-radius: 10px; background: #fff;
    font-size: 15px; font-weight: 500;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.choice-option span:hover { border-color: #a89e8b; }
.choice-option input:checked + span { background: var(--text); border-color: var(--text); color: var(--paper); }
.choice-option input:focus-visible + span { box-shadow: 0 0 0 3px rgba(200, 55, 45, 0.25); }

.form-error { display: none; margin: 4px 0 18px; padding: 12px 16px; border-radius: 10px; background: #f7e3df; color: var(--accent-dark); font-size: 14px; border: 1px solid #ecc2bb; }
.form-error.show { display: block; }
.submit { width: 100%; height: 56px; font-size: 16px; border-radius: 12px; margin-top: 8px; }
.submit-note { margin-top: 14px; text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- Success dialog ---------- */
.dialog-backdrop { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(17, 17, 16, 0.62); }
.dialog-backdrop.show { display: flex; }
.dialog { width: 100%; max-width: 460px; background: var(--paper); border-radius: 18px; padding: 36px 32px 28px; border: 1px solid var(--line); }
.dialog .kicker { color: var(--accent); }
.dialog h2 { font-family: var(--serif); font-weight: 400; font-size: 42px; line-height: 1.02; margin: 14px 0 14px; letter-spacing: -0.01em; }
.dialog p { color: #3a3732; font-size: 15.5px; line-height: 1.6; }
.dialog p strong { color: var(--text); }
.dialog .btn-wa { width: 100%; height: 54px; margin-top: 24px; background: var(--wa); color: #fff; border-radius: 12px; font-size: 16px; }
.dialog .btn-wa:hover { background: #18683a; }
.dialog .wa-note { margin-top: 10px; font-size: 13px; color: var(--muted); text-align: center; }
.dialog .btn-done { width: 100%; height: 48px; margin-top: 16px; border-radius: 12px; background: none; border: 1px solid var(--line-strong); color: var(--text); }
.dialog .btn-done:hover { border-color: var(--text); }

/* ---------- Footer (ink) ---------- */
.foot { background: var(--ink); color: var(--ink-muted); padding: 48px 0; }
.foot-inner { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.foot img { height: 34px; width: auto; }
.foot p { font-size: 14px; margin-top: 12px; }
.foot nav { display: flex; gap: 22px; flex-wrap: wrap; }
.foot nav a { font-size: 14px; text-decoration: none; color: var(--ink-muted); }
.foot nav a:hover { color: var(--ink-text); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .hero { grid-template-columns: 1fr; gap: 48px; padding-top: 64px; padding-bottom: 72px; }
    .apply-grid { grid-template-columns: 1fr; gap: 36px; }
    .apply-intro { position: static; }
    .role-panel { grid-template-columns: 1fr; gap: 24px; padding-left: 0; }
    .role-summary, .role-duties, .role-actions { grid-column: 1; }
    .role-duties { padding-left: 0; }
}

@media (max-width: 720px) {
    .wrap { padding: 0 20px; }
    .masthead { padding-top: 16px; padding-bottom: 16px; }
    .masthead .logo img { height: 32px; }
    .back-link { display: none; }
    .hero { padding-top: 48px; padding-bottom: 56px; }
    .hero .kicker { margin-bottom: 20px; }
    .hero-title { font-size: clamp(44px, 12.5vw, 64px); }
    .hero-lede { font-size: 17px; margin-top: 22px; }
    .hero-cta .btn { flex: 1 1 auto; }
    .fact { grid-template-columns: 96px minmax(0, 1fr); }

    .section { padding: 64px 0; }
    .section-head { margin-bottom: 32px; }
    .principles { grid-template-columns: 1fr; }
    .principle, .principle + .principle { padding: 24px 0; border-left: none; }
    .principle + .principle { border-top: 1px solid var(--line); }
    .principle h3 { margin-top: 12px; font-size: 28px; }

    .role-row { grid-template-columns: 40px minmax(0, 1fr) 36px; gap: 12px; padding: 20px 0; }
    .role-state { grid-column: 2; grid-row: 2; margin-top: -4px; align-items: flex-start; text-align: left; }
    .spots-bar { width: 120px; }
    .role-toggle { grid-column: 3; grid-row: 1 / span 2; width: 36px; height: 36px; }
    .role-panel { padding-bottom: 28px; }
    .role-summary { font-size: 17px; }
    .role-actions .btn { width: 100%; }
    .workflow-rule { grid-template-columns: 1fr; gap: 10px; padding: 22px 20px; margin-top: 32px; }
    .workflow-text { font-size: 16px; }

    .steps { grid-template-columns: 1fr; }
    .step { padding: 24px; }
    .step h3 { font-size: 28px; margin-top: 14px; }

    .form-card { padding: 4px 20px 24px; border-radius: 14px; }
    legend .legend-title { font-size: 25px; }
    .field-row { grid-template-columns: 1fr; }

    .dialog { padding: 30px 22px 22px; }
    .dialog h2 { font-size: 36px; }
    .foot-inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; }
}
