/* =====================================================================
   FeResPost - site stylesheet
   Fonts are hosted on the site itself (no request to Google).
   ===================================================================== */

@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/space-grotesk-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/space-grotesk-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/space-grotesk-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }

:root {
    --night: #0B1220;        /* dark background */
    --night-2: #121C31;      /* dark cards */
    --night-line: #22314D;   /* dark borders */
    --paper: #F6F8FB;        /* light background */
    --white: #FFFFFF;
    --ink: #13203A;          /* main text */
    --ink-2: #3F4D68;        /* secondary text */
    --muted: #4A5873;
    --line: #DFE5EE;         /* light borders */
    --on-dark: #E6ECF5;
    --on-dark-2: #B4C1D6;
    --accent: #3CC8E8;       /* cyan, on dark backgrounds */
    --accent-ink: #06202A;   /* text on cyan buttons */
    --link: #0B6A8F;         /* links on light backgrounds */
    --link-hover: #08506C;
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    --font-head: "Space Grotesk", "Inter", system-ui, Arial, sans-serif;
    --font-mono: "JetBrains Mono", Consolas, "Courier New", monospace;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; height: auto; }

a { color: var(--link); }
a:hover { color: var(--link-hover); }

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

.container { max-width: 1180px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--white); color: var(--ink); padding: 10px 16px; z-index: 10; }
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- Header and navigation ---------- */

.site-header { background: var(--night); color: var(--on-dark); }

.nav {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 16px; padding-top: 18px; padding-bottom: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--white); text-decoration: none; }
.brand:hover { color: var(--white); }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 22px; letter-spacing: -0.01em; }

