/* Папирус — SaaS-layout: sidebar (left) + main (right). Frosted glass + animated bg. */

:root {
  --text: #1a1c20;
  --text-soft: #4a4f57;
  --text-muted: #828892;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.10);
  --accent-border: rgba(37, 99, 235, 0.28);
  --success: #16a34a;
  --success-soft: rgba(22, 163, 74, 0.12);
  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, 0.12);
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-bg-strong: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-shadow: 0 10px 36px rgba(15, 23, 42, 0.18), 0 1px 2px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Text",
               "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: transparent;
}
body.papyrus-saas {
  height: 100vh;
  overflow: hidden;
}

/* Animated mesh bg */
#bg-animated {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 60% 50% at 12% 22%, #fef3c7 0%, transparent 55%),
    radial-gradient(ellipse 50% 60% at 88% 18%, #ddd6fe 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 78% 82%, #fbcfe8 0%, transparent 55%),
    radial-gradient(ellipse 50% 50% at 12% 88%, #bfdbfe 0%, transparent 55%),
    radial-gradient(ellipse 80% 80% at 50% 50%, #fef9e6 0%, transparent 70%),
    #f8f5ee;
  animation: mesh-drift 36s ease-in-out infinite alternate;
}
#bg-animated::after {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 30% 70%, rgba(167, 243, 208, 0.45) 0%, transparent 40%),
    radial-gradient(circle at 70% 30%, rgba(253, 224, 71, 0.35) 0%, transparent 40%);
  animation: mesh-drift-2 28s ease-in-out infinite alternate;
  mix-blend-mode: multiply;
}
@keyframes mesh-drift {
  0%   { transform: scale(1) translate(0, 0); filter: hue-rotate(0deg); }
  50%  { transform: scale(1.06) translate(-2%, 1%); filter: hue-rotate(8deg); }
  100% { transform: scale(1.02) translate(1%, -2%); filter: hue-rotate(-6deg); }
}
@keyframes mesh-drift-2 {
  0%   { transform: scale(1) rotate(0deg); }
  100% { transform: scale(1.1) rotate(20deg); }
}

/* Glass primitive */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(36px) saturate(180%);
  -webkit-backdrop-filter: blur(36px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 18px;
}

/* ==========  Layout  ========== */
.layout {
  display: grid;
  grid-template-columns: 264px 1fr;
  gap: 16px;
  padding: 16px;
  height: 100vh;
}

/* ==========  Sidebar  ========== */
.sidebar {
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
  overflow-y: auto;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(20, 30, 50, 0.15); border-radius: 100px; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid rgba(20, 30, 50, 0.07);
}
.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 70%, #1e3a8a 100%);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3), inset 0 1px 0 rgba(255,255,255,0.4);
  position: relative;
  flex-shrink: 0;
}
.logo-mark::after {
  content: "";
  position: absolute; inset: 7px;
  border-radius: 5px;
  background: linear-gradient(135deg, rgba(255,255,255,0.35), transparent);
}
.brand-meta { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.brand-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 0 8px;
}
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 12px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-soft);
  font-size: 13.5px;
  font-weight: 500;
  transition: all 100ms;
}
.nav-item:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text);
}
.nav-item.active {
  background: var(--text);
  color: #fff;
}
.nav-item.active .nav-icon::before { background: #fff; opacity: 1; }
.nav-item.primary { color: var(--accent); }
.nav-item.primary:hover { background: var(--accent-soft); }
.nav-tag {
  margin-left: auto;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--success);
  color: #fff;
  padding: 2px 7px;
  border-radius: 100px;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nav-icon::before {
  content: "";
  width: 18px;
  height: 18px;
  background: currentColor;
  opacity: 0.7;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}
.nav-icon[data-icon="home"]::before { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><path d='M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/><polyline points='9 22 9 12 15 12 15 22'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><path d='M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/><polyline points='9 22 9 12 15 12 15 22'/></svg>"); }
.nav-icon[data-icon="excel"]::before,
.step-icon[data-icon="excel"]::before { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><rect x='3' y='3' width='18' height='18' rx='2'/><path d='M8 3v18M16 3v18M3 8h18M3 16h18'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><rect x='3' y='3' width='18' height='18' rx='2'/><path d='M8 3v18M16 3v18M3 8h18M3 16h18'/></svg>"); }
.nav-icon[data-icon="markers"]::before,
.step-icon[data-icon="markers"]::before { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><circle cx='6' cy='6' r='2'/><circle cx='18' cy='6' r='2'/><circle cx='6' cy='18' r='2'/><circle cx='18' cy='18' r='2'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><circle cx='6' cy='6' r='2'/><circle cx='18' cy='6' r='2'/><circle cx='6' cy='18' r='2'/><circle cx='18' cy='18' r='2'/></svg>"); }
.nav-icon[data-icon="template"]::before,
.step-icon[data-icon="template"]::before { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><rect x='3' y='3' width='7' height='7'/><rect x='14' y='3' width='7' height='7'/><rect x='14' y='14' width='7' height='7'/><rect x='3' y='14' width='7' height='7'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><rect x='3' y='3' width='7' height='7'/><rect x='14' y='3' width='7' height='7'/><rect x='14' y='14' width='7' height='7'/><rect x='3' y='14' width='7' height='7'/></svg>"); }
.nav-icon[data-icon="dashboard"]::before,
.step-icon[data-icon="dashboard"]::before { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><line x1='18' y1='20' x2='18' y2='10'/><line x1='12' y1='20' x2='12' y2='4'/><line x1='6' y1='20' x2='6' y2='14'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><line x1='18' y1='20' x2='18' y2='10'/><line x1='12' y1='20' x2='12' y2='4'/><line x1='6' y1='20' x2='6' y2='14'/></svg>"); }
.nav-icon[data-icon="review"]::before,
.step-icon[data-icon="review"]::before { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><path d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/><circle cx='9' cy='7' r='4'/><path d='M23 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><path d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/><circle cx='9' cy='7' r='4'/><path d='M23 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75'/></svg>"); }
.step-icon[data-icon="print"]::before { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><polyline points='6 9 6 2 18 2 18 9'/><path d='M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2'/><rect x='6' y='14' width='12' height='8'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><polyline points='6 9 6 2 18 2 18 9'/><path d='M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2'/><rect x='6' y='14' width='12' height='8'/></svg>"); }
.step-icon[data-icon="done"]::before { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>"); }

.sidebar-footer {
  border-top: 1px solid rgba(20, 30, 50, 0.07);
  padding-top: 12px;
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.status-row {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-soft);
  font-weight: 500;
  font-size: 12.5px;
}
.status-meta { padding-left: 15px; }
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}
.status-dot.ok {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18); }
  50%      { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0.06); }
}

/* ==========  Main  ========== */
.main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  min-width: 0;
}
.main::-webkit-scrollbar { width: 8px; }
.main::-webkit-scrollbar-thumb { background: rgba(20, 30, 50, 0.18); border-radius: 100px; }

.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  flex-shrink: 0;
}
.page-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.page-subtitle {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}
.btn-cta {
  padding: 10px 18px;
  border-radius: 100px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  transition: all 120ms;
}
.btn-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35); }

/* Hero card */
.hero-card {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 22px 28px;
  flex-shrink: 0;
}
.hero-text { flex: 1; }
.hero-text h2 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.hero-text p {
  margin: 0;
  font-size: 14.5px;
  color: var(--text-soft);
  max-width: 700px;
  line-height: 1.5;
}
.hero-illustration {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.illu-step {
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-soft);
  font-family: "SF Mono", Consolas, monospace;
}
.illu-step.illu-cv { background: var(--accent-soft); color: var(--accent); }
.illu-step.illu-final { background: var(--success-soft); color: var(--success); }
.illu-arrow { color: var(--text-muted); font-size: 14px; }

/* Metrics */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  flex-shrink: 0;
}
.metric { padding: 16px 20px; display: flex; flex-direction: column; gap: 4px; }
.metric-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.metric-value { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.metric-sub { font-size: 12px; color: var(--text-muted); }
.metric.accent {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.92), rgba(29, 78, 216, 0.92));
  color: #fff;
  border-color: rgba(255,255,255,0.2);
}
.metric.accent .metric-label,
.metric.accent .metric-value,
.metric.accent .metric-sub { color: #fff; }
.metric.accent .metric-label { opacity: 0.85; }
.metric.accent .metric-sub { opacity: 0.8; }

/* Stepper card */
.stepper-card {
  padding: 22px 26px 26px;
}
.card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
}
.card-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.card-sub { font-size: 12.5px; color: var(--text-muted); }

