/* ==========================================================================
   苏哲 · 个人简历站
   Architecture-sheet hero on a dark shell. No external fonts / CDN.
   ========================================================================== */

:root {
  --bg: #0a192f;
  --bg-deep: #071324;
  --card: #112240;
  --card-2: #0d1b30;
  --ink: #e6f1ff;
  --text: #ccd6f6;
  --muted: #8892b0;
  --muted-2: #6b7a96;
  --accent: #64ffda;
  --accent-soft: rgba(100, 255, 218, 0.1);
  --line: rgba(136, 146, 176, 0.18);
  --line-strong: rgba(136, 146, 176, 0.32);
  --radius: 14px;
  --mono: "SF Mono", "JetBrains Mono", "Fira Code", "Cascadia Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --shadow: 0 18px 50px -20px rgba(2, 12, 27, 0.8);
  --paper: #fbfaf6;
  --paper-ink: #0f172a;
  --paper-muted: #64748b;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: rgba(100, 255, 218, 0.24); color: #fff; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
code {
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 1px 5px;
  border-radius: 4px;
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(760px 520px at 82% -8%, rgba(38, 108, 255, 0.16), transparent 62%),
    radial-gradient(620px 460px at 10% 18%, rgba(100, 255, 218, 0.07), transparent 60%),
    radial-gradient(900px 700px at 55% 108%, rgba(120, 80, 255, 0.08), transparent 65%);
}

.page {
  position: relative;
  z-index: 1;
  width: min(1360px, calc(100% - 48px));
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0 14px;
}

.head-main { max-width: 720px; }

.name {
  margin: 0;
  font-size: clamp(36px, 3.6vw, 48px);
  line-height: 0.98;
  letter-spacing: -0.05em;
  font-weight: 800;
  color: var(--ink);
}

.role {
  margin: 8px 0 0;
  font-size: clamp(14px, 1.35vw, 17px);
  line-height: 1.4;
  font-weight: 600;
  color: var(--text);
}

.role span { color: var(--muted); font-weight: 500; }

.tagline {
  margin: 8px 0 0;
  max-width: 42ch;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--muted);
}

.head-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  flex: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav a {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav a:hover,
.nav a.active { color: var(--accent); border-color: var(--accent); }

.head-actions {
  display: flex;
  gap: 8px;
}

.head-links {
  display: flex;
  gap: 14px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted);
}

.head-links a:hover { color: var(--accent); }

.head-stats {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted-2);
}

.head-stats b {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(100, 255, 218, 0.12);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border-radius: 7px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover { transform: translateY(-2px); }

.btn.primary {
  background: var(--accent);
  color: #04121f;
  font-weight: 600;
  border: 1px solid var(--accent);
}

.btn.primary:hover { background: #8bffe7; }

.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-strong);
}

.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }

/* --------------------------------------------------------------------------
   Architecture sheet
   -------------------------------------------------------------------------- */

.arch-hero { padding: 0 0 8px; }

.arch-sheet {
  padding: 16px 20px 8px;
  border-radius: 18px;
  background: var(--paper);
  color: var(--paper-ink);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 30px 80px -32px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}

.arch-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 2px 2px 6px;
  border-bottom: 1px solid #e2e4e8;
  margin-bottom: 6px;
}

.arch-kicker {
  margin: 0 0 5px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: #0f766e;
}

.arch-title {
  margin: 0;
  font-size: clamp(19px, 2.1vw, 27px);
  line-height: 1.2;
  letter-spacing: -0.03em;
  font-weight: 800;
  color: var(--paper-ink);
}

.arch-sub {
  margin: 6px 0 0;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--paper-muted);
}

.arch-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 4px;
  font-size: 9.5px;
  color: #475569;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.legend-item i {
  display: inline-block;
  width: 22px;
  height: 2px;
  border-radius: 1px;
}