.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; font-size: 15px; margin: 0; padding: 0; list-style: none; }
.nav-links a { color: #C5D0E0; text-decoration: none; display: inline-block; padding: 8px 0; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--white); }
.nav-links a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 48px; padding: 0 22px; border-radius: 10px; border: 1px solid transparent;
    font-family: var(--font-body); font-weight: 600; font-size: 16px; line-height: 1.2;
    text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #63D4EE; color: var(--accent-ink); }
.btn-ghost { border-color: #3A4C6E; color: var(--white); background: transparent; }
.btn-ghost:hover { border-color: #5A6E93; color: var(--white); }
.btn-dark { background: var(--night); color: var(--white); }
.btn-dark:hover { background: #1B2944; color: var(--white); }
.btn-light { border-color: #C3CDDB; color: var(--ink); background: var(--white); }
.btn-light:hover { border-color: #9AA8BF; color: var(--ink); }
.nav-links .btn { display: inline-flex; padding: 0 18px; min-height: 44px; color: var(--accent-ink); }
.nav-links .btn:hover, .nav-links .btn[aria-current="page"] { color: var(--accent-ink); box-shadow: none; }

/* ---------- Home: hero ---------- */

.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 48px; padding-top: 56px; padding-bottom: 72px; }
.hero-text { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.hero-badge {
    margin: 0; align-self: flex-start; font-family: var(--font-mono); font-size: 13px; color: #C5D0E0;
    border: 1px solid #2A3A57; border-radius: 999px; padding: 6px 14px;
}
.hero h1 {
    margin: 0; font-family: var(--font-head); font-weight: 700; color: var(--white);
    font-size: clamp(36px, 5vw, 58px); line-height: 1.05; letter-spacing: -0.02em;
}
.hero-lead { margin: 0; font-size: 19px; color: var(--on-dark-2); max-width: 36em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-actions .btn { min-height: 52px; font-size: 17px; padding: 0 24px; }
.langs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 4px 0 0; list-style: none; }
.langs-label { font-size: 14px; color: #8D9BB3; margin-right: 4px; }
.lang { font-family: var(--font-mono); font-size: 13px; color: var(--on-dark); background: #16223A; border-radius: 6px; padding: 5px 10px; }
.hero-figure { flex: 1 1 380px; min-width: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.hero-figure .frame { border-radius: 16px; overflow: hidden; border: 1px solid #2A3A57; background: #8FA0E6; }
.hero-figure img { display: block; width: 100%; max-height: 470px; object-fit: cover; }
.hero-figure figcaption { font-family: var(--font-mono); font-size: 12px; color: #8D9BB3; }

/* Colour scale of finite element results, used as the site's signature */
.scale { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); height: 6px; }
.scale span:nth-child(1) { background: #1F3FB8; }
.scale span:nth-child(2) { background: #2B7BE0; }
.scale span:nth-child(3) { background: #3CC8E8; }
.scale span:nth-child(4) { background: #8ED16B; }
.scale span:nth-child(5) { background: #F5C33D; }
.scale span:nth-child(6) { background: #E5553A; }

/* ---------- Home: sections ---------- */

.section { padding-top: 88px; padding-bottom: 88px; }
.section-tight-bottom { padding-bottom: 40px; }
.band { background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { display: flex; flex-direction: column; gap: 14px; max-width: 760px; margin-bottom: 40px; }
.eyebrow { margin: 0; font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--link); }
.section h2 {
    margin: 0; font-family: var(--font-head); font-weight: 700;
    font-size: clamp(28px, 3.4vw, 40px); line-height: 1.1; letter-spacing: -0.015em;
}
.section-lead { margin: 0; font-size: 18px; color: var(--ink-2); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.card {
    background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 28px;
    display: flex; flex-direction: column; gap: 12px;
}
.band .card { background: transparent; }
.card h3 { margin: 0; font-family: var(--font-head); font-size: 21px; font-weight: 600; line-height: 1.25; }
.card p { margin: 0; color: var(--ink-2); }
.card .icon { width: 34px; height: 34px; }
.card .btn, .card .more { align-self: flex-start; margin-top: auto; }
.more { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

.step-num { font-family: var(--font-head); font-size: 40px; font-weight: 700; line-height: 1; color: #C9D3E2; }

.facts { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; font-size: 15px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.mono { font-family: var(--font-mono); font-size: 14px; }

.flow { background: var(--night); color: var(--on-dark); border-radius: 20px; padding: 40px; display: flex; flex-direction: column; gap: 28px; }
.flow h2 { font-size: 26px; font-weight: 600; color: var(--white); }
.flow ol { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.flow li { background: var(--night-2); border: 1px solid var(--night-line); border-radius: 12px; padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.flow-num { font-family: var(--font-mono); font-size: 14px; color: var(--accent); }
.flow-title { font-family: var(--font-head); font-size: 19px; font-weight: 600; color: var(--white); }
.flow-text { font-size: 15px; color: #AEBBD0; }

.split { display: flex; flex-wrap: wrap; gap: 40px; }
.split-main { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.split-side { flex: 1 1 520px; min-width: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.video { display: flex; flex-direction: column; gap: 12px; color: var(--ink); text-decoration: none; }
.video:hover { color: var(--link); }
.video-thumb { aspect-ratio: 16 / 9; border-radius: 12px; background: var(--night); display: flex; align-items: center; justify-content: center; }
.video-kind { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.video-title { font-family: var(--font-head); font-size: 18px; font-weight: 600; line-height: 1.3; }

.duo { display: flex; flex-wrap: wrap; gap: 24px; }
.panel-dark { flex: 2 1 460px; min-width: 0; background: var(--night); color: var(--on-dark); border-radius: 20px; padding: 40px; display: flex; flex-direction: column; gap: 18px; }
.panel-dark .eyebrow { color: var(--accent); }
.panel-dark h2 { font-size: 30px; line-height: 1.15; color: var(--white); }
.panel-dark p { margin: 0; color: var(--on-dark-2); }
.panel-dark a:not(.btn) { color: #C5D0E0; }
.panel-light { flex: 1 1 320px; min-width: 0; background: var(--white); border: 1px solid var(--line); border-radius: 20px; padding: 40px; display: flex; flex-direction: column; gap: 16px; }
.panel-light h2 { font-size: 30px; line-height: 1.15; }
.panel-light p { margin: 0; color: var(--ink-2); }

.subscribe { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 6px 0 0; }
.subscribe label { flex: 1 1 240px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: #C5D0E0; }
.subscribe input[type="email"] {
    min-height: 48px; border-radius: 10px; border: 1px solid #3A4C6E; background: var(--night-2);
    color: var(--white); padding: 0 14px; font: inherit; font-size: 16px;
}

/* ---------- Inner pages: existing section content ---------- */

.page-title-band { padding-top: 8px; }

.prose { max-width: 900px; padding-top: 0; padding-bottom: 88px; color: var(--ink); }

/* The section files were written with inline fonts and indents:
   harmonise them with the new design without touching their text. */
.prose :where(*:not(pre, code, kbd, samp, tt)) { font-family: inherit !important; }
.prose pre, .prose code, .prose kbd, .prose samp, .prose tt { font-family: var(--font-mono) !important; font-size: 0.9em; }
.prose pre { background: var(--night); color: var(--on-dark); padding: 16px 20px; border-radius: 10px; overflow-x: auto; }

.prose [style*="margin-left: 40px"], .prose [style*="margin-left:40px"] { margin-left: 0 !important; }
.prose [style*="margin-left: 80px"], .prose [style*="margin-left:80px"] { margin-left: 1.5rem !important; }
.prose [style*="margin-left: 120px"], .prose [style*="margin-left:120px"] { margin-left: 3rem !important; }

.prose h2 {
    font-family: var(--font-head) !important; font-weight: 700; color: var(--ink);
    font-size: clamp(28px, 3.6vw, 40px); line-height: 1.1; letter-spacing: -0.015em; margin: 64px 0 20px;
}
.prose h3 { font-family: var(--font-head) !important; font-weight: 600; font-size: 24px; line-height: 1.25; margin: 44px 0 14px; color: var(--ink); }
.prose h4 { font-family: var(--font-head) !important; font-weight: 600; font-size: 19px; line-height: 1.3; margin: 32px 0 10px; color: var(--ink); }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--link); }
.prose a { font-weight: 500; }

.prose table { border-collapse: collapse; max-width: 100%; }
.prose iframe { display: block; width: 100%; max-width: 640px; height: auto; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; margin: 12px 0 24px; background: var(--night); }

.prose fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 20px 24px; margin: 0; background: var(--white); }
.prose legend { font-family: var(--font-head); font-weight: 600; padding: 0 6px; }
.prose input[type="text"], .prose input[type="email"], .prose select {
    min-height: 44px; border: 1px solid #C3CDDB; border-radius: 8px; padding: 0 12px;
    font: inherit; font-size: 16px; background: var(--white); color: var(--ink); width: auto !important; height: auto !important;
}
.prose input[type="submit"], .prose button {
    min-height: 44px; border: 0; border-radius: 8px; padding: 0 18px; background: var(--night); color: var(--white);
    font: inherit; font-weight: 600; cursor: pointer; width: auto !important; height: auto !important;
}
.prose input[type="submit"]:hover, .prose button:hover { background: #1B2944; }

/* ---------- Downloads ---------- */

.dl-form { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 24px; margin: 28px 0; display: flex; flex-direction: column; gap: 10px; }
.dl-form label { font-family: var(--font-head); font-weight: 600; font-size: 18px; }
.dl-row { display: flex; flex-wrap: wrap; gap: 12px; }
.dl-row select { flex: 1 1 260px; }
.dl-results:empty { display: none; }
.dl-heading { margin: 36px 0 12px !important; font-size: 21px !important; }
.dl-table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: 12px; }
.dl-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.dl-table th { text-align: left; font-weight: 600; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); }
.dl-table td { padding: 10px 16px; border-bottom: 1px solid var(--line); }
.dl-table tr:last-child td { border-bottom: 0; }
.dl-table .dl-size { text-align: right; white-space: nowrap; font-family: var(--font-mono) !important; font-size: 14px; color: var(--muted); }
.dl-list { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 14px 36px; }

/* ---------- Keywords shown to search robots (home page) ---------- */

.robots-content { padding-bottom: 40px; color: var(--ink-2); font-size: 15px; }

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

.site-footer { background: var(--night); color: #AEBBD0; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; padding-top: 48px; padding-bottom: 48px; font-size: 14px; }
.footer-about { display: flex; flex-direction: column; gap: 8px; max-width: 540px; }
.footer-brand { font-family: var(--font-head); font-weight: 700; font-size: 20px; color: var(--white); }
.footer-note { color: #8D9BB3; }
.site-footer a { color: #C5D0E0; }
.site-footer a:hover { color: var(--white); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; align-content: flex-start; margin: 0; padding: 0; list-style: none; }
.crawl-link { color: inherit !important; text-decoration: none; }

@media (max-width: 600px) {
    body { font-size: 16px; }
    .hero { padding-top: 32px; padding-bottom: 48px; gap: 32px; }
    .section { padding-top: 64px; padding-bottom: 64px; }
    .flow, .panel-dark, .panel-light { padding: 28px; }
    .prose { padding-bottom: 64px; }
    .prose h2 { margin-top: 44px; }
}
