/* dieec.evemisslab.com — one stylesheet, no dependencies.
   Signature colour: a wax-seal plum. Deliberately not MLF's blue-violet --
   the lab index prints every sibling's colour on one page, so two violets
   there would read as a mistake rather than as two projects.
   Warm paper in light, ink in dark, per the EveMissLab family convention. */

:root {
  --paper: #f7f5f1;
  --paper-2: #fffefb;
  --paper-3: #edeae3;
  --ink: #17181d;
  --ink-2: #40434c;
  --ink-3: #6c6f7a;
  --rule: #dbd6cd;
  --rule-2: #c7c1b6;
  --accent: #6b2d5c;
  --accent-2: #521f46;
  --accent-wash: #f3e7f0;
  --ok: #1c6b4a;
  --ok-wash: #e2f0e9;
  --warn: #8a5a10;
  --bad: #a02525;
  --bad-wash: #f6e6e6;
  --mono: ui-monospace, "Cascadia Mono", "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --serif: "Iowan Old Style", "Source Serif 4", Georgia, "Noto Serif TC", serif;
  --shadow: 0 1px 2px rgba(20, 24, 30, .06), 0 8px 24px -12px rgba(20, 24, 30, .18);
  --radius: 10px;
  --wrap: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15161b;
    --paper-2: #1c1e25;
    --paper-3: #242730;
    --ink: #eae8e3;
    --ink-2: #b9b6af;
    --ink-3: #8c8a85;
    --rule: #2f333c;
    --rule-2: #3d424d;
    --accent: #e39bd0;
    --accent-2: #f0c2e2;
    --accent-wash: #342030;
    --ok: #6fc39b;
    --ok-wash: #16281f;
    --warn: #d9ab5c;
    --bad: #e88b8b;
    --bad-wash: #2c1c1c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -14px rgba(0, 0, 0, .7);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  font-feature-settings: "kern" 1, "liga" 1;
}

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

a { color: var(--accent); text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: .18em; }
a:hover { color: var(--accent-2); }

