/* Apptitude Labs v2
   Tokens: one accent (fox magenta), navy-tinted neutrals, light + dark.
   Radius rule: surfaces 20px, media tiles 28px, buttons + chips full pill, icon wells 12px. */

@font-face {
  font-family: "Geist";
  src: url("../fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #fafbfc;
  --surface: #ebeef3;
  --surface-2: #dde2ea;
  --ink: #122041;
  --muted: #4a5572;
  --line: rgb(18 32 65 / 0.1);
  --accent: #c92a63;
  --accent-hover: #b0204f;
  --accent-ink: #fffafc;
  --accent-soft: #fbe9ef;
  --navy: #122041;
  --navy-ink: #eef1f8;
  --navy-muted: #b4bdd3;
  --shadow: 0 1px 2px rgb(18 32 65 / 0.06), 0 12px 32px -12px rgb(18 32 65 / 0.18);

  --r-surface: 20px;
  --r-media: 28px;
  --r-well: 12px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --max: 1200px;
  --gutter: clamp(1rem, 4vw, 2.5rem);

  color-scheme: light;
}

.dark {
  --bg: #0a0f1d;
  --surface: #111a2e;
  --surface-2: #17213a;
  --ink: #e9edf6;
  --muted: #a4aec5;
  --line: rgb(233 237 246 / 0.1);
  --accent: #f06a96;
  --accent-hover: #f58bae;
  --accent-ink: #1c0610;
  --accent-soft: #2a1426;
  --navy: #16264d;
  --navy-ink: #eef1f8;
  --navy-muted: #b4bdd3;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 16px 40px -16px rgb(0 0 0 / 0.6);

  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

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

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 100;
  background: var(--surface);
  padding: 0.5rem 1rem;
  border-radius: 999px;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex-shrink: 0;
  fill: currentColor;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 3rem;
  padding-inline: 1.375rem;
  border-radius: 999px;
  font: inherit;
  font-weight: 550;
  font-size: 0.975rem;
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease),
    color 0.25s var(--ease), transform 0.25s var(--ease);
}
.btn:active {
  transform: scale(0.98);
}
.btn .icon {
  transition: transform 0.3s var(--ease);
}
.btn:hover .icon {
  transform: translateX(3px);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-ghost {
  border-color: var(--line);
  color: var(--ink);
  background: transparent;
}
.btn-ghost:hover {
  background: var(--surface-2);
}

.btn-sm {
  height: 2.5rem;
  padding-inline: 1.125rem;
  font-size: 0.9rem;
}

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.nav.is-stuck {
  border-bottom-color: var(--line);
}
.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-size: 1.05rem;
  white-space: nowrap;
}
.brand-logo {
  display: block;
  width: 40px;
  height: 40px;
}
.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nav-links {
  display: none;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
  transition: color 0.2s var(--ease);
}
.nav-links a:hover {
  color: var(--ink);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.theme-toggle:hover {
  background: var(--surface-2);
}
.theme-toggle:active {
  transform: scale(0.94);
}
.theme-toggle .icon-sun,
.dark .theme-toggle .icon-moon {
  display: none;
}
.dark .theme-toggle .icon-sun {
  display: block;
}

@media (max-width: 479px) {
  .nav-actions .btn-sm {
    display: none;
  }
}
@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

/* ---------- Hero ---------- */

.hero {
  padding-block: clamp(3rem, 7vw, 5.5rem) clamp(3rem, 6vw, 5rem);
  overflow-x: clip;
}
.hero .wrap {
  display: grid;
  gap: 3rem;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.375rem, 4.4vw, 3.625rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
  font-weight: 650;
  max-width: 18ch;
  text-wrap: balance;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-sub {
  margin-top: 1.5rem;
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--muted);
  max-width: 44ch;
  line-height: 1.55;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.25rem;
}

.hero-art {
  justify-self: center;
  width: min(100%, 420px);
  aspect-ratio: 1;
}
@media (max-width: 767px) {
  .hero-art {
    width: min(100%, 320px);
  }
}
.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (min-width: 900px) {
  .hero .wrap {
    grid-template-columns: 7fr 5fr;
    gap: 4rem;
  }
  .hero-art {
    justify-self: end;
  }
}

/* ---------- Stack strip ---------- */

.stack {
  padding-block: 1.75rem;
  border-block: 1px solid var(--line);
}
.stack .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2rem;
}
.stack-label {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.stack ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem 2.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.stack li {
  color: var(--muted);
  transition: color 0.2s var(--ease);
}
.stack li:hover {
  color: var(--ink);
}
.stack li svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

@media (max-width: 767px) {
  .stack ul {
    width: 100%;
    justify-content: space-between;
    gap: 1rem;
  }
}

/* ---------- Section heading ---------- */

.section {
  padding-block: clamp(4.5rem, 9vw, 7rem);
}
.section-title {
  font-size: clamp(2rem, 3.6vw, 2.875rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
  font-weight: 650;
  max-width: 20ch;
  text-wrap: balance;
}
.section-lede {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 1.075rem;
  max-width: 58ch;
}

/* ---------- Services bento ---------- */

.bento {
  display: grid;
  gap: 1rem;
  margin-top: 3rem;
  grid-template-columns: 1fr;
}

.cell {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  min-height: 240px;
  padding: 1.75rem;
  border-radius: var(--r-surface);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  isolation: isolate;
}
.cell h3 {
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  font-weight: 620;
  line-height: 1.25;
}
.cell p {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.975rem;
  max-width: 42ch;
}

.well {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--r-well);
  background: var(--surface-2);
  color: var(--ink);
}
.well .icon {
  width: 1.4rem;
  height: 1.4rem;
}

/* photo cell */
.cell-photo {
  min-height: 420px;
  border-color: transparent;
  background: #0d1426;
  color: #f1f3f8;
}
.cell-photo > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  transition: transform 0.9s var(--ease);
}
.cell-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgb(10 15 29 / 0.15) 0%, rgb(10 15 29 / 0.35) 45%, rgb(10 15 29 / 0.88) 100%);
}
.cell-photo:hover > img {
  transform: scale(1.04);
}
.cell-photo p {
  color: #cdd3e1;
}
.cell-photo .well {
  background: rgb(255 255 255 / 0.12);
  color: #f1f3f8;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* navy cell */
.cell-navy {
  background: var(--navy);
  border-color: transparent;
  color: var(--navy-ink);
}
.cell-navy p {
  color: var(--navy-muted);
}
.cell-navy .well {
  background: rgb(255 255 255 / 0.1);
  color: var(--navy-ink);
}

/* accent-tinted cell */
.cell-tint {
  background: var(--accent-soft);
  border-color: transparent;
}
.cell-tint .well {
  background: var(--accent);
  color: var(--accent-ink);
}

/* split cell with side image */
.cell-split {
  padding: 0;
  display: grid;
  gap: 0;
}
.cell-split .cell-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.75rem;
}
.cell-split .cell-media {
  position: relative;
  min-height: 200px;
  overflow: hidden;
}
.cell-split .cell-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease);
}
.cell-split:hover .cell-media img {
  transform: scale(1.04);
}

