/* ==========================================================================
   Amrit Duwal — portfolio
   Design tokens → base → layout → components → sections → utilities
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Sora", var(--font-sans);
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --container: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 68px;
  --section-y: clamp(72px, 10vw, 128px);

  --ease: cubic-bezier(.2, .7, .2, 1);
}

:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d12;
  --bg-alt: #0e1118;
  --surface: #131722;
  --surface-2: #1a1f2c;
  --surface-3: #222839;
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .16);
  --text: #eef1f7;
  --text-2: #aab2c3;
  --text-3: #7d879b;
  --accent: #7c9cff;
  --accent-2: #b48cff;
  --accent-soft: rgba(124, 156, 255, .14);
  --on-accent: #0b0d12;
  --success: #3ddc97;
  --danger: #ff7a85;
  --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .04);
  --shadow-md: 0 14px 30px -12px rgba(0, 0, 0, .55);
  --glow-1: rgba(124, 156, 255, .22);
  --glow-2: rgba(180, 140, 255, .16);
  --grid-line: rgba(255, 255, 255, .045);
  --header-bg: rgba(11, 13, 18, .72);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7fb;
  --bg-alt: #eef1f7;
  --surface: #ffffff;
  --surface-2: #f2f4f9;
  --surface-3: #e7ebf3;
  --border: rgba(15, 23, 42, .09);
  --border-strong: rgba(15, 23, 42, .18);
  --text: #0e1422;
  --text-2: #475268;
  --text-3: #6b7589;
  --accent: #3b5bff;
  --accent-2: #8a4dff;
  --accent-soft: rgba(59, 91, 255, .1);
  --on-accent: #ffffff;
  --success: #0f9d63;
  --danger: #d6334a;
  --shadow-lg: 0 30px 60px -24px rgba(15, 23, 42, .28), 0 0 0 1px rgba(15, 23, 42, .05);
  --shadow-md: 0 14px 30px -16px rgba(15, 23, 42, .3);
  --glow-1: rgba(59, 91, 255, .14);
  --glow-2: rgba(138, 77, 255, .1);
  --grid-line: rgba(15, 23, 42, .05);
  --header-bg: rgba(246, 247, 251, .78);
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.15;
  text-wrap: balance;
}

p { text-wrap: pretty; }

::selection { background: var(--accent); color: var(--on-accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.icon { width: 1.15em; height: 1.15em; flex: none; }

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container.narrow { max-width: calc(880px + var(--gutter) * 2); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius-sm);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform .2s var(--ease);
}
.skip-link:focus { transform: none; }

.text-gradient {
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: .95rem;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .2s var(--ease), background-color .2s, border-color .2s, box-shadow .2s, color .2s;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
  box-shadow: 0 10px 24px -10px var(--accent);
}
.btn-primary:hover { box-shadow: 0 14px 32px -10px var(--accent); transform: translateY(-1px); }

.btn-ghost {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-sm { height: 38px; padding: 0 16px; font-size: .875rem; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: color .2s, border-color .2s, background-color .2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, box-shadow .25s;
}
.site-header.is-scrolled { border-bottom-color: var(--border); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 100%;
}

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
  font-family: var(--font-display);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.brand-name { font-family: var(--font-display); letter-spacing: -.01em; }

.site-nav ul { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  display: block;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  color: var(--text-2);
  font-size: .925rem;
  font-weight: 500;
  transition: color .2s, background-color .2s;
}
.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-nav a.is-active,
.site-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }

.header-actions { display: flex; align-items: center; gap: 10px; }

.theme-icon { display: inline-grid; }
:root[data-theme="dark"] .theme-icon--moon,
:root[data-theme="light"] .theme-icon--sun { display: none; }

.nav-toggle { display: none; }
.nav-toggle-close { display: none; }

@media (max-width: 900px) {
  .nav-toggle { display: inline-grid; }
  .header-cta { display: none; }

  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    padding: 12px var(--gutter) 24px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s, transform .2s var(--ease), visibility 0s .2s;
  }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .site-nav a { padding: 14px 12px; border-radius: 12px; font-size: 1.05rem; }

  .nav-open .site-nav {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .2s, transform .2s var(--ease);
  }
  .nav-open .nav-toggle-open { display: none; }
  .nav-open .nav-toggle-close { display: inline-grid; }
}

/* ---------- Shared section pieces ---------- */
.section { position: relative; padding-block: var(--section-y); }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--border); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: currentColor;
}
.eyebrow--muted { color: var(--text-3); margin-bottom: 8px; }
.eyebrow--muted::before { display: none; }

