/*
 * remoty.work -- "the case file" design system.
 *
 * The product is an audit, not a job board: every listing is graded A-F and
 * checked for ghost jobs, and the whole promise is that the verdict is
 * visible and inspectable. So the page is built like a filed report --
 * warm paper, ink-black type, an editorial serif for the human sentence,
 * a monospace face for anything that is *data* (salary, dates, grades,
 * counts), and one signature motif: the rotated ink grade stamp.
 *
 * Served as a static file (like /js/*.js) rather than through Vite: this app
 * has no JS build step in the deploy path, and one cached stylesheet beats an
 * inline <style> repeated on every SSR response.
 */

:root {
    --ink: #14120F;          /* near-black, warm -- primary text */
    --paper: #F7F5F0;        /* warm off-white page ground */
    --card: #FDFCFA;         /* the filed sheet on top of the desk */
    --verified: #2E6B4F;     /* pass state, grades A/B, "Verified" */
    --flag: #B23A2E;         /* ghost jobs, scams, grades D-F */
    --grade-amber: #C98A2C;  /* C grade, mid-tier signals */
    --line: #D8D3C7;         /* warm hairline */
    --muted: #6B6459;        /* secondary prose / meta */

    --display: "Fraunces", Georgia, "Times New Roman", serif;
    --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
    --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --measure: 62rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--ink);
    background: var(--paper);
    margin: 0;
    /* A faint ruled-paper wash. Two hairlines, not a texture image: it reads
       as a filed sheet without costing a request. */
    background-image: linear-gradient(180deg, rgba(216, 211, 199, .35) 0 1px, transparent 1px 100%);
    background-size: 100% 2.5rem;
}

main {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 2.5rem 1.25rem 4rem;
}

/* ---------------------------------------------------------------- type --- */

h1, h2, h3, h4 {
    font-family: var(--display);
    font-weight: 600;
    font-optical-sizing: auto;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin: 2rem 0 0.75rem;
}

h1 { font-size: clamp(1.9rem, 1.4rem + 2.2vw, 2.9rem); margin-top: 0.5rem; }
h2 { font-size: clamp(1.35rem, 1.15rem + 1vw, 1.7rem); }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

p { margin: 0 0 1rem; max-width: 42rem; }

a { color: var(--verified); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ink); }

strong { font-weight: 650; }

hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

/* Breadcrumb-ish nav lines that sit above an h1 on hub/detail pages. */
main > nav {
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1.25rem;
}
main > nav a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); }
main > nav a:hover { color: var(--ink); border-bottom-color: var(--ink); }

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

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    max-width: var(--measure);
    margin: 0 auto;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); }
.brand-logo { height: 2rem; width: auto; display: block; }

/* The hand-inked "R" from the marketing assets, rebuilt in type: the letter
   set in the display serif inside an irregular hand-drawn box. */
.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.2rem;
    line-height: 1;
    color: var(--paper);
    background: var(--ink);
    border-radius: 225px 15px 200px 15px/15px 200px 15px 225px;
    transform: rotate(-3deg);
}

.brand-name { font-family: var(--display); font-weight: 600; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand-tag {
    display: block;
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.site-nav { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.site-nav a {
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    padding-bottom: 2px;
    border-bottom: 1px solid transparent;
}
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--ink); }

.site-footer {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
    border-top: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    color: var(--muted);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-bottom: 0.75rem; }
.site-footer a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); }
.site-footer a:hover { color: var(--ink); }
.site-footer p { max-width: 46rem; margin: 0; }

/* ------------------------------------------------------- the grade stamp -- */
/*
 * The one memorable motif. A customs/verification stamp: the letter grade in
 * mono bold, inside a deliberately irregular border (the asymmetric
 * border-radius makes the ring hand-drawn rather than CSS-perfect), rotated
 * a few degrees off-axis, with a second inset ring so it reads as inked
 * rather than as a chip. Used ONLY where a grade appears.
 */
