/* NOIR — Availity-inspired: deep blue gradient + orange accents */
:root {
  --bg-deep: #0a1c36;
  --bg-mid: #132f54;
  --surface: rgba(20, 52, 92, 0.88);
  --surface-2: rgba(26, 62, 104, 0.94);
  --text: #f0f5fc;
  --text-soft: #c5d4ea;
  --muted: #a8bdd6;
  --accent: #f57c20;
  --accent-2: #5eb3ff;
  --border: rgba(255, 255, 255, 0.14);
  --max: 1180px;
  --hero-photo-bg: #0a1c36;
  --hero-photo-deep: #060f1e;
  --pad-left: max(1.25rem, env(safe-area-inset-left, 0px));
  --pad-right: max(1.25rem, env(safe-area-inset-right, 0px));
  --mob-tabbar-h: 3.75rem;
  --font-body: "Lato", Helvetica, Arial, sans-serif;
  --font-heading: "Montserrat", Helvetica, Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  overflow-x: clip;
  max-width: 100%;
}

#top,
#about,
#portfolio,
#contact {
  scroll-margin-top: 5.5rem;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background-color: var(--bg-deep);
  background-image:
    radial-gradient(ellipse 70% 55% at 88% 12%, rgba(245, 124, 32, 0.28), transparent 55%),
    radial-gradient(ellipse 50% 45% at 8% 88%, rgba(94, 179, 255, 0.14), transparent 50%),
    linear-gradient(160deg, #0a1c36 0%, #132f54 42%, #0f2848 100%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  max-width: 100%;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, .display {
  font-family: var(--font-heading);
  letter-spacing: -0.01em;
  font-weight: 500;
}

.container {
  width: min(var(--max), 100%);
  margin-inline: auto;
  padding-left: var(--pad-left);
  padding-right: var(--pad-right);
}

/* —— Header —— */
.hdr {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: max(1.25rem, env(safe-area-inset-top, 0px)) 0 1.25rem;
  background: transparent;
  border-bottom: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: background 0.3s ease, border-color 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}

.hdr.is-scrolled {
  padding: 0.85rem 0;
  background: rgba(10, 28, 54, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(4, 12, 24, 0.45);
}

.hdr.is-scrolled .hdr__nav a { color: var(--text); }
.hdr.is-scrolled .hdr__nav a:hover { color: var(--accent); }

.hdr__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
}

.hdr__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.hdr__name {
  font-family: var(--font-heading);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  color: var(--text);
}

.hdr__nav {
  display: flex;
  gap: clamp(1rem, 2.5vw, 1.75rem);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  color: var(--muted);
  flex-shrink: 0;
}

.hdr__nav a:hover { color: var(--accent); }

.hdr__cta {
  padding: 0.55rem 1.65rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  flex-shrink: 0;
  white-space: nowrap;
}

/* —— Hero —— */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  padding: 5rem 0 0;
  overflow-x: clip;
  background: var(--bg-deep);
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(52vw, 760px);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(14, 33, 63, 0.2) 16%,
    rgba(14, 33, 63, 0.55) 28%,
    var(--hero-photo-deep) 40%,
    var(--hero-photo-bg) 52%,
    var(--hero-photo-bg) 100%
  );
  z-index: 0;
  pointer-events: none;
}

.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  -webkit-mask-image: linear-gradient(
    90deg,
    #000 0%,
    #000 48%,
    rgba(0, 0, 0, 0.25) 58%,
    transparent 70%
  );
  mask-image: linear-gradient(
    90deg,
    #000 0%,
    #000 48%,
    rgba(0, 0, 0, 0.25) 58%,
    transparent 70%
  );
}

.hero-aurora {
  position: absolute;
  width: 160%;
  height: 160%;
  left: -30%;
  top: -30%;
  background:
    radial-gradient(ellipse 42% 38% at 28% 32%, rgba(245, 124, 32, 0.42) 0%, transparent 62%),
    radial-gradient(ellipse 36% 32% at 62% 68%, rgba(94, 179, 255, 0.28) 0%, transparent 58%),
    radial-gradient(ellipse 30% 26% at 18% 78%, rgba(245, 124, 32, 0.2) 0%, transparent 55%);
  animation: aurora-drift 22s ease-in-out infinite;
  will-change: transform;
}