.stepper {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}
.stepper::before {
  content: "";
  position: absolute;
  left: 35px;
  top: 18px;
  bottom: 18px;
  width: 2px;
  background: linear-gradient(to bottom, transparent, rgba(20, 30, 50, 0.1) 12%, rgba(20, 30, 50, 0.1) 88%, transparent);
  z-index: 0;
}

.step { position: relative; }
.step-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.5);
  transition: all 120ms;
  position: relative;
  z-index: 1;
}
.step-link:not(.disabled):hover {
  border-color: var(--accent-border);
  background: rgba(255, 255, 255, 0.8);
  transform: translateX(4px);
}
.step-link.disabled { cursor: default; }

.step-num {
  font-family: "SF Mono", Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  flex-shrink: 0;
  width: 22px;
  text-align: center;
}
.step-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.step-icon::before {
  content: "";
  width: 18px;
  height: 18px;
  background: var(--accent);
  opacity: 0.75;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}
.step-content { flex: 1; min-width: 0; }
.step-content h4 {
  margin: 0 0 2px;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.step-content p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-soft);
  line-height: 1.45;
}
.step-tag {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.05);
  padding: 4px 10px;
  border-radius: 100px;
  flex-shrink: 0;
}
.step-tag.primary { background: var(--accent); color: #fff; }
.step-tag.success { background: var(--success); color: #fff; }

.step.primary .step-link {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.92), rgba(29, 78, 216, 0.92));
  border-color: rgba(255,255,255,0.18);
}
.step.primary .step-content h4 { color: #fff; }
.step.primary .step-content p { color: rgba(255,255,255,0.85); }
.step.primary .step-num { color: rgba(255,255,255,0.7); }
.step.primary .step-icon { background: rgba(255,255,255,0.22); }
.step.primary .step-icon::before { background: #fff; opacity: 1; }
.step.primary .step-link:hover { transform: translateX(4px); }

.step.success .step-link {
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.85), rgba(5, 122, 56, 0.85));
  border-color: rgba(255,255,255,0.18);
}
.step.success .step-content h4 { color: #fff; }
.step.success .step-content p { color: rgba(255,255,255,0.88); }
.step.success .step-num { color: rgba(255,255,255,0.7); }
.step.success .step-icon { background: rgba(255,255,255,0.24); }
.step.success .step-icon::before { background: #fff; opacity: 1; }

.step.info .step-link { background: rgba(255, 255, 255, 0.4); }

/* Tech strip */
.tech-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 14px 22px;
  font-size: 12.5px;
  color: var(--text-soft);
}
.tech-item b { color: var(--text); font-weight: 600; }

/* Responsive */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 220px 1fr; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .tech-strip { grid-template-columns: repeat(2, 1fr); }
  .hero-illustration { display: none; }
}
@media (max-width: 720px) {
  .layout { grid-template-columns: 1fr; height: auto; }
  body.papyrus-saas { height: auto; overflow: auto; }
  .sidebar { height: auto; }
  .metrics { grid-template-columns: 1fr; }
  .tech-strip { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Aurora background: мягкий интерактивный градиент.
   Заменил YT livestream — iframe ломался, плюс ходить в сеть за фоном
   на каждой загрузке — лишний tax.
   ========================================================================== */

.bg-aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(
      650px circle at var(--mx, 50%) var(--my, 35%),
      rgba(56, 130, 246, 0.28),
      transparent 60%
    ),
    linear-gradient(180deg, #070b16 0%, #0c1226 55%, #0a1020 100%);
}

.bg-aurora::before,
.bg-aurora::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.6;
  pointer-events: none;
  will-change: transform;
}

.bg-aurora::before {
  width: 55vmax;
  height: 55vmax;
  left: -12vmax;
  top: -15vmax;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.55), rgba(124, 58, 237, 0) 70%);
  animation: aurora-drift-1 22s ease-in-out infinite alternate;
}