.stamp {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 3.1rem;
    height: 3.1rem;
    flex: 0 0 auto;
    font-family: var(--mono);
    font-weight: 700;
    line-height: 1;
    color: var(--verified);
    border: 2px solid currentColor;
    border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 35%, transparent);
    background: transparent;
    transform: rotate(-4deg);
    opacity: 0.92;
}
.stamp-letter { font-size: 1.25rem; }
.stamp-label {
    font-size: 0.42rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-top: 0.18rem;
    font-weight: 600;
}

.stamp--pass { color: var(--verified); }
.stamp--mid  { color: var(--grade-amber); transform: rotate(-2.5deg); }
.stamp--fail { color: var(--flag); transform: rotate(3deg); }

.stamp--lg { width: 4.6rem; height: 4.6rem; }
.stamp--lg .stamp-letter { font-size: 1.9rem; }
.stamp--lg .stamp-label { font-size: 0.5rem; }

.stamp--sm { width: 2.5rem; height: 2.5rem; border-width: 1.5px; }
.stamp--sm .stamp-letter { font-size: 1rem; }
.stamp--sm .stamp-label { display: none; }

/* ----------------------------------------------------------- case files --- */
/*
 * A listing is a case file, not a marketing card: title, the facts in mono,
 * a hairline, then the verdict.
 */
.job-list { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: 0.9rem; }

.job-list > li {
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 3px solid var(--ink);
    padding: 1rem 1.15rem;
    position: relative;
}
.job-list > li:hover { border-left-color: var(--verified); }

.case-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }

.case-title {
    font-family: var(--display);
    font-weight: 600;
    font-size: 1.12rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin: 0;
}
.case-title a { color: var(--ink); text-decoration: none; }
.case-title a:hover { text-decoration: underline; text-decoration-color: var(--verified); }

/* "The facts" -- everything that is data reads as data. */
.case-facts {
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.01em;
    color: var(--muted);
    margin: 0.4rem 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.85rem;
}
/* Interpuncts between the facts, so a row reads as a filed line of data
   rather than a run-on sentence. */
.case-facts > *:not(:first-child)::before {
    content: "·";
    color: var(--line);
    margin-right: 0.85rem;
}
.case-facts a { color: var(--muted); }
.case-facts .fact-salary { color: var(--ink); font-weight: 600; }

/* The rule between the facts and the verdict. */
.case-verdict {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
    margin-top: 0.8rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--line);
}
.case-verdict-note {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    color: var(--muted);
}

/* A flag is never just a colour: the reason is spelled out, because the
   reason is the product. */
.flag-note {
    font-family: var(--mono);
    font-size: 0.72rem;
    line-height: 1.45;
    letter-spacing: 0.01em;
    color: var(--flag);
    display: block;
    margin-top: 0.35rem;
}
.flag-note--block {
    border-left: 2px solid var(--flag);
    background: color-mix(in srgb, var(--flag) 5%, transparent);
    padding: 0.5rem 0.75rem;
    margin: 0.9rem 0;
}

.verified-note { color: var(--verified); }

/* ------------------------------------------------------------- job page --- */

.case-file-header {
    border-bottom: 1px solid var(--line);
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
}
.case-file-header .stamp { float: right; margin: 0.25rem 0 0.75rem 1.25rem; }

.case-dossier {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: 0.85rem 1.5rem;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 0.9rem 0;
    margin: 1.25rem 0;
}
.dossier-item { display: flex; flex-direction: column; gap: 0.15rem; }
.dossier-label {
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}
.dossier-value { font-family: var(--mono); font-size: 0.9rem; color: var(--ink); }

.job-body { max-width: 42rem; margin: 1.5rem 0; }
.job-body p { margin-bottom: 1rem; }

.apply-cta {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--paper);
    background: var(--ink);
    text-decoration: none;
    padding: 0.75rem 1.4rem;
    border-radius: 225px 15px 200px 15px/15px 200px 15px 225px;
}
.apply-cta:hover { background: var(--verified); color: var(--paper); }

/* ---------------------------------------------------------------- tags ---- */

