/* ── Variables ─────────────────────────────────────── */
:root {
  --bg: #0b0d10;
  --bg-alt: #0f1216;
  --text: #e6edf3;
  --muted: #8b9ab0;
  --brand: #6ae3ff;
  --brand-2: #9b8cff;
  --brand-3: #50dca0;
  --card: #12161c;
  --card-hover: #141920;
  --border: #1d2430;
  --border-hover: #2a3444;
  --shadow: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.55);
  --radius: 14px;
}

/* ── Reset & base ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(155,140,255,0.10), transparent),
    radial-gradient(1000px 500px at 10% -10%, rgba(106,227,255,0.08), transparent),
    repeating-linear-gradient(0deg,  rgba(255,255,255,0.025) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.018) 0 1px, transparent 1px 28px),
    var(--bg);
  line-height: 1.65;
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ── Accessibility ─────────────────────────────────── */
.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 16px; top: 16px;
  background: var(--bg-alt);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 100;
}

/* ── Layout helpers ────────────────────────────────── */
.container { width: min(1100px, 92%); margin: 0 auto; }
.section { padding: 88px 0; scroll-margin-top: 76px; }
.section.alt { background: var(--bg-alt); }

/* ── Typography ────────────────────────────────────── */
h1, h2, h3 { margin-top: 0; line-height: 1.15; }

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 16px;
  padding: 4px 12px;
  border: 1px solid rgba(106,227,255,0.25);
  border-radius: 999px;
  background: rgba(106,227,255,0.06);
}

.section-sub {
  color: var(--muted);
  margin: 6px 0 28px;
  max-width: 56ch;
}

/* ── Hero ──────────────────────────────────────────── */
.hero {
  padding: 110px 0 100px;
  scroll-margin-top: 76px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 75vh;
  min-height: 440px;
  background:
    radial-gradient(40% 50% at 20% 40%, color-mix(in oklab, var(--brand) 55%, transparent) 0%, transparent 60%),
    radial-gradient(35% 45% at 80% 20%, color-mix(in oklab, var(--brand-2) 55%, transparent) 0%, transparent 60%);
  filter: blur(72px) saturate(130%);
  opacity: 0.5;
  pointer-events: none;
  animation: hero-pulse 12s ease-in-out infinite;
  transform-origin: center;
}
@keyframes hero-pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50%       { opacity: 0.65; transform: scale(1.06); }
}

