/* Fuzzy MCDM public website. One stylesheet, no framework, self-hosted fonts (no third-party requests). */
@import url("assets/fonts/fonts.css");

:root {
  color-scheme: light;
  --paper: #f5f7fb;
  --surface: #ffffff;
  --ink: #13233f;
  --ink-2: #44526b;
  --rule: #d5dce8;
  --brand: #0046ae;
  --brand-ink: #ffffff;
  --brand-soft: #e3ebf8;
  --band: #c3d4f0;
  --note-bg: #fff5dc;
  --note-ink: #6b4500;
  --focus: #ffb000;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Atkinson Hyperlegible Next", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --measure: 68ch;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --wide: 76rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0f1726;
    --surface: #152036;
    --ink: #e6ecf6;
    --ink-2: #a9b6cc;
    --rule: #2b3a55;
    --brand: #6f9df0;
    --brand-ink: #0b1424;
    --brand-soft: #1b2b49;
    --band: #2d4675;
    --note-bg: #2d2412;
    --note-ink: #f2d39a;
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 0.6em; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.35rem); }
h3 { font-size: 1.25rem; }
p, ul, ol, dl { margin: 0 0 1em; }
p, li { max-width: var(--measure); }
code, .mono { font-family: var(--mono); font-size: 0.92em; }

.skip {
  position: absolute; left: 0.75rem; top: -3rem; z-index: 50;
  background: var(--surface); color: var(--ink); padding: 0.5rem 0.9rem; border: 2px solid var(--brand);
}
.skip:focus { top: 0.75rem; }

.wrap { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }

/* Header and navigation */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.75rem; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--ink); text-decoration: none; font-family: var(--serif); font-weight: 600; font-size: 1.2rem; }
.brand svg { width: 1.75rem; height: 1.75rem; flex: none; }
.nav-toggle {
  display: none; font: inherit; background: none; border: 1px solid var(--rule); color: var(--ink);
  padding: 0.35rem 0.75rem; border-radius: 6px; cursor: pointer;
}
.site-nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; list-style: none; margin: 0; padding: 0; }
.site-nav a { color: var(--ink-2); text-decoration: none; font-size: 0.95rem; padding: 0.35rem 0; }
.site-nav a:hover, .site-nav a[aria-current="true"] { color: var(--ink); text-decoration: underline; }

@media (max-width: 62rem) {
  .nav-toggle { display: inline-block; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--rule); }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; padding: 0.5rem var(--gutter) 1rem; }
  .site-nav a { display: block; padding: 0.6rem 0; font-size: 1.05rem; }
}

/* Hero */
.hero { position: relative; padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(2rem, 5vw, 4rem); overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2.6rem, 6.5vw, 4.6rem); margin-bottom: 0.25em; letter-spacing: -0.02em; }
.hero .lede { font-size: clamp(1.15rem, 2vw, 1.35rem); color: var(--ink); max-width: 34ch; margin-bottom: 1.1rem; }
.hero .affil { color: var(--ink-2); font-size: 0.98rem; margin-bottom: 1.6rem; }
.hero .affil span { display: block; }
.hero .meta { color: var(--ink-2); font-size: 0.92rem; margin-top: 1rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.9rem; padding: 0.6rem 1.25rem;
  border-radius: 8px; font-weight: 600; text-decoration: none; border: 1px solid var(--brand); font-size: 1rem;
}
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 86%, black); }
.btn-secondary { background: transparent; color: var(--brand); }
.btn-secondary:hover { background: var(--brand-soft); }
.btn svg { width: 1.1rem; height: 1.1rem; }

.window {
  margin: 0; border-radius: 10px; overflow: hidden; background: var(--surface);
  border: 1px solid var(--rule); box-shadow: 0 1px 2px rgb(19 35 63 / 0.06), 0 18px 40px -18px rgb(19 35 63 / 0.35);
}
.window img { width: 100%; }

