:root {
  color-scheme: light dark;
  --bg: #f8f5f1;
  --bg-alt: #ffffff;
  --text: #1f1f1f;
  --muted: #4d4d4d;
  --border: rgba(15, 23, 42, 0.12);
  --accent: #f97316;
  --accent-strong: #ea580c;
  --shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

body[data-theme='dark'] {
  --bg: #0d1117;
  --bg-alt: #161b22;
  --text: #f6f7fb;
  --muted: #a0aec0;
  --border: rgba(148, 163, 184, 0.2);
  --accent: #fb923c;
  --accent-strong: #f97316;
  --shadow: 0 10px 35px rgba(0, 0, 0, 0.35);
}

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

body {
  font-family: 'Space Grotesk', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 0 1.5rem 3rem;
  transition: background 0.3s ease, color 0.3s ease;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  border: none;
  cursor: pointer;
  background: none;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="160" height="160" viewBox="0 0 160 160" fill="none"%3E%3Crect width="160" height="160" fill="white"/%3E%3Ccircle cx="6" cy="6" r="1" fill="%23f97316" fill-opacity="0.16"/%3E%3C/svg%3E');
  opacity: 0.25;
  z-index: 0;
}

.site-header,
main,
.site-footer {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.site-header {
  padding: 2.5rem 0 1.5rem;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

body[data-theme='dark'] .nav {
  background: rgba(13, 17, 23, 0.75);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.name {
  font-weight: 600;
  letter-spacing: 0.5px;
}

.eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.ghost-btn {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  color: var(--muted);
  transition: border 0.2s ease, color 0.2s ease;
  text-decoration: none;
  display: inline-block;
}

.ghost-btn:hover,
.ghost-btn.active {
  border-color: var(--border);
  color: var(--text);
}

.ghost-btn.active {
  background: rgba(249, 115, 22, 0.12);
  border-color: var(--accent);
  color: var(--accent-strong);
}

.theme-toggle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  transition: border 0.2s ease;
}

.theme-toggle__icon {
  display: none;
}

body[data-theme='light'] .theme-toggle__icon:first-child,
body:not([data-theme]) .theme-toggle__icon:first-child,
body[data-theme='dark'] .theme-toggle__icon:last-child {
  display: inline;
}

.hero {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
  align-items: center;
}

.hero__content h1 {
  font-size: clamp(2.4rem, 4vw, 3.8rem);
  line-height: 1.1;
  margin: 1rem 0;
}

.lede {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 45ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.primary-btn,
.secondary-btn {
  padding: 0.9rem 1.6rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: var(--shadow);
}

.primary-btn:hover {
  transform: translateY(-2px);
}

.secondary-btn {
  border: 1px solid var(--border);
  color: var(--text);
}

.hero__visual {
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--bg-alt);
}

.hero__visual img {
  /* Make the profile image a responsive square crop */
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  display: block;
}

.hero__visual figcaption {
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}

main {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  margin-top: 3rem;
}

.panel {
  border-radius: 32px;
  padding: 2.25rem;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  box-shadow: var(--shadow);
}

.panel--accent {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.08), rgba(249, 115, 22, 0.02));
}

.panel__badge {
  display: inline-flex;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.12);
  color: var(--accent-strong);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
}

.panel__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.panel__header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 2rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.project-card {
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: 24px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform 0.2s ease, border 0.2s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.project-card h3 {
  font-size: 1.2rem;
}

.project-card ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
}

.project-card li {
  font-size: 0.85rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px dashed var(--border);
  color: var(--muted);
}

.project-card a {
  color: var(--accent-strong);
  font-weight: 600;
  text-decoration: none;
}

.timeline {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.timeline li {
  display: flex;
  gap: 1.5rem;
  align-items: baseline;
  border-left: 2px solid var(--border);
  padding-left: 1.5rem;
}

.timeline time {
  font-weight: 600;
  color: var(--accent-strong);
}

.panel--split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
}

