/* ==================================================================
   AppSurge — portfolio styles. Dark, cinematic.
   Display: Space Grotesk · Body: Manrope
================================================================== */
:root {
  --bg: #06060c;
  --bg-soft: #0b0c15;
  --panel: #0e0f1a;
  --panel-2: #12131f;
  --ink: #f5f6fc;
  --muted: #9498b4;
  --muted-2: #6f7390;
  --line: rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.05);
  --accent: #8B5CF6;
  --radius: 18px;
  --maxw: 1180px;
  --ff-disp: "Space Grotesk", system-ui, sans-serif;
  --ff-body: "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ff-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
.page {
  position: relative;
  background:
    radial-gradient(1200px 700px at 80% -8%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    radial-gradient(900px 600px at -5% 18%, rgba(34, 211, 238, 0.08), transparent 55%),
    var(--bg);
}
a { color: inherit; text-decoration: none; }
::selection { background: color-mix(in srgb, var(--accent) 45%, transparent); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 18px clamp(20px, 4vw, 44px);
  transition: background .3s ease, backdrop-filter .3s ease, border-color .3s ease, padding .3s ease;
  border-bottom: 1px solid transparent;
}
.nav.solid {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--line);
  padding-top: 12px; padding-bottom: 12px;
}
.brand { display: flex; align-items: center; gap: 0; font-weight: 700; }
.brand-badge {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 11px;
  font-family: var(--ff-disp); font-weight: 700; font-size: 15px; letter-spacing: .5px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 30%, #22D3EE));
  box-shadow: 0 6px 20px -6px color-mix(in srgb, var(--accent) 70%, transparent);
}
.brand-name { font-family: var(--ff-disp); font-size: 15px; letter-spacing: .2px; }
.nav-links { display: flex; gap: 30px; }
.nav-links a { color: var(--muted); font-size: 14.5px; font-weight: 500; transition: color .2s; position: relative; }
.nav-links a:hover { color: var(--ink); }
.nav-cta {
  font-size: 14px; font-weight: 600; padding: 9px 18px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink); transition: all .2s;
}
.nav-cta:hover { border-color: color-mix(in srgb, var(--accent) 60%, transparent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
@media (max-width: 760px) { .nav-links { display: none; } }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; overflow: hidden; }
.galaxy-wrap { position: absolute; inset: 0; z-index: 0; }
.galaxy-canvas { position: absolute; inset: 0; touch-action: pan-y; cursor: grab; }
.galaxy-canvas:active { cursor: grabbing; }
.galaxy-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 35%, transparent 38%, color-mix(in srgb, var(--bg) 55%, transparent) 78%, var(--bg) 100%),
    linear-gradient(to right, var(--bg) 0%, color-mix(in srgb, var(--bg) 80%, transparent) 28%, transparent 56%, transparent 72%, color-mix(in srgb, var(--bg) 45%, transparent) 100%),
    linear-gradient(to bottom, color-mix(in srgb, var(--bg) 60%, transparent) 0%, transparent 22%, transparent 70%, var(--bg) 100%);
}
.hero-inner { position: relative; z-index: 2; max-width: var(--maxw); width: 100%; margin: 0 auto; padding: 0 clamp(20px, 4vw, 44px); pointer-events: none; }
.hero-inner > * { pointer-events: auto; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 13px; font-weight: 600; letter-spacing: .3px; color: var(--muted);
  padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 60%, transparent); backdrop-filter: blur(6px);
}
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: #34D399; box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: pulse 2.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,.5); } 70% { box-shadow: 0 0 0 9px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }
.hero-title {
  font-family: var(--ff-disp); font-weight: 700;
  font-size: clamp(54px, 9.4vw, 128px); line-height: .92; letter-spacing: -.03em;
  /* line-height < 1 makes the gradient box shorter than the glyphs, so descenders
     (the g in "AppSurge") fall outside the painted area and vanish. Pad the box
     down past the descender, then pull the next block back up with a matching
     negative margin so layout is unchanged. Gradient stops are rescaled to the
     taller box so the ramp still lands identically across the letterforms. */
  padding-bottom: .2em;
  margin: 22px 0 -.2em; text-wrap: balance;
  background: linear-gradient(180deg, #fff 25%, color-mix(in srgb, #fff 62%, var(--accent)) 82%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-lead { max-width: 560px; margin: 26px 0 0; font-size: clamp(16px, 1.7vw, 19px); line-height: 1.55; color: var(--muted); text-wrap: pretty; }
.hero-lead em { font-style: normal; color: color-mix(in srgb, var(--accent) 70%, #fff); font-weight: 600; }
.hero-lead strong { color: var(--ink); font-weight: 700; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: clamp(20px, 4vw, 52px); margin-top: 46px; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-n { font-family: var(--ff-disp); font-weight: 700; font-size: clamp(26px, 3.4vw, 38px); line-height: 1; color: var(--ink); }
.stat-l { font-size: 13px; color: var(--muted-2); letter-spacing: .2px; }
.hero-scroll {
  position: absolute; z-index: 2; left: 50%; transform: translateX(-50%); bottom: 26px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: .4px; color: var(--muted-2);
}
.hero-scroll svg { animation: bob 2s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
@media (max-width: 760px) { .hero-scroll span { display: none; } }

/* ---------- store buttons ---------- */
.store-btn {
  display: inline-flex; align-items: center; gap: 11px;
  padding: 11px 18px 11px 16px; border-radius: 13px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border: 1px solid var(--line); color: var(--ink);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.store-btn:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 10%, rgba(255,255,255,.03)); }
.store-mark { display: grid; place-items: center; color: #fff; }
.store-txt { display: flex; flex-direction: column; line-height: 1.05; }
.store-top { font-size: 10px; color: var(--muted); letter-spacing: .3px; text-transform: uppercase; }
.store-name { font-family: var(--ff-disp); font-size: 16px; font-weight: 600; }
.store-btn.compact { padding: 8px 13px; border-radius: 11px; gap: 8px; }
.store-btn.compact .store-top { font-size: 8.5px; }
.store-btn.compact .store-name { font-size: 13px; }

/* ---------- sections ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(72px, 11vw, 130px) clamp(20px, 4vw, 44px); }
.section-head { max-width: 680px; margin-bottom: clamp(36px, 5vw, 60px); }
.eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: color-mix(in srgb, var(--accent) 75%, #fff); margin-bottom: 16px; }
.section-title { font-family: var(--ff-disp); font-weight: 700; font-size: clamp(30px, 4.6vw, 52px); line-height: 1.04; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
.section-sub { margin: 18px 0 0; color: var(--muted); font-size: clamp(15px, 1.6vw, 18px); line-height: 1.6; max-width: 580px; text-wrap: pretty; }

/* ---------- app icon ---------- */
.app-icon { flex-shrink: 0; overflow: hidden; line-height: 0; }
.app-icon svg { display: block; }

/* ---------- featured ---------- */
.feat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 22px; }
.feat-card {
  display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.feat-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: 0 24px 50px -28px rgba(0,0,0,.8); }
.feat-media { position: relative; aspect-ratio: 16/9; overflow: hidden; display: flex; align-items: flex-end; padding: 18px; }
.feat-watermark { position: absolute; right: -22px; top: -34px; width: 180px; height: 180px; opacity: .22; transform: rotate(-12deg); }
.feat-watermark svg { width: 100%; height: 100%; }
.feat-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.32)); }
.feat-media-row { position: relative; z-index: 2; display: flex; align-items: center; gap: 14px; }
.feat-media-meta { display: flex; flex-direction: column; }
.feat-media-name { font-family: var(--ff-disp); font-weight: 600; font-size: 17px; color: #fff; }
.feat-media-cat { font-size: 12px; color: rgba(255,255,255,.78); }
.feat-body { padding: 20px 20px 22px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.feat-name { font-family: var(--ff-disp); font-size: 17px; font-weight: 600; margin: 0; }
.feat-blurb { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.55; flex: 1; }
.feat-foot { display: flex; flex-direction: column; gap: 13px; }
.feat-stores { display: flex; flex-wrap: wrap; gap: 8px; }

/* platform badges */
.plat-badges { display: flex; gap: 7px; }
.plat { font-size: 11px; font-weight: 600; letter-spacing: .3px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.plat.ios { color: #cdd3f5; }
.plat.android { color: #9be7c4; border-color: rgba(91,224,166,.25); }

/* ---------- approach / cases ---------- */
.case-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 22px; }
.case-card { display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); }
.case-media { position: relative; height: 132px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.case-glyph { width: 56px; height: 56px; opacity: .92; filter: drop-shadow(0 6px 14px rgba(0,0,0,.3)); }
.case-glyph svg { width: 100%; height: 100%; }
.case-icon { filter: drop-shadow(0 10px 22px rgba(0,0,0,.45)); }
.case-icon .app-icon { outline: 1px solid rgba(255,255,255,.14); outline-offset: -1px; }
.case-media::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 100% at 50% 0, transparent 50%, rgba(0,0,0,.28)); }
.case-num { position: absolute; left: 16px; bottom: 12px; font-family: var(--ff-disp); font-weight: 700; font-size: 30px; color: rgba(255,255,255,.5); z-index: 2; }
.case-body { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.case-tag { align-self: flex-start; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: color-mix(in srgb, var(--accent) 70%, #fff); }
.case-name { font-family: var(--ff-disp); font-size: 18px; font-weight: 600; margin: 0; line-height: 1.25; }
.case-block, .case-result { display: flex; flex-direction: column; gap: 4px; }
.case-block p, .case-result p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.case-result p { color: var(--ink); }
.case-label { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); }
.case-features { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { font-size: 12px; font-weight: 500; padding: 5px 11px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); color: color-mix(in srgb, var(--accent) 50%, #fff); }
.case-result { padding: 14px 16px; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid var(--line-soft); }
.case-stores { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- directory ---------- */
.dir-controls { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.dir-search { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 13px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); min-width: 240px; flex: 1 1 240px; max-width: 340px; }
.dir-search:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.dir-search input { flex: 1; background: none; border: none; outline: none; color: var(--ink); font-family: var(--ff-body); font-size: 15px; }
.dir-search input::placeholder { color: var(--muted-2); }
.dir-clear { background: none; border: none; color: var(--muted); font-size: 20px; cursor: pointer; line-height: 1; padding: 0 2px; }
.dir-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-pill {
  font-family: var(--ff-body); font-size: 13px; font-weight: 600; cursor: pointer;
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel); color: var(--muted); transition: all .18s ease;
  display: inline-flex; align-items: center; gap: 7px;
}
.cat-pill:hover { color: var(--ink); border-color: var(--muted-2); }
.cat-pill.active { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--c1, var(--accent)), var(--c2, var(--accent))); }
.cat-count { font-size: 11px; opacity: .8; padding: 1px 7px; border-radius: 999px; background: rgba(255,255,255,.16); }
.cat-pill:not(.active) .cat-count { background: rgba(255,255,255,.06); }
.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.dir-card {
  display: flex; align-items: center; gap: 14px; padding: 13px 15px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line); transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.dir-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c1) 50%, transparent); background: var(--panel-2); }
.dir-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dir-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dir-cat { font-size: 12px; color: var(--muted-2); }
.dir-links { display: flex; gap: 8px; }
.dir-link { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); color: var(--muted); transition: all .18s; }
.dir-link:hover { color: #fff; border-color: color-mix(in srgb, var(--c1) 60%, transparent); background: color-mix(in srgb, var(--c1) 16%, transparent); }
.dir-empty { color: var(--muted); text-align: center; padding: 30px; }

/* ---------- skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.skill-col { padding: 26px 24px; border-radius: var(--radius); background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); }
.skill-t { font-family: var(--ff-disp); font-size: 16px; font-weight: 600; margin: 0 0 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.skill-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.skill-col li { font-size: 14.5px; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.skill-col li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 80%, transparent); }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.about-portrait-wrap { position: relative; }
.about-portrait { position: relative; display: block; width: 100%; aspect-ratio: 4/5; overflow: hidden; border-radius: 24px; border: 1px solid var(--line); background: var(--panel); }
.about-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 28%; display: block; }
.about-portrait::after { content: ""; position: absolute; inset: 0; border-radius: 24px; box-shadow: inset 0 0 60px -20px var(--bg); pointer-events: none; }
.about-portrait-glow { position: absolute; inset: -10% -10% auto auto; width: 70%; height: 70%; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 40%, transparent), transparent 70%); filter: blur(40px); z-index: -1; }
.about-p { margin: 18px 0 0; color: var(--muted); font-size: clamp(15px, 1.6vw, 17px); line-height: 1.65; text-wrap: pretty; }
.about-p strong { color: var(--ink); }
.about-facts { display: flex; gap: 36px; margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--line); }
.about-facts > div { display: flex; flex-direction: column; gap: 3px; }
.af-n { font-family: var(--ff-disp); font-weight: 700; font-size: 26px; color: var(--ink); }
.af-l { font-size: 13px; color: var(--muted-2); }
@media (max-width: 760px) { .about-grid { grid-template-columns: 1fr; } .about-portrait { aspect-ratio: 16/10; max-width: 420px; } }

/* ---------- contact ---------- */
.contact { padding-top: clamp(40px, 6vw, 70px); }
.contact-card {
  position: relative; overflow: hidden; text-align: center;
  padding: clamp(44px, 7vw, 80px) clamp(24px, 5vw, 60px);
  border-radius: 28px; border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}
.contact-orb { position: absolute; top: -120px; left: 50%; transform: translateX(-50%); width: 460px; height: 460px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 36%, transparent), transparent 65%); filter: blur(20px); pointer-events: none; }
.contact-card .eyebrow { position: relative; }
.contact-title { position: relative; font-family: var(--ff-disp); font-weight: 700; font-size: clamp(32px, 5vw, 56px); line-height: 1.05; letter-spacing: -.02em; margin: 0 0 16px; }
.contact-sub { position: relative; color: var(--muted); font-size: clamp(15px, 1.7vw, 18px); max-width: 480px; margin: 0 auto; line-height: 1.6; }
.contact-actions { position: relative; display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 34px; }
.btn-primary, .btn-ghost { display: inline-flex; align-items: center; gap: 10px; padding: 14px 24px; border-radius: 13px; font-weight: 600; font-size: 15px; transition: transform .18s ease, box-shadow .18s ease, background .18s; }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 40%, #22D3EE)); box-shadow: 0 14px 36px -14px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 20px 44px -14px color-mix(in srgb, var(--accent) 90%, transparent); }
.btn-ghost { color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { transform: translateY(-2px); background: rgba(255,255,255,.04); }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); margin-top: clamp(40px, 6vw, 80px); padding: clamp(40px, 5vw, 64px) clamp(20px, 4vw, 44px) 30px; max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 40px; justify-content: space-between; }
.footer-brand { display: flex; align-items: center; gap: 0; }
.footer-name { font-family: var(--ff-disp); font-weight: 600; font-size: 16px; }
.footer-role { font-size: 13px; color: var(--muted-2); }
.footer-cols { display: flex; flex-wrap: wrap; gap: 48px; }
.footer-col { display: flex; flex-direction: column; gap: 11px; }
.footer-h { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 3px; }
.footer-col a { font-size: 14px; color: var(--muted); transition: color .2s; }
.footer-col a:hover { color: var(--ink); }
.footer-base { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line-soft); font-size: 13px; color: var(--muted-2); }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  .pulse-dot, .hero-scroll svg { animation: none; }
}

@media (max-width: 540px) {
  .hero-stats { gap: 22px; }
  .footer-base { flex-direction: column; gap: 6px; }
}
