/* =============================================
   ZAHID PIRANI — DARK TECHY DESIGN SYSTEM
   Palette: #0E0E11 bg · #EDEDF2 ink · #22D3EE accent
   Stack: Inter (headings/body) · JetBrains Mono (labels)
   ============================================= */

:root {
  /* Warm charcoal — matches zpirani.com palette */
  --bg:        #16171E;
  --surface:   #1D1F28;
  --surface-2: #252730;
  --surface-3: #2D2F3C;
  --ink:       #EDEDF2;
  --muted:     #C4C4DA; /* body copy */
  --muted-lt:  #6E7090; /* labels, metadata, section numbers */
  --rule:      #23252F;

  --accent:    #22D3EE;
  --accent-lt: rgba(34,211,238,0.08);
  --accent-40: rgba(34,211,238,0.40);

  --green:     #34D399;
  --green-lt:  rgba(52,211,153,0.08);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: 0.015em; /* Revolut: positive body tracking */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; cursor: pointer; }
img { display: block; width: 100%; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }

:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--accent-lt); color: var(--accent); }

/* ===== LAYOUT ===== */
.wrap        { max-width: 1200px; margin: 0 auto; padding: 0 48px; }
.wrap-narrow { max-width: 760px;  margin: 0 auto; padding: 0 48px; }
.wrap-wide   { max-width: 1440px; margin: 0 auto; padding: 0 48px; }
@media (max-width: 768px) {
  .wrap, .wrap-narrow, .wrap-wide { padding: 0 20px; }
}

/* ===== NAV ===== */
nav.top {
  position: sticky; top: 0; z-index: 50;
  background: rgba(22,23,30,0.90);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.2s;
}
nav.top.scrolled { border-color: var(--muted-lt); }
nav.top .inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 48px; height: 64px; max-width: 1440px; margin: 0 auto; gap: 48px;
}
nav.top .mark {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink); white-space: nowrap; flex-shrink: 0;
  transition: opacity 0.18s;
}
nav.top .mark:hover { opacity: 0.7; }
nav.top .mark span {
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 14px; font-weight: 700; letter-spacing: -0.02em;
}

/* Nav links */
nav.top .links {
  display: flex; align-items: center; gap: 36px;
  font-size: 15px; font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-weight: 400; letter-spacing: -0.01em;
  color: var(--muted); flex: 1; justify-content: flex-end;
}
nav.top .links a { transition: color 0.15s; }
nav.top .links a:hover { color: var(--ink); }
nav.top .links a.active { color: var(--ink); font-weight: 500; }
nav.top .links .mobile-cta { display: none; }

/* Dropdown items */
nav.top .links .has-drop { position: relative; }
nav.top .links .drop-toggle {
  display: flex; align-items: center; gap: 5px;
  font-size: 15px; font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-weight: 400; letter-spacing: -0.01em;
  color: var(--muted); background: none; border: none; cursor: pointer; padding: 0;
  transition: color 0.15s;
}
nav.top .links .drop-toggle:hover { color: var(--ink); }
nav.top .links .has-drop.open .drop-toggle { color: var(--ink); }
nav.top .links .drop-arrow { font-size: 10px; transition: transform 0.2s; display: inline-block; }
nav.top .links .has-drop.open .drop-arrow { transform: rotate(180deg); }

