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

:root {
  --page-bg: #f9f9f9;
  --surface: #ffffff;
  --text: #181817;
  --muted: rgba(24, 24, 23, 0.7);
  --border: rgba(24, 24, 23, 0.15);
  --accent: #6f4df5;
  --tag-bg: rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --page-bg: #0d0d0f;
    --surface: #151517;
    --text: #f5f4f1;
    --muted: rgba(245, 244, 241, 0.65);
    --border: rgba(245, 244, 241, 0.15);
    --accent: #a996ff;
    --tag-bg: rgba(245, 244, 241, 0.1);
  }
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: "SF Pro Display", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--page-bg);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

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

.page-shell {
  max-width: 780px;
  margin: 0 auto;
  padding: 56px 24px 96px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  margin-bottom: 56px;
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 24px;
  justify-content: space-between;
}

.site-header h1 {
  font-size: clamp(1.1rem, 1.8vw, 1.6rem);
  line-height: 1.05;
  margin: 0;
  white-space: nowrap;
  font-weight: 600;
}

.site-intro {
  font-size: 1.15rem;
  color: var(--muted);
  margin: -6px 0 24px;
}

.site-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 18px;
  list-style: decimal;
  margin: 0;
  padding-left: 0.8rem;
  color: var(--muted);
  font-size: 0.98rem;
}

.site-nav li {
  text-transform: lowercase;
}

.site-nav a {
  font-weight: 500;
  letter-spacing: 0.08em;
}

section {
  margin-bottom: 64px;
}

.section-label {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 10px;
}

section h2 {
  margin: 0 0 16px;
  font-size: clamp(1.8rem, 3vw, 2.2rem);
  font-weight: 600;
  color: var(--text);
}

section h3 {
  margin: 24px 0 8px;
  font-size: 1.15rem;
  color: var(--text);
}

.muted {
  color: var(--muted);
}

section p {
  margin: 0 0 14px;
  color: var(--text);
}

section ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text);
  line-height: 1.6;
}

section ul + p,
section p + ul {
  margin-top: 14px;
}

.section-subtitle {
  margin: -10px 0 20px;
  color: var(--muted);
}

.project-item {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}

.project-item:first-of-type {
  border-top: none;
  padding-top: 0;
}

.project-item h3 {
  margin: 0;
  font-size: 1.5rem;
}

.project-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin: 12px 0 18px;
}

.meta-label {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.68rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.project-tech {
  list-style: none;
  padding: 0;
  margin: 0;
  color: var(--text);
  line-height: 1.6;
}

.project-tech li + li {
  margin-top: 4px;
}

.contact p {
  margin: 0 0 18px;
  color: var(--muted);
  max-width: 520px;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--accent);
}

.primary-link::after {
  content: "→";
  transition: transform 0.2s ease;
}

.primary-link:hover::after {
  transform: translateX(4px);
}

.site-footer {
  margin-top: auto;
  padding-top: 48px;
  color: var(--muted);
  font-size: 0.92rem;
}

.app-store-button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.app-store-button:hover {
  opacity: 0.78;
}

.app-store-button img {
  height: 42px;
  width: auto;
}

.app-store-light {
  display: block;
}

.app-store-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .app-store-light {
    display: none;
  }

  .app-store-dark {
    display: block;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 40px 20px 72px;
  }

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

  .site-nav {
    margin: 0;
    flex-direction: column;
    list-style: none;
    padding-left: 0;
  }
}

/* Blog and post styles */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.post-item {
  border-top: 1px solid var(--border);
  padding: 16px 0;
}

.post-item h3 {
  margin: 0 0 6px;
}

.post-meta {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 6px 0 10px;
}

/* Tags and divider */
.post-tags {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.post-tags .tag {
  background: var(--tag-bg);
  color: var(--text);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.85rem;
}
.post-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0 6px;
}
.post-summary {
  margin-top: 12px;
}

.post {
  max-width: 740px;
}

.post-content a {
  color: var(--accent);
  text-decoration: underline;
}

.post-content h3 { margin-top: 18px; }

/* Side-by-side (or stacked) video + image with matching max dimensions */
.post-media-pair {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin: 16px auto;
}

.post-media-pair > * {
  flex: 1 1 260px;
  min-width: 0;
  max-width: 100%;
}

.post-media-pair video,
.post-media-pair img {
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  max-width: 100%;
  max-height: 80vh;
  width: 100%;
  height: auto;
}

.post-media-pair img {
  object-fit: contain;
}

/* Code blocks */
pre {
  background: linear-gradient(180deg, rgba(0,0,0,0.02), transparent);
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: 8px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", "Courier New", monospace;
  font-size: 0.95rem;
  line-height: 1.45;
}

code { white-space: pre; }

/* Prism token color overrides to feel closer to Xcode Swift colors */
.token.keyword {
  color: #0a5fff; /* bright blue */
  font-weight: 600;
}
.token.function {
  color: #8b00ff; /* purple */
}
.token.class-name,
.token.type,
.token.important {
  color: #6f4df5;
}
.token.string {
  color: #0b8a3e; /* green */
}
.token.number {
  color: #b0450b; /* orange/brown */
}
.token.comment {
  color: rgba(255,255,255,0.45);
}

@media (prefers-color-scheme: light) {
  .token.comment { color: rgba(24,24,23,0.45); }
}

