/* ============================================================
   PIXEL & PARSE — Premium Apple-inspired stylesheet
   ============================================================ */

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

:root {
  /* Dark palette */
  --dark:          #0A0A0F;
  --dark-mid:      #111118;
  --dark-border:   rgba(255,255,255,0.09);
  --dark-border-s: rgba(255,255,255,0.15);

  /* Light palette */
  --light:         #FAFAF8;
  --light-mid:     #F2F1EE;
  --light-border:  rgba(0,0,0,0.08);

  /* Text */
  --text-on-dark:      #FFFFFF;
  --text-on-dark-sub:  rgba(255,255,255,0.55);
  --text-on-light:     #0A0A0F;
  --text-on-light-sub: rgba(10,10,15,0.5);

  /* Accent */
  --blue:    #0071E3;
  --blue-hv: #0077ED;

  /* Type */
  --serif: 'DM Serif Display', Georgia, serif;
  --sans:  'DM Sans', system-ui, -apple-system, sans-serif;

  --nav-h: 60px;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  background: var(--dark);
  color: var(--text-on-dark);
  overflow-x: hidden;
}

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

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 40px;
}

/* -- Eyebrow ----------------------------------------------- */
.eyebrow {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-on-dark-sub);
  margin-bottom: 20px;
}
.eyebrow--dark { color: var(--text-on-light-sub); }

/* -- Section headings -------------------------------------- */
.section-heading {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--text-on-dark);
}
.section-heading--dark { color: var(--text-on-light); }

.section-intro { margin-bottom: 72px; }

/* -- Buttons ----------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 980px;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.2s ease, color 0.2s ease,
              box-shadow 0.2s ease, transform 0.15s ease;
  white-space: nowrap;
}

/* White button (on dark) */
.btn--dark {
  background: var(--text-on-dark);
  color: var(--dark);
}
.btn--dark:hover {
  background: #e8e8e8;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}

/* Ghost button (on dark) */
.btn--outline-dark {
  background: transparent;
  color: var(--text-on-dark);
  border: 1px solid var(--dark-border-s);
}
.btn--outline-dark:hover {
  border-color: rgba(255,255,255,0.35);
  transform: translateY(-1px);
}

/* Dark button (on light) */
.btn--light {
  background: var(--dark);
  color: var(--text-on-dark);
}
.btn--light:hover {
  background: #1c1c24;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* -- Nav --------------------------------------------------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: var(--nav-h);
  transition: background 0.3s ease, border-bottom 0.3s ease,
              backdrop-filter 0.3s ease;
}
.nav.scrolled {
  background: rgba(10,10,15,0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--dark-border);
}

.nav__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 40px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-on-dark);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav__links a {
  font-size: 0.84rem;
  font-weight: 400;
  color: var(--text-on-dark-sub);
  transition: color 0.15s;
}
.nav__links a:hover { color: var(--text-on-dark); }

.nav__contact {
  color: var(--text-on-dark) !important;
  background: rgba(255,255,255,0.1);
  padding: 7px 18px;
  border-radius: 980px;
  font-weight: 500 !important;
  border: 1px solid var(--dark-border-s);
  transition: background 0.15s ease !important;
}
.nav__contact:hover { background: rgba(255,255,255,0.16) !important; }

.nav__burger {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav__burger span {
  display: block;
  width: 22px; height: 1.5px;
  background: var(--text-on-dark);
  border-radius: 1px;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.nav__burger.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav__burger.open span:nth-child(2) { transform: translateY(-7.5px) rotate(-45deg); }

.nav__drawer {
  display: none;
  position: fixed;
  top: var(--nav-h); left: 0; right: 0;
  background: rgba(10,10,15,0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--dark-border);
  flex-direction: column;
  padding: 20px 40px 32px;
  z-index: 199;
}
.nav__drawer.open { display: flex; }
.nav__drawer a {
  font-family: var(--sans);
  font-size: 1.6rem;
  font-weight: 300;
  color: var(--text-on-dark);
  padding: 12px 0;
  border-bottom: 1px solid var(--dark-border);
  transition: color 0.15s;
}
.nav__drawer a:last-child { border-bottom: none; }
.nav__drawer a:hover { color: rgba(255,255,255,0.6); }

/* -- Hero -------------------------------------------------- */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 80px) 40px 120px;
  background: var(--dark);
  position: relative;
  overflow: hidden;
}

/* Subtle radial glow */
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse 80% 60% at 60% 40%, rgba(0,113,227,0.07) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 20% 80%, rgba(255,255,255,0.03) 0%, transparent 60%);
  pointer-events: none;
}