nav.top .links .dropdown {
  display: none;
  position: absolute; top: calc(100% + 16px); left: 50%; transform: translateX(-50%);
  background: var(--surface-3); border: 1px solid var(--rule);
  border-radius: 8px; padding: 6px; min-width: 220px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
  z-index: 100;
}
nav.top .links .has-drop.open .dropdown { display: block; }
nav.top .links .dropdown li a {
  display: block; padding: 9px 14px; border-radius: 5px;
  font-size: 13px; font-family: 'Inter', system-ui, sans-serif;
  color: var(--muted); transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
nav.top .links .dropdown li a:hover {
  background: var(--surface-2); color: var(--ink);
}

/* Nav CTA pill */
nav.top .cta {
  background: transparent; color: var(--accent);
  border: 1.5px solid var(--accent-40);
  padding: 10px 20px; font-size: 12px; font-weight: 500;
  border-radius: 9999px;
  transition: background 0.18s, border-color 0.18s;
  white-space: nowrap; cursor: pointer; flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace; letter-spacing: 0.04em;
}
nav.top .cta:hover { background: var(--accent-lt); border-color: var(--accent); }

/* Hamburger */
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; background: none; border: none; cursor: pointer; padding: 10px;
  flex-shrink: 0;
}
.nav-toggle span { display: block; height: 1.5px; background: var(--ink); border-radius: 2px; transition: transform 0.24s cubic-bezier(0.16,1,0.3,1), opacity 0.18s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Tablet */
@media (max-width: 1080px) and (min-width: 769px) {
  nav.top .inner { padding: 0 32px; gap: 28px; }
  nav.top .links { gap: 28px; font-size: 14px; }
}

/* Mobile — full-screen overlay */
@media (max-width: 768px) {
  nav.top .inner { padding: 0 20px; height: 56px; }
  nav.top .links { display: none; }
  nav.top .cta { display: none; }
  .nav-toggle { display: flex; }

  nav.top .links.open {
    display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 0;
    position: fixed; top: 56px; left: 0; right: 0; bottom: 0;
    background: var(--bg);
    padding: 32px 28px 48px;
    z-index: 49; overflow-y: auto;
  }
  nav.top .links.open > li {
    width: 100%; border-bottom: 1px solid var(--rule);
  }
  nav.top .links.open > li > a,
  nav.top .links.open > li > .drop-toggle {
    display: block; padding: 20px 0;
    font-size: clamp(28px, 7vw, 40px);
    font-family: 'Schibsted Grotesk', sans-serif;
    font-weight: 700; letter-spacing: -0.03em;
    color: var(--muted); transition: color 0.15s;
    width: 100%; text-align: left;
  }
  nav.top .links.open > li > a:hover,
  nav.top .links.open > li > a.active,
  nav.top .links.open > li > .drop-toggle:hover { color: var(--ink); }
  nav.top .links.open .drop-arrow { font-size: 14px; }

  /* Mobile dropdown — expand below toggle */
  nav.top .links.open .has-drop.open .dropdown {
    display: block; position: static; transform: none;
    background: none; border: none; box-shadow: none;
    padding: 0 0 12px 16px; border-radius: 0;
  }
  nav.top .links.open .dropdown li a {
    font-size: 15px; padding: 8px 0; color: var(--muted);
    border-radius: 0;
  }
  nav.top .links.open .dropdown li a:hover { background: none; color: var(--ink); }

  /* Mobile CTA — shown inside overlay */
  nav.top .links .mobile-cta { display: block; }
  nav.top .links.open .mobile-cta { border-bottom: none; margin-top: 32px; }
  nav.top .links.open .mobile-cta a {
    font-size: 13px !important;
    font-family: 'JetBrains Mono', monospace !important;
    font-weight: 500 !important;
    letter-spacing: 0.06em !important;
    color: var(--accent) !important;
    padding: 12px 0 !important;
    text-transform: uppercase;
  }
}

/* ===== FOOTER ===== */
footer.site {
  background: var(--surface);
  border-top: 1px solid var(--rule);
  padding: 40px 48px;
}
footer.site .inner {
  max-width: 1440px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 20px;
}
footer.site .mark {
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 13px; font-weight: 700; letter-spacing: -0.01em;
  color: var(--ink);
}
footer.site .links { display: flex; gap: 24px; font-size: 13px; color: var(--muted); }
footer.site .links a { transition: color 0.15s; }
footer.site .links a:hover { color: var(--ink); }
footer.site .copy { font-size: 11px; color: var(--muted-lt); font-family: 'JetBrains Mono', monospace; letter-spacing: 0.04em; }
@media (max-width: 600px) {
  footer.site { padding: 32px 20px; }
  footer.site .inner { flex-direction: column; align-items: flex-start; gap: 16px; }
}

/* ===== TYPOGRAPHY =====
   Schibsted Grotesk — geometric grotesque, closest Google Fonts match to Revolut's Aeonik Pro
   Inter — body / UI text
   JetBrains Mono — all labels, tags, metadata
*/
h1, h2, h3, h4, h5 {
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  color: var(--ink);
}
h2 { font-size: clamp(20px, 2.2vw, 26px); font-weight: 700; line-height: 1.15; letter-spacing: -0.022em; }
h3 { font-size: 17px; font-weight: 600; line-height: 1.25; letter-spacing: -0.012em; }
h4 { font-size: 14px; font-weight: 600; line-height: 1.35; }
p  { color: var(--muted); line-height: 1.72; }

/* ===== TAGS — Revolut pill ===== */
.tag {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--rule);
  padding: 4px 10px; border-radius: 9999px;
}
.tag.accent { background: var(--accent-lt); color: var(--accent); border-color: rgba(34,211,238,0.15); }
.tag.green  { background: var(--green-lt);  color: var(--green);  border-color: rgba(52,211,153,0.15); }

