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

:root {
  --bg:          #060a14;
  --surface:     #0d1526;
  --surface-2:   #101e35;
  --accent:      #2563eb;
  --accent-dim:  rgba(37, 99, 235, 0.18);
  --sky:         #38bdf8;
  --sky-dim:     rgba(56, 189, 248, 0.1);
  --green:       #10b981;
  --green-dim:   rgba(16, 185, 129, 0.1);
  --text:        #f8fafc;
  --text-muted:  #94a3b8;
  --text-dim:    #3d5166;
  --border:      #1a2840;
  --border-mid:  #243454;

  --ff-head: 'Space Grotesk', sans-serif;
  --ff-body: 'Inter', sans-serif;
  --ff-mono: 'JetBrains Mono', monospace;

  --r:    12px;
  --r-sm: 6px;
  --max:  1200px;
}

html { scroll-behavior: smooth; }

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

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

.mono       { font-family: var(--ff-mono); font-size: 0.78em; letter-spacing: 0.05em; }
.accent-dot { color: var(--accent); }
.text-sky   { color: var(--sky); }

.gradient-text {
  background: linear-gradient(120deg, #f8fafc 0%, #38bdf8 45%, #2563eb 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: grad 7s ease infinite;
}

@keyframes grad {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ─── Scroll Animations ─────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.projects-grid .fade-in:nth-child(2) { transition-delay: 0.12s; }
.projects-grid .fade-in:nth-child(3) { transition-delay: 0.24s; }
.pillars-grid  .fade-in:nth-child(2) { transition-delay: 0.08s; }
.pillars-grid  .fade-in:nth-child(3) { transition-delay: 0.16s; }
.pillars-grid  .fade-in:nth-child(4) { transition-delay: 0.24s; }
.process-list  .fade-in:nth-child(2) { transition-delay: 0.12s; }
.process-list  .fade-in:nth-child(3) { transition-delay: 0.24s; }

/* ─── Nav ───────────────────────────────────────────────── */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  padding: 22px 0;
  transition: background 0.35s ease, padding 0.35s ease, border-color 0.35s ease;
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background: rgba(6, 10, 20, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 14px 0;
  border-bottom-color: var(--border);
}

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

.nav-logo {
  font-family: var(--ff-head);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 40px;
}

.nav-links a {
  font-family: var(--ff-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

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

.nav-cta {
  color: var(--sky) !important;
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 7px 20px;
  border-radius: var(--r-sm);
  transition: background 0.2s, border-color 0.2s !important;
}

.nav-cta:hover {
  background: var(--sky-dim) !important;
  border-color: var(--sky) !important;
}

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

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

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 13px 28px;
  border-radius: var(--r-sm);
  font-family: var(--ff-head);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
}

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

.btn-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.38);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-mid);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-muted);
  transform: translateY(-2px);
}

/* ─── Hero ──────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  overflow: hidden;
}

.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(37,99,235,0.07) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  top: -280px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 900px;
  background: radial-gradient(circle, rgba(37,99,235,0.13) 0%, transparent 65%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  color: var(--text-muted);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: fadeUp 0.7s ease 0.15s both;
}

.hero-headline {
  font-family: var(--ff-head);
  font-size: clamp(2.8rem, 6.5vw, 5.2rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 28px;
  animation: fadeUp 0.7s ease 0.3s both;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 520px;
  line-height: 1.75;
  margin-bottom: 36px;
  animation: fadeUp 0.7s ease 0.45s both;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  animation: fadeUp 0.7s ease 0.6s both;
}

.hero-link {
  font-family: var(--ff-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.hero-link:hover { color: var(--text); }

.hero-link-arrow {
  display: inline-block;
  transition: transform 0.2s;
}

.hero-link:hover .hero-link-arrow { transform: translateX(4px); }

.hero-scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-dim);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: fadeUp 0.7s ease 0.8s both;
}

.scroll-line {
  width: 1px;
  height: 44px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: pulse 2.2s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.25; }
  50%       { opacity: 1; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-num {
  display: block;
  margin-bottom: 14px;
}

.section-header {
  margin-bottom: 64px;
}

.section-title {
  font-family: var(--ff-head);
  font-size: clamp(1.9rem, 3.5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 10px;
}

.section-sub {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 480px;
}

/* ─── Project Cards ─────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}

.project-card:hover {
  border-color: rgba(37, 99, 235, 0.45);
  transform: translateY(-5px);
  box-shadow: 0 20px 56px rgba(0,0,0,0.45), 0 0 0 1px rgba(37,99,235,0.12);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.card-tag {
  font-family: var(--ff-mono);
  font-size: 0.68rem;
  letter-spacing: 0.09em;
  color: var(--sky);
  text-transform: uppercase;
}

.card-badge {
  font-family: var(--ff-mono);
  font-size: 0.62rem;
  letter-spacing: 0.07em;
  padding: 3px 10px;
  border-radius: 100px;
}

.badge-live {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-concept {
  background: rgba(245, 158, 11, 0.08);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.card-title {
  font-family: var(--ff-head);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 14px;
}

.card-rule {
  height: 1px;
  background: var(--border);
  margin-bottom: 18px;
}

.card-body {
  flex: 1;
}

.card-field {
  font-size: 0.855rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 14px;
}

.field-label {
  display: block;
  font-family: var(--ff-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.card-metric {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--sky);
  padding: 11px 14px;
  background: var(--sky-dim);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  margin: 18px 0;
}

.metric-arrow {
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 4px;
}

.tech-tag {
  font-family: var(--ff-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: 4px;
}

/* ─── Card Actions ──────────────────────────────────────── */
.card-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.card-action-email,
.card-action-pdf {
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: color 0.2s;
}

