@import url("https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;1,400&family=DM+Sans:wght@300;400;500&display=swap");

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

:root {
  --ink: #1a1a18;
  --muted: #6b6b67;
  --faint: #e8e6e0;
  --paper: #faf9f6;
  --accent: #c17a3a;
  --white: #ffffff;
  --card-bg: #ffffff;
  --nav-bg: rgba(250, 249, 246, 0.92);
  --max: 680px;
}

html[data-theme="dark"] {
  --ink: #e8e5de;
  --muted: #8a8780;
  --faint: #2a2926;
  --paper: #161614;
  --accent: #d4904a;
  --white: #1e1d1b;
  --card-bg: #1e1d1b;
  --nav-bg: rgba(22, 22, 20, 0.92);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "DM Sans", sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition:
    background 0.2s,
    color 0.2s;
}

/* ── THEME TOGGLE ── */
.theme-toggle {
  background: none;
  border: 1px solid var(--faint);
  border-radius: 20px;
  cursor: pointer;
  width: 36px;
  height: 22px;
  padding: 0;
  position: relative;
  flex-shrink: 0;
  transition:
    border-color 0.2s,
    background 0.2s;
}
.theme-toggle:hover {
  border-color: var(--muted);
}
.theme-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  transition:
    transform 0.2s,
    background 0.2s;
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
html[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(14px);
  background: var(--accent);
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--faint);
  transition:
    background 0.2s,
    border-color 0.2s;
}
.nav-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 32px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-logo {
  font-family: "Lora", serif;
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}
.nav-links a {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
  letter-spacing: 0.01em;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--ink);
}

/* ── PAGE WRAPPER ── */
.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 112px 24px 80px;
}

.page-wide {
  max-width: 1000px;
  margin: 0 auto;
  padding: 112px 32px 80px;
}

/* ── SECTION HEADER ── */
.section-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.section-title {
  font-family: "Lora", serif;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 48px;
}

/* ── POST LIST ── */
.post-list {
  display: flex;
  flex-direction: column;
}

.post-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--faint);
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s;
  align-items: start;
}
.post-item:first-child {
  border-top: 1px solid var(--faint);
}
.post-item:hover {
  opacity: 0.7;
}

.post-date {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0.01em;
  padding-top: 4px;
  text-align: right;
  line-height: 1.4;
}
.post-date span {
  display: block;
}
.post-tag {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.post-title {
  font-family: "Lora", serif;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: 8px;
}
.post-excerpt {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
  font-weight: 300;
}

/* ── PROJECTS GRID ── */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
}
@media (max-width: 760px) {
  .projects-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 480px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

.project-card {
  background: var(--card-bg);
  border: 1px solid var(--faint);
  border-radius: 8px;
  padding: 28px;
  text-decoration: none;
  color: inherit;
  transition:
    box-shadow 0.2s,
    transform 0.15s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.project-card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.07);
  transform: translateY(-2px);
}
.project-icon {
  width: 40px;
  height: 40px;
  line-height: 1;
}
.project-name {
  font-family: "Lora", serif;
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.project-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  font-weight: 300;
  flex: 1;
}
.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.tag {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--faint);
  padding: 3px 8px;
  border-radius: 3px;
}

/* ── ABOUT ── */
.about-layout {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 48px;
  align-items: start;
}
@media (max-width: 560px) {
  .about-layout {
    grid-template-columns: 1fr;
  }
  .about-photo {
    order: -1;
  }
}
.about-body p {
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
  margin-bottom: 18px;
  font-weight: 300;
}
.about-body p:last-child {
  margin-bottom: 0;
}
.about-body strong {
  font-weight: 500;
}
.about-photo-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: var(--faint);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}
.about-photo img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
}

/* ── CONTACT ── */
.contact-intro {
  font-size: 17px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 40px;
  font-weight: 300;
}
.links-list {
  list-style: none;
}
.links-list li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  border-bottom: 1px solid var(--faint);
  text-decoration: none;
  color: var(--ink);
  transition: opacity 0.2s;
}
.links-list li:first-child a {
  border-top: 1px solid var(--faint);
}
.links-list li a:hover {
  opacity: 0.6;
}
.link-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
}
.link-icon {
  font-size: 18px;
}
.link-handle {
  font-size: 14px;
  color: var(--muted);
}
.link-arrow {
  font-size: 16px;
  color: var(--muted);
}

/* ── POST IMAGES ── */
.post-image {
  margin: 36px 0;
}
.post-image img {
  width: 100%;
  border-radius: 6px;
  display: block;
  border: 1px solid var(--faint);
}
.post-image-caption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  text-align: center;
  font-style: italic;
}

/* ── BLOG POST ── */
.post-header {
  margin-bottom: 48px;
}
.post-header-tag {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.post-header-title {
  font-family: "Lora", serif;
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 16px;
}
.post-header-meta {
  font-size: 14px;
  color: var(--muted);
}
.post-header-divider {
  border: none;
  border-top: 1px solid var(--faint);
  margin: 40px 0;
}
.post-body p {
  font-size: 18px;
  line-height: 1.8;
  color: var(--ink);
  margin-bottom: 24px;
  font-weight: 300;
}
.post-body p:last-child {
  margin-bottom: 0;
}
.post-body strong {
  font-weight: 500;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 48px;
  transition: color 0.2s;
}
.back-link:hover {
  color: var(--ink);
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--faint);
  padding: 32px 24px;
  text-align: center;
}
footer p {
  font-size: 13px;
  color: var(--muted);
}

/* ── FADE IN ── */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.6s ease forwards;
}
@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.d1 {
  animation-delay: 0.05s;
}
.d2 {
  animation-delay: 0.15s;
}
.d3 {
  animation-delay: 0.25s;
}
.d4 {
  animation-delay: 0.35s;
}

/* ── LOADING ── */
.loading {
  color: var(--muted);
  font-size: 15px;
  padding: 40px 0;
}

/* ── RESPONSIVE NAV ──
   Append these rules to the bottom of style.css
-------------------------------------------------- */

/* Hamburger button — hidden on desktop */
.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--faint);
  border-radius: 4px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  width: 36px;
  height: 36px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition:
    border-color 0.2s,
    color 0.2s;
}
.menu-toggle:hover {
  border-color: var(--muted);
}

@media (max-width: 640px) {
  /* Show hamburger button */
  .menu-toggle {
    display: flex;
  }

  /* Nav inner: logo | right-side controls */
  .nav-inner {
    padding: 0 20px;
    gap: 12px;
  }

  /* Stack the links vertically in a dropdown */
  .nav-links {
    display: none;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 56px; /* nav height */
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--faint);
    padding: 8px 0 16px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 12px 20px;
    font-size: 15px;
    border-bottom: 1px solid var(--faint);
  }

  .nav-links li:last-child a {
    border-bottom: none;
  }

  /* Reorder: logo — theme toggle — hamburger */
  .nav-right {
    gap: 12px;
  }

  /* Give pages a little breathing room for the smaller viewport */
  .page {
    padding: 96px 16px 64px;
  }
  .page-wide {
    padding: 96px 16px 64px;
  }
}