/* ===== BUTTONS — Revolut pill, 14px 32px padding ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 32px; font-size: 14px; font-weight: 500;
  border-radius: 9999px; border: 2px solid transparent;
  cursor: pointer; transition: background 0.18s, border-color 0.18s, color 0.18s, opacity 0.18s;
  font-family: 'Inter', sans-serif; user-select: none; letter-spacing: 0.01em;
  white-space: nowrap;
}
.btn-dark    { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-dark:hover { opacity: 0.85; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--bg); }
.btn-accent  { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 600; }
.btn-accent:hover { opacity: 0.88; }
.btn-ghost   { background: rgba(34,211,238,0.08); color: var(--accent); border-color: var(--accent-40); }
.btn-ghost:hover { background: rgba(34,211,238,0.14); }

/* ===== SCROLL REVEAL ===== */
.reveal {
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.6s cubic-bezier(0.16,1,0.3,1), transform 0.6s cubic-bezier(0.16,1,0.3,1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.06s; }
.reveal-delay-2 { transition-delay: 0.12s; }
.reveal-delay-3 { transition-delay: 0.18s; }
.reveal-delay-4 { transition-delay: 0.24s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .cs-card .thumb img { transition: none; }
  .cs-card, nav.top .cta, nav.top .links a,
  nav.top .links .dropdown-menu, .btn, .rlink { transition: none; }
  .avail::before { animation: none; }
  .progress-bar { transition: none; }
}

/* ===== CASE STUDY CARD — Revolut: 20px radius, flat, no shadow ===== */
.cs-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 20px;
  display: flex; flex-direction: column;
  overflow: hidden; cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.cs-card:hover { border-color: var(--accent-40); background: var(--surface-2); }

.cs-card .thumb {
  aspect-ratio: 16/9; overflow: hidden;
  background: var(--surface-2); position: relative;
}
.cs-card .thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.16,1,0.3,1);
}
.cs-card:hover .thumb img { transform: scale(1.04); }

.cs-card .card-body {
  padding: 36px 44px 44px;
  flex: 1; display: flex; flex-direction: column;
  border-top: 1px solid var(--rule);
}
.cs-card .card-tags { display: flex; flex-wrap: wrap; gap: 0; margin-bottom: 20px; align-items: center; }
.cs-card .card-tags span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted-lt); background: none; padding: 0; border: none; border-radius: 0;
}
.cs-card .card-tags span + span::before { content: ' · '; margin: 0 2px; color: var(--muted-lt); }
.cs-card h3 {
  font-size: 17px; font-weight: 600; margin-bottom: 14px;
  line-height: 1.3; letter-spacing: -0.015em; color: var(--ink);
}
.cs-card p {
  color: var(--muted); font-size: 15px; line-height: 1.7;
  flex: 1; margin-bottom: 24px;
}
.cs-card .rlink {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); align-self: flex-start;
  display: flex; align-items: center; gap: 8px;
  transition: color 0.18s, gap 0.2s;
}
.cs-card .rlink::after { content: "↗"; }
.cs-card:hover .rlink { color: var(--accent); gap: 12px; }