.bg-aurora::after {
  width: 60vmax;
  height: 60vmax;
  right: -15vmax;
  bottom: -20vmax;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.45), rgba(20, 184, 166, 0) 70%);
  animation: aurora-drift-2 28s ease-in-out infinite alternate;
}

@keyframes aurora-drift-1 {
  0%   { transform: translate(0, 0)         scale(1);    }
  50%  { transform: translate(12vw, 8vh)    scale(1.15); }
  100% { transform: translate(-6vw, 14vh)   scale(0.95); }
}

@keyframes aurora-drift-2 {
  0%   { transform: translate(0, 0)         scale(1);    }
  50%  { transform: translate(-10vw, -10vh) scale(1.10); }
  100% { transform: translate(8vw, -4vh)    scale(0.92); }
}

@media (prefers-reduced-motion: reduce) {
  .bg-aurora::before,
  .bg-aurora::after { animation: none; }
}

/* ==========================================================================
   Projects list (index.html — root entry point)
   ========================================================================== */

body.papyrus-projects-root {
  height: auto;
  overflow-y: auto;
}

.projects-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 28px 64px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.projects-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 26px;
  border-radius: 18px;
}

.projects-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}
.projects-brand h1 {
  margin: 0 0 2px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.projects-brand p {
  margin: 0;
  color: var(--text-soft);
  font-size: 13.5px;
}
.projects-brand .logo-mark {
  width: 44px; height: 44px;
}

.projects-intro {
  padding: 22px 26px;
  border-radius: 16px;
}
.projects-intro h2 {
  margin: 0 0 6px;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.projects-intro p {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.55;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.project-card {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 16px;
  padding: 22px 60px 22px 22px;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  --card-accent: #2563eb;
}
.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.12);
  border-color: var(--card-accent);
}
.project-color-band {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 6px;
  background: var(--card-accent);
}
.project-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 8px;
  min-width: 0;
}
.project-card h3 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.project-desc {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.project-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
  font-size: 12.5px;
  color: var(--text-soft);
}
.project-stat b {
  color: var(--text);
  font-weight: 600;
}
.dot-sep { opacity: 0.5; }
.project-arrow {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  color: var(--card-accent);
  font-weight: 300;
  transition: transform 0.18s ease;
}
.project-card:hover .project-arrow { transform: translateY(-50%) translateX(4px); }

