/* Resumé — chic, warm, single accent. Text always wears ink tokens; color is
   reserved for the accent bars and the four status colors. */

:root {
  --bg: #f6f1ea;
  --surface: #fffdf9;
  --surface-2: #f0e9df;
  --line: #e4dbcf;
  --ink: #1b1a17;
  --ink-2: #4c473f;
  --ink-3: #857c70;
  --accent: #163d3a;
  --accent-2: #2f6b64;
  --accent-soft: #d9e6e2;
  --good: #2f6f3e;
  --good-soft: #dfeee2;
  --warn: #8a5a12;
  --warn-soft: #f6e9cf;
  --serious: #a3441f;
  --serious-soft: #f7dfd3;
  --critical: #8b1e2d;
  --critical-soft: #f5d8dc;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(27, 26, 23, .04), 0 12px 32px -16px rgba(27, 26, 23, .18);
  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; margin: 0; }
h1 { font-size: clamp(2.4rem, 5.5vw, 4.2rem); line-height: 1.05; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.15; }
h3 { font-size: 1.35rem; margin-bottom: .25rem; }
em { font-style: italic; }
p { margin: 0 0 .75rem; }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }
.eyebrow {
  text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 600;
  color: var(--accent-2); margin-bottom: .75rem;
}
[hidden] { display: none !important; }

/* ---- chrome ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem clamp(1rem, 4vw, 3rem);
}
.brand { font-family: var(--serif); font-size: 1.6rem; text-decoration: none; }
.brand-accent { color: var(--accent-2); }
.nav { display: flex; gap: .25rem; align-items: center; }
.nav a, .nav button {
  font: inherit; font-size: .9rem; color: var(--ink-2); text-decoration: none;
  padding: .45rem .8rem; border-radius: 999px; border: 0; background: transparent; cursor: pointer;
}
.nav a:hover, .nav button:hover { background: var(--surface-2); color: var(--ink); }
.nav .who { color: var(--ink-3); font-size: .85rem; padding-right: .5rem; }
.view { flex: 1; width: min(1080px, 100% - 2rem); margin: 0 auto; padding: 1rem 0 4rem; }
.footer { padding: 1.5rem; text-align: center; color: var(--ink-3); font-size: .8rem; border-top: 1px solid var(--line); }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-weight: 500; font-size: .95rem; text-decoration: none; cursor: pointer;
  padding: .7rem 1.25rem; border-radius: 999px; border: 1px solid transparent;
  transition: transform .12s ease, background .12s ease, opacity .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #f6f1ea; }
.btn-primary:not(:disabled):hover { background: var(--accent-2); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger-ghost { background: transparent; border-color: transparent; color: var(--critical); }
.btn-danger-ghost:hover { background: var(--critical-soft); }
.btn-block { width: 100%; }

/* ---- cards & forms ---- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow);
}
label { display: block; margin-bottom: 1rem; }
label > span { display: block; font-size: .85rem; font-weight: 500; color: var(--ink-2); margin-bottom: .35rem; }
input[type="text"], input[type="email"], input[type="password"] {
  width: 100%; font: inherit; padding: .7rem .9rem; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent-2); }
.form-error { color: var(--critical); font-size: .9rem; margin: -.25rem 0 .75rem; }
.grow { flex: 1; }

/* ---- landing ---- */
.hero { padding: clamp(2rem, 8vh, 6rem) 0 3rem; max-width: 820px; }
.lede { font-size: 1.15rem; color: var(--ink-2); max-width: 620px; margin: 1.25rem 0 1.75rem; }
.cta-row { display: flex; gap: .75rem; flex-wrap: wrap; }
.proof { list-style: none; padding: 0; margin: 2.5rem 0 0; display: flex; gap: 2rem; flex-wrap: wrap; color: var(--ink-3); font-size: .9rem; }
.proof strong { display: block; font-family: var(--serif); font-size: 1.9rem; color: var(--ink); line-height: 1; }
.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; border-top: 1px solid var(--line); padding-top: 2.5rem; }
.how-step p { color: var(--ink-2); }
.how-num { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-family: var(--serif); font-size: 1.1rem; margin-bottom: .75rem; }

/* ---- auth ---- */
.auth { max-width: 420px; margin: clamp(1rem, 8vh, 5rem) auto; }
.auth h2 { margin-bottom: .25rem; }
.auth form { margin-top: 1.25rem; }

/* ---- dashboard ---- */
.dash-head { display: flex; justify-content: space-between; align-items: end; margin: 1rem 0 1.25rem; }
.upload { margin-bottom: 2rem; }
.drop {
  border: 1.5px dashed var(--line); border-radius: 14px; padding: 2rem 1rem; text-align: center;
  cursor: pointer; transition: background .12s ease, border-color .12s ease; background: var(--bg);
}
.drop:hover, .drop:focus-visible, .drop.over { border-color: var(--accent-2); background: var(--accent-soft); outline: none; }
.drop-title { font-family: var(--serif); font-size: 1.35rem; margin: 0 0 .25rem; }
.upload-row { display: flex; gap: 1rem; align-items: end; margin-top: 1.25rem; flex-wrap: wrap; }
.upload-row label { margin: 0; }
.progress { margin-top: 1rem; }
.progress-bar { height: 4px; border-radius: 2px; background: var(--accent-soft); overflow: hidden; position: relative; margin-bottom: .5rem; }
.progress-bar::after {
  content: ""; position: absolute; inset: 0; width: 40%; background: var(--accent);
  animation: slide 1s ease-in-out infinite;
}
@keyframes slide { 0% { left: -40%; } 100% { left: 100%; } }