/* Featured card — wide layout */
.cs-card.featured { flex-direction: row; }
@media (max-width: 760px) { .cs-card.featured { flex-direction: column; } }
.cs-card.featured .thumb { aspect-ratio: auto; flex: 1.1; min-height: 320px; }
.cs-card.featured .card-body { flex: 1; padding: 56px 60px; justify-content: center; border-top: none; border-left: 1px solid var(--rule); }
.cs-card.featured h3 { font-size: 22px; margin-bottom: 14px; }
.cs-card.featured p { font-size: 15px; }

/* ===== CASE STUDY PAGE ===== */
.cs-hero {
  padding: 88px 0 64px;
  border-bottom: 1px solid var(--rule);
}
.cs-hero .eyebrow { margin-bottom: 24px; display: flex; flex-wrap: wrap; gap: 0; align-items: center; }
.cs-hero .eyebrow span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted-lt); background: none; padding: 0; border: none; border-radius: 0;
}
.cs-hero .eyebrow span + span::before { content: ' · '; margin: 0 6px; color: var(--muted-lt); }
.cs-hero h1 {
  font-size: clamp(36px, 5vw, 64px); font-weight: 700;
  max-width: 18ch; margin-bottom: 24px;
  line-height: 1.04; letter-spacing: -0.03em;
}
.cs-hero .lead {
  font-size: 17px; color: var(--muted); max-width: 58ch;
  line-height: 1.75; margin-bottom: 40px;
}
.cs-meta {
  display: flex; gap: 48px; flex-wrap: wrap;
  padding-top: 36px; border-top: 1px solid var(--rule); margin-top: 40px;
}
.cs-meta .meta-item label {
  display: block; font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted-lt); margin-bottom: 6px;
  font-family: 'JetBrains Mono', monospace;
}
.cs-meta .meta-item span { font-size: 14px; font-weight: 500; color: var(--ink); }

.cs-hero-img {
  width: 100%; overflow: hidden;
  border-bottom: 1px solid var(--rule);
  background: var(--surface); max-height: 560px;
}
.cs-hero-img img { width: 100%; height: 100%; object-fit: cover; display: block; max-height: 560px; }

.cs-body { padding: 80px 0; }
.cs-body h2 {
  font-size: clamp(20px, 2.6vw, 28px); font-weight: 700;
  margin-bottom: 20px; margin-top: 64px; letter-spacing: -0.025em;
}
.cs-body h2:first-child { margin-top: 0; }
.cs-body h3 { font-size: 16px; margin-bottom: 12px; margin-top: 40px; font-weight: 600; }
.cs-body p {
  color: var(--muted); font-size: 17px; line-height: 1.75;
  margin-bottom: 18px; max-width: 68ch;
}
.cs-body ul { margin-bottom: 24px; display: grid; gap: 10px; }
.cs-body ul li {
  position: relative; padding-left: 18px;
  color: var(--muted); font-size: 15px; line-height: 1.7; max-width: 66ch;
}
.cs-body ul li::before {
  content: "—"; position: absolute; left: 0;
  color: var(--accent); font-family: 'JetBrains Mono', monospace; font-size: 12px;
}

.cs-img {
  margin: 48px 0; background: var(--surface);
  border: 1px solid var(--rule); overflow: hidden;
}
.cs-img img { width: 100%; display: block; }
.cs-img figcaption {
  padding: 10px 16px; font-size: 11px; color: var(--muted-lt);
  font-family: 'JetBrains Mono', monospace; letter-spacing: 0.04em; border-top: 1px solid var(--rule);
}

/* Stat row */
.cs-stat-row {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 0; margin: 48px 0;
  border: 1px solid var(--rule); overflow: hidden;
}
.cs-stat { background: var(--surface); padding: 36px 32px; transition: background 0.18s; border-right: 1px solid var(--rule); }
.cs-stat:last-child { border-right: none; }
.cs-stat:hover { background: var(--surface-2); }
.cs-stat .num {
  font-size: 48px; font-weight: 700; letter-spacing: -0.05em;
  color: var(--ink); margin-bottom: 8px; line-height: 1;
}
.cs-stat .num span { color: var(--accent); }
.cs-stat .label { font-size: 13px; color: var(--muted); line-height: 1.5; }
@media (max-width: 600px) {
  .cs-stat-row { grid-template-columns: 1fr; }
  .cs-stat { border-right: none; border-bottom: 1px solid var(--rule); }
  .cs-stat:last-child { border-bottom: none; }
}