.hero-aurora--b {
  animation-name: aurora-drift-alt;
  animation-duration: 28s;
  animation-delay: -11s;
  opacity: 0.75;
  background:
    radial-gradient(ellipse 38% 34% at 72% 28%, rgba(94, 179, 255, 0.32) 0%, transparent 60%),
    radial-gradient(ellipse 34% 30% at 38% 58%, rgba(245, 124, 32, 0.26) 0%, transparent 56%),
    radial-gradient(ellipse 28% 24% at 55% 82%, rgba(94, 179, 255, 0.16) 0%, transparent 52%);
}

@keyframes aurora-drift {
  0%   { transform: translate(0, 0) scale(1) rotate(0deg); }
  25%  { transform: translate(6%, -4%) scale(1.06) rotate(2deg); }
  50%  { transform: translate(-4%, 5%) scale(0.97) rotate(-1deg); }
  75%  { transform: translate(5%, 3%) scale(1.04) rotate(1.5deg); }
  100% { transform: translate(-3%, -2%) scale(1.02) rotate(-0.5deg); }
}

@keyframes aurora-drift-alt {
  0%   { transform: translate(0, 0) scale(1.02) rotate(0deg); }
  30%  { transform: translate(-5%, 4%) scale(0.96) rotate(-2deg); }
  60%  { transform: translate(4%, -5%) scale(1.07) rotate(1deg); }
  100% { transform: translate(2%, 3%) scale(1) rotate(1.5deg); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-aurora,
  .hero-aurora--b,
  .hero-glow,
  .hero h1 em,
  .cta__script-mark.is-visible .cta__script-text,
  .mob-sheet__backdrop,
  .mob-sheet__panel {
    animation: none;
    transition: none;
  }

  .mob-sheet.is-open .mob-sheet__panel {
    transform: none;
  }

  .work-scroll-hint__icon {
    animation: none;
  }

  .cta__script-mark .cta__script-text {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

.hero-glow {
  position: absolute;
  width: min(50vw, 480px);
  height: min(50vw, 480px);
  top: 8%;
  right: -4%;
  background: radial-gradient(circle, rgba(245, 124, 32, 0.38) 0%, rgba(94, 179, 255, 0.1) 40%, transparent 68%);
  filter: blur(52px);
  pointer-events: none;
  z-index: 0;
  animation: glow-pulse 10s ease-in-out infinite alternate;
}

@keyframes glow-pulse {
  to { transform: scale(1.06); opacity: 0.88; }
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.88fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: center;
  flex: 1;
  position: relative;
  z-index: 1;
  min-height: calc(100svh - 5rem);
}

.hero__copy {
  position: relative;
  z-index: 2;
  min-width: 0;
  padding-bottom: 0;
}

.eyebrow,
.section__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.85rem;
  line-height: 1.4;
}

.eyebrow {
  margin-bottom: 0.85rem;
}

.hero h1 {
  font-size: clamp(2rem, 4.2vw, 3.35rem);
  line-height: 1.12;
  margin: 0 0 1rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  max-width: 36rem;
  overflow-wrap: break-word;
  text-wrap: balance;
}

.hero h1 em {
  font-style: normal;
  white-space: nowrap;
  background: linear-gradient(
    115deg,
    var(--accent) 0%,
    #ff9a4d 40%,
    #6aabdf 60%,
    var(--accent-2) 80%,
    var(--accent) 100%
  );
  background-size: 160% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: pipeline-gradient 16s ease-in-out infinite;
}

@keyframes pipeline-gradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero__lead {
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--text-soft);
  max-width: 36rem;
  margin-bottom: 1.75rem;
}

.hero__row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

/* Photo anchored to hero bottom — flush with marquee */
.hero__photo-wrap {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  width: min(50%, 560px);
  height: 100%;
  min-width: 0;
  margin: 0;
  margin-right: calc(50% - 50vw);
  padding: 0;
  padding-right: var(--pad-right);
  background: transparent;
  pointer-events: none;
}

.hero__photo-panel {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: 100%;
  max-width: min(100%, 560px);
  background: transparent;
  line-height: 0;
  pointer-events: auto;
}

.hero__photo-wrap::after {
  content: "";
  position: absolute;
  width: 85%;
  height: 55%;
  left: 50%;
  bottom: 12%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 42%, rgba(245, 124, 32, 0.28) 0%, rgba(245, 124, 32, 0.06) 42%, transparent 70%);
  filter: blur(40px);
  z-index: 0;
  pointer-events: none;
}