.section-head { margin-bottom: clamp(36px, 5vw, 56px); }
.section-head h2 { font-size: clamp(1.85rem, 3.6vw, 2.75rem); max-width: 22ch; }

.section-head--row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  align-items: end;
  gap: 20px 64px;
}
.section-lead { max-width: 46ch; color: var(--text-2); font-size: 1.02rem; }
.section-head--row .section-lead { justify-self: end; }

.section-cta { display: flex; justify-content: center; margin-top: 40px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: .8rem;
  font-weight: 500;
  line-height: 1.4;
}
.tags--sm li { padding: 3px 10px; font-size: .75rem; }

.checklist { display: grid; gap: 8px; }
.checklist li { display: flex; gap: 10px; color: var(--text-2); font-size: .95rem; line-height: 1.5; }
.checklist .icon { margin-top: .2em; color: var(--success); width: 1em; height: 1em; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-top: clamp(48px, 8vw, 96px);
  padding-bottom: clamp(48px, 6vw, 72px);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(50% 60% at 85% 10%, var(--glow-1), transparent 70%),
    radial-gradient(40% 50% at 10% 30%, var(--glow-2), transparent 70%);
}
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 30%, #000 30%, transparent 100%);
  mask-image: radial-gradient(70% 60% at 50% 30%, #000 30%, transparent 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr);
  align-items: center;
  gap: clamp(40px, 6vw, 80px);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  padding: 7px 14px 7px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-2);
  font-size: .85rem;
  font-weight: 500;
}
.status-dot {
  position: relative;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
}
.status-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--success);
  opacity: .5;
  animation: pulse 2s var(--ease) infinite;
}
@keyframes pulse {
  0% { transform: scale(.6); opacity: .6; }
  100% { transform: scale(1.6); opacity: 0; }
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.04;
}
.hero-title .text-gradient { display: inline; }

.hero-lead {
  max-width: 56ch;
  margin-top: 24px;
  color: var(--text-2);
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.7;
}
.hero-lead strong { color: var(--text); font-weight: 600; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

.hero-social { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 36px; }
.hero-social a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-3);
  font-size: .9rem;
  font-weight: 500;
  transition: color .2s;
}
.hero-social a:hover { color: var(--text); }

.hero-visual { position: relative; justify-self: center; width: min(100%, 400px); }

.portrait {
  position: relative;
  aspect-ratio: 4 / 5;
  padding: 10px;
  border-radius: 36px;
  background: linear-gradient(140deg, var(--accent), transparent 45%, transparent 55%, var(--accent-2));
  box-shadow: var(--shadow-lg);
}
.portrait picture { display: block; height: 100%; }
.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  border-radius: 28px;
  background: var(--surface-2);
}

.float-card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
  font-size: .85rem;
  line-height: 1.3;
}
.float-card strong { display: block; font-size: 1rem; }
.float-card small { display: block; color: var(--text-3); font-size: .78rem; }

.float-card--top { top: 8%; left: -14%; transition: transform .2s var(--ease); }
.float-card--top:hover { transform: translateY(-2px); }
.float-card--bottom { bottom: 6%; right: -10%; flex-direction: column; align-items: flex-start; gap: 8px; }

.float-card-icon {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
}
.float-card-icon .icon { width: 20px; height: 20px; }

.float-card-stack { display: flex; gap: 6px; }
.float-card-stack span {
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: .72rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: clamp(56px, 8vw, 88px) 0 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  overflow: hidden;
}
.stat {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 4px;
  padding: 24px 28px;
}
.stat + .stat { border-left: 1px solid var(--border); }
.stat dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.1;
}
.stat dt { color: var(--text-3); font-size: .9rem; }

