:root {
  --bg: #ffffff;
  --bg-section: #f5f5f7;
  --ink: #1d1d1f;
  --muted: #86868b;
  --soft: #6e6e73;
  --line: #d2d2d7;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-light: rgba(0, 113, 227, 0.08);
  --gradient-start: #0071e3;
  --gradient-end: #5856d6;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.08);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --max: 980px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  background: var(--bg);
  line-height: 1.47059;
}

a {
  color: var(--accent);
  text-decoration: none;
}

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

p {
  margin: 0 0 1.2em;
  color: var(--muted);
  line-height: 1.6;
  font-size: 1.0625rem;
}

h1, h2, h3, h4 {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
}

h1 {
  font-size: clamp(2.6rem, 6vw, 3.5rem);
  line-height: 1.0625;
  letter-spacing: -0.015em;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 1.08349;
  letter-spacing: -0.003em;
}

h3 {
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.31579;
  margin-bottom: 0.6em;
}

.site-shell {
  width: 100%;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.8rem 1.5rem;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
}

.brand strong {
  display: block;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
}

.brand small {
  display: block;
  margin-top: 0.05rem;
  color: var(--soft);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-mark svg,
.brand-mark img {
  width: 32px;
  height: 32px;
}

.site-nav {
  display: flex;
  gap: 0.25rem;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 400;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  transition: color 0.2s;
}

.site-nav a:hover {
  color: var(--ink);
}

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4rem 1.5rem 5rem;
  text-align: center;
}

.hero h1 {
  margin: 0 auto 0.6rem;
  max-width: 14ch;
}

.hero .lead {
  max-width: 600px;
  margin: 0 auto 2rem;
  font-size: 1.2rem;
  color: var(--muted);
  line-height: 1.6;
}

.hero .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
  margin-top: 1.2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.button-primary {
  background: var(--accent);
  color: #fff;
}

.button-primary:hover {
  background: var(--accent-hover);
  color: #fff;
}

.button-secondary {
  background: var(--accent-light);
  color: var(--accent);
}

.button-secondary:hover {
  background: rgba(0, 113, 227, 0.14);
  color: var(--accent-hover);
}

.section {
  padding: 4.5rem 1.5rem;
}

.section-alt {
  background: var(--bg-section);
}

.section-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.section-heading {
  margin-bottom: 2rem;
}

.eyebrow {
  color: var(--soft);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.section-heading .eyebrow {
  display: block;
  margin-bottom: 0.4rem;
}

.section-heading h2 {
  max-width: 18ch;
}

.wide-copy {
  max-width: 700px;
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.5rem;
}

.two-column p {
  margin-bottom: 0.9em;
}

.pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.pill {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--bg-section);
  color: var(--ink);
  font-size: 0.9rem;
  border: 1px solid var(--line);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
}

