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

:root {
  --bg: #f9f8f6;
  --fg: #1a1a1a;
  --muted: #666;
  --accent: #2563eb;
  --border: #e2e2de;
  --max-width: 720px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  font-size: 1.0625rem;
  line-height: 1.7;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */

header {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 10;
  padding: 1rem 0;
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wordmark {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

nav {
  display: flex;
  gap: 1.5rem;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

nav a:hover {
  color: var(--fg);
}

/* Sections */

section {
  padding: 5rem 0;
  border-bottom: 1px solid var(--border);
}

section:last-of-type {
  border-bottom: none;
}

h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

h2 {
  font-size: 1.125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 2rem;
}

/* Hero */

.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: center;
}

.hero-text .tagline {
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 480px;
  margin-bottom: 2rem;
}

.cta {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 0.65rem 1.4rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: opacity 0.15s;
}

.cta:hover {
  opacity: 0.88;
}

.hero-photo img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  object-position: center top;
  border-radius: 50%;
  border: 3px solid var(--border);
  display: block;
}

/* Services */

.services-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.services-list li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.25rem;
}

.services-list strong {
  display: block;
}

/* Build vs. buy callout */

.cost-callout {
  margin-top: 2.5rem;
  padding: 1.1rem 1.25rem;
  border-left: 3px solid var(--accent);
  background: #f0f5ff;
  border-radius: 0 6px 6px 0;
}

.cost-callout p {
  font-size: 0.975rem;
  color: var(--fg);
  line-height: 1.65;
}

/* Process */

.process-list {
  list-style: none;
  counter-reset: process;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.process-list li {
  counter-increment: process;
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0 0.75rem;
  align-items: start;
}

.process-list li::before {
  content: counter(process);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  background: #e8effe;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.process-list strong {
  display: block;
}

/* Work */

.project {
  margin-bottom: 4rem;
}

.project:last-child {
  margin-bottom: 0;
}

.project-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.project-name {
  font-size: 1.1rem;
  font-weight: 600;
}

.project-header a {
  font-size: 0.875rem;
  color: var(--accent);
  text-decoration: none;
}

.project-header a:hover {
  text-decoration: underline;
}

.project p {
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.project-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.project-tags li {
  font-size: 0.8rem;
  background: var(--border);
  color: var(--fg);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

/* Project grid */

.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
  margin-bottom: 1.25rem;
}

/* Screenshots */

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

.screenshot {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  display: block;
}

.screenshot-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.screenshot-row .screenshot {
  width: 100%;
}

/* Contact */

#contact p {
  margin-bottom: 0.5rem;
}

#contact a {
  color: var(--accent);
  text-decoration: none;
  font-size: 1.05rem;
}

#contact a:hover {
  text-decoration: underline;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.contact-form label {
  font-size: 0.9rem;
  color: var(--muted);
}

.contact-form input,
.contact-form textarea {
  font-family: inherit;
  font-size: 1rem;
  background: #fff;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.6rem 0.75rem;
  width: 100%;
  margin-bottom: 0.5rem;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.contact-form button {
  align-self: flex-start;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.6rem 1.25rem;
  font-size: 1rem;
  cursor: pointer;
}

.contact-form button:hover {
  opacity: 0.88;
}

.contact-fallback {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.contact-fallback a {
  font-size: 0.9rem;
}

.github {
  margin-top: 0.5rem;
  margin-bottom: 2.5rem;
}

.github a {
  font-size: 0.95rem;
  color: var(--muted);
}

.moira {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.moira img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.moira span {
  font-size: 0.875rem;
  color: var(--muted);
}

/* Lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  cursor: zoom-out;
  padding: 2rem;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

/* Footer */

footer {
  padding: 1.5rem 0;
  font-size: 0.85rem;
  color: var(--muted);
}

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

footer a:hover {
  color: var(--fg);
}

.moira-quote {
  font-size: 0.9rem;
  font-style: italic;
  color: var(--muted);
  margin-top: 0.5rem;
}

@media (max-width: 768px) {
  section {
    padding: 2.75rem 0;
  }

  h2 {
    margin-bottom: 1.25rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .hero-photo {
    display: block;
    order: -1;
  }

  .hero-photo img {
    width: 72px;
    height: 72px;
  }

  h1 {
    margin-bottom: 0.75rem;
  }

  .hero-text .tagline {
    font-size: 1rem;
    margin-bottom: 1.25rem;
  }

  .project {
    margin-bottom: 2.5rem;
  }

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

  .screenshot-row {
    grid-template-columns: 1fr;
  }

  .github {
    margin-bottom: 1.5rem;
  }
}