.card-action-email {
  color: var(--sky);
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-action-email::after {
  content: '→';
  transition: transform 0.2s;
}

.card-action-email:hover { color: var(--text); }
.card-action-email:hover::after { transform: translateX(3px); }

.card-action-pdf {
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 5px;
}

.card-action-pdf::before {
  content: '↓';
}

.card-action-pdf:hover { color: var(--text-muted); }

/* ─── Pillars ───────────────────────────────────────────── */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}

.pillar-num {
  color: var(--sky);
  display: block;
  margin-bottom: 14px;
}

.pillar-title {
  font-family: var(--ff-head);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.pillar-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ─── Process ───────────────────────────────────────────── */
.process-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.process-step {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 24px;
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
  transition: padding-left 0.3s ease;
}

.process-step:first-child { border-top: 1px solid var(--border); }
.process-step:hover { padding-left: 10px; }

.process-num {
  font-size: 0.75rem;
  color: var(--sky);
  letter-spacing: 0.1em;
  padding-top: 5px;
}

.process-title {
  font-family: var(--ff-head);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
  margin-bottom: 10px;
}

.process-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 640px;
}

.writing-list .fade-in:nth-child(2) { transition-delay: 0.1s; }
.writing-list .fade-in:nth-child(3) { transition-delay: 0.2s; }

/* ─── Writing (kept for future use) ─────────────────────── */
.writing-list {
  display: flex;
  flex-direction: column;
}

.writing-item {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  padding: 36px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
  transition: padding-left 0.3s ease;
}

.writing-item:first-child { border-top: 1px solid var(--border); }

.writing-item:hover { padding-left: 10px; }

.writing-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 3px;
}

.writing-date {
  color: var(--text-dim);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.writing-tag {
  font-family: var(--ff-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sky);
}

.writing-title {
  font-family: var(--ff-head);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
  margin-bottom: 8px;
}

.writing-excerpt {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ─── Contact ───────────────────────────────────────────── */
.section-contact {
  position: relative;
  padding: 140px 0;
  overflow: hidden;
}

.contact-glow {
  position: absolute;
  bottom: -360px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(37,99,235,0.14) 0%, transparent 65%);
  pointer-events: none;
}

.section-contact .container {
  position: relative;
  z-index: 1;
}

.contact-headline {
  font-family: var(--ff-head);
  font-size: clamp(2.4rem, 4.5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 14px 0 12px;
}

.contact-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 36px;
}

.contact-email {
  display: inline-block;
  font-family: var(--ff-head);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--sky);
  text-decoration: none;
  border-bottom: 1px solid rgba(56,189,248,0.3);
  padding-bottom: 3px;
  margin-bottom: 36px;
  transition: color 0.2s, border-color 0.2s;
}

.contact-email:hover {
  color: var(--text);
  border-color: var(--text);
}

.contact-address { font-style: normal; }

.contact-socials {
  display: flex;
  align-items: center;
  gap: 14px;
}

.social-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.76rem;
  letter-spacing: 0.07em;
  transition: color 0.2s;
}

.social-link:hover { color: var(--text); }

.social-sep { color: var(--text-dim); }

/* ─── Footer ────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
}

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

.footer-logo {
  font-family: var(--ff-head);
  font-weight: 700;
  font-size: 1rem;
}

.footer-copy {
  color: var(--text-dim);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 1024px) {
  .projects-grid {
    grid-template-columns: 1fr 1fr;
  }
  .pillars-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .project-card:nth-child(3) {
    grid-column: 1 / -1;
    max-width: 580px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 24px;
    background: rgba(6,10,20,0.97);
    border-bottom: 1px solid var(--border);
    gap: 24px;
  }

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

  .nav-burger { display: flex; }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .project-card:nth-child(3) {
    grid-column: auto;
    max-width: none;
  }

  .pillars-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .writing-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .hero-scroll { display: none; }

  .br-desktop { display: none; }

  .process-step {
    grid-template-columns: 48px 1fr;
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .section { padding: 80px 0; }
  .hero { padding: 100px 0 60px; }
  .section-contact { padding: 100px 0; }
  .hero-actions { flex-direction: column; }
  .btn { justify-content: center; }
}