/* ---------- About & services ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 24px 64px;
  align-items: start;
}
.about-copy { display: grid; gap: 18px; color: var(--text-2); font-size: 1.075rem; }

.services {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: clamp(40px, 5vw, 64px);
}
.service-card {
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .25s, transform .25s var(--ease);
}
.service-card:hover { border-color: var(--border-strong); transform: translateY(-3px); }
.service-card h3 { margin: 18px 0 8px; font-size: 1.1rem; }
.service-card p { color: var(--text-2); font-size: .93rem; line-height: 1.6; }
.service-icon {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}
.service-icon .icon { width: 22px; height: 22px; }

/* ---------- Featured projects ---------- */
.projects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.project {
  --tint: var(--accent);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  transition: border-color .3s, transform .3s var(--ease), box-shadow .3s;
}
.project:hover {
  border-color: color-mix(in srgb, var(--tint) 55%, var(--border));
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.project-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background:
    radial-gradient(120% 100% at 0% 0%, color-mix(in srgb, var(--tint) 55%, transparent), transparent 60%),
    radial-gradient(90% 90% at 100% 100%, color-mix(in srgb, var(--tint) 30%, transparent), transparent 60%),
    var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.browser {
  position: absolute;
  top: 10%;
  left: 7%;
  right: 7%;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 24px 48px -16px rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .08);
  transition: transform .5s var(--ease);
}
.browser-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 26px;
  padding: 0 10px;
  background: #e9ebf0;
  border-bottom: 1px solid rgba(0, 0, 0, .06);
}
.browser-dots { display: flex; gap: 5px; }
.browser-dots i { width: 7px; height: 7px; border-radius: 50%; background: #c6cad3; }
.browser-dots i:nth-child(1) { background: #ff5f57; }
.browser-dots i:nth-child(2) { background: #febc2e; }
.browser-dots i:nth-child(3) { background: #28c840; }
.browser-url {
  flex: 1;
  max-width: 220px;
  margin-inline: auto;
  padding: 1px 10px;
  border-radius: 6px;
  background: #fff;
  color: #5b6272;
  font-family: var(--font-mono);
  font-size: 10px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.browser img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }

.project-media--web-phone .browser { right: 26%; left: 6%; }
.project-media--web-phone .phones {
  position: absolute;
  top: 16%;
  right: 6%;
  width: 25%;
}

.phone {
  border: 4px solid #0d0f14;
  border-radius: 20px;
  overflow: hidden;
  background: #0d0f14;
  box-shadow: 0 24px 40px -16px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .06);
  transition: transform .5s var(--ease);
}
.phone img { width: 100%; aspect-ratio: 460 / 996; object-fit: cover; object-position: top; border-radius: 15px; }

.project-media--phones .phones {
  position: absolute;
  inset: 9% 10% auto;
  display: flex;
  justify-content: center;
  gap: 5%;
}
.project-media--phones .phone { width: 27%; }
.project-media--phones .phone:nth-child(2) { transform: translateY(-5%); }

/* Store marketing screenshots already include a device frame: drop our bezel. */
.phones--bare .phone { border: 0; background: transparent; border-radius: 14px; }
.phones--bare .phone img { border-radius: 14px; }

.project:hover .browser { transform: translateY(-6px); }
.project:hover .project-media--web-phone .phone { transform: translateY(-10px); }
.project:hover .project-media--phones .phone:nth-child(1) { transform: translateY(-4px) rotate(-1.5deg); }
.project:hover .project-media--phones .phone:nth-child(2) { transform: translateY(-9%); }
.project:hover .project-media--phones .phone:nth-child(3) { transform: translateY(-4px) rotate(1.5deg); }

.project-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: clamp(22px, 3vw, 32px);
}
.project-body h3 { font-size: clamp(1.35rem, 2.2vw, 1.6rem); }
.project-summary { margin: 10px 0 18px; color: var(--text-2); }

.project-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding-top: 24px;
}
.project-links { display: flex; flex-wrap: wrap; gap: 8px; }
.link-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  font-size: .85rem;
  font-weight: 600;
  transition: border-color .2s, color .2s, background-color .2s;
}
.link-pill:hover { border-color: var(--tint); color: var(--text); background: color-mix(in srgb, var(--tint) 14%, transparent); }
.link-pill .icon { width: 1em; height: 1em; }

