:root {
  --bg: #ffffff;
  --text: #1c1c1e;
  --muted: #6b7280;
  --card: #f3f4f6;
  --accent: #0a84ff;
  --border: #e5e7eb;
  --gradient: linear-gradient(90deg, #4f8cff, #8b5cf6);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b0f;
    --text: #f2f2f7;
    --muted: #9ca3af;
    --card: #17171c;
    --border: #2a2a31;
  }
}

:root[data-theme="dark"] {
  --bg: #0b0b0f;
  --text: #f2f2f7;
  --muted: #9ca3af;
  --card: #17171c;
  --border: #2a2a31;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.navbar nav { display: flex; align-items: center; gap: 8px; }
.navbar a { color: var(--text); text-decoration: none; padding: 6px 12px; border-radius: 8px; }
.navbar a:hover { background: var(--card); }
.brand { font-family: ui-monospace, Menlo, monospace; font-weight: 700; }

#theme-toggle {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
}

main { max-width: 900px; margin: 0 auto; padding: 0 24px; }

/* Hero */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 96px 0 64px;
}
.hero h1 { font-size: 3.2rem; line-height: 1.15; margin: 0; }
.hero h2 { font-weight: 500; margin: 8px 0 16px; }
.location { color: var(--muted); }
.hero-photo {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  flex-shrink: 0;
  padding: 6px;
  background: var(--gradient);
}

/* Sections */
.section { padding: 48px 0; border-top: 1px solid var(--border); }
.section-title { text-align: center; font-size: 2.2rem; margin: 0 0 24px; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
}

.links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  text-decoration: none;
}
.btn.outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.footer {
  text-align: center;
  color: var(--muted);
  padding: 32px 24px;
  border-top: 1px solid var(--border);
}

.hero-visual {
  position: relative;
  width: 280px;
  height: 280px;
  flex-shrink: 0;
  animation: pop 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.hero-photo {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 6px;
  border-radius: 50%;
  box-shadow: 0 20px 60px rgba(139, 92, 246, 0.35);
  animation: float 4s ease-in-out infinite;
}
.hero-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(#4f8cff, #8b5cf6, #ec4899, #4f8cff);
  animation: spin 6s linear infinite;
}

.hero-photo img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg);
}
.hero-photo:hover::before { animation-duration: 2s; }
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.card h3, .card h4 { margin: 0 0 8px; }
.card p { margin: 0; }
.journey { margin-bottom: 40px; }

.sub-title { text-align: center; font-size: 1.5rem; margin: 40px 0 20px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

.icon-box {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--card);
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 1.2rem;
}
.chips.center { justify-content: center; }

.timeline { position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.t-item { position: relative; width: 50%; padding: 0 32px 32px 0; }
.t-item:nth-child(even) { margin-left: 50%; padding: 0 0 32px 32px; }
.t-item::after {
  content: "";
  position: absolute;
  top: 24px;
  right: -6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text);
}
.t-item:nth-child(even)::after { right: auto; left: -6px; }

