/* Cover letter page (cover-letter.html, js/cover-letter-page.js).
   The site's calm system: white cards on a soft grey page, 12px control corners, navy for the
   main action, green only for focus and "done". Two cards of the same width and height sit side
   by side (the job | the letter); the letter lies on a sheet that looks like the PDF. */
:root {
    --ink: #0F1C35; --text: #344054; --muted: #667085; --faint: #98A2B3;
    --line: #E4E7EC; --line-2: #EAECF0; --soft: #F9FAFB; --page: #F6F7F9;
    --green: #12A26D; --green-ink: #067647; --navy: #0F1C35; --navy-2: #1A2B4C;
    --r: 12px; --r-card: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--page); color: var(--text); font: 15px/1.5 Geist, Inter, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }

/* header */
.cl-header { position: sticky; top: 0; z-index: 20; height: 64px; background: rgba(255,255,255,.92); backdrop-filter: saturate(140%) blur(8px); border-bottom: 1px solid var(--line); }
.cl-header-in { max-width: 1200px; height: 100%; margin: 0 auto; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cl-logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.cl-logo-mark { width: 32px; height: 32px; }
.cl-logo-text { display: flex; flex-direction: column; gap: 2px; }
.cl-logo-word { font-size: 16px; line-height: 18px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap;
    color: #047857; background: linear-gradient(120deg,#047857 0%,#059669 60%,#10b981 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.cl-logo-tag { font-size: 11px; line-height: 12px; color: var(--muted); white-space: nowrap; }
.cl-nav { display: flex; align-items: center; gap: 4px; }
.cl-nav a { padding: 8px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--text); text-decoration: none; white-space: nowrap; transition: background .15s, color .15s; }
.cl-nav a:hover { background: #F2F4F7; color: var(--ink); }
.cl-nav a[aria-current="page"] { color: var(--ink); background: #F2F4F7; }
.cl-nav .cl-nav-cta { margin-left: 6px; background: var(--navy); color: #fff; }
.cl-nav .cl-nav-cta:hover { background: var(--navy-2); color: #fff; }

.cl-main { max-width: 1200px; margin: 0 auto; padding: 56px 32px 80px; }

/* hero: centred */
.cl-hero { max-width: 720px; margin: 0 auto 40px; text-align: center; }
.cl-eyebrow { margin: 0 0 10px; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--green-ink); }
.cl-hero h1 { margin: 0; font-size: 40px; line-height: 48px; font-weight: 700; letter-spacing: -.025em; color: var(--ink); text-wrap: balance; }
.cl-lede { margin: 14px auto 0; max-width: 600px; font-size: 17px; line-height: 27px; color: var(--muted); text-wrap: balance; }
.cl-steps { display: inline-flex; gap: 8px; margin: 28px 0 0; padding: 0; list-style: none; }
.cl-step { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: #fff; box-shadow: 0 0 0 1px var(--line); font-size: 13.5px; font-weight: 500; color: var(--muted); transition: color .2s, box-shadow .2s, background .2s; }
.cl-step span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #F2F4F7; color: var(--muted); font-size: 12px; font-weight: 600; transition: background .2s, color .2s; }
.cl-step.is-on { color: var(--ink); box-shadow: 0 0 0 1.5px var(--navy); }
.cl-step.is-on span { background: var(--navy); color: #fff; }
.cl-step.is-done { color: var(--text); }
.cl-step.is-done span { background: #ECFDF3; color: transparent; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23067647' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); background-size: 12px; background-position: center; background-repeat: no-repeat; }

/* two equal cards */
.cl-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: stretch; }
.cl-card { display: flex; flex-direction: column; min-width: 0; background: #fff; border-radius: var(--r-card); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(16,24,40,.04), 0 12px 32px -20px rgba(15,28,53,.18); }
.cl-card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 14px 24px; border-bottom: 1px solid var(--line-2); }
.cl-card-h h2 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; color: var(--ink); }
.cl-card-b { flex: 1; padding: 22px 24px 6px; }
.cl-card-f { padding: 16px 24px 20px; border-top: 1px solid var(--line-2); }
.cl-kbd { font-size: 12px; color: var(--faint); white-space: nowrap; }
.cl-kbd kbd { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 5px; background: #F2F4F7; box-shadow: inset 0 -1px 0 var(--line); font: 600 11px/18px inherit; color: var(--muted); text-align: center; }

/* fields */
.cl-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cl-f { display: block; margin: 0 0 16px; }
.cl-f > span { display: flex; align-items: baseline; gap: 4px; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--text); }
.cl-f em { font-style: normal; font-weight: 400; color: var(--faint); }
.cl-count { margin-left: auto; font-weight: 400; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.cl-f input, .cl-f textarea, .cl-f select {
    width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r); background: #fff;
    color: #101828; font: inherit; font-size: 14px; transition: border-color .15s, box-shadow .15s, background .15s;
}
.cl-f input:hover, .cl-f textarea:hover, .cl-f select:hover { border-color: #D0D5DD; }
.cl-f input, .cl-f select { height: 44px; }
.cl-f select { appearance: none; padding-right: 36px; cursor: pointer; text-overflow: ellipsis;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 12px center / 16px no-repeat; }
.cl-f textarea { resize: vertical; min-height: 150px; line-height: 21px; }
.cl-f input:focus, .cl-f textarea:focus, .cl-f select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(18,162,109,.12); }
.cl-f ::placeholder { color: var(--faint); }
.cl-hint { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; }
.cl-hint:empty { display: none; }
.cl-hint a { color: var(--ink); font-weight: 600; }
.cl-opts { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.cl-len { display: inline-flex; padding: 3px; border-radius: var(--r); background: #F2F4F7; }
.cl-len label { cursor: pointer; }
.cl-len input { position: absolute; opacity: 0; pointer-events: none; }
.cl-len span { display: block; padding: 6px 14px; border-radius: 9px; font-size: 13px; font-weight: 500; color: #475467; transition: background .15s, color .15s, box-shadow .15s; }
.cl-len input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(16,24,40,.08), 0 0 0 1px rgba(16,24,40,.04); }
.cl-len input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 1px; }
.cl-len-note { font-size: 13px; color: var(--faint); }
.cl-err { margin: 0 0 16px; padding: 10px 12px; border-radius: 10px; background: #FEF3F2; color: #B42318; font-size: 13px; }
.cl-err[hidden] { display: none; }
.cl-err a { color: inherit; font-weight: 600; }
.cl-trust { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.cl-trust svg { color: var(--green-ink); }

/* buttons */
.cl-btn { display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 18px; border: 1px solid var(--navy); border-radius: var(--r); background: var(--navy); color: #fff;
    font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s, transform .1s; }
.cl-btn:hover:not(:disabled) { background: var(--navy-2); border-color: var(--navy-2); }
.cl-btn:active:not(:disabled) { transform: translateY(1px); }
.cl-btn:disabled { opacity: .4; cursor: default; }
.cl-btn--ghost { background: #fff; color: var(--text); border-color: #D0D5DD; }
.cl-btn--ghost:hover:not(:disabled) { background: var(--soft); border-color: #D0D5DD; }
.cl-btn--sm { height: 36px; padding: 0 14px; font-size: 13.5px; border-radius: 10px; }
.cl-btn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.cl-actions { display: flex; gap: 8px; }
#clWrite { width: 100%; height: 48px; font-size: 15px; }

/* the letter: a true A4 sheet on a soft desk.
   Every measurement below mirrors letterHtml() in js/cover-letter-page.js,
   which is what the PDF is printed from: 794x1123 page, 72/80 margins,
   11.5pt Inter at 1.55. The sheet is always drawn at full A4 size and then
   scaled to fit the column by fitSheet(), so the preview is the PDF. */
.cl-desk { flex: 1; padding: 24px; background: var(--soft); display: flex; justify-content: center; align-items: flex-start; }
.cl-fit { position: relative; width: 100%; max-width: 794px; }
.cl-paper {
    position: relative; box-sizing: border-box;
    width: 794px; min-height: 1123px; padding: 72px 80px;
    transform-origin: top left;
    font-size: 11.5pt; line-height: 1.55; color: #1D2939;
    background: #fff; border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(16,24,40,.06), 0 2px 4px rgba(16,24,40,.04), 0 16px 32px -18px rgba(15,28,53,.25);
    transition: box-shadow .2s;
}
/* a hairline where each A4 page would end, so a letter that runs long shows it */
.cl-paper::after {
    content: ""; position: absolute; left: 0; right: 0; top: 1123px; bottom: 0; pointer-events: none;
    background: repeating-linear-gradient(to bottom, #E4E7EC 0 1px, transparent 1px 1123px);
}
.cl-paper > * { position: relative; z-index: 1; }
.cl-paper:focus-within { box-shadow: 0 0 0 2px rgba(18,162,109,.4), 0 16px 32px -18px rgba(15,28,53,.25); }
.cl-paper-name { font-size: 22pt; line-height: 1.2; font-weight: 700; color: #0F1C35; letter-spacing: -.01em; }
.cl-paper-contact { margin-top: 6px; color: #475467; font-size: 10pt; }
.cl-paper-rule { width: 48px; height: 2px; margin: 22px 0 28px; background: #0F1C35; }
.cl-paper-date { margin: 0 0 4px; color: #475467; }
.cl-paper-co { margin: 0 0 22px; color: #475467; }
.cl-paper-co:empty { display: none; }
#clLetter {
    display: block; width: 100%; min-height: 240px; padding: 0; margin: 0; border: 0; resize: none; overflow: hidden;
    background: transparent; color: #1D2939; font: inherit; cursor: text;
}
#clLetter:focus { outline: none; }
/* before a letter: the greeting (live from the form) and faint lines where the letter will go */
.cl-ghost[hidden] { display: none; }
.cl-ghost-greet { margin: 0 0 18px; color: #1D2939; font-size: 14.5px; }
.cl-ghost i { display: block; height: 9px; margin-bottom: 13px; border-radius: 5px; background: #F2F4F7; width: 96%; }
.cl-ghost i:nth-of-type(2) { width: 92%; } .cl-ghost i:nth-of-type(3) { width: 88%; }
.cl-ghost i.s { width: 64%; margin-bottom: 24px; } .cl-ghost i.xs { width: 30%; }
.is-writing .cl-ghost i { background: linear-gradient(90deg, #F2F4F7 25%, #E4E7EC 50%, #F2F4F7 75%); background-size: 200% 100%; animation: clShimmer 1.3s ease-in-out infinite; }
.is-writing .cl-ghost[hidden] { display: block; }
.is-writing #clLetter { display: none; }
.is-writing .cl-actions .cl-btn { opacity: .4; pointer-events: none; }
@keyframes clShimmer { to { background-position: -200% 0; } }
.cl-card-f--doc { font-size: 13px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }

/* guide + FAQ (the reading part of the page) */
.cl-guide { margin-top: 96px; }
.cl-guide-head { max-width: 640px; margin: 0 auto 32px; text-align: center; }
.cl-guide h2, .cl-faq h2 { margin: 0; font-size: 28px; line-height: 36px; letter-spacing: -.02em; color: var(--ink); text-wrap: balance; }
.cl-guide-head p { margin: 10px 0 0; color: var(--muted); }
.cl-tips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cl-tip { padding: 24px; background: #fff; border-radius: var(--r-card); box-shadow: 0 0 0 1px var(--line); transition: box-shadow .2s, transform .2s; }
.cl-tip:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px #D0D5DD, 0 12px 24px -16px rgba(15,28,53,.3); }
.cl-tip span { display: block; margin-bottom: 14px; font-size: 13px; font-weight: 600; color: var(--green-ink); font-variant-numeric: tabular-nums; }
.cl-tip h3 { margin: 0 0 8px; font-size: 16px; line-height: 22px; color: var(--ink); }
.cl-tip p { margin: 0; font-size: 14px; line-height: 22px; color: var(--muted); }
.cl-faq { max-width: 760px; margin: 96px auto 0; }
.cl-faq h2 { margin-bottom: 20px; text-align: center; }
.cl-faq details { background: #fff; border-radius: var(--r); box-shadow: 0 0 0 1px var(--line); }
.cl-faq details + details { margin-top: 10px; }
.cl-faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; font-weight: 600; color: var(--ink); cursor: pointer; list-style: none; }
.cl-faq summary::-webkit-details-marker { display: none; }
.cl-faq summary::after { content: ""; flex: none; width: 16px; height: 16px; transition: transform .2s;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / 16px no-repeat; }
.cl-faq details[open] summary::after { transform: rotate(180deg); }
.cl-faq summary:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: var(--r); }
.cl-faq details p { margin: 0; padding: 0 20px 18px; color: var(--muted); font-size: 14.5px; line-height: 23px; }
.cl-faq details a { color: var(--ink); font-weight: 600; }

@media (max-width: 1080px) {
    .cl-tips { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
    .cl-header-in, .cl-main { padding-left: 16px; padding-right: 16px; }
    .cl-nav a:not(.cl-nav-cta):not([aria-current]) { display: none; }
    .cl-main { padding-top: 32px; }
    .cl-hero { margin-bottom: 28px; }
    .cl-hero h1 { font-size: 28px; line-height: 35px; }
    .cl-lede { font-size: 15.5px; line-height: 24px; }
    .cl-steps { display: flex; justify-content: center; flex-wrap: wrap; }
    .cl-step { padding-right: 12px; font-size: 13px; }
    .cl-layout { grid-template-columns: 1fr; gap: 20px; }
    .cl-kbd { display: none; }
    .cl-card-h, .cl-card-b, .cl-card-f { padding-left: 18px; padding-right: 18px; }
    .cl-row { grid-template-columns: 1fr; gap: 0; }
    .cl-doc .cl-card-h { flex-wrap: wrap; }
    .cl-actions { width: 100%; }
    .cl-actions .cl-btn { flex: 1; }
    .cl-desk { padding: 12px; }
    .cl-guide, .cl-faq { margin-top: 64px; }
    .cl-guide h2, .cl-faq h2 { font-size: 23px; line-height: 30px; }
    .cl-tips { grid-template-columns: 1fr; gap: 12px; }
}
/* Phones: the wordmark and tagline stay. What goes is the nav link to the
   page you are already on, which is the one thing in this header that buys
   nothing, and some padding on the button. */
@media (max-width: 640px) {
    .cl-nav a[aria-current="page"] { display: none; }
    .cl-nav .cl-nav-cta { margin-left: 0; }
}
@media (max-width: 380px) {
    .cl-header-in { padding: 0 12px; gap: 10px; }
    .cl-nav .cl-nav-cta { padding: 8px 10px; font-size: 13.5px; }
}
@media (prefers-reduced-motion: reduce) {
    .is-writing .cl-ghost i { animation: none; }
    .cl-tip, .cl-btn, .cl-step { transition: none; }
}