/* ---------- Client apps ---------- */
.client-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.client-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: border-color .25s, transform .25s var(--ease), box-shadow .25s;
}
.client-card:hover { border-color: var(--border-strong); transform: translateY(-3px); box-shadow: var(--shadow-md); }

.client-shots {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 10px;
  height: 230px;
  padding: 22px 20px 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(80% 80% at 50% 0%, var(--accent-soft), transparent 70%),
    var(--surface-2);
  overflow: hidden;
  cursor: zoom-in;
}
.client-shots img {
  width: 31%;
  height: auto;
  align-self: flex-start;
  border-radius: 12px;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .45);
  transition: transform .4s var(--ease);
}
.client-shots img:nth-child(2) { transform: translateY(14px); }
.client-card:hover .client-shots img { transform: translateY(-6px); }
.client-card:hover .client-shots img:nth-child(2) { transform: translateY(6px); }

.shots-count {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: rgba(10, 12, 18, .78);
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.shots-count .icon { width: 14px; height: 14px; }

.client-card { --tint: var(--accent); }
.client-body { display: flex; flex: 1; flex-direction: column; gap: 10px; padding: 20px 22px 22px; }
.client-body .client-name {
  margin-bottom: -6px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.client-links { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.link-pill--sm { height: 32px; padding: 0 12px; font-size: .8rem; }

.dev-page-link {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  padding: 18px 22px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-2);
  transition: border-color .2s, background-color .2s, color .2s;
}
.dev-page-link:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.dev-page-link > span:nth-child(2) { flex: 1; min-width: 0; }
.dev-page-link strong { display: block; color: var(--text); }
.dev-page-link small { display: block; font-size: .85rem; }
.dev-page-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---------- Expertise ---------- */
.capabilities {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.capability {
  display: flex;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .25s, transform .25s var(--ease);
}
.capability:hover { border-color: var(--border-strong); transform: translateY(-3px); }
.capability .service-icon { flex: none; }
.capability h3 { margin-bottom: 6px; font-size: 1.02rem; }
.capability p { color: var(--text-2); font-size: .9rem; line-height: 1.6; }

/* ---------- Education credential ---------- */
.credential {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.credential strong { display: block; color: var(--text); font-size: .98rem; line-height: 1.4; }
.credential small { display: block; color: var(--text-3); font-size: .88rem; }
.credential-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}
.credential-icon .icon { width: 22px; height: 22px; }
.client-body h3 { font-size: 1.1rem; }
.client-body p { color: var(--text-2); font-size: .92rem; line-height: 1.6; }
.client-body .tags { margin-top: auto; padding-top: 6px; }

/* ---------- App Store grid ---------- */
.filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-2);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.chip span {
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  font-size: .75rem;
}
.chip:hover { color: var(--text); }
.chip.is-active { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip.is-active span { background: color-mix(in srgb, var(--bg) 18%, transparent); }

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
}
.app-tile[hidden] { display: none; }
.app-tile a {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
  padding: 14px 16px 14px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .2s, transform .2s var(--ease), background-color .2s;
}
.app-tile a:hover { border-color: var(--accent); transform: translateY(-2px); }

.app-icon {
  flex: none;
  width: 60px; height: 60px;
  border-radius: 14px;
  box-shadow: 0 0 0 1px var(--border), 0 6px 14px -6px rgba(0, 0, 0, .4);
}
.app-meta { display: flex; flex: 1; flex-direction: column; min-width: 0; line-height: 1.35; }
.app-name { font-weight: 600; }
.app-tagline {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--text-2);
  font-size: .85rem;
}
.app-cat { margin-top: 3px; color: var(--text-3); font-size: .75rem; }
.app-go { color: var(--text-3); transition: color .2s, transform .2s var(--ease); }
.app-tile a:hover .app-go { color: var(--accent); transform: translate(2px, -2px); }

/* ---------- Experience timeline ---------- */
.timeline { position: relative; display: grid; gap: 8px; }
.timeline-item {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 8px 32px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
}
.timeline-meta { display: flex; flex-direction: column; gap: 2px; }
.timeline-period { font-family: var(--font-mono); font-size: .85rem; color: var(--accent); }
.timeline-location { color: var(--text-3); font-size: .85rem; }
.timeline-body h3 { font-size: 1.15rem; }
.timeline-body h3 span { color: var(--text-2); font-weight: 500; }
.timeline-body h3 a:hover { color: var(--accent); }
.timeline-body p { margin: 8px 0 12px; color: var(--text-2); }

/* ---------- Skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.skill-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.skill-card h3 {
  margin-bottom: 16px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.skill-card .tags li { background: transparent; color: var(--text); }

/* ---------- CTA ---------- */
.section--cta { padding-top: 0; }
.section--alt + .section--cta,
.section--cta { padding-top: var(--section-y); }

.cta-card {
  position: relative;
  padding: clamp(40px, 7vw, 80px) clamp(24px, 6vw, 72px);
  border: 1px solid var(--border-strong);
  border-radius: 32px;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(60% 80% at 50% 0%, var(--glow-1), transparent 70%),
    radial-gradient(50% 70% at 100% 100%, var(--glow-2), transparent 70%),
    var(--surface);
}
.cta-card .eyebrow { justify-content: center; }
.cta-card h2 { max-width: 20ch; margin-inline: auto; font-size: clamp(1.9rem, 4vw, 3rem); }
.cta-card p:not(.eyebrow) { max-width: 52ch; margin: 18px auto 0; color: var(--text-2); font-size: 1.05rem; }
.cta-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }

/* ---------- Footer ---------- */
.site-footer { padding-top: 56px; border-top: 1px solid var(--border); background: var(--bg-alt); }
.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  gap: 32px;
  align-items: start;
}
.footer-brand p { max-width: 42ch; margin-top: 14px; color: var(--text-3); font-size: .92rem; }
.footer-contact { display: grid; gap: 6px; font-size: .95rem; }
.footer-contact a { color: var(--text-2); transition: color .2s; }
.footer-contact a:hover { color: var(--accent); }

.social-list { display: flex; flex-wrap: wrap; gap: 8px; }
.social-list a {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-2);
  transition: color .2s, border-color .2s, transform .2s var(--ease), background-color .2s;
}
.social-list a:hover { color: var(--text); border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
.social-list .icon { width: 18px; height: 18px; }
.social-list--lg { margin-top: 32px; }
.social-list--lg a { width: 46px; height: 46px; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 48px;
  padding-block: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: .85rem;
}

/* ---------- Contact page ---------- */
.page-section {
  position: relative;
  padding-block: clamp(48px, 8vw, 104px) var(--section-y);
  overflow: hidden;
}
.page-title { font-size: clamp(2.3rem, 5vw, 3.75rem); font-weight: 700; letter-spacing: -.035em; line-height: 1.06; }

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: start;
}

.contact-list { display: grid; gap: 12px; margin-top: 40px; }
.contact-list a,
.contact-list div {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px 14px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .2s;
}
.contact-list a:hover { border-color: var(--accent); }
.contact-list small { display: block; color: var(--text-3); font-size: .78rem; line-height: 1.3; }
.contact-list span:last-child { min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.contact-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}