/* The signature: an interval type-2 trapezoidal fuzzy number drawn behind the hero. */
.membership { position: absolute; inset: auto 0 0 40%; height: 62%; z-index: 0; pointer-events: none; color: var(--brand); }
.membership svg { width: 100%; height: 100%; }
.membership .fou { fill: var(--band); opacity: 0.42; }
.membership .umf, .membership .lmf { fill: none; stroke: currentColor; stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.membership .lmf { stroke-dasharray: 5 5; opacity: 0.75; }
.membership .axis { stroke: var(--rule); stroke-width: 1; vector-effect: non-scaling-stroke; }
@media (prefers-reduced-motion: no-preference) {
  .membership .umf { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.6s 0.2s ease-out forwards; }
  .membership .fou { opacity: 0; animation: fade 1s 1.2s ease-out forwards; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes fade { to { opacity: 0.42; } }
}

@media (max-width: 56rem) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); }
  .membership { left: 0; height: 28%; }
}

/* Sections */
section { padding: clamp(3rem, 7vw, 5.5rem) 0; border-top: 1px solid var(--rule); }
section.alt { background: var(--surface); }
.section-intro { color: var(--ink-2); font-size: 1.1rem; max-width: 62ch; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 1.5rem 2.5rem; }
.cols > div > p:last-child { margin-bottom: 0; }

/* Methods: a reference list, not a card grid */
.method-list { list-style: none; padding: 0; margin: 2rem 0 0; border-top: 2px solid var(--ink); }
.method-list > li { max-width: none; display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); gap: 0.5rem 2.5rem; padding: 1.4rem 0; border-bottom: 1px solid var(--rule); }
.method-list h3 { margin-bottom: 0.25rem; }
.method-list .family { color: var(--ink-2); font-size: 0.92rem; margin: 0; }
.method-list .role { display: inline-block; margin-top: 0.5rem; font-size: 0.85rem; padding: 0.1rem 0.55rem; border-radius: 999px; background: var(--brand-soft); color: var(--ink); }
.method-list .sources { font-size: 0.93rem; color: var(--ink-2); margin: 0.6rem 0 0; }
.method-list .limits { font-size: 0.93rem; color: var(--ink-2); }
.method-list .comparator .role { background: transparent; border: 1px solid var(--rule); }
@media (max-width: 48rem) { .method-list > li { grid-template-columns: minmax(0, 1fr); } }

/* Features: a two-column definition list */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1.4rem 3rem; margin: 2rem 0 0; align-items: start; }
.features dt { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; }
.features dd { margin: 0.3rem 0 0; color: var(--ink-2); max-width: 52ch; }

