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

:root {
  --bg-primary: #000;
  --bg-secondary: #0a0a0a;
  --bg-card: #1a1a1a;
  --bg-card-hover: #222;
  --border-color: #333;
  --text-primary: #fff;
  --text-secondary: #ccc;
  --text-muted: #888;
  --accent: #ff6b35;
  --accent-hover: #ff8555;
  --accent-glow: rgba(255, 107, 53, 0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --nav-height: 64px;
  --max-width: 1200px;
  --font-stack: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-stack);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

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

img {
  max-width: 100%;
  display: block;
}

/* ===== Navigation ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-inner {
  width: 100%;
  max-width: var(--max-width);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo-icon {
  flex-shrink: 0;
}

.nav-logo span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
  padding: 4px 0;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}

/* ===== Layout ===== */
.page-content {
  padding-top: var(--nav-height);
}

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

.section {
  padding: 80px 0;
}

.section-sm {
  padding: 48px 0;
}

/* ===== Hero ===== */
.hero {
  padding: 120px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-with-bg {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 160px 0 100px;
}

.hero-with-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.85) 100%);
  pointer-events: none;
}

.hero-with-bg > .container {
  position: relative;
  z-index: 1;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.hero-logo {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  margin: 0 auto 28px;
  display: block;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  background: var(--accent-glow);
  border: 1px solid rgba(255, 107, 53, 0.3);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 24px;
}

.hero h1 {
  font-size: 48px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  position: relative;
}

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

.hero p {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

/* ===== Typography ===== */
.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-header h2 {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.section-header p {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
}

h3 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ===== Grid ===== */
.grid {
  display: grid;
  gap: 24px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 32px;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 107, 53, 0.3);
  box-shadow: 0 8px 32px rgba(255, 107, 53, 0.08);
}

.card-link {
  display: block;
  color: inherit;
}

.card-link:hover {
  color: inherit;
}

.card-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-glow);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 20px;
}

/* Numbered card icon */
.card-num {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent), #ff9b35);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #000;
  margin-bottom: 20px;
  flex-shrink: 0;
}

/* Nav logo image */
.nav-logo-img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  flex-shrink: 0;
}

/* Case header image */
.case-cover {
  width: 100%;
  height: 260px;
  object-fit: cover;
}

/* Section visual image */
.section-visual {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  margin-bottom: 48px;
  overflow: hidden;
}

.section-visual img {
  width: 100%;
  display: block;
}

