/* MicroTodoSuite — engineering case study. Editorial, warm-paper, single-accent system. */

:root {
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-sans: "Instrument Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;

  --ink: #0b0c0e;
  --ink-700: #191b21;
  --ink-500: #454a54;
  --ink-300: #7b808c;

  --paper: #f4f1ea;
  --paper-100: #faf8f2;
  --paper-200: #ede9df;
  --paper-300: #e1dcce;

  --signal: #b5502e;
  --signal-600: #8f3e22;
  --amber: #c98a2c;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --maxw: 1180px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

::selection { background: var(--signal); color: var(--ink); }

a { color: inherit; text-decoration: none; }
code, .mono { font-family: var(--font-mono); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

.hairline { height: 1px; background: var(--ink); opacity: 0.12; border: none; margin: 0; }
.wrap-hr { width: 100%; }

/* --- Reveal-on-scroll --- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal-group .reveal:nth-child(1) { transition-delay: 0s; }
.reveal-group .reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal-group .reveal:nth-child(3) { transition-delay: 0.16s; }
.reveal-group .reveal:nth-child(4) { transition-delay: 0.24s; }
.reveal-group .reveal:nth-child(5) { transition-delay: 0.32s; }
.reveal-group .reveal:nth-child(6) { transition-delay: 0.4s; }

.line-mask { display: block; overflow: hidden; padding-bottom: 0.1em; }
.line-inner {
  display: block;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.9s var(--ease), opacity 0.9s var(--ease);
}
.line-mask:nth-child(1) .line-inner { transition-delay: 0.05s; }
.line-mask:nth-child(2) .line-inner { transition-delay: 0.16s; }
.line-mask:nth-child(3) .line-inner { transition-delay: 0.27s; }
.lines-in .line-inner { transform: none; opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .line-inner { transition-duration: 0.001ms !important; opacity: 1 !important; transform: none !important; }
}

/* --- Top nav --- */
.topnav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  background: transparent;
  transition: background 0.5s var(--ease), border-color 0.5s var(--ease), backdrop-filter 0.5s var(--ease);
}
.topnav.scrolled {
  background: rgba(244, 241, 234, 0.86);
  backdrop-filter: blur(14px);
  border-bottom-color: rgba(11, 12, 14, 0.1);
}
.topnav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  gap: 20px;
  transition: height 0.5s var(--ease);
}
.topnav.scrolled .wrap { height: 62px; }
.brand {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 16px;
}
.brand .dot { color: var(--signal-600); }
.navlinks {
  display: flex;
  gap: 26px;
  overflow-x: auto;
  scrollbar-width: none;
}
.navlinks::-webkit-scrollbar { display: none; }
.navlinks a {
  color: var(--ink-500);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  padding: 6px 0;
  position: relative;
}
.navlinks a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%; bottom: 0;
  height: 1px;
  background: var(--signal-600);
  transition: right 0.35s var(--ease);
}
.navlinks a:hover { color: var(--ink); }
.navlinks a:hover::after { right: 0; }
.nav-cta {
  font-family: var(--font-mono);
  font-size: 12px;
  border: 1px solid rgba(11,12,14,0.18);
  border-radius: 100px;
  padding: 8px 16px;
  white-space: nowrap;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.nav-cta:hover { border-color: var(--ink); background: var(--ink); color: var(--paper); }

/* --- Hero --- */
.hero {
  padding: 168px 0 88px;
  position: relative;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.03;
  font-size: clamp(34px, 5vw, 58px);
  margin: 0 0 26px;
  max-width: 900px;
}
.hero .lede {
  font-size: 18.5px;
  color: var(--ink-500);
  max-width: 680px;
  margin: 0;
}

/* --- Sections --- */
section { padding: 108px 0; }
.section-head { max-width: 700px; margin-bottom: 52px; }
h2 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.08;
  font-size: clamp(26px, 3vw, 36px);
  margin: 0 0 16px;
}
.section-head p { color: var(--ink-500); font-size: 16.5px; margin: 0; }
h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}
p { color: var(--ink-500); }
.prose p { max-width: 760px; }
.prose strong { color: var(--ink); font-weight: 600; }