.hero__photo {
  display: block;
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  object-position: bottom center;
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 2.25rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn__icon {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}

.btn:hover { transform: translateY(-2px); }

.btn--fill {
  background: linear-gradient(135deg, var(--accent), #ff9a4d);
  color: #fff;
  box-shadow: 0 8px 32px rgba(245, 124, 32, 0.35);
}

.btn--line {
  border: 1px solid var(--border);
  color: var(--text);
}

/* —— Marquee —— */
.marquee-wrap {
  position: relative;
  z-index: 2;
  padding: 0.85rem 0;
  overflow: hidden;
  background: transparent;
  border-top: 1px solid var(--border);
}

.marquee {
  display: flex;
  gap: 3rem;
  width: max-content;
  animation: scroll 28s linear infinite;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.marquee span { white-space: nowrap; }
.marquee .hi { color: var(--accent); }

@keyframes scroll {
  to { transform: translateX(-50%); }
}

/* —— Sections —— */
.section {
  padding: 5rem 0;
}

.hl-company {
  color: var(--accent);
}

.about-intro {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

.about-intro__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 34%);
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
}

.about-intro__copy {
  max-width: 36rem;
}

.about-intro__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
}

.about-intro__mark img {
  width: min(100%, 280px);
  height: auto;
  display: block;
  opacity: 0.22;
}

.about-intro h2 {
  font-size: clamp(1.85rem, 3.5vw, 2.65rem);
  margin: 0 0 1.5rem;
  line-height: 1.1;
}

.about-intro__body {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.about-intro__body p {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.72;
  color: var(--text-soft);
}

.about-intro__body p:first-child {
  font-size: 1.15rem;
  color: var(--text);
}

.section h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin: 0 0 1rem;
  line-height: 1.05;
  text-wrap: balance;
}

.headline-keep {
  white-space: nowrap;
}

@media (max-width: 540px) {
  .headline-keep {
    white-space: normal;
  }
}

.section__sub {
  color: var(--text-soft);
  max-width: 36rem;
  margin-bottom: 2.5rem;
  font-size: 1.05rem;
}

.fit {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
}

.fit article {
  background: var(--surface);
  padding: 1.5rem;
  transition: background 0.25s;
}

.fit article:hover { background: var(--surface-2); }

.fit .num {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 600;
  color: rgba(245, 124, 32, 0.25);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.fit h3 { font-size: 1rem; margin: 0 0 0.5rem; font-weight: 700; }
.fit p { margin: 0; font-size: 0.9rem; color: var(--text-soft); line-height: 1.55; }

/* —— Stats —— */
.stats-band {
  padding: 4rem 0;
  border-block: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(245,124,32,0.08), transparent, rgba(94,179,255,0.08));
}

.stats-head {
  margin-bottom: 2.5rem;
}

.stats-head h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.85rem, 3.5vw, 2.65rem);
}

.stats-head .section__sub {
  margin-bottom: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  text-align: center;
}

.stats strong {
  display: block;
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 600;
  line-height: 1;
  background: linear-gradient(180deg, #fff, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stats span {
  display: block;
  margin-top: 0.65rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-soft);
  max-width: 14rem;
  margin-inline: auto;
  line-height: 1.35;
}

