:root {
  --bg: #ffffff;
  --fg: #111827;
  --muted: #4b5563;
  --border: #e5e7eb;
  --accent: #4f46e5;
  --accent-fg: #ffffff;
  --code-bg: #f3f4f6;
  --code-fg: #111827;
  --callout-bg: rgba(79, 70, 229, 0.07);
  --callout-border: #4f46e5;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --fg: #f3f4f6;
    --muted: #9ca3af;
    --border: #27272a;
    --accent: #a5b4fc;
    --accent-fg: #1e1b4b;
    --code-bg: #18181b;
    --code-fg: #f3f4f6;
    --callout-bg: rgba(165, 180, 252, 0.10);
    --callout-border: #a5b4fc;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (max-width: 640px) {
  body { font-size: 16px; }
}

main, header.site, footer.site {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

header.site {
  padding-top: 1.5rem;
  padding-bottom: 0.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--fg);
  font: 600 1rem/1 ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: -0.01em;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

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

section:first-of-type {
  border-top: none;
  padding-top: 2.5rem;
}

h1, h2, h3 {
  margin: 0 0 0.75rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: 2.1rem;
  font-weight: 700;
}

@media (max-width: 640px) {
  h1 { font-size: 1.7rem; }
}

h2 {
  font-size: 1.35rem;
  font-weight: 600;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
}

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover { text-decoration-thickness: 2px; }

code {
  font: 0.92em/1 ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.lead {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.hero.center { text-align: center; }

.cta-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero.center .cta-row { justify-content: center; }

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--accent);
  color: var(--accent-fg);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--accent);
  transition: filter 0.15s;
}

.cta-icon {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}

.cta:hover { filter: brightness(1.08); text-decoration: none; }

.cta.ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--border);
}

.cta.ghost:hover {
  background: var(--code-bg);
  filter: none;
}

@media (max-width: 480px) {
  .cta-row { flex-direction: column; align-items: stretch; }
  .cta { text-align: center; }
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.75rem;
}

.card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  background: var(--bg);
}

.card h3 { color: var(--accent); margin-bottom: 0.4rem; }
.card p { font-size: 0.95rem; color: var(--muted); margin: 0; }

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .gallery { grid-template-columns: 1fr; }
}

.thumb {
  display: block;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  cursor: zoom-in;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
  width: 100%;
}

.thumb:hover { border-color: var(--accent); }
.thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1280 / 800;
  object-fit: cover;
}

.callout {
  background: var(--callout-bg);
  border-left: 3px solid var(--callout-border);
  padding: 1rem 1.1rem;
  border-radius: 6px;
  font-size: 0.95rem;
}

.callout strong { color: var(--accent); }

footer.site {
  padding: 2rem 1.25rem 3rem;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  text-align: center;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: lb-fade 0.15s ease-out;
}

@keyframes lb-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox img {
  max-width: 95vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.lightbox .close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox .close:hover { background: rgba(255, 255, 255, 0.25); }
.lightbox .close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .lightbox { animation: none; }
  * { transition: none !important; }
}