/* --- Cards / grids --- */
.grid { display: grid; gap: 1px; background: rgba(11,12,14,0.1); border: 1px solid rgba(11,12,14,0.1); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.card {
  background: var(--paper-100);
  padding: 28px 26px;
  transition: background 0.35s var(--ease);
}
.card:hover { background: var(--paper-200); }
.card h3 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card p { font-size: 14.5px; margin: 0; }
.card ul { margin: 12px 0 0; padding-left: 18px; }
.card li { font-size: 14px; color: var(--ink-500); margin-bottom: 6px; }

/* --- Status dots (single-accent semantic system) --- */
.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-500);
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.status.live::before { background: var(--signal-600); }
.status.designed::before { background: var(--ink-300); }
.status.warn::before { background: var(--amber); }

/* --- ADR / decision records (editorial index style) --- */
.decision {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 32px;
  padding: 48px 0;
  border-top: 1px solid rgba(11,12,14,0.12);
}
.decision:last-child { border-bottom: 1px solid rgba(11,12,14,0.12); }
.decision-index {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-300);
  padding-top: 4px;
}
.decision-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.decision-head h3 { margin: 0; font-size: 21px; }
.decision-body .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 760px) {
  .decision { grid-template-columns: 1fr; }
  .decision-body .cols { grid-template-columns: 1fr; }
}
.decision-body h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-300);
  margin: 0 0 10px;
}
.decision-body p, .decision-body li { font-size: 15px; }
.decision-body ul { margin: 0; padding-left: 18px; }
.decision-body li { color: var(--ink-500); margin-bottom: 7px; }

/* --- Tables --- */
.tbl-wrap { overflow-x: auto; border-top: 1px solid rgba(11,12,14,0.14); }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 620px; }
th, td { text-align: left; padding: 13px 18px 13px 0; border-bottom: 1px solid rgba(11,12,14,0.1); }
th {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-300);
  font-weight: 500;
}
td { color: var(--ink-500); }
tr:last-child td { border-bottom: none; }

/* --- Diagram frames --- */
.diagram {
  background: var(--paper-100);
  border: 1px solid rgba(11,12,14,0.1);
  padding: 30px;
  overflow-x: auto;
}
.diagram svg { display: block; width: 100%; height: auto; min-width: 640px; }
.diagram-caption {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-300);
  margin-top: 16px;
}
.diagram + .diagram { margin-top: 22px; }
.diagram-link { display: block; cursor: zoom-in; }
.diagram-link img {
  display: block;
  height: auto;
  max-width: 100%;
}
.diagram-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-300);
}
.diagram-transition {
  margin: 34px 0 22px;
  max-width: 720px;
}

/* --- Pipeline strip --- */
.pipeline {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  align-items: center;
  border-top: 1px solid rgba(11,12,14,0.12);
  border-bottom: 1px solid rgba(11,12,14,0.12);
}
.pipe-step {
  padding: 16px 20px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink);
  border-right: 1px dashed rgba(11,12,14,0.18);
  white-space: nowrap;
}
.pipe-step:last-child { border-right: none; }

/* --- Evidence / verified-state panels --- */
.evidence-panel {
  border-top: 1px solid rgba(11,12,14,0.14);
  padding: 30px 0;
}

/* --- Footer --- */
footer {
  padding: 56px 0 72px;
  color: var(--ink-300);
  font-size: 13px;
  border-top: 1px solid rgba(11,12,14,0.14);
}
footer a { color: var(--ink-500); transition: color 0.3s var(--ease); }
footer a:hover { color: var(--ink); }
.foot-grid { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; }

/* --- Misc --- */
.tech-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-500);
  border: 1px solid rgba(11,12,14,0.16);
  padding: 6px 13px;
  border-radius: 100px;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.tech-pill:hover { border-color: var(--ink); background: var(--paper-200); }
.kicker-list { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }

/* --- Team --- */
.team-card { text-align: left; }
.team-photo {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin-bottom: 18px;
  filter: grayscale(0.65);
  transition: filter 0.4s var(--ease);
}
.team-card:hover .team-photo { filter: grayscale(0); }
.team-role {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-300);
  margin: 0 0 14px;
}
.team-linkedin {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-500);
  border-bottom: 1px solid rgba(11,12,14,0.18);
  padding-bottom: 1px;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.team-linkedin:hover { color: var(--signal-600); border-color: var(--signal-600); text-decoration: none; }