@media (min-width: 768px) {
  .bento {
    grid-template-columns: repeat(6, 1fr);
  }
  .cell-ios {
    grid-column: span 4;
    grid-row: span 2;
  }
  .cell-backend,
  .cell-web {
    grid-column: span 2;
  }
  .cell-wp,
  .cell-consult {
    grid-column: span 3;
  }
  .cell-split {
    grid-template-columns: 1.1fr 1fr;
  }
  .cell-split .cell-media {
    min-height: 100%;
  }
}

/* ---------- Statement ---------- */

.statement {
  padding-block: clamp(4rem, 8vw, 6.5rem);
  border-block: 1px solid var(--line);
}
.statement p {
  font-size: clamp(1.625rem, 3.3vw, 2.625rem);
  line-height: 1.22;
  letter-spacing: -0.03em;
  font-weight: 560;
  max-width: 30ch;
  text-wrap: pretty;
}
.statement p span {
  color: var(--muted);
}

/* ---------- Audience ---------- */

.audience .wrap {
  display: grid;
  gap: 3rem;
  align-items: center;
}
.audience-media {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-media);
  overflow: hidden;
  background: var(--surface-2);
}
.audience-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.audience-list {
  margin: 2.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 1.75rem;
  border-top: 1px solid var(--line);
  padding-top: 2rem;
}
.audience-list div {
  display: grid;
  gap: 0.25rem;
}
.audience-list dt {
  font-weight: 620;
  font-size: 1.075rem;
  letter-spacing: -0.01em;
}
.audience-list dd {
  margin: 0;
  color: var(--muted);
}