/* —— Domain / RCM —— */
.domain-flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
  counter-reset: domain;
}

.domain-flow li {
  padding: 1.75rem 1.5rem 0;
  counter-increment: domain;
}

.domain-flow li:not(:last-child) {
  border-right: 1px solid var(--border);
}

.domain-flow__label {
  display: block;
  font-family: var(--font-heading);
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  font-weight: 500;
  line-height: 1.3;
  color: var(--text);
}

.domain-flow li::before {
  content: counter(domain, decimal-leading-zero);
  display: block;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.65rem;
}

/* —— Stack logos —— */
.stack-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: center;
  margin-top: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.stack-certs {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: flex-start;
  gap: clamp(1.25rem, 2.5vw, 2rem);
  width: 100%;
}

.cert-badge {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  flex: 1 1 8.5rem;
  max-width: 10.5rem;
}

.cert-badge img {
  width: clamp(7rem, 11vw, 9.5rem);
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.4));
}

.cert-badge figcaption {
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-soft);
  text-align: center;
  max-width: 10rem;
  line-height: 1.35;
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.45rem;
  width: 100%;
}

.stack-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 0.2rem;
  min-height: 4.1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.2s, background 0.2s;
}

.stack-item:hover {
  border-color: rgba(245, 124, 32, 0.4);
  background: var(--surface-2);
}

.stack-item img {
  width: 1.25rem;
  height: 1.25rem;
  object-fit: contain;
}

.stack-item__sf {
  width: auto !important;
  height: 0.9rem !important;
  max-width: 2.6rem;
  object-fit: contain;
}

.stack-item__zapier {
  width: 1.25rem !important;
  height: 1.25rem !important;
  object-fit: contain;
}

.stack-item__onetrust {
  width: 1rem !important;
  height: 1.25rem !important;
}

.stack-item__zoominfo {
  width: 1.25rem !important;
  height: 1.25rem !important;
  object-fit: contain;
  border-radius: 4px;
}

.stack-item span {
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--text-soft);
  text-align: center;
  line-height: 1.15;
}

/* —— Portfolio —— */
.work-scroll-outer {
  position: relative;
}

.work-scroll-hint {
  display: none;
}

.work-scroll {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 1rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.work-scroll::-webkit-scrollbar { height: 4px; }
.work-scroll::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }

.work-item {
  flex: 0 0 min(420px, 85vw);
  scroll-snap-align: start;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform 0.3s, border-color 0.3s;
}

.work-item__media {
  display: block;
  position: relative;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.work-item__enlarge {
  font: inherit;
}

.work-item__media img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  object-position: top;
  display: block;
  transition: transform 0.35s ease;
}

.work-item__badge {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  z-index: 2;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(10, 28, 54, 0.82);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: none;
}

.work-item__badge--wip {
  background: rgba(245, 124, 32, 0.92);
  color: var(--navy-deep, #0a1c36);
}

.work-item__badge--almost {
  background: rgba(255, 193, 7, 0.92);
  color: var(--navy-deep, #0a1c36);
}

.work-item__badge--live {
  background: rgba(46, 160, 67, 0.92);
  color: #fff;
}

.work-item__badge--paused {
  background: rgba(10, 28, 54, 0.82);
  color: rgba(255, 255, 255, 0.75);
}

.work-item__live-preview {
  container-type: inline-size;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #f4f6f8;
  display: block;
}

.work-item__live-preview iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 1280px;
  height: 800px;
  border: 0;
  pointer-events: none;
  transform-origin: top left;
  transform: scale(calc(100cqw / 1280px));
}

.work-item--live .work-item__media:hover .work-item__live-preview,
.work-item--live .work-item__media:focus-visible .work-item__live-preview {
  transform: scale(1.03);
  transition: transform 0.35s ease;
}

.work-item__overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(10, 28, 54, 0.55);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.work-item--link .work-item__media:hover img,
.work-item--link .work-item__media:focus-visible img,
.work-item--expand .work-item__media:hover img,
.work-item--expand .work-item__media:focus-visible img {
  transform: scale(1.03);
}

.work-item--live .work-item__media:hover img,
.work-item--live .work-item__media:focus-visible img {
  transform: none;
}

.work-item__media:hover .work-item__overlay,
.work-item__media:focus-visible .work-item__overlay {
  opacity: 1;
}

.work-item__media:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.work-item:hover {
  transform: scale(1.02);
  border-color: rgba(245, 124, 32, 0.35);
}

.work-item__body { padding: 1.25rem; }
.work-item__body h3 { margin: 0 0 0.4rem; font-size: 1.2rem; }
.work-item__body p { margin: 0 0 0.75rem; font-size: 0.9rem; color: var(--text-soft); line-height: 1.55; }
.work-item__body a { color: var(--accent); font-weight: 600; font-size: 0.88rem; }

/* —— Portfolio lightbox —— */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 2.5rem);
}

