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

:root {
  --bg:         #09090e;
  --surface:    #111118;
  --surface2:   #16161f;
  --border:     #1e1e2e;
  --text:       #eeeef5;
  --muted:      #7a7a94;
  --accent:     #4f7df9;
  --accent-dim: rgba(79, 125, 249, 0.12);
  --accent-glow:rgba(79, 125, 249, 0.25);
  --green:      #34d399;
  --radius:     10px;
  --max:        1100px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ── */
h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; color: var(--muted); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }
p  { color: #c0c0d0; }
a  { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.section   { padding: 96px 0; }
.section--sm { padding: 64px 0; }

/* ── Nav ── */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(9, 9, 14, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--max); margin: 0 auto; padding: 0 24px; height: 64px;
}
.nav-logo {
  font-weight: 700; font-size: 1rem; color: var(--text); letter-spacing: -0.01em;
}
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; gap: 32px; list-style: none; }
.nav-links a { color: var(--muted); font-size: 0.9rem; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-cta {
  background: var(--accent); color: #fff; padding: 8px 20px;
  border-radius: 6px; font-size: 0.875rem; font-weight: 600; transition: opacity 0.2s;
}
.nav-cta:hover { opacity: 0.85; text-decoration: none; }

/* ── Hero ── */
.hero { padding: 120px 0 96px; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent-dim); border: 1px solid var(--accent-glow);
  color: var(--accent); font-size: 0.8rem; font-weight: 600;
  padding: 6px 14px; border-radius: 100px; margin-bottom: 28px;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.hero h1 { max-width: 800px; margin-bottom: 20px; }
.hero h1 span { color: var(--accent); }
.hero-sub {
  font-size: 1.15rem; max-width: 640px; color: var(--muted);
  margin-bottom: 44px; line-height: 1.7;
}
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 26px; border-radius: 8px; font-weight: 600;
  font-size: 0.9rem; transition: all 0.2s; cursor: pointer;
  border: none; text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { opacity: 0.88; text-decoration: none; }
.btn-outline {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ── Section label ── */
.section-label {
  display: flex; align-items: center; gap: 12px;
  color: var(--accent); font-size: 0.8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 16px;
}
.section-label::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── Case study cards ── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; margin-top: 48px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 36px;
  transition: border-color 0.2s, transform 0.2s;
  display: flex; flex-direction: column;
}
.card:hover { border-color: var(--accent); transform: translateY(-3px); }
.card-tag {
  display: inline-block; background: var(--accent-dim); color: var(--accent);
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.07em; padding: 4px 10px; border-radius: 4px; margin-bottom: 20px;
}
.card h3 { font-size: 1.3rem; margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 0.9rem; margin-bottom: 24px; flex: 1; }
.card-meta {
  display: flex; gap: 16px; font-size: 0.8rem; color: var(--muted);
  padding-top: 20px; border-top: 1px solid var(--border); margin-bottom: 24px;
}
.card-meta span::before { content: '· '; }
.card-meta span:first-child::before { content: ''; }
.card-link {
  color: var(--accent); font-size: 0.875rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
}
.card-link::after { content: '→'; transition: transform 0.2s; }
.card:hover .card-link::after { transform: translateX(4px); }

/* ── How I work ── */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-top: 48px; }
.step {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
}
.step-num {
  font-size: 0.75rem; font-weight: 700; color: var(--accent);
  letter-spacing: 0.1em; margin-bottom: 12px;
}
.step h3 { font-size: 1rem; margin-bottom: 8px; }
.step p  { font-size: 0.875rem; color: var(--muted); }

/* ── Skills ── */
.skills-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 36px; }
.skill {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); font-size: 0.85rem; padding: 8px 16px;
  border-radius: 6px;
}

/* ── CTA strip ── */
.cta-strip {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 64px; text-align: center; margin-top: 0;
}
.cta-strip h2 { margin-bottom: 12px; }
.cta-strip p { color: var(--muted); margin-bottom: 32px; max-width: 480px; margin-left: auto; margin-right: auto; }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border); padding: 32px 0;
  color: var(--muted); font-size: 0.85rem;
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--max); margin: 0 auto; padding: 0 24px;
  flex-wrap: wrap; gap: 16px;
}
.footer-links { display: flex; gap: 24px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); text-decoration: none; }