.l-main { background: #111827; }
.l-return { background: #7c3aed; }
.l-human { background: #d97706; }
.l-record {
  height: 1px !important;
  background: repeating-linear-gradient(90deg, #94a3b8 0 4px, transparent 4px 8px);
}

.arch-svg {
  display: block;
  width: 100%;
  height: auto;
  font-family: var(--sans);
}

.arch-hit {
  fill: rgba(255, 255, 255, 0);
  cursor: pointer;
  transition: fill 0.2s ease;
}

.arch-hit:hover { fill: rgba(37, 99, 235, 0.08); }

.flow-live {
  stroke-dasharray: 4 8;
  animation: flow-dash 1.1s linear infinite;
}

@keyframes flow-dash {
  to { stroke-dashoffset: -12; }
}

.arch-mobile { display: none; max-width: 680px; margin: 0 auto; }

/* Mobile vertical architecture */
.m-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 14px;
  margin-bottom: 8px;
  font-size: 9.5px;
  color: #475569;
}

.m-block {
  margin-top: 8px;
  padding: 11px 12px;
  border: 1px solid;
  border-radius: 12px;
}

.m-events { background: #e9f2fb; border-color: #bfd6ef; color: #1e3a8a; }
.m-platform { background: #143a33; border-color: #0b2a24; color: #e9f6f1; }
.m-business { background: #ecf7f0; border-color: #c8e4d2; color: #0f5132; }
.m-data { background: #e9f2fb; border-color: #bfd6ef; color: #1e3a8a; }
.m-model { background: #f2ecfa; border-color: #d9c9ef; color: #5b21b6; }
.m-records { background: #f1f3f6; border-color: #d5dae1; color: #334155; }

.m-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 10.5px;
  font-weight: 700;
}

.m-hint {
  flex: none;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 400;
  opacity: 0.65;
}

.m-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.m-chip {
  padding: 4px 7px;
  border: 1px solid #c9d5e3;
  border-radius: 6px;
  background: #fff;
  font-size: 9px;
  color: #263445;
}

.m-platform .m-chip {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.28);
  color: #e9f6f1;
}

.m-human {
  background: #fff3e4 !important;
  border-color: #e8b36a !important;
  color: #92400e !important;
}

.m-return {
  display: block;
  margin-top: 7px;
  font-family: var(--mono);
  font-size: 8.5px;
  color: #7c3aed;
}

.m-note {
  margin: 7px 0 0;
  font-size: 8.5px;
  color: #9fc0b6;
}

.m-arrow {
  height: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.m-arrow::before {
  content: "";
  width: 1px;
  height: 12px;
  background: #111827;
}

.m-arrow::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #111827;
}

.m-lane {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #cfe0d5;
}

.m-lane:first-of-type { margin-top: 6px; padding-top: 0; border-top: 0; }

.m-lane-head {
  font-size: 10px;
  font-weight: 700;
  color: #0f5132;
}

.m-click { cursor: pointer; }
.m-click:active { opacity: 0.82; }

.m-records-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-top: 7px;
}

.m-record {
  padding: 5px 6px;
  border: 1px solid #d5dae1;
  border-radius: 6px;
  background: #fff;
  font-size: 9px;
  text-align: center;
}

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

main { padding-bottom: 56px; }

.section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 56px 0 72px;
}

.section-tight { padding-bottom: 40px; }

.section-kicker {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--accent);
}

.section-title {
  margin: 0;
  font-size: clamp(24px, 2.6vw, 32px);
  line-height: 1.25;
  letter-spacing: -0.03em;
  font-weight: 700;
  color: var(--ink);
}

.section-sub {
  margin: 10px 0 0;
  max-width: 62ch;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

/* Project grid */

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.pcard {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(420px 180px at 100% 0%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 70%),
    rgba(17, 34, 64, 0.46);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.25s ease, transform 0.25s ease, background 0.25s ease;
}

.pcard:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  transform: translateY(-2px);
  background: rgba(17, 34, 64, 0.72);
}

.pcard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--muted-2);
}

.pcard-top span:first-child { color: var(--accent); }

.pcard-name {
  display: block;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 650;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.pcard-line {
  display: block;
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--muted);
}

.pcard-foot {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: auto;
  padding-top: 6px;
}

.pcard-foot strong {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
}

.pcard-foot span { font-size: 9.5px; color: var(--muted-2); }

.pcard-foot em {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 9px;
  font-style: normal;
  color: var(--accent);
  opacity: 0.8;
}

/* Stack */

.stack-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 4px;
}

.stack-cloud span {
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  background: rgba(13, 27, 48, 0.5);
}

/* Open source */

.oss-list {
  display: grid;
  gap: 1px;
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--line);
}

.oss {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: rgba(17, 34, 64, 0.55);
  font-size: 12.5px;
  transition: background 0.2s ease;
}