.hero__inner {
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 1;
}

.hero__label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-on-dark-sub);
  margin-bottom: 28px;
  opacity: 0;
  animation: fadeUp 0.7s 0.15s ease forwards;
}

.hero__heading {
  font-family: var(--serif);
  font-size: clamp(3.5rem, 8vw, 7rem);
  font-weight: 400;
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--text-on-dark);
  margin-bottom: 32px;
  opacity: 0;
  animation: fadeUp 0.8s 0.25s ease forwards;
}
.hero__heading em {
  font-style: italic;
  color: rgba(255,255,255,0.55);
}

.hero__body {
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  font-weight: 300;
  color: var(--text-on-dark-sub);
  line-height: 1.75;
  max-width: 480px;
  margin-bottom: 48px;
  opacity: 0;
  animation: fadeUp 0.7s 0.38s ease forwards;
}

.hero__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.6s 0.5s ease forwards;
}

/* -- Work -------------------------------------------------- */
.work {
  padding: 140px 0;
  background: var(--dark);
}

/* Feature layout */
.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 40px;
  align-items: center;
  min-height: 600px;
}

/* iPhone mockup */
.feature__media {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
}

.iphone {
  position: relative;
}

.iphone__shell {
  width: 220px;
  height: 440px;
  background: #17171f;
  border-radius: 46px;
  border: 6px solid #2a2a35;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06),
    0 40px 80px rgba(0,0,0,0.7),
    0 12px 32px rgba(0,0,0,0.4);
}

.iphone__notch {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 72px; height: 14px;
  background: #17171f;
  border-radius: 0 0 14px 14px;
  z-index: 10;
}

.iphone__screen {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #0d0d14;
  display: flex;
  flex-direction: column;
}

/* Detours map */
.dmap {
  flex: 1;
  background: #141b2a;
  position: relative;
  overflow: hidden;
}
.dmap__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 20px 20px;
}
.dmap__road {
  position: absolute;
  background: #233047;
}
.dmap__road--h { left: 0; right: 0; height: 9px; top: 40%; }
.dmap__road--v { top: 0; bottom: 0; width: 9px; left: 52%; }
.dmap__road--d {
  width: 140%; height: 7px;
  top: 65%; left: -15%;
  transform: rotate(-18deg);
  transform-origin: left center;
}
.dmap__pin {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 3;
}
.dmap__dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  position: relative;
  z-index: 2;
}
.dmap__pulse {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 26px; height: 26px;
  border-radius: 50%;
  animation: ripple 2.2s ease-out infinite;
}
.dmap__pin--red .dmap__dot  { background: #FF453A; }
.dmap__pin--red .dmap__pulse { background: rgba(255,69,58,0.18); }
.dmap__pin--yellow .dmap__dot  { background: #FFD60A; }
.dmap__pin--yellow .dmap__pulse { background: rgba(255,214,10,0.15); animation-delay: 0.6s; }

/* Detours live card */
.dlive {
  background: rgba(13,13,20,0.97);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dlive__row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dlive__badge {
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #FF453A;
  background: rgba(255,69,58,0.12);
  padding: 3px 7px;
  border-radius: 4px;
}
.dlive__count {
  font-size: 0.55rem;
  color: rgba(255,255,255,0.35);
}
.dlive__incident {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}
.dlive__sev {
  width: 3px;
  height: 32px;
  border-radius: 2px;
  flex-shrink: 0;
  margin-top: 2px;
}
.dlive__sev--high { background: #FF453A; }
.dlive__sev--med  { background: #FFD60A; }
.dlive__title {
  font-size: 0.6rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  margin-bottom: 2px;
  line-height: 1.3;
}
.dlive__meta {
  font-size: 0.52rem;
  color: rgba(255,255,255,0.35);
}

/* Feature copy */
.feature__copy {
  padding: 40px 20px 40px 60px;
}
.feature__tag {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-on-dark-sub);
  margin-bottom: 20px;
}
.feature__name {
  font-family: var(--serif);
  font-size: 3.2rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text-on-dark);
  line-height: 1;
  margin-bottom: 10px;
}
.feature__subtitle {
  font-size: 1rem;
  font-weight: 400;
  font-style: italic;
  color: var(--text-on-dark-sub);
  margin-bottom: 24px;
}
.feature__desc {
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--text-on-dark-sub);
  line-height: 1.8;
  margin-bottom: 28px;
}
.feature__stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin-bottom: 36px;
}
.feature__stack li {
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 5px 13px;
  border-radius: 980px;
}

/* Coming next */
.coming-next {
  margin-top: 80px;
  padding: 48px;
  border: 1px solid var(--dark-border);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.coming-next__label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-on-dark-sub);
}
.coming-next__text {
  font-family: var(--serif);
  font-size: 1.6rem;
  color: rgba(255,255,255,0.25);
  font-style: italic;
}