.t-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.t-head .icon-box { margin-bottom: 0; }
.year-pill {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid currentColor;
}
.t-item.blue .year-pill { color: #3b82f6; }
.t-item.purple .year-pill { color: #8b5cf6; }
.t-item.orange .year-pill { color: #f97316; }
.t-item.green .year-pill { color: #10b981; }

.t-item strong { display: block; margin: 12px 0 6px; font-size: 0.9rem; }
.t-item ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 0.9rem; }
.t-item .chip { font-size: 0.8rem; padding: 3px 10px; }

.group-head { display: flex; align-items: center; gap: 14px; margin: 40px 0 20px; }
.group-head h3, .group-head p { margin: 0; }
.group-head .icon-box { margin-bottom: 0; width: 48px; height: 48px; }

.project { display: flex; flex-direction: column; }
.project-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 12px;
}
.project strong { display: block; margin: 12px 0 6px; font-size: 0.9rem; }
.project ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 0.9rem; }
.project .chip {
  font-size: 0.8rem;
  padding: 3px 10px;
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.project .links { margin-top: auto; padding-top: 16px; }
.btn.small { padding: 6px 12px; font-size: 0.85rem; }

.badge {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
  font-size: 1.2rem;
  font-weight: 700;
  animation: float 3s ease-in-out infinite;
}
.badge-code { top: 8px; right: -10px; background: #111827; color: #fff; }
.badge-app { bottom: 14px; left: -12px; animation-delay: -1.5s; }
.badge-swift { bottom: 50px; right: -18px; animation-delay: -0.7s; }

.hero-text { animation: slide-up 0.8s ease both; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop {
  0%   { opacity: 0; transform: scale(0.6); }
  70%  { transform: scale(1.06); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes slide-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-visual, .hero-photo, .hero-photo::before, .badge, .hero-text {
    animation: none;
  }
}

.center-text { text-align: center; margin-bottom: 32px; }
.contact-grid { align-items: start; }
.stack { display: grid; gap: 20px; }
.btn.block { display: block; text-align: center; }

.info-row, .find-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  color: var(--text);
  text-decoration: none;
}
.info-row .icon-box, .find-row .icon-box { margin-bottom: 0; flex-shrink: 0; }
.info-row div, .find-row div { display: flex; flex-direction: column; flex: 1; line-height: 1.4; }
.find-row:hover { background: var(--card); border-radius: 10px; }

.footer { text-align: left; }
.footer-grid {
  max-width: 900px;
  margin: 0 auto 24px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 24px;
}
.footer-grid a { display: block; color: var(--muted); text-decoration: none; padding: 2px 0; }
.footer-grid a:hover { color: var(--text); }
.footer > p, .footer > a { text-align: center; display: block; color: var(--muted); }
.pill {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: #10b981;
  font-size: 0.85rem;
}


.blog-wrap { max-width: 720px; margin: 0 auto; padding: 48px 0; }
.blog-header { margin-bottom: 8px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.blog-header h1 { font-size: 2.6rem; margin: 0 0 8px; }

.post-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}
.post-row-text { flex: 1; min-width: 0; }
.post-row h2 { font-size: 1.5rem; line-height: 1.3; margin: 4px 0 8px; }
.post-row h2 a { color: var(--text); text-decoration: none; }
.post-row h2 a:hover { text-decoration: underline; }
.post-row p { margin: 0 0 10px; }
.post-meta { font-size: 0.85rem; color: var(--muted); }
.post-thumb { width: 150px; height: 100px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }


.blog-wrap { max-width: 900px; }

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 24px;
}

.post-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.post-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12); }

.post-card-img {
  height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, #94a3b8, #475569);
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
}
.post-card-img img { width: 100%; height: 100%; object-fit: cover; }
.ph-emoji { font-size: 2rem; }

.post-card-body { padding: 18px; display: flex; flex-direction: column; flex: 1; }
.post-card-body h3 { font-size: 1.15rem; line-height: 1.35; margin: 4px 0 8px; }
.post-card-body h3 a { color: var(--text); text-decoration: none; }
.post-excerpt {
  margin: 0 0 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.read-more { margin-top: auto; color: var(--accent); text-decoration: none; font-weight: 500; }
.read-more:hover { text-decoration: underline; }
.view-all { text-align: center; margin-top: 32px; }

.article { max-width: 680px; margin: 0 auto; padding: 40px 0 64px; }
.back-link { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.back-link:hover { color: var(--text); }

.article-title {
  font-size: 2.8rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 24px 0 12px;
}
.article-subtitle { font-size: 1.35rem; line-height: 1.5; color: var(--muted); margin: 0 0 28px; }

.byline {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  margin-bottom: 32px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.byline-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.byline div { display: flex; flex-direction: column; line-height: 1.4; }

.article-cover { width: 100%; border-radius: 8px; margin-bottom: 32px; }

.article-body {
  font-family: Charter, "Iowan Old Style", Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  line-height: 1.8;
}
.article-body p { margin: 0 0 1.5em; }
.article-body h2, .article-body h3 { font-family: "Inter", sans-serif; line-height: 1.3; }
.article-body h2 { font-size: 1.8rem; margin: 2em 0 0.6em; }
.article-body h3 { font-size: 1.4rem; margin: 1.8em 0 0.5em; }
.article-body a { color: var(--text); text-decoration: underline; }
.article-body a:hover { color: var(--accent); }
.article-body ul, .article-body ol { margin: 0 0 1.5em; padding-left: 1.4em; }
.article-body li { margin-bottom: 0.5em; }
.article-body img { max-width: 100%; border-radius: 8px; }
.article-body blockquote {
  margin: 1.5em 0;
  padding-left: 20px;
  border-left: 3px solid var(--text);
  font-style: italic;
  color: var(--muted);
}
.article-body hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
.article-body table { border-collapse: collapse; margin: 0 0 1.5em; font-size: 1rem; }
.article-body th, .article-body td { border: 1px solid var(--border); padding: 8px 12px; }

.article-body code {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.85em;
  background: var(--card);
  padding: 2px 6px;
  border-radius: 4px;
}
.article-body .codehilite { margin: 1.5em 0; border-radius: 8px; overflow-x: auto; }
.article-body .codehilite pre { margin: 0; padding: 18px 20px; font-size: 0.9rem; line-height: 1.6; }
.article-body .codehilite code { background: none; padding: 0; font-size: inherit; }

.article-tags { margin: 40px 0 24px; }



/* Responsive: keep these LAST so they override the rules above */
@media (max-width: 700px) {
  .article-title { font-size: 2rem; }
  .article-subtitle { font-size: 1.1rem; }
  .article-body { font-size: 1.1rem; }
  .post-row { flex-direction: column-reverse; }
  .post-thumb { width: 100%; height: 180px; }
  .hero-visual { width: 220px; height: 220px; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .hero { flex-direction: column-reverse; text-align: center; }
  .hero h1 { font-size: 2.2rem; }
  .navbar { flex-direction: column; gap: 8px; }
  .timeline::before { left: 8px; }
  .t-item, .t-item:nth-child(even) { width: 100%; margin-left: 0; padding: 0 0 24px 32px; }
  .t-item::after, .t-item:nth-child(even)::after { left: 2px; right: auto; }
}