.oss:hover { background: rgba(17, 34, 64, 0.92); }

.oss span { color: var(--ink); }

.oss b {
  flex: none;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  color: var(--accent);
}

.inline-link {
  display: inline-block;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--accent);
  border-bottom: 1px solid rgba(100, 255, 218, 0.35);
  padding-bottom: 2px;
}

.inline-link:hover { opacity: 0.75; }

/* Experience */

.exp-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-top: 4px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.exp-row h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  color: var(--ink);
}

.exp-row p { margin: 5px 0 0; font-size: 12px; color: var(--accent); }

.exp-row > span {
  flex: none;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted-2);
  white-space: nowrap;
}

.exp-line {
  margin: 16px 0 0;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--muted);
}

.edu-line {
  margin: 10px 0 0;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted-2);
}

/* Contact / footer */

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
}

.contact-links a { border-bottom: 1px dotted var(--line-strong); padding-bottom: 1px; }
.contact-links a:hover { color: var(--accent); border-color: var(--accent); }

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted-2);
}

.footer p { margin: 0; }

/* --------------------------------------------------------------------------
   Dialog / runtime drawer
   -------------------------------------------------------------------------- */

.project-dialog {
  width: min(720px, calc(100vw - 32px));
  max-width: none;
  max-height: 88vh;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}

.project-dialog::backdrop {
  background: rgba(3, 9, 18, 0.72);
  backdrop-filter: blur(6px);
}

body.dialog-open { overflow: hidden; }

.dialog-inner {
  position: relative;
  max-height: 88vh;
  overflow-y: auto;
  padding: 26px 28px 28px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(17, 34, 64, 0.98), rgba(8, 20, 37, 0.98));
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.dialog-inner::-webkit-scrollbar { width: 6px; }
.dialog-inner::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }

.dialog-close {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(10, 25, 47, 0.9);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.dialog-close:hover { border-color: var(--accent); color: var(--accent); }

.dialog-kicker {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.dialog-title {
  margin: 0;
  padding-right: 40px;
  font-size: clamp(20px, 2.4vw, 26px);
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.dialog-meta {
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted-2);
}

.dialog-desc {
  margin: 14px 0 0;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--muted);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 18px 0 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--line);
}

.metric {
  padding: 12px 13px;
  background: rgba(6, 16, 30, 0.6);
}

.metric strong {
  display: block;
  font-family: var(--mono);
  font-size: clamp(15px, 1.8vw, 18px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--accent);
  font-weight: 600;
}

.metric span {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.5;
  color: var(--muted);
}

.flow-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 0 8px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--muted-2);
}

.flow-label em {
  font-style: normal;
  letter-spacing: 0.02em;
  opacity: 0.8;
}

.flow-wrap {
  overflow-x: auto;
  padding: 2px 2px 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.flow-wrap::-webkit-scrollbar { height: 5px; }
.flow-wrap::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }

.flow {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.flow-node {
  position: relative;
  flex: 1 1 78px;
  min-width: 78px;
  max-width: 120px;
  min-height: 82px;
  padding: 10px 7px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card-2);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.flow-node:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  transform: translateY(-2px);
}

.flow-node.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, var(--card-2));
  box-shadow: 0 0 0 1px var(--accent);
}

.node-code {
  display: block;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--muted-2);
}

.node-layer {
  display: block;
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.04em;
  line-height: 1.25;
  color: var(--accent);
  overflow-wrap: anywhere;
}

.node-title {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--text);
}

.flow-link {
  flex: 0 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.flow-link::before {
  content: "";
  width: 100%;
  height: 1px;
  background: var(--line-strong);
}

.flow-link::after {
  content: "";
  position: absolute;
  right: 1px;
  width: 5px;
  height: 5px;
  border-top: 1px solid var(--line-strong);
  border-right: 1px solid var(--line-strong);
  transform: rotate(45deg);
}

.node-detail {
  margin-top: 10px;
  padding: 12px 14px;
  border-left: 2px solid var(--accent);
  border-radius: 0 9px 9px 0;
  background: rgba(6, 16, 30, 0.62);
  min-height: 92px;
}

.detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 9px;
}

.detail-layer {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.detail-title { font-size: 12.5px; font-weight: 650; color: var(--ink); }

.detail-endpoint {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted);
}