.lightbox[hidden] {
  display: none;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(6, 14, 28, 0.88);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.lightbox__dialog {
  position: relative;
  z-index: 1;
  width: min(1100px, 100%);
  max-height: calc(100vh - 3rem);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  background: var(--surface);
}

.lightbox__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 3rem);
  object-fit: contain;
  object-position: top;
}

.lightbox__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 999px;
  background: rgba(10, 28, 54, 0.72);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox__close:hover {
  background: rgba(245, 124, 32, 0.9);
}

body.is-lightbox-open {
  overflow: hidden;
}

/* —— CTA / Footer —— */
.cta {
  padding: 5rem 0 6rem;
  text-align: center;
}

.cta__headline {
  max-width: min(40rem, 92vw);
  margin: 0 auto 1.25rem;
}

.cta h2 {
  font-size: clamp(2rem, 5vw, 3.8rem);
  margin: 0;
  line-height: 1.05;
  text-wrap: balance;
}

.cta__script {
  margin: 0.15rem 0 0;
  font-family: "Caveat", cursive;
  font-size: clamp(2.15rem, 5.5vw, 3rem);
  font-weight: 700;
  font-style: normal;
  line-height: 1;
  color: var(--accent);
  transform: rotate(-2deg);
  min-height: 1.1em;
}

.cta__script-mark {
  display: inline-block;
}

.cta__script-text {
  display: inline-block;
  opacity: 0;
  transform: translateY(14px) scaleX(0.72);
  transform-origin: left center;
  filter: blur(5px);
}