code { font: 500 .89em/1.5 var(--mono); background: var(--paper-3); padding: .1em .38em; border-radius: 4px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

/* ---------------------------------------------------------------- topbar */

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.topbar .inner { display: flex; align-items: center; gap: 16px; min-height: 58px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; color: var(--ink); letter-spacing: -.01em; }
.brand .mark {
  width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center;
  background: var(--accent); color: #fff; font: 700 12px/1 var(--mono);
}
@media (prefers-color-scheme: dark) { .brand .mark { color: #14151a; } }
.brand small { display: block; font: 400 11px/1.2 var(--sans); color: var(--ink-3); letter-spacing: .02em; }
.nav { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.nav a { padding: 6px 10px; border-radius: 7px; font-size: 14px; text-decoration: none; color: var(--ink-2); }
.nav a:hover { background: var(--paper-3); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-wash); }
.langswitch { font: 500 13px/1 var(--mono); padding: 6px 9px; border: 1px solid var(--rule-2); border-radius: 7px; text-decoration: none; color: var(--ink-2); }
.langswitch:hover { border-color: var(--accent); color: var(--accent); }

/* ---------------------------------------------------------------- hero */

.hero { padding: 64px 0 34px; }
.eyebrow { font: 600 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
h1 { font: 700 clamp(30px, 5vw, 48px)/1.14 var(--sans); letter-spacing: -.025em; margin: 16px 0 0; max-width: 22ch; }
h1 em { font-style: normal; color: var(--accent); }
.lead { font-size: clamp(17px, 2.1vw, 19.5px); color: var(--ink-2); max-width: 66ch; margin: 18px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 10px 16px; border-radius: 8px; border: 1px solid var(--rule-2);
  background: var(--paper-2); color: var(--ink); font: 500 14.5px/1 var(--sans);
  text-decoration: none; transition: border-color .15s, background .15s, transform .05s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.primary, .btn.primary:hover { color: #14151a; } }

/* ---------------------------------------------------------------- sections */

section { padding: 34px 0; }
section.tinted { background: var(--paper-2); border-block: 1px solid var(--rule); }
h2 { font: 700 clamp(21px, 3vw, 28px)/1.25 var(--sans); letter-spacing: -.02em; margin: 0 0 14px; }
h3 { font: 650 17.5px/1.4 var(--sans); margin: 26px 0 8px; letter-spacing: -.01em; }
p { margin: 0 0 14px; max-width: 74ch; }
.prose > :last-child { margin-bottom: 0; }
.note { color: var(--ink-3); font-size: 15px; max-width: 74ch; }

/* ---------------------------------------------------------------- stats */

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 30px 0 0; }
.stat { background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px 18px; }
.stat b { display: block; font: 700 clamp(21px, 3vw, 27px)/1.1 var(--sans); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat span { display: block; font-size: 13px; color: var(--ink-3); margin-top: 5px; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------------------------------------------------------------- thesis */

.thesis {
  border: 1px solid var(--rule-2); border-left: 3px solid var(--accent);
  background: var(--paper-2); border-radius: var(--radius);
  padding: 22px 24px; margin: 0;
}
.thesis .formula {
  font: 600 clamp(15px, 2.2vw, 19px)/1.65 var(--serif);
  letter-spacing: -.005em; margin: 0; max-width: none; color: var(--ink);
}
.thesis .formula .ne { color: var(--accent); font-family: var(--mono); font-size: .88em; padding: 0 .18em; }

/* ---------------------------------------------------------------- table */

.tablewrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper-2); }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; min-width: 620px; }
caption { text-align: left; padding: 14px 18px 0; color: var(--ink-3); font-size: 14px; }
th, td { padding: 9px 14px; text-align: right; border-bottom: 1px solid var(--rule); font-variant-numeric: tabular-nums; }
th:first-child, td:first-child { text-align: left; font-variant-numeric: normal; }
thead th { font: 600 12.5px/1.4 var(--sans); color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.highlight td { background: var(--accent-wash); font-weight: 600; }
tbody tr.highlight td:first-child { color: var(--accent); }

/* ---------------------------------------------------------------- chain */

.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 20px 0; padding: 0; list-style: none; }
.chain li { display: flex; align-items: center; gap: 8px; }
.chain li::before { content: "→"; color: var(--accent); font-family: var(--sans); }
.chain li:first-child::before { content: none; }
.chain span {
  font: 600 13.5px/1 var(--mono); padding: 10px 14px; border-radius: 8px;
  background: var(--paper-2); border: 1px solid var(--rule-2); color: var(--ink);
}

/* ---------------------------------------------------------------- list */

.checklist { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 7px; }
.checklist li { display: flex; gap: 11px; align-items: baseline; font-size: 15px; color: var(--ink-2); max-width: 78ch; }
.checklist li::before { content: "—"; color: var(--accent); font-family: var(--mono); flex: none; }

.policy { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.policy li {
  font: 500 13.5px/1.5 var(--mono); padding: 9px 13px; border-radius: 8px;
  background: var(--paper-2); border: 1px solid var(--rule); color: var(--ink-2);
}
.policy li b { color: var(--ink); font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 0; padding: 0; list-style: none; }
.chips li { font: 500 12.5px/1 var(--mono); padding: 7px 10px; border-radius: 6px; background: var(--accent-wash); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); }

/* ---------------------------------------------------------------- defect cards */

.defects { display: grid; gap: 14px; margin-top: 22px; counter-reset: defect; }
.defect {
  background: var(--paper-2); border: 1px solid var(--rule); border-left: 3px solid var(--bad);
  border-radius: var(--radius); padding: 20px 22px;
}
.defect h3 { margin: 0 0 10px; display: flex; gap: 11px; align-items: baseline; }
.defect h3::before {
  counter-increment: defect; content: counter(defect);
  font: 700 12px/1 var(--mono); color: var(--bad); background: var(--bad-wash);
  border-radius: 5px; padding: 5px 7px; flex: none;
}
.defect p:last-child { margin-bottom: 0; }

.measured { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 18px; }
.measured div { background: var(--ok-wash); border: 1px solid color-mix(in srgb, var(--ok) 28%, transparent); border-radius: 8px; padding: 13px 15px; }
.measured b { display: block; font: 700 17px/1.2 var(--sans); color: var(--ok); font-variant-numeric: tabular-nums; }
.measured span { display: block; font: 500 12.5px/1.45 var(--mono); color: var(--ink-3); margin-top: 4px; }

/* ---------------------------------------------------------------- cards */

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); gap: 14px; margin-top: 20px; }
.card { background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px 20px; }
.card h3 { margin: 0 0 7px; font-size: 16px; }
.card p { font-size: 14.5px; color: var(--ink-2); margin: 0; }

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

.footer { border-top: 1px solid var(--rule); margin-top: 44px; padding: 24px 0 40px; }
.footer .inner { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; font-size: 14px; color: var(--ink-3); }
.footer a { color: var(--ink-3); }
.footer a:hover { color: var(--accent); }