.contact-meta {
  list-style: none;
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-meta li {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 0.35rem;
  gap: 1rem;
}

.contact-meta a {
  color: var(--accent-strong);
  text-decoration: none;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form label {
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--muted);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 0.85rem 1rem;
  font-size: 1rem;
  background: transparent;
  color: var(--text);
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
}

.form-status {
  min-height: 1.25rem;
  font-size: 0.9rem;
}

.site-footer {
  margin-top: 3rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

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

.footer-actions a {
  color: var(--accent-strong);
  text-decoration: none;
}

/* Gallery Styles */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.gallery-item {
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  background: var(--bg);
  transition: transform 0.2s ease, border 0.2s ease;
  cursor: pointer;
}

.gallery-item:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.gallery-item img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.gallery-item__caption {
  padding: 1rem 1.25rem;
}

.gallery-item__caption h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.gallery-item__caption p {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox[aria-hidden="false"] {
  display: flex;
}

.lightbox__content {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
}

.lightbox__content img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
}

.lightbox__caption {
  color: #fff;
  text-align: center;
  margin-top: 1rem;
  font-size: 1.1rem;
}

.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: absolute;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.lightbox__close {
  top: 1rem;
  right: 1rem;
  font-size: 2.5rem;
  line-height: 1;
}

.lightbox__prev,
.lightbox__next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.5rem;
  line-height: 1;
}

.lightbox__prev {
  left: 1rem;
}

.lightbox__next {
  right: 1rem;
}

.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Blog Styles */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.blog-card {
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.5rem;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform 0.2s ease, border 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.blog-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.blog-card__meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.blog-card h3 {
  font-size: 1.4rem;
  line-height: 1.3;
}

.blog-card__excerpt {
  color: var(--muted);
  line-height: 1.6;
}

.blog-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}

.blog-card__tag {
  font-size: 0.8rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px dashed var(--border);
  color: var(--muted);
}

/* Blog Post */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-strong);
  text-decoration: none;
  margin-bottom: 2rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

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

.blog-post {
  max-width: 800px;
  margin: 0 auto;
}

.blog-post__meta {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.blog-post h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.2;
  margin-bottom: 2rem;
}

.blog-post__body {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text);
}

.blog-post__body p {
  margin-bottom: 1.5rem;
}

.blog-post__body h2 {
  font-size: 1.8rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.blog-post__body h3 {
  font-size: 1.4rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.blog-post__body code {
  background: var(--bg);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
  border: 1px solid var(--border);
}

.blog-post__body pre {
  background: var(--bg);
  padding: 1.5rem;
  border-radius: 12px;
  overflow-x: auto;
  border: 1px solid var(--border);
  margin: 1.5rem 0;
}

.blog-post__body pre code {
  background: none;
  padding: 0;
  border: none;
}

.blog-post__body ul,
.blog-post__body ol {
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.blog-post__body li {
  margin-bottom: 0.5rem;
}

.blog-post__body img {
  max-width: 100%;
  border-radius: 12px;
  margin: 2rem 0;
  border: 1px solid var(--border);
}

.blog-post__body blockquote {
  border-left: 4px solid var(--accent);
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  color: var(--muted);
  font-style: italic;
}

/* ── Nav right wrapper ── */
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── 3-dot menu toggle (hidden on desktop) ── */
.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-direction: row;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.menu-toggle:hover {
  border-color: var(--accent);
}

.menu-toggle__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
  transition: background 0.2s ease;
}

.menu-toggle:hover .menu-toggle__dot {
  background: var(--accent-strong);
}

/* ── Mobile nav overlay ── */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 99;
}

.nav-overlay.open {
  display: block;
}

/* ── Mobile dropdown (appended to body by JS) ── */
.mobile-dropdown {
  display: none;
  position: fixed;
  left: 1rem;
  right: 1rem;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
  z-index: 200;
}

body[data-theme='dark'] .mobile-dropdown {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.mobile-dropdown.open {
  display: flex;
  animation: menuSlideDown 0.2s ease;
}

@keyframes menuSlideDown {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.mobile-dropdown .ghost-btn {
  width: 100%;
  text-align: left;
  padding: 0.65rem 1rem;
  border-radius: 12px;
  font-size: 0.95rem;
}

.mobile-dropdown .ghost-btn:hover,
.mobile-dropdown .ghost-btn.active {
  background: rgba(249, 115, 22, 0.1);
}

.mobile-dropdown .theme-toggle {
  align-self: center;
  margin-top: 0.25rem;
}

@media (max-width: 640px) {
  body {
    padding: 1rem;
  }

  .site-header {
    z-index: 10;
    padding: 1.5rem;
  }

  .nav {
    border-radius: 16px;
    padding: 0.75rem 1rem;
  }

  .menu-toggle {
    display: flex;
  }

  .nav-actions {
    display: none !important;
  }

  .panel {
    padding: 1.5rem;
    border-radius: 24px;
  }

  .gallery-grid,
  .blog-grid {
    grid-template-columns: 1fr;
  }

  .lightbox__prev,
  .lightbox__next {
    display: none;
  }

  .lightbox__content {
    max-width: 95vw;
  }
}