.hero h1 {
  font-size: clamp(1.65rem, 5.5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  background: linear-gradient(150deg, var(--text) 45%, rgba(180,195,215,0.65) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 58ch;
  margin-bottom: 0;
}

.cta-group {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}

/* ── Buttons ───────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 11px 22px;
  border: 1px solid var(--border-hover);
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  background: rgba(255,255,255,0.04);
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  backdrop-filter: blur(4px);
}
.btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #060d14;
  border: none;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(106,227,255,0.2);
}
.btn.primary:hover {
  box-shadow: 0 8px 32px rgba(106,227,255,0.35);
  transform: translateY(-2px);
  filter: brightness(1.06);
}

/* ── Focus ─────────────────────────────────────────── */
:where(a, button, .btn, input, select, textarea):focus-visible {
  outline: 2px solid rgba(106,227,255,0.7);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ── Header / Nav ──────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  background: rgba(11,13,16,0.72);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}
.logo {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 6px 10px;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 10px;
  right: 10px;
  height: 1.5px;
  background: var(--brand);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s ease;
}
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-links a.active { color: var(--text); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }

/* ── Mobile hamburger ──────────────────────────────── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  padding: 8px 9px;
  line-height: 0;
  transition: border-color 0.2s ease;
}
.nav-toggle:hover { border-color: var(--border-hover); }
.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--muted);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── Cards ─────────────────────────────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 14px;
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.28s ease, border-color 0.28s ease, background 0.28s ease;
  will-change: transform;
  cursor: default;
}
.card:hover {
  transform: translateY(-6px);
  background: var(--card-hover);
  border-color: rgba(106,227,255,0.22);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(106,227,255,0.1);
}
.card .thumb {
  position: relative;
  width: 100%;
  height: 130px;
  border-radius: 10px;
  background: #0d1017;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color 0.28s ease;
}
.card:hover .thumb { border-color: rgba(106,227,255,0.18); }
.card .thumb .brand-logo {
  max-width: 72%;
  max-height: 72%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.3s ease;
}
.card:hover .brand-logo { transform: scale(1.06); }
.card h3 { margin: 6px 0 6px; font-size: 0.975rem; font-weight: 600; }
.card p { color: var(--muted); font-size: 0.875rem; margin: 0 0 12px; line-height: 1.55; }
.card .link {
  color: var(--brand);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: gap 0.2s ease, color 0.2s ease;
}
.card .link:hover { gap: 7px; }

/* ── Badge variants ────────────────────────────────── */
.card-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  color: var(--muted);
}
.badge-crypto { border-color: rgba(106,227,255,0.3); color: var(--brand); background: rgba(106,227,255,0.07); }
.badge-ai     { border-color: rgba(155,140,255,0.3); color: var(--brand-2); background: rgba(155,140,255,0.07); }
.badge-aicrypto {
  border-color: rgba(155,140,255,0.35);
  color: #c8aaff;
  background: linear-gradient(135deg, rgba(106,227,255,0.06), rgba(155,140,255,0.1));
}
.badge-infra  { border-color: rgba(80,220,160,0.3); color: var(--brand-3); background: rgba(80,220,160,0.07); }

/* ── Team ──────────────────────────────────────────── */
.team {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 14px;
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
}
.member {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.member:hover {
  transform: translateY(-4px);
  border-color: rgba(155,140,255,0.28);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(155,140,255,0.1);
}
.member-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  flex-shrink: 0;
  border: 2px solid var(--border);
  transition: border-color 0.25s ease;
}
.member:hover .member-avatar {
  border-color: rgba(155,140,255,0.45);
}
.member-body h3 { margin: 0; font-size: 0.975rem; font-weight: 600; }
.member-role {
  display: block;
  font-size: 0.8rem;
  color: var(--brand-2);
  font-weight: 500;
  margin: 3px 0 8px;
}
.member-body p { margin: 0; color: var(--muted); font-size: 0.875rem; line-height: 1.55; }

/* ── Contact ───────────────────────────────────────── */
.contact-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 52px 56px;
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.contact-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 60% at 30% 10%, rgba(106,227,255,0.07) 0%, transparent 70%),
    radial-gradient(50% 50% at 80% 80%, rgba(155,140,255,0.07) 0%, transparent 70%);
  pointer-events: none;
}
.contact-card h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 14px;
}
.contact-card p { color: var(--muted); margin: 0 0 10px; }
.contact-card a:not(.btn) { color: var(--brand); text-decoration: none; border-bottom: 1px solid rgba(106,227,255,0.3); transition: border-color 0.2s; }
.contact-card a:not(.btn):hover { border-color: var(--brand); }
.contact-btn { margin-top: 24px; }

/* ── Footer ────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid rgba(255,255,255,0.05);
  background: #090b0e;
  padding: 28px 0;
  color: var(--muted);
  font-size: 0.875rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.footer-inner .logo { font-size: 0.9rem; opacity: 0.6; }
.footer-inner p { margin: 0; }

/* ── Writings index grid ───────────────────────────── */
.writings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 16px;
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
}
.writing-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  text-decoration: none;
  color: inherit;
}
.writing-card:hover {
  transform: translateY(-4px);
  border-color: rgba(106,227,255,0.22);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(106,227,255,0.1);
}
.writing-card h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}
.writing-card p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.55;
  flex: 1;
}
.writing-card .writing-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  font-size: 0.78rem;
  color: var(--muted);
}
.writing-card .writing-meta time { color: var(--muted); }
.view-all-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 28px;
  color: var(--brand);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: gap 0.2s ease;
}
.view-all-link:hover { gap: 10px; }

