/* ---------- Design tokens ---------- */
:root {
  --bg: #ffffff;
  --bg-alt: #fafafa;
  --text: #0a0a0a;
  --text-muted: #6b7280;
  --border: #eaeaea;
  --max-width: 720px;
  --max-width-wide: 1080px;
  --section-padding-y: 120px;
  --section-padding-y-mobile: 72px;
  --radius-pill: 999px;
  --radius-lg: 20px;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", system-ui, sans-serif;
}

/* ---------- Minimal reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ---------- Base ---------- */
body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0;
}

p { margin: 0; }

/* ---------- Layout ---------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}
.container--wide { max-width: var(--max-width-wide); }

.section {
  padding-top: var(--section-padding-y-mobile);
  padding-bottom: var(--section-padding-y-mobile);
}
@media (min-width: 720px) {
  .section {
    padding-top: var(--section-padding-y);
    padding-bottom: var(--section-padding-y);
  }
}
.section--alt { background: var(--bg-alt); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-weight: 600;
  letter-spacing: 0.2em;
  font-size: 14px;
}
.site-nav a {
  font-size: 14px;
  color: var(--text-muted);
  margin-left: 24px;
  transition: color .15s ease;
}
.site-nav a:hover { color: var(--text); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-top: 72px;
  padding-bottom: 72px;
  overflow: hidden;
}
@media (min-width: 720px) {
  .hero { padding-top: 128px; padding-bottom: 128px; }
}
.hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: center;
}
@media (min-width: 900px) {
  .hero__grid { grid-template-columns: 1.1fr 1fr; gap: 64px; }
}
.eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.hero h1 {
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1.08;
}
.hero p.lead {
  margin-top: 20px;
  color: var(--text-muted);
  font-size: clamp(17px, 2vw, 19px);
  max-width: 520px;
}
.cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 32px;
  padding: 12px 22px;
  background: var(--text);
  color: #fff;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.cta:hover {
  background: #1a1a1a;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -14px rgba(10,10,10,.5);
}
.cta__arrow { transition: transform .18s ease; }
.cta:hover .cta__arrow { transform: translateX(3px); }

/* ---------- Hero visual (device frames) ---------- */
.hero__visual {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
  perspective: 1400px;
}
.stage {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}
.stage__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(10,10,10,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10,10,10,0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(80% 80% at 55% 50%, #000 40%, transparent 80%);
  -webkit-mask-image: radial-gradient(80% 80% at 55% 50%, #000 40%, transparent 80%);
}
.ambient {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.7;
  pointer-events: none;
}
.ambient--a {
  width: 55%; height: 55%;
  top: 10%; left: -8%;
  background: radial-gradient(circle, #c7d2fe 0%, transparent 70%);
  animation: ambientA 14s ease-in-out infinite;
}
.ambient--b {
  width: 48%; height: 48%;
  bottom: 5%; right: -5%;
  background: radial-gradient(circle, #fecdd3 0%, transparent 70%);
  animation: ambientB 18s ease-in-out infinite;
}
@keyframes ambientA {
  0%,100% { transform: translate(0,0) scale(1); opacity: .65; }
  50%     { transform: translate(20px,-10px) scale(1.08); opacity: .85; }
}
@keyframes ambientB {
  0%,100% { transform: translate(0,0) scale(1); opacity: .6; }
  50%     { transform: translate(-16px,12px) scale(1.05); opacity: .8; }
}

/* MacBook */
.mac {
  position: absolute;
  width: 76%;
  top: 22%;
  left: 4%;
  transform: rotateX(10deg) rotateY(-14deg) rotateZ(-2deg);
  transform-origin: 50% 60%;
  filter: drop-shadow(0 30px 40px rgba(10,10,10,0.18));
  animation: floatMac 9s ease-in-out infinite;
}
.mac svg { width: 100%; height: auto; display: block; }

/* iPhone */
.phone {
  position: absolute;
  width: 26%;
  bottom: 6%;
  right: 8%;
  transform: rotateX(-6deg) rotateY(12deg) rotateZ(5deg);
  transform-origin: 50% 50%;
  filter: drop-shadow(0 28px 34px rgba(10,10,10,0.28));
  animation: floatPhone 11s ease-in-out infinite;
}
.phone svg { width: 100%; height: auto; display: block; }

@keyframes floatMac {
  0%,100% { transform: rotateX(10deg) rotateY(-14deg) rotateZ(-2deg) translateY(0); }
  50%     { transform: rotateX(10deg) rotateY(-14deg) rotateZ(-2deg) translateY(-10px); }
}
@keyframes floatPhone {
  0%,100% { transform: rotateX(-6deg) rotateY(12deg) rotateZ(5deg) translateY(0); }
  50%     { transform: rotateX(-6deg) rotateY(12deg) rotateZ(5deg) translateY(-14px); }
}

/* Platform tags */
.platform-tag {
  position: absolute;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border: 1px solid rgba(10,10,10,0.08);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: #0a0a0a;
  box-shadow: 0 6px 16px -8px rgba(10,10,10,0.25);
}
.platform-tag--mac { top: -8px; left: 6%; }
.platform-tag--ios { bottom: -6px; right: -4%; }

@media (prefers-reduced-motion: reduce) {
  .mac, .phone, .ambient--a, .ambient--b { animation: none; }
}

@media (max-width: 899px) {
  .hero__visual { max-width: 380px; }
  .platform-tag { font-size: 9px; }
}

/* ---------- What we do ---------- */
.pillars {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 40px;
}
@media (min-width: 720px) {
  .pillars { grid-template-columns: repeat(3, 1fr); gap: 24px; }
}
.pillar {
  padding: 28px 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.pillar:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 40px -28px rgba(10,10,10,.25);
  border-color: #d4d4d8;
}
.pillar__icon {
  width: 40px;
  height: 40px;
  margin-bottom: 18px;
  color: var(--text);
}
.pillar__icon svg { width: 100%; height: 100%; }
.pillar h3 {
  font-size: 17px;
  margin-bottom: 8px;
}
.pillar p { color: var(--text-muted); font-size: 15px; }

/* ---------- About ---------- */
.about__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
  margin-top: 32px;
}
@media (min-width: 820px) {
  .about__grid { grid-template-columns: 1.1fr 1fr; gap: 56px; }
}
.about p { color: var(--text-muted); max-width: 560px; }
.about__visual {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #fdf2f8 100%);
  border: 1px solid var(--border);
  perspective: 1200px;
}
.about__ambient {
  position: absolute;
  border-radius: 50%;
  filter: blur(44px);
  opacity: 0.6;
  pointer-events: none;
  z-index: 0;
}
.about__ambient--a {
  width: 60%; height: 60%;
  top: -12%; left: -10%;
  background: radial-gradient(circle, #c7d2fe 0%, transparent 70%);
  animation: ambientA 16s ease-in-out infinite;
}
.about__ambient--b {
  width: 55%; height: 55%;
  bottom: -12%; right: -10%;
  background: radial-gradient(circle, #fecdd3 0%, transparent 70%);
  animation: ambientB 20s ease-in-out infinite;
}

/* Code editor mockup */
.editor {
  position: absolute;
  inset: 8% 6%;
  border-radius: 12px;
  background: #1e1e24;
  color: #e5e7eb;
  overflow: hidden;
  box-shadow:
    0 30px 60px -30px rgba(10,10,10,0.55),
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 0 0 1px rgba(10,10,10,0.08);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.55;
  transform: perspective(1400px) rotateX(6deg) rotateY(-8deg);
  transform-origin: 50% 50%;
  animation: editorFloat 10s ease-in-out infinite;
  z-index: 1;
}
.editor__chrome {
  position: relative;
  height: 30px;
  background: linear-gradient(180deg, #2a2a32, #232329);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  padding: 0 12px;
}
.editor__dot {
  width: 10px; height: 10px; border-radius: 50%;
  margin-right: 6px; flex-shrink: 0;
}
.editor__dot--r { background: #ff5f57; }
.editor__dot--y { background: #febc2e; }
.editor__dot--g { background: #28c840; }
.editor__tabs {
  margin-left: 14px;
  display: flex;
  gap: 2px;
  overflow: hidden;
}
.editor__tab {
  padding: 4px 10px;
  font-size: 10px;
  color: #9ca3af;
  background: transparent;
  border-radius: 4px 4px 0 0;
  white-space: nowrap;
}
.editor__tab--active {
  background: #1e1e24;
  color: #e5e7eb;
  border-top: 1px solid rgba(255,255,255,0.08);
  border-left: 1px solid rgba(255,255,255,0.06);
  border-right: 1px solid rgba(255,255,255,0.06);
}

.editor__body {
  display: grid;
  grid-template-columns: 90px 1fr;
  min-height: calc(100% - 30px - 22px);
}
.editor__sidebar {
  background: #17171c;
  border-right: 1px solid rgba(255,255,255,0.04);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 10px;
  color: #9ca3af;
}
.editor__folder {
  color: #e5e7eb;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.editor__file {
  padding: 2px 6px;
  border-radius: 3px;
  cursor: default;
}
.editor__file--active {
  background: rgba(199,210,254,0.12);
  color: #c7d2fe;
}
.editor__file--muted { opacity: 0.5; }

.editor__code {
  position: relative;
  padding: 10px 12px 10px 0;
  display: flex;
  gap: 10px;
  overflow: hidden;
}
.editor__gutter {
  list-style: none;
  margin: 0;
  padding: 0 0 0 10px;
  color: rgba(156,163,175,0.4);
  text-align: right;
  user-select: none;
  font-variant-numeric: tabular-nums;
}
.editor__gutter li { line-height: 1.55; font-size: 10px; }
.editor__lines {
  margin: 0;
  color: #e5e7eb;
  white-space: pre;
  font-size: 11px;
  line-height: 1.55;
  position: relative;
}
.tk { font-family: inherit; }
.tk-kw   { color: #ff7ab2; }    /* keywords: import, struct, var, some */
.tk-type { color: #78c6ff; }    /* types: SwiftUI, App, Scene, etc. */
.tk-mod  { color: #d4a7ff; }    /* modules */
.tk-at   { color: #ffd580; }    /* attributes */

.editor__cursor {
  display: inline-block;
  width: 2px;
  height: 12px;
  background: #c7d2fe;
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: cursorBlink 1.1s steps(2, start) infinite;
}
@keyframes cursorBlink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.editor__status {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 22px;
  background: linear-gradient(180deg, #1a1a20, #15151a);
  border-top: 1px solid rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  font-size: 10px;
  color: #9ca3af;
}
.editor__status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #28c840;
  box-shadow: 0 0 6px rgba(40,200,64,0.7);
}
.editor__status-sep { opacity: 0.5; }

@keyframes editorFloat {
  0%,100% { transform: perspective(1400px) rotateX(6deg) rotateY(-8deg) translateY(0); }
  50%     { transform: perspective(1400px) rotateX(6deg) rotateY(-8deg) translateY(-8px); }
}
@media (prefers-reduced-motion: reduce) {
  .editor, .editor__cursor, .about__ambient--a, .about__ambient--b { animation: none; }
}
@media (max-width: 900px) {
  .editor { font-size: 10px; inset: 6% 4%; }
  .editor__body { grid-template-columns: 70px 1fr; }
  .editor__gutter li, .editor__lines { font-size: 10px; }
}

/* ---------- Contact ---------- */
.contact dl {
  margin: 32px 0 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 720px) {
  .contact dl { grid-template-columns: 180px 1fr; gap: 16px 24px; }
}
.contact dt {
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
  align-self: start;
}
.contact dd { margin: 0; font-size: 16px; }
.contact a { text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; transition: text-decoration-color .15s ease; }
.contact a:hover { text-decoration-color: var(--text); }

/* ---------- Footer ---------- */
.site-footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  background: var(--bg);
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  justify-content: space-between;
}
.site-footer a { transition: color .15s ease; }
.site-footer a:hover { color: var(--text); }

/* ---------- Section title block ---------- */
.section h2 { font-size: clamp(24px, 3vw, 32px); }
.section h2 + p.lead {
  margin-top: 16px;
  color: var(--text-muted);
  max-width: 600px;
}

/* ---------- Privacy page typography ---------- */
.prose h2 { font-size: 22px; margin-top: 32px; }
.prose h2:first-of-type { margin-top: 0; }
.prose p { margin-top: 12px; color: var(--text-muted); }
.prose ul { margin: 12px 0 0 20px; padding: 0; color: var(--text-muted); }
.prose li { margin-top: 6px; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal--delay-1 { transition-delay: .08s; }
.reveal--delay-2 { transition-delay: .16s; }
.reveal--delay-3 { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Initial fade on load ---------- */
@media (prefers-reduced-motion: no-preference) {
  .fade-in { animation: fadeIn .7s ease-out both; }
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}
