
:root {
  --bg: #f7f8fc;
  --bg-soft: #ffffff;
  --surface: rgba(255, 255, 255, 0.72);
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.12);
  --text: #0f172a;
  --text-muted: #475569;
  --text-soft: #64748b;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --gradient-1: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --gradient-2: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --gradient-3: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  --gradient-4: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  --gradient-5: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
  --gradient-6: linear-gradient(135deg, #14b8a6 0%, #84cc16 100%);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.06), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 24px 48px -16px rgba(79, 70, 229, 0.18), 0 8px 16px rgba(15, 23, 42, 0.04);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(99, 102, 241, 0.10), transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(236, 72, 153, 0.08), transparent 60%),
    radial-gradient(ellipse 70% 60% at 50% 120%, rgba(14, 165, 233, 0.08), transparent 60%);
  background-attachment: fixed;
}

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

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

/* ===== Layout ===== */

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Navigation ===== */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: rgba(247, 248, 252, 0.72);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  font-size: 17px;
}

.nav-brand:hover {
  color: var(--text);
}

.nav-logo {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--gradient-1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  box-shadow: var(--shadow-md);
}

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

.nav-link {
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(15, 23, 42, 0.04);
}

/* ===== Hero ===== */

.hero {
  padding: 96px 0 64px;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

.hero h1 {
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 20px;
  background: linear-gradient(135deg, #0f172a 0%, #4f46e5 60%, #8b5cf6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  font-size: clamp(17px, 2vw, 20px);
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto;
}

/* ===== Section ===== */

.section {
  padding: 32px 0 96px;
}

.section-head {
  text-align: center;
  margin-bottom: 48px;
}

.section-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.section-sub {
  color: var(--text-muted);
  margin: 0;
}

/* ===== Card Grid ===== */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 28px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.3s ease,
              border-color 0.3s ease;
  overflow: hidden;
  color: var(--text);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, transparent 40%, rgba(99, 102, 241, 0.4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.card:hover::before {
  opacity: 1;
}

.card-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin-bottom: 18px;
  box-shadow: 0 8px 20px -8px rgba(79, 70, 229, 0.5);
}

.card-icon svg {
  width: 28px;
  height: 28px;
  stroke-width: 2;
}

.card-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  color: var(--text);
}

.card-desc {
  font-size: 15px;
  color: var(--text-muted);
  margin: 0 0 20px;
  flex-grow: 1;
  line-height: 1.55;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.card-link::after {
  content: "→";
  transition: transform 0.2s ease;
}

.card:hover .card-link::after {
  transform: translateX(4px);
}

.card-tag {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-soft);
  background: rgba(15, 23, 42, 0.04);
  padding: 4px 10px;
  border-radius: 999px;
}

/* Icon background variants */

.bg-grad-1 { background: var(--gradient-1); }
.bg-grad-2 { background: var(--gradient-2); }
.bg-grad-3 { background: var(--gradient-3); }
.bg-grad-4 { background: var(--gradient-4); }
.bg-grad-5 { background: var(--gradient-5); }
.bg-grad-6 { background: var(--gradient-6); }

/* ===== About card with photo ===== */

.about-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 32px;
  align-items: center;
}

/* Auto-collapse to a single column when the photo block is commented out */
.about-card:not(:has(.about-photo)) {
  grid-template-columns: 1fr;
}

.about-content h2 {
  margin-top: 0;
}

.about-content p:last-child {
  margin-bottom: 0;
}

.about-photo {
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--gradient-1);
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.9),
    0 0 0 5px rgba(99, 102, 241, 0.25),
    0 24px 48px -16px rgba(79, 70, 229, 0.45),
    0 8px 16px rgba(15, 23, 42, 0.08);
  isolation: isolate;
}

.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
  transition: transform 0.5s ease;
}

.about-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, transparent 60%);
  mix-blend-mode: soft-light;
  pointer-events: none;
  z-index: 1;
}

.about-photo:hover img {
  transform: scale(1.03);
}

.about-photo-fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 56px;
  letter-spacing: -0.02em;
}

.about-photo--placeholder .about-photo-fallback {
  display: flex;
}

@media (max-width: 640px) {
  .about-card {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 20px;
  }
  .about-photo {
    margin: 0 auto;
    width: 140px;
    height: 140px;
  }
}

/* ===== Doc Page ===== */

.doc {
  padding: 56px 0 96px;
}

.doc-header {
  margin-bottom: 40px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 24px;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--accent);
}

.back-link::before {
  content: "←";
}

.doc h1 {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 12px;
}

.doc-meta {
  color: var(--text-soft);
  font-size: 14px;
  margin: 0;
}

.doc-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.doc-card h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  color: var(--text);
}

.doc-card h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 24px 0 8px;
  color: var(--text);
}

.doc-card p {
  margin: 0 0 14px;
  color: var(--text-muted);
}

.doc-card ul,
.doc-card ol {
  padding-left: 22px;
  margin: 0 0 14px;
  color: var(--text-muted);
}

.doc-card li {
  margin-bottom: 6px;
}

.doc-card strong {
  color: var(--text);
  font-weight: 600;
}

.doc-card a {
  border-bottom: 1px solid rgba(79, 70, 229, 0.25);
}

.doc-card a:hover {
  border-bottom-color: var(--accent);
}

.callout {
  display: flex;
  gap: 14px;
  padding: 16px 20px;
  background: var(--accent-soft);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-md);
  margin: 0 0 20px;
}

.callout-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.callout p {
  margin: 0;
  font-size: 15px;
  color: var(--text);
}

/* ===== Footer ===== */

.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
  color: var(--text-soft);
  font-size: 14px;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
}

.footer a {
  color: var(--text-muted);
}

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

/* ===== Utilities ===== */

.mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92em;
}

/* ===== Responsive ===== */

@media (max-width: 640px) {
  .container,
  .container-narrow {
    padding: 0 20px;
  }
  .hero {
    padding: 64px 0 40px;
  }
  .section {
    padding: 24px 0 64px;
  }
  .doc-card {
    padding: 24px;
  }
  .card {
    padding: 24px;
  }
  .nav-links .nav-link:not(:last-child) {
    display: none;
  }
}

/* ===== Dark mode (system preference) ===== */

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d12;
    --bg-soft: #12151c;
    --surface: rgba(255, 255, 255, 0.04);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --text: #f1f5f9;
    --text-muted: #cbd5e1;
    --text-soft: #94a3b8;
    --accent: #818cf8;
    --accent-hover: #a5b4fc;
    --accent-soft: rgba(99, 102, 241, 0.12);
  }
  body {
    background-image:
      radial-gradient(ellipse 80% 50% at 20% -10%, rgba(99, 102, 241, 0.18), transparent 60%),
      radial-gradient(ellipse 60% 40% at 90% 10%, rgba(236, 72, 153, 0.10), transparent 60%),
      radial-gradient(ellipse 70% 60% at 50% 120%, rgba(14, 165, 233, 0.12), transparent 60%);
  }
  .nav {
    background: rgba(11, 13, 18, 0.72);
  }
  .hero h1 {
    background: linear-gradient(135deg, #f1f5f9 0%, #a5b4fc 60%, #c4b5fd 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  .card-tag {
    background: rgba(255, 255, 255, 0.06);
  }
  .footer {
    background: rgba(11, 13, 18, 0.4);
  }
}