/* Split layout: image + text side by side */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.split-img {
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.split-img img {
  width: 100%;
  display: block;
}

.card h3 {
  margin-bottom: 12px;
}

.card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.card .card-arrow {
  display: inline-block;
  margin-top: 16px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
}

/* ===== Stats ===== */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.stat {
  text-align: center;
  padding: 32px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
}

.stat-number {
  font-size: 40px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255, 107, 53, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

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

.btn-group {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== Tags / Badges ===== */
.tag {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  font-size: 13px;
  color: var(--text-secondary);
}

.tag-accent {
  background: var(--accent-glow);
  border-color: rgba(255, 107, 53, 0.3);
  color: var(--accent);
}

.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ===== Table ===== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background: var(--bg-card);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  color: var(--text-secondary);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* ===== Timeline / Steps ===== */
.steps {
  display: flex;
  gap: 0;
  position: relative;
}

.step {
  flex: 1;
  text-align: center;
  padding: 24px 16px;
  position: relative;
}

.step::before {
  content: '';
  position: absolute;
  top: 44px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border-color);
}

.step:first-child::before {
  left: 50%;
}

.step:last-child::before {
  right: 50%;
}

.step-number {
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.step h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.step p {
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== Case Study ===== */
.case {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 32px;
}

.case-header {
  padding: 32px;
  border-bottom: 1px solid var(--border-color);
}

.case-header .case-tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--accent-glow);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 12px;
}

.case-header h3 {
  font-size: 24px;
  margin-bottom: 8px;
}

.case-header p {
  color: var(--text-secondary);
  font-size: 15px;
}

.case-body {
  padding: 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.case-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.case-section p,
.case-section li {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.case-section ul {
  list-style: none;
  padding: 0;
}

.case-section li {
  padding: 4px 0;
  padding-left: 20px;
  position: relative;
}

.case-section li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
}

.case-stats {
  display: flex;
  gap: 24px;
  padding: 24px 32px;
  border-top: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
}

.case-stat {
  text-align: center;
}

.case-stat .num {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
}

.case-stat .label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== Team Member ===== */
.member {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
}

.member-avatar {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--accent), #ff9b35);
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
}

.member h3 {
  font-size: 18px;
  margin-bottom: 4px;
}

.member .role {
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 12px;
}

.member p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== Publication List ===== */
.pub-list {
  list-style: none;
  padding: 0;
}

.pub-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.pub-list li:last-child {
  border-bottom: none;
}

.pub-venue {
  display: inline-block;
  padding: 2px 8px;
  background: var(--accent-glow);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-right: 8px;
}

/* ===== Divider ===== */
.divider {
  height: 1px;
  background: var(--border-color);
  margin: 0;
  border: none;
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 48px 0;
  text-align: center;
}

.footer p {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 14px;
}

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

/* ===== CTA Section ===== */
.cta-section {
  text-align: center;
  padding: 80px 0;
  position: relative;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.cta-section h2 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 16px;
  position: relative;
}

.cta-section p {
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 16px;
  position: relative;
}

/* ===== Architecture Diagram ===== */
.arch-diagram {
  position: relative;
  background: linear-gradient(180deg, #0d0d0d 0%, #111 50%, #0d0d0d 100%);
  border: 1px solid rgba(255, 107, 53, 0.15);
  border-radius: 16px;
  padding: 48px 40px;
  margin-bottom: 48px;
  overflow: hidden;
}

/* Architecture diagram with background image — overlay baked into background */
.arch-diagram-bg {
  background:
    linear-gradient(rgba(0,0,0,0.92), rgba(0,0,0,0.92)),
    url('assets/os-architecture.png') center / cover no-repeat !important;
}

/* Grid background pattern */
.arch-diagram::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 107, 53, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 107, 53, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

/* Ambient glow behind kernel */
.arch-diagram::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: 300px;
  background: radial-gradient(ellipse, rgba(255, 107, 53, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.arch-layer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px 24px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: border-color 0.3s, background 0.3s;
}

.arch-layer:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

/* OS Kernel layer — visually prominent */
.arch-layer.arch-kernel {
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.08) 0%, rgba(255, 107, 53, 0.02) 100%);
  border: 1px solid rgba(255, 107, 53, 0.3);
  box-shadow: 0 0 40px rgba(255, 107, 53, 0.06), inset 0 1px 0 rgba(255, 107, 53, 0.1);
  padding: 24px;
}

.arch-layer.arch-kernel .arch-label {
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

.arch-label {
  width: 100px;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.3;
}

.arch-items {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}

.arch-item {
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  transition: all 0.2s;
}

.arch-item:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  transform: translateY(-1px);
}

/* Kernel items have accent styling */
.arch-kernel .arch-item {
  background: rgba(255, 107, 53, 0.06);
  border-color: rgba(255, 107, 53, 0.2);
  color: #fff;
}

.arch-kernel .arch-item:hover {
  background: rgba(255, 107, 53, 0.12);
  border-color: rgba(255, 107, 53, 0.4);
  box-shadow: 0 0 16px rgba(255, 107, 53, 0.1);
}

/* Status dot on items */
.arch-item::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  margin-right: 8px;
  vertical-align: middle;
}

.arch-kernel .arch-item::before {
  background: var(--accent);
  box-shadow: 0 0 6px rgba(255, 107, 53, 0.5);
}

/* Connection arrows between layers */
.arch-arrow {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 0;
  color: rgba(255, 255, 255, 0.3);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.arch-arrow::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, rgba(255, 107, 53, 0.3) 0%, rgba(255, 107, 53, 0.05) 100%);
  z-index: -1;
}

.arch-arrow-text {
  background: #111;
  padding: 4px 16px;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

/* Animated data flow dots */
@keyframes dataFlow {
  0% { top: 0; opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.arch-arrow::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(255, 107, 53, 0.6);
  animation: dataFlow 2s ease-in-out infinite;
}

.arch-arrow:nth-child(4)::after { animation-delay: 0.5s; }
.arch-arrow:nth-child(6)::after { animation-delay: 1s; }
.arch-arrow:nth-child(8)::after { animation-delay: 1.5s; }

/* ===== Scroll Animations ===== */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    padding: 16px 24px;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-links a:last-child {
    border-bottom: none;
  }

  .nav-toggle {
    display: flex;
  }

  .hero {
    padding: 80px 0 48px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .hero p {
    font-size: 16px;
  }

  .section-header h2 {
    font-size: 28px;
  }

  .section {
    padding: 56px 0;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .case-body {
    grid-template-columns: 1fr;
  }

  .case-stats {
    flex-wrap: wrap;
  }

  .steps {
    flex-direction: column;
    gap: 0;
  }

  .step::before {
    display: none;
  }

  .step {
    text-align: left;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 16px 0;
  }

  .step-number {
    flex-shrink: 0;
    margin-bottom: 0;
  }

  .split {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .case-cover {
    height: 180px;
  }

  .hero-with-bg {
    padding: 100px 0 60px;
  }

  .hero-logo {
    width: 60px;
    height: 60px;
    border-radius: 14px;
  }

  .arch-diagram {
    padding: 24px 16px;
  }

  .arch-layer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
  }

  .arch-label {
    width: auto;
  }

  .arch-arrow::before {
    display: none;
  }

  .arch-arrow::after {
    display: none;
  }
}