.tag {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 2px;
    padding: 0.1rem 0.45rem;
    margin: 0 0.25rem 0.3rem 0;
}
.tag--flag { color: var(--flag); border-color: color-mix(in srgb, var(--flag) 40%, var(--line)); }
.tag--pass { color: var(--verified); border-color: color-mix(in srgb, var(--verified) 40%, var(--line)); }

/* --------------------------------------------------------- panels etc. ---- */

.widget {
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 3px solid var(--line);
    border-radius: 0;
    padding: 1.15rem 1.35rem;
    margin: 1.5rem 0;
}
.widget h2, .widget h3 { margin-top: 0; }

/* A talent pool is a dossier on a company, so it gets a filed-folder tab. */
.pool-file { border-left-color: var(--verified); }
.pool-file > h3 { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; }
.pool-file .pool-stats {
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    color: var(--muted);
    margin: 0.2rem 0 0.4rem;
}
.pool-file .job-list { margin: 0.9rem 0 0; }

.archived-banner {
    background: color-mix(in srgb, var(--grade-amber) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--grade-amber) 45%, var(--line));
    border-left: 3px solid var(--grade-amber);
    padding: 0.85rem 1.1rem;
    margin-bottom: 1.5rem;
}
.archived-banner p { margin: 0; }

/* The lede under an h1 -- one editorial sentence, then back to data. */
.lede { font-size: 1.08rem; color: var(--muted); max-width: 40rem; }
.lede strong { color: var(--ink); }

.stat-line {
    font-family: var(--mono);
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    color: var(--muted);
    text-transform: uppercase;
}

/* Free vs Early Access: the paid tier is stamped, the free tier is filed. */
.tier-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.tier {
    background: var(--card);
    border: 1px solid var(--line);
    padding: 1.1rem 1.25rem;
}
.tier--paid { border-left: 3px solid var(--verified); }
.tier--free { border-left: 3px solid var(--line); }
.tier h3 { margin-top: 0; }
.tier-price { font-family: var(--mono); font-size: 0.85rem; color: var(--ink); letter-spacing: 0.03em; }
.tier p { font-size: 0.92rem; }

/* -------------------------------------------------------------- forms ----- */

textarea, input[type="email"], input[type="text"], input[type="search"] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-family: var(--mono);
    font-size: 0.9rem;
    color: var(--ink);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 0;
    padding: 0.55rem 0.7rem;
}
textarea:focus, input:focus { outline: 2px solid var(--verified); outline-offset: 1px; }

button, .button {
    font-family: var(--mono);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ink);
    background: var(--card);
    border: 1px solid var(--ink);
    border-radius: 0;
    padding: 0.5rem 1rem;
    cursor: pointer;
}
button:hover, .button:hover { background: var(--ink); color: var(--paper); }

[aria-pressed="true"] { outline: 2px solid var(--verified); }

.ats-error, .ghost-error, .rrc-error, .feedback-error { color: var(--flag); font-family: var(--mono); font-size: 0.85rem; }

/* --------------------------------------------------- account menu (JS) ---- */

.account-menu { position: relative; display: inline-block; }
.account-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--card);
    border: 1px solid var(--line);
    padding: 0.6rem 0.85rem;
    min-width: 12rem;
    z-index: 10;
    font-family: var(--mono);
    font-size: 0.78rem;
}
.account-dropdown span { display: block; font-size: 0.78rem; }
.account-email { color: var(--muted); }
.account-signin, #account-menu a {
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    border-bottom: 1px solid var(--line);
}
.account-signin:hover, #account-menu a:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* -------------------------------------------------------------- tables ---- */

table { border-collapse: collapse; width: 100%; margin: 1.25rem 0; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.5rem 0.65rem; border-bottom: 1px solid var(--line); }
th { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
td { font-family: var(--mono); font-size: 0.82rem; }

@media (max-width: 34rem) {
    .case-head { flex-direction: column; }
    .case-file-header .stamp { float: none; margin: 0 0 0.75rem; }
}
