:root{
  --bg:#ffffff;
  --ink:#101828;
  --muted:#475467;
  --subtle:#667085;
  --line:#e4e7ec;
  --soft:#f2f4f7;
  --alt:#f9fafb;
  --accent:#0b5fff;
  --shadow:0 10px 28px rgba(16,24,40,.08);
  --radius:16px;
  --max:1080px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  color:var(--ink);
  background:var(--bg);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  line-height:1.6;
}

a{ color:var(--accent); text-decoration:none; }
a:hover{ text-decoration:underline; }

.skip-link{
  position:absolute; left:-999px; top:auto; width:1px; height:1px; overflow:hidden;
}
.skip-link:focus{
  left:16px; top:16px; width:auto; height:auto;
  padding:10px 12px; z-index:9999;
  background:var(--bg);
  border:1px solid var(--line);
  border-radius:10px;
}

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

/* Header */
.site-header{
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.header-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  padding:18px 0;
  min-height:96px;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

/* Vector logo */
.brand-logo-link{
  display:flex;
  align-items:center;
  flex-shrink:0;
}

.brand-logo{
  height: 90px;
  width: auto;
  display:block;
  opacity: 0.95;
}

.paper-logo{
  height: 80px;
  width: auto;
  display:block;
  opacity: 0.95
}

.brand-icon{
  flex-shrink: 0;
}

.brand-text{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:0;
}

.brand-title{
  font-weight:800;
  font-size: 1.1rem;
  letter-spacing:-.01em;
  white-space:nowrap;
}

.brand-subtitle{
  font-size:.92rem;
  color:var(--subtle);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:50vw;
}

.top-nav{
  display:flex;
  align-items:center;
  gap:10px;
  white-space:nowrap;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.top-nav a{
  color:var(--muted);
  font-size:.9rem;
  font-weight: 600;
  padding:8px 10px;
  border-radius:10px;
  transition: all .15s ease;
}

.top-nav a:hover{
  background:var(--soft);
  text-decoration:none;
  color:var(--ink);
}

/* Hero */
.hero{
  padding:44px 0 36px;
  background: linear-gradient(180deg, var(--alt) 0%, #fff 70%);
  border-bottom:1px solid var(--line);
}

.hero-center{
  text-align:center;
  max-width: 940px;
  margin:0 auto 28px;
}

.hero-accent{ color: var(--accent); }

.pill{
  display:inline-block;
  padding:4px 12px;
  border-radius:999px;
  background:var(--soft);
  border:1px solid var(--line);
  color:var(--subtle);
  font-weight:800;
  font-size:.75rem;
  margin-bottom:14px;
}

h1{
  margin: 0 0 14px 0;
  font-size: 2.4rem;
  line-height: 1.18;
  letter-spacing: -.02em;
  font-weight: 900;
}

h2{
  margin:0 0 14px 0;
  font-size:1.75rem;
  font-weight: 900;
  letter-spacing:-.015em;
}

h3{
  margin:0;
  font-size:1.1rem;
  font-weight: 800;
}

.paper-meta{
  margin: 10px auto 0;
  color:var(--muted);
  display:grid;
  gap:8px;
  font-size: .98rem;
  justify-items: center;
}
.paper-meta .k{ color:var(--subtle); font-weight:800; }

.cta-row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin:18px auto 0;
  justify-content:center;
}

.btn{
  appearance:none;
  border:1px solid var(--line);
  background:var(--ink);
  color:#fff;
  padding:12px 18px;
  border-radius:12px;
  font-weight:800;
  font-size: .95rem;
  cursor:pointer;
  transition: all .2s ease;
  box-shadow: 0 2px 8px rgba(16,24,40,.1);
}
.btn:hover{ transform: translateY(-1px); box-shadow: 0 4px 12px rgba(16,24,40,.15); }
.btn:active{ transform: translateY(0); }
.btn-secondary{ background:#fff; color:var(--ink); }
.btn-secondary:hover{ background:var(--soft); }

.btn-disabled{
  opacity: .55;
  pointer-events: none;
}

.hero-cards-row{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap:18px;
  margin: 18px 0 20px;
}

.three-col{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:18px;
}

@media (max-width: 768px) {
  .three-col {
    grid-template-columns: 1fr;
  }
}

.card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover{
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(16,24,40,.12);
}
.card-h{
  padding:14px 16px;
  border-bottom:1px solid var(--line);
  font-weight:900;
  font-size: .98rem;
  background: var(--soft);
}
.card-b{
  padding:14px 16px;
  color:var(--muted);
}

/* Callout */
.callout{
  margin-top:18px;
  padding:16px 16px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow: 0 2px 8px rgba(16,24,40,.06);
  display:flex;
  gap:12px;
  align-items:flex-start;
}
.callout-icon{ font-size: 1.4rem; line-height: 1; padding-top:2px; }
.callout-title{ font-weight:900; margin-bottom:6px; }
.callout p{ margin:0; color:var(--muted); }
.callout-position{
  border-left:4px solid var(--accent);
  background: linear-gradient(135deg, #eff6ff 0%, #fff 100%);
}

/* Sections */
.section{ padding:42px 0; }
.section.alt{
  background: var(--alt);
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
}

.lead{
  color:var(--muted);
  font-size:1.08rem;
  margin:0;
  line-height: 1.75;
}
.muted{ color:var(--muted); }
.fineprint{ color:var(--subtle); font-size:.9rem; }

/* Layout helpers */
.two-col{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:18px;
}

/* Figures */
.figure-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap:22px;
  margin-top:16px;
}

.figure-card{
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
}

.figure-card img{
  width:100%;
  display:block;
  height:auto;
  max-height: 700px;
  object-fit: contain;
  background:#fff;
}

.figure-large img {
  max-height: none;
  padding: 16px;
}

figcaption{
  padding:14px 16px;
  color:var(--muted);
  font-size:.94rem;
  line-height: 1.55;
  background: var(--soft);
  border-top:1px solid var(--line);
}

.nowrap{ white-space:nowrap; }

.img-fallback{
  display:none;
  margin-top:10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
  font-size: .9rem;
  color:#4a4a4a;
}
.img-error .img-fallback{ display:block; }

/* Action grid */
.action-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap:18px;
  margin-top:18px;
}

.subsection-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 4px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
}

.action-card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:18px;
  box-shadow: var(--shadow);
}
.action-header{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:12px;
  padding-bottom:10px;
  border-bottom:1px solid var(--line);
}
.action-icon{ font-size: 1.6rem; }

