/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0a0a0a;
  --bg-alt:    #111111;
  --bg-card:   #141414;
  --border:    #1e1e1e;
  --text:      #e8e8e8;
  --text-muted:#888;
  --amber:     #fbbf24;
  --amber-dim: #92400e;
  --amber-glow:rgba(251,191,36,0.08);
  --font-sans: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ── Navigation ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 56px;
  background: rgba(10,10,10,0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--amber);
}

.nav-mark {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--amber);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.2s;
  letter-spacing: 0.02em;
}

.nav-links a:hover { color: var(--amber); }

/* ── Hero ── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 80px 2rem 4rem;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.18;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  text-align: center;
}

.hero-mark {
  margin: 0 auto 2rem;
  width: 72px;
  height: 72px;
}

.hero-mark svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--amber);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: rotate 32s linear infinite;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  color: #fff;
}

.hero-sub {
  font-size: 1.125rem;
  color: var(--text-muted);
  font-weight: 300;
  max-width: 560px;
  margin: 0 auto 2.5rem;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  background: var(--amber);
  color: #0a0a0a;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  border-radius: 4px;
  transition: opacity 0.2s, transform 0.15s;
}

.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }

.btn-ghost {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  border-radius: 4px;
  transition: border-color 0.2s, color 0.2s;
}

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

/* ── Sections ── */
section {
  padding: 6rem 2rem;
}

.section-alt {
  background: var(--bg-alt);
}

.container {
  max-width: 1024px;
  margin: 0 auto;
}

.container-narrow {
  max-width: 680px;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  color: #fff;
}

.section-title::after {
  content: '';
  display: block;
  width: 32px;
  height: 2px;
  background: var(--amber);
  margin-top: 0.5rem;
}

.section-sub {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 3rem;
  line-height: 1.65;
}

/* ── Papers ── */
.papers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
  gap: 1.5px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.paper-card {
  background: var(--bg-card);
  display: flex;
  gap: 1.25rem;
  padding: 1.75rem;
  transition: background 0.2s;
}

.paper-card:hover { background: #181818; }

.paper-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--amber);
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--amber-dim);
  border-radius: 3px;
  height: fit-content;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.paper-body h3 {
  font-size: 1rem;
  font-weight: 500;
  color: #fff;
  margin-bottom: 0.2rem;
  line-height: 1.35;
}

.paper-subtitle {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-style: italic;
  font-weight: 300;
}

.paper-abstract {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.paper-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.paper-author {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-style: italic;
}

.paper-doi {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--amber);
  opacity: 0.7;
  transition: opacity 0.2s;
}

.paper-doi:hover { opacity: 1; }

/* ── Open Work placeholder ── */
.open-work-placeholder {
  text-align: center;
  padding: 4rem 2rem;
  border: 1px dashed var(--border);
  border-radius: 6px;
  color: var(--text-muted);
}

.placeholder-mark {
  width: 48px;
  height: 48px;
  fill: none;
  stroke: var(--border);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin: 0 auto 1.25rem;
  display: block;
  animation: rotate 24s linear infinite;
}

.open-work-placeholder p {
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.placeholder-note {
  font-size: 0.875rem;
  color: #555;
}

/* ── Framework ── */
.framework-link-line { margin-top: -1.5rem; margin-bottom: 2.5rem; }
.framework-link-line a { color: var(--amber); border-bottom: 1px solid var(--amber-dim); transition: border-color 0.2s; }
.framework-link-line a:hover { border-color: var(--amber); }

.framework-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.framework-card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  transition: border-color 0.2s;
}

.framework-card:hover { border-color: var(--amber-dim); }

.framework-card h3 {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--amber);
  margin-bottom: 0.6rem;
  letter-spacing: 0.01em;
}

.framework-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── About ── */
#about p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 1.25rem;
  font-weight: 300;
}

.contact-block {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.contact-link {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  color: var(--amber);
  transition: opacity 0.2s;
}

.contact-link:hover { opacity: 0.7; }

/* ── Footer ── */
footer {
  padding: 2rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--amber);
  letter-spacing: 0.04em;
}

.footer-mark {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--amber);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  font-size: 0.8125rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--amber); }

.footer-license {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #444;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  nav { padding: 0 1rem; }
  .nav-links { gap: 1.25rem; }
  .nav-links li:nth-child(n+3) { display: none; }
  section { padding: 4rem 1.25rem; }
  .papers-grid { grid-template-columns: 1fr; }
  .framework-grid { grid-template-columns: 1fr 1fr; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* ── Open Work Cards ── */
.open-work-card {
  background: var(--bg-card);
  border: 1px solid rgba(251,191,36,0.15);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  transition: border-color 0.2s;
}
.open-work-card:hover { border-color: rgba(251,191,36,0.4); }
.ow-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}
.ow-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.ow-date {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #555;
}
.ow-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  line-height: 1.3;
}
.ow-title a { color: var(--text); text-decoration: none; border-bottom: 1px solid rgba(251,191,36,0.3); }
.ow-title a:hover { border-color: var(--amber); }
.ow-desc { font-size: 0.875rem; color: #aaa; margin: 0 0 1rem; line-height: 1.5; }
.ow-meta { display: flex; justify-content: space-between; align-items: center; }
.ow-speedup {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--amber);
}
.ow-link {
  font-size: 0.8rem;
  color: var(--amber);
  text-decoration: none;
  border-bottom: 1px solid rgba(251,191,36,0.3);
}
.ow-link:hover { border-color: var(--amber); }