/* ===== DEVICE MOCKUPS ===== */
.cs-mockup-full { margin: 64px -120px; }

.mockup-caption {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted-lt); text-align: center; margin-top: 14px; line-height: 1.5;
}

/* Browser chrome */
.mockup-browser {
  background: var(--surface-2); border-radius: 10px; overflow: hidden;
  border: 1px solid var(--rule);
  box-shadow: 0 24px 72px rgba(0,0,0,0.55), 0 4px 16px rgba(0,0,0,0.3);
}
.mockup-browser .m-bar {
  background: var(--surface-3); padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--rule);
}
.mockup-browser .m-dots { display: flex; gap: 6px; flex-shrink: 0; }
.mockup-browser .m-dots span {
  width: 11px; height: 11px; border-radius: 50%;
}
.mockup-browser .m-dots span:nth-child(1) { background: rgba(255,95,87,0.75); }
.mockup-browser .m-dots span:nth-child(2) { background: rgba(255,189,46,0.75); }
.mockup-browser .m-dots span:nth-child(3) { background: rgba(40,201,64,0.75); }
.mockup-browser .m-url {
  flex: 1; background: var(--bg); border-radius: 5px;
  padding: 5px 12px; font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--muted-lt); text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mockup-browser img {
  display: block; width: 100%; height: auto;
  object-fit: cover; max-height: 480px;
  filter: brightness(0.68) saturate(0.75) contrast(1.08);
}

/* Device scene — real device photography, full-bleed */
.cs-device-scene {
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--rule);
  box-shadow: 0 24px 72px rgba(0,0,0,0.55), 0 4px 16px rgba(0,0,0,0.3);
}
.cs-device-scene img {
  display: block; width: 100%; height: auto;
  max-height: 580px; object-fit: cover; object-position: center;
}

/* Phone frame (kept for legacy, not used in current case studies) */
.mockup-phones {
  display: flex; justify-content: center; gap: 20px; flex-wrap: wrap;
}
.mockup-phone {
  width: 216px; flex-shrink: 0;
  background: var(--surface-3); border-radius: 38px; padding: 12px;
  border: 1.5px solid var(--rule);
  box-shadow: 0 24px 64px rgba(0,0,0,0.55), 0 4px 16px rgba(0,0,0,0.3);
}
.mockup-phone .m-notch {
  width: 68px; height: 5px; background: var(--rule);
  border-radius: 3px; margin: 0 auto 10px;
}
.mockup-phone img {
  display: block; width: 100%; border-radius: 24px;
  aspect-ratio: 9 / 19.5; object-fit: cover;
  filter: brightness(0.68) saturate(0.75) contrast(1.08);
}

@media (max-width: 1000px) { .cs-mockup-full { margin: 48px -40px; } }
@media (max-width: 768px)  { .cs-mockup-full { margin: 40px -20px; } }
@media (max-width: 640px) {
  .cs-mockup-full { margin: 32px 0; }
  .mockup-phone { width: 150px; border-radius: 28px; }
  .mockup-phones { gap: 10px; }
  .mockup-browser img { max-height: 320px; }
}

/* Next case study */
.cs-next { background: var(--surface); border-top: 1px solid var(--rule); padding: 72px 0; }
.cs-next .inner {
  max-width: 1200px; margin: 0 auto; padding: 0 48px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 24px;
}
.cs-next p {
  font-size: 10px; color: var(--muted-lt);
  font-family: 'JetBrains Mono', monospace; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 10px;
}
.cs-next h3 { font-size: 24px; color: var(--ink); letter-spacing: -0.02em; font-weight: 700; }
.cs-next a:hover h3 { color: var(--accent); transition: color 0.18s; }

/* ===== SCROLL PROGRESS ===== */
.progress-bar {
  position: fixed; top: 0; left: 0; height: 1px; z-index: 100;
  background: var(--accent); width: 0%; pointer-events: none;
  box-shadow: 0 0 8px var(--accent);
}