.bullets{ margin:0; padding-left:18px; color:var(--muted); }
.bullets li{ margin: 8px 0; }

.card-body-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Bib */
.bib{
  padding:16px 18px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:#0f172a;
  color:#e2e8f0;
  overflow:auto;
  font-size: .92rem;
  line-height: 1.6;
}

/* Use Case Section */
.usecase-blocks {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 20px;
}

.usecase-block {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.usecase-block h3 {
  margin: 0 0 12px 0;
  font-size: 1.1rem;
}

.usecase-block p {
  margin: 0 0 12px 0;
  color: var(--muted);
  line-height: 1.7;
}

.usecase-block p:last-child {
  margin-bottom: 0;
}

.layer-cycle {
  background: linear-gradient(135deg, #f8fafc 0%, #fff 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.cycle-title {
  text-align: center;
  font-weight: 900;
  font-size: 1.1rem;
  margin-bottom: 20px;
  color: var(--ink);
}

.cycle-ring {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.layer-node {
  display: grid;
  grid-template-columns: 36px 1fr;
  grid-template-rows: auto auto;
  gap: 2px 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  border: 2px solid var(--line);
  transition: all 0.2s ease;
}

.layer-node:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(16,24,40,.1);
}

.layer-num {
  grid-row: 1 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: 900;
  font-size: 0.9rem;
  color: #fff;
}

.layer-1 { border-color: #3b82f6; }
.layer-1 .layer-num { background: #3b82f6; }

.layer-2 { border-color: #8b5cf6; }
.layer-2 .layer-num { background: #8b5cf6; }

.layer-3 { border-color: #ec4899; }
.layer-3 .layer-num { background: #ec4899; }

.layer-4 { border-color: #f59e0b; }
.layer-4 .layer-num { background: #f59e0b; }

.layer-5 { border-color: #10b981; }
.layer-5 .layer-num { background: #10b981; }

.layer-name {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--ink);
}

.layer-desc {
  font-size: 0.82rem;
  color: var(--muted);
}

.layer-connector {
  text-align: center;
  color: var(--subtle);
  font-size: 1.2rem;
  padding: 2px 0;
}

.cycle-feedback {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

.feedback-arrow {
  font-size: 1.5rem;
  color: var(--accent);
}

.feedback-text {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

/* Alternate Views */
.alt-views-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

@media (max-width: 800px) {
  .alt-views-grid {
    grid-template-columns: 1fr;
  }
}

.alt-view-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.alt-view-objection {
  display: flex;
  gap: 12px;
  padding: 16px;
  align-items: flex-start;
}

.alt-view-objection p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.alt-view-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.82rem;
  margin-top: 2px;
}

.alt-view-label {
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--ink);
}

.alt-view-response {
  padding: 12px 16px;
  background: linear-gradient(135deg, #f0fdf4 0%, #fff 100%);
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
}

.alt-view-response strong {
  color: #16a34a;
}

/* Intro Flow Diagram */
.intro-flow {
  display: grid;
  grid-template-columns: 1fr 32px 1fr;
  align-items: stretch;
  gap: 0;
  margin-top: 24px;
}

.intro-flow-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.intro-problem { border-top-color: #ef4444; }
.intro-gap { border-top-color: #f59e0b; }
.intro-position { border-top-color: #10b981; }

.intro-flow-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.intro-flow-label {
  font-weight: 900;
  font-size: 1.05rem;
  color: var(--ink);
}

.intro-flow-text {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.7;
}

.intro-flow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--subtle);
  padding: 0;
}

@media (max-width: 800px) {
  .intro-flow {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .intro-flow-arrow {
    transform: rotate(90deg);
    padding: 6px 0;
    font-size: 1.2rem;
  }
}

/* Footer */
.site-footer{
  padding:28px 0;
  border-top:1px solid var(--line);
  background: var(--soft);
  margin-top: 24px;
}
.footer-inner{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  flex-wrap:wrap;
}
.footer-title{ font-weight:900; font-size: 1.05rem; }
.footer-muted{ color:var(--subtle); font-size:.92rem; }
.footer-links{ display:flex; gap:14px; flex-wrap:wrap; }
.footer-links a{ color:var(--muted); font-weight:700; font-size:.9rem; }
.footer-links a:hover{ color:var(--ink); text-decoration:none; }

/* Responsive */
@media (max-width: 920px){
  .two-col{ grid-template-columns: 1fr; }
  h1{ font-size: 1.7rem; }
  .brand-subtitle{ max-width: 100%; white-space:normal; }
  .brand-logo{ height: 38px; }
}

@media (max-width: 520px){
  .brand-logo{ height: 34px; }
}