.card-grid.single-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-card {
  padding: 1.6rem;
  border-radius: var(--radius-md);
  background: var(--bg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.project-card p {
  font-size: 0.95rem;
}

.project-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  margin-bottom: 0.8rem;
  border-radius: 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
}

.projectnotes-mark {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
}

.project-logo {
  width: 2.6rem;
  height: 2.6rem;
  margin-bottom: 0.8rem;
  object-fit: contain;
}

.sync-mark {
  background: linear-gradient(135deg, #34a853, #1a73e8);
}

.feature-list {
  margin: 0.8rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.95rem;
}

.feature-list li {
  margin-bottom: 0.35rem;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1rem;
}

.text-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
}

.text-link:hover {
  color: var(--accent-hover);
}

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

.approach-card {
  padding: 1.6rem;
  border-radius: var(--radius-md);
  background: var(--bg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.approach-card p {
  font-size: 0.95rem;
  margin-bottom: 0;
}

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

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.2rem 1.4rem;
  border-radius: var(--radius-md);
  background: var(--bg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.contact-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.contact-label {
  display: block;
  color: var(--soft);
  font-size: 0.82rem;
  font-weight: 500;
}

.contact-card strong {
  font-weight: 600;
  color: var(--ink);
}

/* Project detail pages */
.project-hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem 1.5rem 3.5rem;
  text-align: center;
}

.project-hero h1 {
  margin: 0 auto 0.6rem;
  max-width: 20ch;
}

.project-hero .lead {
  max-width: 650px;
  margin: 0 auto 1.6rem;
  font-size: 1.15rem;
  color: var(--muted);
}

.project-hero .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
}

.showcase-intro {
  margin-bottom: 1.5rem;
  max-width: 700px;
}

.feature-showcase {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.feature-stack {
  display: grid;
  gap: 1.25rem;
  grid-template-rows: auto 1fr;
}

.screenshot-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
  margin: 0;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg);
  box-shadow: var(--shadow-sm);
}

.screenshot-card-large {
  border-color: var(--line);
}

.screenshot-frame {
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fafafa;
  border-radius: 6px;
}

.desktop-frame {
  aspect-ratio: 16 / 9;
}

.dark-frame {
  background: #1d1d1f;
}

.phone-frame {
  width: min(72%, 280px);
  aspect-ratio: 1320 / 2868;
  margin: 0 auto;
  border-radius: 16px;
  background: var(--bg-section);
}

.screenshot-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.screenshot-card-large .desktop-frame img,
.feature-stack .desktop-frame img {
  object-position: center center;
}

.screenshot-grid .desktop-frame img {
  object-position: center top;
}

.screenshot-card figcaption {
  display: grid;
  gap: 0.15rem;
  padding-top: 0.15rem;
}

.screenshot-card strong {
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.25;
}

.screenshot-card span {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

.screenshot-gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.gallery-item-wrapper {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.gallery-item-wrapper:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* Footer */
.site-footer {
  background: var(--bg-section);
  border-top: 1px solid var(--line);
  padding: 2rem 1.5rem;
  margin-top: 1rem;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-col h4 {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--soft);
  margin-bottom: 0.8rem;
}

.footer-col a {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  padding: 0.25rem 0;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--ink);
}

.footer-legal {
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-legal p {
  color: var(--soft);
  font-size: 0.75rem;
  margin: 0;
}

.footer-legal-links {
  display: flex;
  gap: 1rem;
}

.footer-legal-links a {
  color: var(--soft);
  font-size: 0.75rem;
}

.footer-legal-links a:hover {
  color: var(--ink);
}

/* Lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9999;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.lightbox-overlay.is-active {
  display: flex;
  opacity: 1;
}

.lightbox-content {
  position: relative;
  max-width: min(90vw, 1200px);
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: var(--radius-md);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
  object-position: center top;
}

.lightbox-caption {
  margin-top: 1rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.95rem;
  text-align: center;
  max-width: 60ch;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: background 0.15s ease;
  z-index: 10;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox-close {
  top: -2rem;
  right: -2rem;
}

.lightbox-prev {
  left: -3rem;
}

.lightbox-next {
  right: -3rem;
}

/* Scroll reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.1, 0.25, 1),
              transform 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media (max-width: 940px) {
  .hero {
    padding: 3rem 1.5rem 3.5rem;
  }

  .project-hero {
    padding: 2.5rem 1.5rem 2.5rem;
  }

  .section {
    padding: 3rem 1.5rem;
  }

  .two-column,
  .card-grid,
  .card-grid.single-row,
  .feature-showcase,
  .approach-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .lightbox-prev { left: 0.5rem; }
  .lightbox-next { right: 0.5rem; }
  .lightbox-close { top: 0.5rem; right: 0.5rem; }
}

@media (max-width: 640px) {
  .site-header {
    padding: 0.6rem 1rem;
  }

  .hero {
    padding: 2rem 1rem 2.5rem;
    text-align: left;
  }

  .hero .actions {
    justify-content: flex-start;
  }

  .project-hero {
    padding: 1.8rem 1rem 2rem;
    text-align: left;
  }

  .project-hero .actions {
    justify-content: flex-start;
  }

  .section {
    padding: 2.5rem 1rem;
  }

  .two-column {
    gap: 1.2rem;
  }

  .feature-stack,
  .screenshot-gallery {
    grid-template-columns: 1fr;
  }

  .phone-frame {
    width: min(76%, 260px);
  }

  .site-nav a {
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
  }

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

  .footer-legal {
    flex-direction: column;
    align-items: flex-start;
  }

  .actions,
  .card-actions,
  .site-nav {
    gap: 0.5rem;
  }

  .button {
    width: 100%;
  }
}