.cta__script-mark.is-visible .cta__script-text {
  animation: marker-swipe-in 1.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes marker-swipe-in {
  0% {
    opacity: 0;
    transform: translateY(14px) scaleX(0.72);
    filter: blur(5px);
  }
  55% {
    opacity: 0.92;
    filter: blur(1px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scaleX(1);
    filter: blur(0);
  }
}

.cta p {
  color: var(--text-soft);
  max-width: 32rem;
  margin: 0 auto 2rem;
}

.cta__btns { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }

.footer {
  padding: 1.5rem 0 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}

.footer a { color: var(--accent); }

/* —— Mobile tab bar + sheet (Vital Tears / ISM pattern) —— */
.mob-tabbar,
.mob-sheet {
  display: none;
}

.mob-tabbar__item {
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 900px) {
  html {
    scroll-padding-top: 4.5rem;
    scroll-padding-bottom: calc(var(--mob-tabbar-h) + env(safe-area-inset-bottom, 0px));
  }

  #top,
  #about,
  #portfolio,
  #contact {
    scroll-margin-top: 4.5rem;
    scroll-margin-bottom: calc(var(--mob-tabbar-h) + 0.5rem);
  }

  body {
    padding-bottom: calc(var(--mob-tabbar-h) + env(safe-area-inset-bottom, 0px));
  }

  html.mob-sheet-open body {
    overflow: hidden;
  }

  .hdr {
    padding-top: max(0.85rem, env(safe-area-inset-top, 0px));
    padding-bottom: 0.85rem;
  }

  .hdr__nav,
  .hdr__cta {
    display: none;
  }

  .mob-tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    height: calc(var(--mob-tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(10, 28, 54, 0.97);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 28px rgba(4, 12, 24, 0.45);
  }

  .mob-tabbar__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-height: var(--mob-tabbar-h);
    padding: 0.35rem 0.25rem 0.25rem;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--muted);
    text-decoration: none;
    cursor: pointer;
  }

  .mob-tabbar__item svg {
    width: 1.35rem;
    height: 1.35rem;
    flex-shrink: 0;
  }

  .mob-tabbar__item.is-active,
  .mob-tabbar__item[aria-current="page"] {
    color: var(--text);
  }

  .mob-tabbar__item.is-active svg,
  .mob-tabbar__item[aria-current="page"] svg {
    stroke: var(--accent);
  }

  .mob-tabbar__item[data-mob-more].is-open {
    color: var(--text);
  }

  .mob-tabbar__item[data-mob-more].is-open svg {
    stroke: var(--accent);
  }

  .mob-sheet {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1200;
    pointer-events: none;
  }

  .mob-sheet[hidden] {
    display: none;
  }

  .mob-sheet.is-open {
    pointer-events: auto;
  }

  .mob-sheet__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    background: rgba(4, 12, 24, 0.62);
    opacity: 0;
    transition: opacity 0.28s ease;
    cursor: pointer;
  }

  .mob-sheet.is-open .mob-sheet__backdrop {
    opacity: 1;
  }

  .mob-sheet__panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: min(88vh, 640px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    background: #0f2848;
    border-radius: 1.25rem 1.25rem 0 0;
    padding: 0.65rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -16px 48px rgba(4, 12, 24, 0.55);
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  }

  .mob-sheet.is-open .mob-sheet__panel {
    transform: translateY(0);
  }

  .mob-sheet__handle {
    width: 2.5rem;
    height: 0.25rem;
    margin: 0.35rem auto 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
  }

  .mob-sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .mob-sheet__title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
  }

  .mob-sheet__close {
    appearance: none;
    -webkit-appearance: none;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    background: var(--surface);
    color: var(--text);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
  }

  .mob-sheet__links {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
  }

  .mob-sheet__links li {
    border-bottom: 1px solid var(--border);
  }

  .mob-sheet__links a {
    display: flex;
    align-items: center;
    min-height: 3rem;
    padding: 0.75rem 0.5rem;
    margin: 0 -0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    border-radius: 0.5rem;
  }

  .mob-sheet__links a:hover,
  .mob-sheet__links a:focus-visible {
    background: rgba(245, 124, 32, 0.12);
    color: var(--accent);
  }

  .mob-sheet__actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .mob-sheet__actions .btn {
    justify-content: center;
    width: 100%;
    min-height: 3rem;
  }

  .hero {
    min-height: auto;
    padding-top: 4.5rem;
    padding-bottom: 0;
  }

  .hero__grid {
    grid-template-columns: 1fr;
    align-items: start;
    min-height: 0;
    flex: none;
    padding-bottom: 0;
    gap: 1rem;
  }

  .hero__copy {
    order: 1;
    padding-bottom: 0;
  }

  .hero__photo-wrap {
    position: relative;
    order: 2;
    width: 100%;
    height: auto;
    margin: 0;
    margin-right: 0;
    padding-right: 0;
    background: transparent;
    pointer-events: auto;
  }

  .hero__photo-wrap::after {
    display: none;
  }

  .hero__photo-panel {
    max-width: min(100%, 22rem);
    margin-inline: auto;
    height: auto;
    line-height: 0;
  }

  .hero__photo {
    width: 100%;
    height: auto;
    max-height: min(48vh, 20rem);
    object-fit: contain;
    object-position: bottom center;
    margin-bottom: 0;
  }

  .marquee-wrap {
    margin-top: 0;
    padding-top: 0.85rem;
  }

  .work-scroll-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin: 0 0 0.85rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
  }

  .work-scroll-hint.is-hidden {
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }

  .work-scroll-hint__icon {
    display: inline-block;
    animation: swipe-nudge 1.4s ease-in-out infinite;
  }

  @keyframes swipe-nudge {
    0%, 100% { transform: translateX(0); opacity: 0.7; }
    50% { transform: translateX(5px); opacity: 1; }
  }

  .work-scroll-outer::after {
    content: "";
    position: absolute;
    top: 2rem;
    right: 0;
    bottom: 1rem;
    width: 2.5rem;
    background: linear-gradient(90deg, transparent, var(--bg-deep));
    pointer-events: none;
    z-index: 2;
  }

  .work-scroll {
    margin-inline: calc(-1 * var(--pad-left));
    padding-inline: var(--pad-left);
    scroll-padding-inline: var(--pad-left);
    gap: 1rem;
    padding-bottom: 1.25rem;
  }

  .work-scroll::-webkit-scrollbar {
    height: 6px;
  }

  .work-item {
    flex: 0 0 min(88vw, 380px);
    scroll-snap-align: start;
  }

  .hero-bg {
    -webkit-mask-image: linear-gradient(
      180deg,
      #000 0%,
      #000 42%,
      rgba(0, 0, 0, 0.45) 62%,
      transparent 78%
    );
    mask-image: linear-gradient(
      180deg,
      #000 0%,
      #000 42%,
      rgba(0, 0, 0, 0.45) 62%,
      transparent 78%
    );
  }

  .hero-glow {
    top: 6%;
    right: 50%;
    transform: translateX(50%);
    width: 80vw;
    height: 40vw;
  }

  .hero::before {
    width: 100%;
    background: linear-gradient(
      180deg,
      transparent 0%,
      rgba(20, 48, 88, 0.25) 48%,
      var(--hero-photo-bg) 62%,
      var(--hero-photo-bg) 100%
    );
  }

  .hero h1 em { white-space: normal; }

  .hero__row .btn {
    flex: 1 1 calc(50% - 0.5rem);
    justify-content: center;
    min-height: 2.75rem;
  }

  .about-intro__grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-intro__mark {
    justify-content: flex-start;
  }

  .about-intro__mark img {
    width: min(42vw, 140px);
    opacity: 0.16;
  }

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

  .stack-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .stack-certs {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
  }

  .stack-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-width: none;
    justify-self: stretch;
    gap: 0.45rem;
  }

  .stats { grid-template-columns: repeat(2, 1fr); }

  .domain-flow {
    grid-template-columns: 1fr;
    border-top: 1px solid var(--border);
  }

  .domain-flow li {
    padding: 1.25rem 0 0;
    border-right: none !important;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.25rem;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .domain-flow li:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .section {
    padding: 3.5rem 0;
  }

  .stats-band {
    padding: 3rem 0;
  }

  .cta {
    padding: 3.5rem 0 calc(3.5rem + var(--mob-tabbar-h));
  }

  .cta__btns {
    flex-direction: column;
    align-items: stretch;
  }

  .cta__btns .btn {
    justify-content: center;
    width: 100%;
    min-height: 2.75rem;
  }
}

@media (max-width: 540px) {
  .hero h1 {
    font-size: clamp(1.75rem, 8vw, 2.15rem);
  }

  .hero__lead {
    font-size: 0.92rem;
  }

  .hero__row {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__row .btn {
    flex: 1 1 auto;
    width: 100%;
  }

  .section h2 {
    font-size: clamp(1.65rem, 7.5vw, 2rem);
  }

  .stack-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
  }

  .stats {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .stats strong {
    font-size: clamp(2.25rem, 12vw, 3rem);
  }

  .work-item {
    flex: 0 0 92vw;
  }

  .marquee {
    font-size: 0.78rem;
  }
}