/* -- Services (light) -------------------------------------- */
.services {
  background: var(--light);
  padding: 140px 0;
  position: relative;
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--light-border);
  border-left: 1px solid var(--light-border);
}

.svc {
  padding: 44px 36px;
  border-right: 1px solid var(--light-border);
  border-bottom: 1px solid var(--light-border);
  transition: background 0.2s ease;
}
.svc:hover { background: #F5F4F1; }

.svc__num {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-on-light-sub);
  letter-spacing: 0.1em;
  margin-bottom: 20px;
}
.svc h3 {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-on-light);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}
.svc p {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-on-light-sub);
  line-height: 1.7;
}

/* -- About (dark) ----------------------------------------- */
.about {
  background: var(--dark-mid);
  padding: 140px 0;
  border-top: 1px solid var(--dark-border);
}

.about__inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 80px;
  align-items: start;
}

.about__body {
  font-size: 1rem;
  font-weight: 300;
  color: var(--text-on-dark-sub);
  line-height: 1.8;
  margin-bottom: 20px;
}
.about__body:last-of-type { margin-bottom: 0; }

.about__aside {
  padding-top: 80px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.about__stat {
  padding: 32px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.about__stat-num {
  font-family: var(--serif);
  font-size: 2.8rem;
  font-weight: 400;
  color: var(--text-on-dark);
  letter-spacing: -0.02em;
  line-height: 1;
}
.about__stat-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-on-dark-sub);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.about__divider {
  height: 1px;
  background: var(--dark-border);
}

/* -- Contact (light) --------------------------------------- */
.contact {
  background: var(--light);
  padding: 140px 0;
}

.contact__inner { max-width: 640px; }

.contact__heading {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 5vw, 4.2rem);
  font-weight: 400;
  color: var(--text-on-light);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.contact__body {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-on-light-sub);
  line-height: 1.75;
  margin-bottom: 44px;
  max-width: 440px;
}

/* -- Footer ------------------------------------------------ */
.footer {
  background: var(--light);
  border-top: 1px solid var(--light-border);
  padding: 28px 0;
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer__brand {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-on-light);
}
.footer__legal {
  font-size: 0.8rem;
  color: var(--text-on-light-sub);
}
.footer__links {
  display: flex;
  gap: 28px;
}
.footer__links a {
  font-size: 0.8rem;
  color: var(--text-on-light-sub);
  transition: color 0.15s;
}
.footer__links a:hover { color: var(--text-on-light); }

/* -- Scroll reveal ----------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* -- Animations -------------------------------------------- */
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes ripple {
  0%   { transform: translate(-50%,-50%) scale(0.4); opacity: 0.9; }
  100% { transform: translate(-50%,-50%) scale(2.4); opacity: 0; }
}

/* -- Responsive -------------------------------------------- */
@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__burger { display: flex; }
  .container { padding: 0 24px; }
  .nav__inner { padding: 0 24px; }

  .hero { padding-left: 24px; padding-right: 24px; }
  .hero__heading { font-size: clamp(3rem, 10vw, 5rem); }

  .feature {
    grid-template-columns: 1fr;
    padding: 0 24px;
    text-align: center;
  }
  .feature__copy {
    padding: 0 0 40px;
    order: -1;
  }
  .feature__stack { justify-content: center; }

  .coming-next { flex-direction: column; gap: 8px; }

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

  .about__inner { grid-template-columns: 1fr; gap: 48px; }
  .about__aside { padding-top: 0; flex-direction: row; flex-wrap: wrap; gap: 0; }
  .about__stat { flex: 1; min-width: 140px; }
  .about__divider { display: none; }
}

@media (max-width: 560px) {
  .services__grid { grid-template-columns: 1fr; }
  .hero__actions { flex-direction: column; align-items: flex-start; }
  .footer__inner { flex-direction: column; text-align: center; align-items: center; }
  .iphone__shell { width: 180px; height: 360px; border-radius: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .hero__label, .hero__heading, .hero__body, .hero__actions {
    opacity: 1; animation: none;
  }
}