.history-empty { text-align: center; color: var(--ink-3); padding: 2rem 0; }
.hist-list { display: grid; gap: .6rem; }
.hist {
  display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: .9rem 1.1rem;
  text-decoration: none; transition: border-color .12s ease, transform .12s ease;
}
.hist:hover { border-color: var(--accent-2); transform: translateY(-1px); }
.hist-score { font-family: var(--serif); font-size: 1.9rem; line-height: 1; width: 3rem; text-align: center; }
.hist-score small { display: block; font-family: var(--sans); font-size: .65rem; letter-spacing: .1em; color: var(--ink-3); text-transform: uppercase; }
.hist-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-sub { color: var(--ink-3); font-size: .85rem; }
.hist-grade { font-family: var(--serif); font-size: 1.4rem; color: var(--accent-2); }
.trend { display: flex; gap: .6rem; align-items: center; margin: 1.25rem 0 .75rem; color: var(--ink-3); font-size: .85rem; }
.trend svg { height: 36px; width: 140px; }
.trend path { fill: none; stroke: var(--accent-2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.trend circle { fill: var(--accent-2); }

/* ---- report ---- */
.back { display: inline-block; color: var(--ink-3); text-decoration: none; font-size: .9rem; margin-bottom: 1.25rem; }
.back:hover { color: var(--ink); }
.report-head { display: grid; grid-template-columns: auto 1fr; gap: 2rem; align-items: center; margin-bottom: 2rem; }
@media (max-width: 640px) { .report-head { grid-template-columns: 1fr; } }
.score-hero { position: relative; width: 168px; height: 168px; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--surface-2); stroke-width: 8; }
.ring-fill { fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset 1.1s cubic-bezier(.2,.8,.2,1); }
.score-num { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.score-value { font-family: var(--serif); font-size: 3.6rem; line-height: 1; }
.score-of { font-size: .8rem; color: var(--ink-3); letter-spacing: .05em; }
.report-title h2 { margin-bottom: .75rem; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin: 0; }
.chip { font-size: .78rem; padding: .3rem .7rem; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.chip.accent { background: var(--accent-soft); color: var(--accent); }

.report-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1rem; margin-bottom: 1rem; }
@media (max-width: 800px) { .report-grid { grid-template-columns: 1fr; } }

.dims { display: grid; gap: .9rem; margin-top: 1rem; }
.dim { display: grid; grid-template-columns: 1fr auto; gap: .25rem .75rem; align-items: baseline; }
.dim-label { font-weight: 500; }
.dim-weight { color: var(--ink-3); font-size: .78rem; }
.dim-bar { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; position: relative; }
.dim-bar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--accent-2); width: 0; transition: width .9s cubic-bezier(.2,.8,.2,1); }
.dim-bar > b { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--surface); }
.dim-level { grid-column: 1 / -1; font-size: .85rem; color: var(--ink-2); display: flex; justify-content: space-between; gap: 1rem; }
.dim-level .score { color: var(--ink-3); white-space: nowrap; }
.dim-advice { grid-column: 1 / -1; font-size: .88rem; color: var(--ink-2); background: var(--bg); border-left: 3px solid var(--accent-soft); padding: .5rem .75rem; border-radius: 0 8px 8px 0; }
.uncertain { font-size: .72rem; color: var(--warn); margin-left: .35rem; }

.fixes { padding-left: 1.25rem; margin: .75rem 0 0; display: grid; gap: .75rem; }
.fixes li { color: var(--ink-2); }
.fixes li::marker { font-family: var(--serif); color: var(--accent-2); font-size: 1.1rem; }
.fixes strong { color: var(--ink); font-weight: 500; }

.findings { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .6rem; }
.finding { display: grid; grid-template-columns: auto 1fr auto; gap: .6rem; align-items: start; padding: .6rem .8rem; border-radius: 10px; font-size: .9rem; }
.finding .ico { font-size: .95rem; line-height: 1.4; }
.finding .pts { font-variant-numeric: tabular-nums; color: var(--ink-3); font-size: .8rem; white-space: nowrap; }
.finding .why { display: block; color: var(--ink-2); font-size: .84rem; margin-top: .15rem; }
.finding.good { background: var(--good-soft); } .finding.good .ico { color: var(--good); }
.finding.warn { background: var(--warn-soft); } .finding.warn .ico { color: var(--warn); }
.finding.serious { background: var(--serious-soft); } .finding.serious .ico { color: var(--serious); }
.finding.critical { background: var(--critical-soft); } .finding.critical .ico { color: var(--critical); }
.none { color: var(--ink-3); font-size: .9rem; padding: .4rem 0; }

.details summary { cursor: pointer; font-family: var(--serif); font-size: 1.2rem; }
.details-body { margin-top: 1rem; color: var(--ink-2); font-size: .9rem; }
.details-body table { border-collapse: collapse; width: 100%; margin-top: .5rem; }
.details-body td, .details-body th { text-align: left; padding: .35rem .5rem; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.details-body th { font-weight: 500; color: var(--ink-3); font-size: .8rem; }

.report-actions { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; align-items: center; }
.inline-form { display: flex; gap: .5rem; flex: 1; max-width: 480px; }
.inline-form input { flex: 1; }

/* ---- toast ---- */
.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: .7rem 1.1rem; border-radius: 999px; font-size: .9rem;
  box-shadow: var(--shadow); max-width: min(90vw, 520px);
}

.skeleton { height: 1em; background: linear-gradient(90deg, var(--surface-2), var(--bg), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  .ring-fill, .dim-bar > i, .btn { transition: none; }
  .progress-bar::after, .skeleton { animation: none; }
}