/* Workflow: a real sequence, so it is numbered */
.workflow { list-style: none; counter-reset: step; padding: 0; margin: 2.5rem 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem 0; }
.workflow li { counter-increment: step; position: relative; padding: 2.6rem 1.25rem 0 0; max-width: none; }
.workflow li::before {
  content: counter(step); position: absolute; top: 0; left: 0; width: 2rem; height: 2rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); font-weight: 700; font-size: 0.95rem;
}
.workflow li::after { content: ""; position: absolute; top: 1rem; left: 2.4rem; right: 0.6rem; border-top: 2px solid var(--band); }
.workflow li:nth-child(3n)::after, .workflow li:last-child::after { display: none; }
@media (min-width: 72rem) {
  .workflow { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .workflow li:nth-child(3n)::after { display: block; }
  .workflow li:last-child::after { display: none; }
}
.workflow h3 { font-size: 1.08rem; margin-bottom: 0.35rem; }
.workflow p { color: var(--ink-2); font-size: 0.97rem; margin: 0; }
@media (max-width: 40rem) {
  .workflow { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .workflow li:nth-child(3n)::after { display: block; }
  .workflow li:last-child::after { display: none; }
  .workflow li { padding: 0 0 1.5rem 3rem; }
  .workflow li::after { top: 2.3rem; bottom: 0.3rem; left: 1rem; right: auto; border-top: 0; border-left: 2px solid var(--band); }
}

/* Screenshot gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); gap: 1.75rem; margin-top: 2rem; }
.gallery figure { margin: 0; }
.gallery button { display: block; width: 100%; padding: 0; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; background: var(--surface); cursor: zoom-in; }
.gallery button:hover { border-color: var(--brand); }
.gallery figcaption { font-size: 0.93rem; color: var(--ink-2); margin-top: 0.6rem; }
.gallery figcaption strong { color: var(--ink); font-weight: 600; }
dialog.lightbox { border: 0; padding: 0; max-width: min(96vw, 1600px); width: fit-content; background: var(--surface); color: var(--ink); border-radius: 10px; }
dialog.lightbox::backdrop { background: rgb(9 16 30 / 0.82); }
dialog.lightbox img { max-height: 82vh; width: auto; }
dialog.lightbox .lb-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.6rem 0.9rem; font-size: 0.95rem; }
dialog.lightbox .lb-bar button { font: inherit; background: none; color: inherit; border: 1px solid var(--rule); border-radius: 6px; padding: 0.3rem 0.7rem; cursor: pointer; }

/* Download */
.download { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 2rem 3.5rem; margin-top: 2rem; }
@media (max-width: 56rem) { .download { grid-template-columns: minmax(0, 1fr); } }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.55rem 1.5rem; margin: 0 0 1.5rem; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; }
.hash { font-family: var(--mono); font-size: 0.85rem; overflow-wrap: anywhere; background: var(--brand-soft); padding: 0.15rem 0.35rem; border-radius: 4px; }
.steps { padding-left: 1.3rem; }
.steps li { margin-bottom: 0.6rem; }
.note { background: var(--note-bg); color: var(--note-ink); padding: 0.9rem 1.1rem; border-radius: 8px; font-size: 0.97rem; max-width: var(--measure); }
.note p:last-child { margin-bottom: 0; }
.note code, .steps code { overflow-wrap: anywhere; }
pre.cmd { background: var(--brand-soft); color: var(--ink); padding: 0.75rem 1rem; border-radius: 6px; overflow-x: auto; font-size: 0.88rem; max-width: 100%; }
pre.cite-text { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Documents */
.doc-list { list-style: none; padding: 0; margin: 2rem 0 0; border-top: 1px solid var(--rule); }
.doc-list li { max-width: none; display: grid; grid-template-columns: minmax(0, 18rem) minmax(0, 1fr) 6rem; align-items: baseline; gap: 0.25rem 2rem; padding: 1rem 0; border-bottom: 1px solid var(--rule); }
.doc-list a { font-weight: 600; font-size: 1.05rem; }
.doc-list .desc { color: var(--ink-2); margin: 0; font-size: 0.97rem; }
.doc-list .size { color: var(--ink-2); font-size: 0.9rem; white-space: nowrap; text-align: right; }
@media (max-width: 48rem) {
  .doc-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .doc-list .desc { grid-column: 1 / -1; grid-row: 2; }
}

/* Funding */
.ack { font-family: var(--serif); font-size: clamp(1.2rem, 2.2vw, 1.45rem); line-height: 1.45; max-width: 48ch; border-left: 4px solid var(--brand); padding-left: 1.25rem; margin: 1.5rem 0; }

/* People */
.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: 2rem 3rem; margin-top: 2rem; }
.people h3 { margin-bottom: 0.2rem; }
.people .role-line { color: var(--ink-2); margin-bottom: 0.5rem; }
.people p { font-size: 0.97rem; }

/* Footer */
.site-footer { background: var(--ink); color: #dbe3f0; padding: 2.75rem 0 2rem; font-size: 0.93rem; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .site-footer { background: #0a101c; } }
.site-footer a { color: #ffffff; }
.site-footer .wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1.5rem 2.5rem; }
.site-footer h2 { font-size: 1.05rem; color: #ffffff; margin-bottom: 0.5rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 0.2rem 0; }
.site-footer .legal { grid-column: 1 / -1; border-top: 1px solid rgb(255 255 255 / 0.18); padding-top: 1.25rem; color: #b8c4d8; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media print {
  .site-header, .membership, .nav-toggle { display: none; }
  section { border: 0; padding: 1.5rem 0; }
}