/* ── Article page ──────────────────────────────────── */
.post-header {
  padding: 72px 0 48px;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.post-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(80% 80% at 20% 0%, rgba(106,227,255,0.06) 0%, transparent 70%),
    radial-gradient(60% 60% at 80% 100%, rgba(155,140,255,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  margin-bottom: 20px;
  transition: color 0.2s ease, gap 0.2s ease;
}
.back-link:hover { color: var(--text); gap: 4px; }
.post-category-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
}
.post-header h1 {
  font-size: clamp(1.7rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0 0 16px;
  max-width: 820px;
  background: linear-gradient(150deg, var(--text) 50%, rgba(180,195,215,0.65) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.post-header .post-lead {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 66ch;
  margin: 0 0 20px;
}
.post-meta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--muted);
}
.post-meta-row span { display: flex; align-items: center; gap: 5px; }
.post-body {
  padding: 56px 0 80px;
  max-width: 780px;
}
.post-body h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 40px 0 12px;
  color: var(--text);
}
.post-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 28px 0 10px;
  color: var(--text);
}
.post-body p {
  color: var(--muted);
  line-height: 1.78;
  margin: 0 0 18px;
  font-size: 1rem;
}
.post-body ul, .post-body ol {
  color: var(--muted);
  padding-left: 24px;
  margin: 0 0 18px;
  line-height: 1.78;
}
.post-body li { margin-bottom: 6px; }
.post-body strong { color: var(--text); font-weight: 600; }
.post-body a { color: var(--brand); text-decoration: none; border-bottom: 1px solid rgba(106,227,255,0.3); transition: border-color 0.2s; }
.post-body a:hover { border-color: var(--brand); }
.post-cta {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-top: 48px;
}
.post-cta p { margin: 6px 0 16px; }
.post-cta h4 { margin: 0; font-size: 1rem; color: var(--text); }

/* ── Writings full index page ──────────────────────── */
.writings-hero {
  padding: 72px 0 48px;
}
.writings-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 24px 0 32px;
}
.filter-btn {
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.filter-btn:hover, .filter-btn.active {
  border-color: var(--brand);
  color: var(--brand);
  background: rgba(106,227,255,0.06);
}

/* ── Responsive writings ───────────────────────────── */
@media (max-width: 900px) {
  .writings-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 540px) {
  .writings-grid { grid-template-columns: 1fr; }
  .post-header { padding: 48px 0 32px; }
  .post-body { padding: 36px 0 56px; }
}

/* ── Reveal animation ──────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 1000px) {
  .cards { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .team  { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 700px) {
  .cards { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .team  { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .contact-card { padding: 36px 24px; }
  .section { padding: 72px 0; }
}
@media (max-width: 540px) {
  /* Nav: allow links to wrap below logo row */
  .nav { flex-wrap: wrap; padding: 12px 0; }
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    padding: 8px 0 4px;
    gap: 0;
    border-top: 1px solid var(--border);
    margin-top: 8px;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a {
    display: block;
    padding: 10px 6px;
    border-radius: 6px;
    font-size: 0.95rem;
  }
  /* Disable underline animation on mobile stacked links */
  .nav-links a::after { display: none; }
  .nav-links a.active,
  .nav-links a:hover { background: rgba(255,255,255,0.05); color: var(--text); }

  /* Hero */
  .hero { padding: 68px 0 60px; }
  .hero h1 { font-size: clamp(1.55rem, 8vw, 1.9rem); }
  .lead { font-size: 1rem; }

  /* Sections */
  .section { padding: 56px 0; }

  /* Cards: single column */
  .cards { grid-template-columns: 1fr; gap: 12px; }

  /* Team: single column, switch to row layout (avatar left, text right) */
  .team { grid-template-columns: 1fr; gap: 12px; }
  .member { flex-direction: row; align-items: flex-start; gap: 14px; }
  .member-avatar { width: 52px; height: 52px; flex-shrink: 0; margin-top: 2px; }

  /* Contact */
  .contact-card { padding: 32px 20px; border-radius: 16px; }
  .contact-btn { width: 100%; text-align: center; }

  /* Buttons */
  .cta-group { flex-direction: column; gap: 10px; }
  .cta-group .btn { text-align: center; }

  /* Footer */
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 4px; }
}