.form-card {
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.form-title { margin-bottom: 24px; font-size: 1.35rem; }

.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label { font-size: .88rem; font-weight: 600; }
.field input,
.field textarea {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: .97rem;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input::placeholder,
.field textarea::placeholder { color: var(--text-3); }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.field.has-error input,
.field.has-error textarea { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .84rem; }

.form-alert {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--danger);
  border-radius: 12px;
  color: var(--danger);
  font-size: .9rem;
}
.form-note { margin-top: 14px; color: var(--text-3); font-size: .82rem; text-align: center; }

.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Toasts ---------- */
.toast-region {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  display: grid;
  gap: 10px;
  width: min(420px, calc(100vw - 32px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--success);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: toast-in .35s var(--ease);
}
.toast p { flex: 1; font-size: .93rem; line-height: 1.5; }
.toast-icon { color: var(--success); margin-top: 2px; }
.toast--error { border-left-color: var(--danger); }
.toast--error .toast-icon { color: var(--danger); }
.toast-close {
  display: grid;
  place-items: center;
  width: 26px; height: 26px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
}
.toast-close:hover { color: var(--text); background: var(--surface-2); }
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Lightbox ---------- */
.lightbox {
  width: min(100vw, 980px);
  max-width: 100vw;
  max-height: 100dvh;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
}
.lightbox::backdrop {
  background: rgba(5, 6, 10, .88);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.lightbox[open] { animation: lightbox-in .25s var(--ease); }
@keyframes lightbox-in { from { opacity: 0; transform: scale(.98); } }

.lightbox-inner { display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.lightbox-head { display: flex; align-items: center; gap: 14px; }
.lightbox-head h2 { flex: 1; font-size: 1.1rem; }
.lightbox-count { color: rgba(255, 255, 255, .6); font-family: var(--font-mono); font-size: .85rem; }
.lightbox .icon-btn { color: #fff; border-color: rgba(255, 255, 255, .2); }
.lightbox .icon-btn:hover { background: rgba(255, 255, 255, .1); }

.lightbox-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.lightbox-stage img {
  max-width: 100%;
  max-height: calc(100dvh - 110px);
  width: auto;
  border-radius: 22px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8);
  user-select: none;
}
.lightbox-nav {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px; height: 48px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  color: #fff;
  cursor: pointer;
  transition: background-color .2s;
}
.lightbox-nav:hover { background: rgba(255, 255, 255, .16); }
.lightbox-nav .icon { width: 22px; height: 22px; }

/* ---------- Reveal on scroll (only when JS + IntersectionObserver run) ---------- */
.reveal-ready .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal-ready .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal-ready .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .services,
  .skills-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client-grid,
  .capabilities { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .float-card--top { left: -6%; }
  .float-card--bottom { right: -4%; }
}

@media (max-width: 900px) {
  .hero-grid,
  .about-grid,
  .contact-grid,
  .section-head--row { grid-template-columns: minmax(0, 1fr); }
  .section-head--row .section-lead { justify-self: start; }

  .hero-visual { order: -1; width: min(100%, 300px); justify-self: start; }
  .float-card--top { left: auto; right: -40%; top: 10%; }
  .float-card--bottom { right: -40%; bottom: 10%; }

  .projects { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--border); }

  .footer-inner { grid-template-columns: minmax(0, 1fr); }
  .timeline-item { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  :root { --header-h: 60px; }

  .hero-visual { display: flex; align-items: center; gap: 16px; width: 100%; }
  .portrait { flex: none; width: 148px; padding: 6px; border-radius: 28px; }
  .portrait img { border-radius: 22px; }
  .float-card--top { position: static; min-width: 0; }
  .float-card--bottom { display: none; }

  .hero-actions .btn { flex: 1 1 auto; }

  .services,
  .skills-grid,
  .client-grid,
  .capabilities { grid-template-columns: minmax(0, 1fr); }

  .stat { padding: 18px 20px; }

  .client-shots { height: 210px; }

  .project-media--web-phone .browser { left: 5%; right: 24%; }
  .browser-bar { height: 20px; }
  .browser-url { display: none; }
  .phone { border-width: 3px; border-radius: 14px; }
  .phone img { border-radius: 11px; }

  .project-foot { flex-direction: column; align-items: flex-start; }
  .field-row { grid-template-columns: minmax(0, 1fr); }

  .lightbox-inner { padding: 12px 8px; }
  .lightbox-nav { position: absolute; z-index: 1; width: 42px; height: 42px; background: rgba(10, 12, 18, .6); }
  .lightbox-nav--prev { left: 6px; }
  .lightbox-nav--next { right: 6px; }
  .lightbox-stage img { max-height: calc(100dvh - 90px); }

  .brand-name { font-size: .95rem; }
}