/* ── Case Study pages ── */
.cs-hero { padding: 80px 0 64px; border-bottom: 1px solid var(--border); }
.cs-back {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 0.875rem; margin-bottom: 32px;
  transition: color 0.2s;
}
.cs-back:hover { color: var(--text); text-decoration: none; }
.cs-back::before { content: '←'; }
.cs-tag {
  display: inline-block; background: var(--accent-dim); color: var(--accent);
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.07em; padding: 5px 12px; border-radius: 4px; margin-bottom: 20px;
}
.cs-hero h1 { max-width: 760px; margin-bottom: 16px; }
.cs-hero p.lead { font-size: 1.1rem; color: var(--muted); max-width: 640px; margin-bottom: 36px; }
.cs-meta-row {
  display: flex; gap: 40px; flex-wrap: wrap;
  padding-top: 32px; border-top: 1px solid var(--border);
}
.cs-meta-item { display: flex; flex-direction: column; gap: 4px; }
.cs-meta-item .label { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.cs-meta-item .value { font-size: 0.9rem; font-weight: 600; color: var(--text); }

/* ── Case study body ── */
.cs-body { padding: 80px 0; }
.cs-section { margin-bottom: 72px; }
.cs-section h2 { font-size: 1.5rem; margin-bottom: 20px; }
.cs-section p, .cs-section li { color: #c0c0d0; }
.cs-section ul { padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.cs-section ul li {
  padding-left: 20px; position: relative; font-size: 0.95rem;
}
.cs-section ul li::before { content: '→'; position: absolute; left: 0; color: var(--accent); font-size: 0.85rem; top: 2px; }

/* ── Flow diagram ── */
.flow {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 40px; margin: 32px 0;
  display: flex; flex-direction: column; align-items: flex-start; gap: 0;
}
.flow-step {
  display: flex; align-items: flex-start; gap: 20px; width: 100%;
}
.flow-step-inner { display: flex; flex-direction: column; padding-bottom: 8px; }
.flow-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); margin-top: 6px; flex-shrink: 0;
}
.flow-line-wrap { display: flex; flex-direction: column; align-items: center; }
.flow-line { width: 2px; height: 32px; background: var(--border); margin: 0 auto; }
.flow-step-text { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.flow-step-sub { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }

/* ── Results ── */
.results-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 32px 0; }
.result-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 24px;
}
.result-card .stat { font-size: 2rem; font-weight: 800; color: var(--accent); letter-spacing: -0.03em; margin-bottom: 6px; }
.result-card .desc { font-size: 0.85rem; color: var(--muted); }

/* ── Ownership ── */
.ownership-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 28px; }
.ownership-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 16px 18px;
  font-size: 0.875rem; font-weight: 500; color: var(--text);
  display: flex; align-items: center; gap: 10px;
}
.ownership-item::before { content: '✓'; color: var(--green); font-weight: 700; }

/* ── Screenshots placeholder ── */
.screenshots { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 28px; }
.screenshot-placeholder {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); aspect-ratio: 16/10;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 8px; color: var(--muted); font-size: 0.8rem;
}
.screenshot-placeholder span { font-size: 1.5rem; }
.screenshot-img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); display: block; aspect-ratio: 16/10; object-fit: cover; object-position: top; cursor: zoom-in; transition: transform 0.2s ease, border-color 0.2s ease; }
.screenshot-img:hover { transform: scale(1.02); border-color: var(--accent); }

/* ── Lightbox ── */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(5, 5, 10, 0.92);
  display: none; align-items: center; justify-content: center;
  flex-direction: column; gap: 14px; padding: 40px;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%; max-height: 85vh;
  border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}
.lightbox-caption { color: var(--muted); font-size: 0.85rem; }
.lightbox-close {
  position: absolute; top: 20px; right: 28px;
  background: none; border: none; color: var(--text);
  font-size: 2rem; line-height: 1; cursor: pointer; opacity: 0.7;
}
.lightbox-close:hover { opacity: 1; }

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

/* ── About ── */
.about-inner { max-width: 720px; }
.about-inner p { color: var(--muted); margin-top: 16px; line-height: 1.7; }
.about-inner p strong { color: var(--text); font-weight: 600; }

/* ── Live site link ── */
.cs-live-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 20px; color: var(--accent); text-decoration: none; font-weight: 600; font-size: 0.9rem; }
.cs-live-link:hover { text-decoration: underline; }
.cs-live-link::after { content: "↗"; }

/* ── 404 ── */
.error-page { min-height: 60vh; display: flex; align-items: center; justify-content: center; text-align: center; }
.error-page .code { font-size: 5rem; font-weight: 800; color: var(--accent); line-height: 1; }
.error-page p { color: var(--muted); margin: 16px 0 28px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .cs-meta-row { gap: 24px; }
  .cta-strip { padding: 40px 24px; }
  .flow { padding: 24px; }
}