@media (min-width: 900px) {
  .audience .wrap {
    grid-template-columns: 5fr 6fr;
    gap: 5rem;
  }
  .audience-media {
    aspect-ratio: 4 / 5;
    margin-top: -1rem;
  }
}

/* ---------- Contact ---------- */

.contact {
  padding-bottom: clamp(3rem, 6vw, 5rem);
}
.contact-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--r-media);
  background: var(--navy);
  color: var(--navy-ink);
  padding: clamp(2rem, 6vw, 4.5rem);
  display: grid;
  gap: 2.5rem;
}
.contact-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 560px;
  height: 560px;
  right: -180px;
  top: -220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(240 106 150 / 0.28), transparent 65%);
  pointer-events: none;
}
.contact-card h2 {
  font-size: clamp(2rem, 4.4vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 650;
  max-width: 18ch;
  text-wrap: balance;
}
.contact-card > div > p {
  margin-top: 1rem;
  color: var(--navy-muted);
  font-size: 1.1rem;
  max-width: 44ch;
}
.contact-card .btn-primary {
  background: #f06a96;
  color: #1c0610;
  margin-top: 2rem;
}
.contact-card .btn-primary:hover {
  background: #f58bae;
}

.contact-meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  align-content: end;
}
.contact-meta li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--navy-muted);
}
.contact-meta a {
  color: var(--navy-ink);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.35s var(--ease);
}
.contact-meta a:hover {
  background-size: 100% 1px;
}

@media (min-width: 900px) {
  .contact-card {
    grid-template-columns: 1.5fr 1fr;
    align-items: end;
  }
}

/* ---------- Footer ---------- */

.footer {
  padding-block: 2rem 2.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.footer nav {
  display: flex;
  gap: 1.5rem;
}
.footer a {
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.footer a:hover {
  color: var(--ink);
}

/* ---------- Prose (privacy, 404) ---------- */

.prose {
  max-width: 68ch;
  padding-block: clamp(3rem, 7vw, 5rem);
}
.prose h1 {
  font-size: clamp(2.25rem, 4.5vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  font-weight: 650;
}
.prose .updated {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.prose h2 {
  margin-top: 2.75rem;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  font-weight: 620;
}
.prose p,
.prose ul {
  margin-top: 1rem;
  color: var(--muted);
}
.prose ul {
  padding-left: 1.25rem;
}
.prose li + li {
  margin-top: 0.4rem;
}
.prose strong {
  color: var(--ink);
  font-weight: 600;
}
.prose a {
  color: var(--accent);
  text-underline-offset: 3px;
}

.notfound {
  min-height: calc(100dvh - 68px - 90px);
  display: grid;
  align-content: center;
  padding-block: 4rem;
}
.notfound .code {
  font-family: "Geist Mono", ui-monospace, monospace;
  color: var(--accent);
  font-size: 0.95rem;
}
.notfound h1 {
  margin-top: 1rem;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 650;
  max-width: 14ch;
}
.notfound p {
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 44ch;
}
.notfound .hero-ctas {
  margin-top: 2rem;
}

/* ---------- Motion (only when allowed) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .rise {
    opacity: 0;
    transform: translateY(18px);
    animation: rise 0.9s var(--ease) forwards;
    animation-delay: calc(var(--i, 0) * 90ms + 60ms);
  }
  .rise-art {
    opacity: 0;
    transform: scale(0.96);
    animation: rise-art 1.1s var(--ease) 0.2s forwards;
  }
  /* Same gentle float as the original site's logo */
  .hero-art img {
    animation: float 3s ease-in-out infinite;
  }
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
    transition-delay: calc(var(--i, 0) * 70ms);
  }
  .js [data-reveal].is-in {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}
@keyframes rise-art {
  to {
    opacity: 1;
    transform: none;
  }
}