.detail-desc {
  margin: 6px 0 0;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--muted);
}

.detail-source {
  margin: 7px 0 0;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted-2);
}

.detail-source b { color: var(--accent); font-weight: 500; }

.project-points {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.project-points li {
  position: relative;
  padding-left: 17px;
  font-size: 12px;
  line-height: 1.75;
  color: var(--muted);
}

.project-points li::before {
  content: "▹";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-size: 10px;
}

.evidence {
  display: flex;
  gap: 9px;
  margin: 16px 0 0;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--muted);
}

.evidence b {
  flex: none;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  color: var(--accent);
  padding-top: 2px;
}

.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 16px;
}

.project-stack span {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted);
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

/* --------------------------------------------------------------------------
   Toast / reveal
   -------------------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  transform: translate(-50%, 16px);
  padding: 9px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(7, 19, 36, 0.94);
  backdrop-filter: blur(8px);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1), transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.js .reveal.visible { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1120px) {
  .site-head { flex-wrap: wrap; align-items: flex-start; }
  .head-side { align-items: flex-start; flex-direction: row; flex-wrap: wrap; gap: 10px 18px; width: 100%; }
  .head-actions { order: 3; }
  .head-stats { order: 5; }
  .nav { order: 2; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
  .arch-desktop { display: none; }
  .arch-mobile { display: block; }
  .arch-legend { display: none; }
  .arch-sheet-head { flex-direction: column; gap: 6px; max-width: 680px; margin-left: auto; margin-right: auto; }
  .arch-sheet { padding: 14px 14px 12px; }
  .section { padding: 44px 0 56px; }
}

@media (max-width: 720px) {
  body { font-size: 15px; }

  .page { width: calc(100% - 28px); }
  .site-head { padding-top: 24px; gap: 12px; }
  .name { font-size: 38px; }
  .tagline { font-size: 12.5px; }
  .nav { display: none; }
  .head-stats { gap: 12px; }
  .status { display: none; }
  .head-side { gap: 9px; }

  .arch-title { font-size: 18px; }
  .arch-sub { font-size: 9.5px; }
  .arch-kicker { font-size: 8px; }

  .section { padding: 36px 0 48px; }
  .project-grid { grid-template-columns: 1fr; }
  .exp-row { flex-direction: column; gap: 6px; }
  .oss { padding: 11px 14px; font-size: 11.5px; }
  .contact-links { gap: 12px; }
  .footer { flex-direction: column; gap: 6px; }

  .project-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    inset: 0;
  }

  .dialog-inner {
    height: 100dvh;
    max-height: 100dvh;
    padding: 18px 16px 24px;
    border-radius: 0;
    border: 0;
  }

  .metrics { grid-template-columns: 1fr; }

  .metric { display: flex; align-items: baseline; gap: 10px; padding: 9px 12px; }

  .metric strong { flex: none; min-width: 78px; }

  .metric span { margin-top: 0; }

  .flow { width: max-content; }
  .flow-node { flex: 0 0 96px; }

  .dialog-title { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .js .reveal { opacity: 1; transform: none; }
  .flow-live { display: none; }
}

/* --------------------------------------------------------------------------
   Print
   -------------------------------------------------------------------------- */

@media print {
  :root {
    --bg: #fff;
    --ink: #111;
    --text: #222;
    --muted: #555;
    --muted-2: #777;
    --line: #ddd;
    --line-strong: #bbb;
    --accent: #0b6b5a;
    --card: #fff;
    --card-2: #fff;
  }

  body { background: #fff; color: #222; font-size: 10.5pt; }
  .bg-glow, .nav, .head-actions, .head-links, .toast, .inline-link { display: none !important; }
  .page { width: 100%; }
  .site-head { padding: 0 0 12px; }
  main { padding: 0; }
  .section, .arch-hero { padding-bottom: 18px; page-break-inside: avoid; }
  .arch-sheet { box-shadow: none; border-color: #ccc; }
  .arch-mobile { display: none !important; }
  .arch-desktop { display: block !important; }
  .arch-svg { width: 100%; height: auto; }
  .flow-live { display: none; }
  .pcard, .oss, .exp-row { break-inside: avoid; background: #fff; }
  .project-dialog { display: none !important; }
  .reveal, .js .reveal { opacity: 1 !important; transform: none !important; }
}