.project-card-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 22px;
  font: inherit;
  background: rgba(255, 255, 255, 0.4);
  border: 2px dashed var(--glass-border);
  border-radius: 16px;
  cursor: pointer;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}
.project-card-add:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(37, 99, 235, 0.06);
}
.add-plus {
  font-size: 32px;
  font-weight: 300;
  line-height: 1;
}

.projects-footer {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-soft);
  padding: 12px 8px 0;
  opacity: 0.7;
}

/* ==========================================================================
   Sidebar back-link (project.html)
   ========================================================================== */

.sidebar-back {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--text-soft);
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-back:hover {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
}
.sidebar-back .back-arrow {
  font-size: 16px;
  line-height: 1;
}

/* ==========================================================================
   Buttons (shared)
   ========================================================================== */

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  text-decoration: none;
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(37, 99, 235, 0.32); }
.primary-btn:active { transform: translateY(0); }
.primary-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.secondary-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  font: inherit;
  font-weight: 500;
  font-size: 13.5px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.secondary-link-btn:hover {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.15);
}

/* ==========================================================================
   Modal (shared)
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }

.modal-card {
  background: #fff;
  border-radius: 16px;
  width: min(520px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 32px 80px rgba(15, 23, 42, 0.32);
  display: flex;
  flex-direction: column;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--glass-border);
}
.modal-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}
.modal-close {
  background: transparent;
  border: 0;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-soft);
  padding: 4px 10px;
  border-radius: 8px;
}
.modal-close:hover { background: rgba(15, 23, 42, 0.06); color: var(--text); }

.create-form {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.create-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.create-form input[type="text"],
.create-form input[type="number"],
.create-form textarea,
.create-form select {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  resize: vertical;
}
.create-form input:focus,
.create-form textarea:focus,
.create-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.color-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  position: relative;
  padding: 0;
  transition: transform 0.12s ease;
}
.color-swatch:hover { transform: scale(1.08); }
.color-swatch.active::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 2px solid currentColor;
  border-radius: 50%;
}
.color-swatch.active { color: #0f172a; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 6px;
}

@media (max-width: 720px) {
  .projects-grid { grid-template-columns: 1fr; }
  .projects-header { flex-direction: column; align-items: stretch; gap: 14px; }
  .projects-footer { flex-direction: column; gap: 6px; }
}

/* ==========================================================================
   Step cards / form layouts (shared: generator, marker, template-builder)
   ========================================================================== */

.gen-card {
  padding: 22px 26px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.gen-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 6px;
}
.gen-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.gen-card-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.gen-card-head .head-sub {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--text-soft);
}

.upload-zone {
  border: 2px dashed var(--glass-border);
  border-radius: 14px;
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
  background: rgba(255, 255, 255, 0.4);
}
.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background: rgba(37, 99, 235, 0.05);
}
.upload-zone.has-file {
  border-color: var(--success);
  background: rgba(22, 163, 74, 0.06);
}
.upload-zone.compact { padding: 16px 18px; text-align: left; }
.upload-icon {
  font-size: 26px;
  margin-bottom: 6px;
  color: var(--accent);
}
.upload-text {
  color: var(--text-soft);
  font-size: 13.5px;
  line-height: 1.5;
}
.upload-file-name {
  margin-top: 8px;
  font-weight: 600;
  color: var(--success);
  font-size: 13.5px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.form-field input[type="text"],
.form-field input[type="number"],
.form-field textarea,
.form-field select {
  padding: 10px 12px;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 14px;
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.form-field textarea {
  min-height: 90px;
  resize: vertical;
  line-height: 1.5;
}
.field-hint {
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.45;
}
.params-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin-top: 6px;
}

.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.prompt-chip {
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 12.5px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent);
  border: 1px solid rgba(37, 99, 235, 0.18);
  cursor: pointer;
  transition: background 0.15s ease;
  font-family: inherit;
}
.prompt-chip:hover { background: rgba(37, 99, 235, 0.15); }

.gen-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding-top: 4px;
}

.info-pill {
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.18);
  font-size: 13.5px;
  color: var(--text);
  display: none;
}
.info-pill.visible { display: block; }
.info-pill strong { font-weight: 600; }

.result-card {
  padding: 22px 26px;
  border-radius: 16px;
  border: 1px solid rgba(22, 163, 74, 0.3);
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.06), rgba(255, 255, 255, 0.65));
  display: none;
  flex-direction: column;
  gap: 14px;
}
.result-card.visible { display: flex; }
.result-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.result-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.result-title { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.result-stats {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  font-size: 13.5px;
}
.result-stat { color: var(--text-soft); }
.result-stat strong { color: var(--text); font-weight: 600; }
.result-warn {
  font-size: 12.5px;
  color: #b45309;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 10px 12px;
  border-radius: 10px;
  line-height: 1.5;
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}
.loading-overlay.visible { display: flex; }
.loading-box {
  background: #fff;
  border-radius: 16px;
  padding: 36px 44px;
  text-align: center;
  min-width: 280px;
  box-shadow: 0 32px 80px rgba(15, 23, 42, 0.32);
}
.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--glass-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-weight: 600; font-size: 14px; }
.loading-subtext { font-size: 12.5px; color: var(--text-soft); margin-top: 4px; }

/* Toast */
.gen-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 20px;
  border-radius: 10px;
  color: #fff;
  font-weight: 600;
  font-size: 13.5px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.28);
  z-index: 300;
  max-width: 360px;
  animation: toastIn 0.32s ease;
}
.gen-toast.error { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.gen-toast.success { background: linear-gradient(135deg, #16a34a, #15803d); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(60px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 720px) {
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}
