:root {
  --bg: #fdf8f1;
  --bg-accent: #f6ecdf;
  --card: #ffffff;
  --card-strong: #f2e6d8;
  --text: #2f2419;
  --text-muted: #5f4f3f;
  --accent: #b36b2b;
  --accent-soft: rgba(179, 107, 43, 0.15);
  --accent-strong: #8b4d18;
  --border: #e4d7c7;
  --shadow: 0 10px 30px rgba(74, 54, 33, 0.12);
  --radius: 16px;
  --font-heading: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, rgba(179, 107, 43, 0.08), transparent 26%),
              radial-gradient(circle at 80% 0%, rgba(161, 136, 94, 0.12), transparent 24%),
              var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.65;
}

a { color: var(--accent-strong); text-decoration: none; }
a:hover { color: #c46f2f; }
img { max-width: 100%; display: block; }

/* Skip link */
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  padding: 0.5rem 0.9rem;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  z-index: 1001;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* Layout */
.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 110px 24px 48px;
}

/* Navbar */
.nav-shell {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1100px, calc(100% - 32px));
  z-index: 1000;
}
nav {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent-strong);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 14px;
}
.nav-link {
  padding: 8px 12px;
  border-radius: 12px;
  color: var(--text);
  font-weight: 600;
}
.nav-link:hover { background: var(--bg-accent); color: var(--accent-strong); }
.nav-link.active { background: var(--accent-soft); color: var(--accent-strong); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
}

@media (max-width: 720px) {
  .page { padding-top: 140px; }
  nav { flex-wrap: wrap; justify-content: space-between; }
  .nav-links {
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
  }
  .nav-links.open { display: flex; }
  .nav-link { width: 100%; }
  .nav-toggle { display: inline-flex; }
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: center;
  margin-bottom: 40px;
}
.hero-card {
  background: linear-gradient(135deg, #fffaf4, #f6ecdf);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}
.eyebrow {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.hero h1 {
  margin: 16px 0 12px;
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 4vw, 3rem);
  letter-spacing: -0.02em;
  color: var(--text);
}
.hero p.lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 20px;
}
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.badge {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--card-strong);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 0.9rem;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.btn.primary { background: linear-gradient(120deg, var(--accent), #d98b45); color: #fff; }
.btn.ghost { background: #fff; border-color: var(--border); color: var(--text); }
.btn.text { background: none; padding-left: 0; padding-right: 0; color: var(--accent-strong); }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(74, 54, 33, 0.15); }

.hero-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}
.panel-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-accent);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.panel-item strong { color: var(--text); }

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

/* Sections */
.section {
  margin: 44px 0;
}
.section h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
  color: var(--text);
}
.section p { color: var(--text-muted); }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 8px; font-family: var(--font-heading); color: var(--text); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-strong);
  color: var(--text-muted);
  font-size: 0.9rem;
}
.chip.highlight { border-color: var(--accent-soft); color: var(--accent-strong); background: var(--accent-soft); }

/* Featured grids */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
  grid-template-rows: 180px 1fr;
  box-shadow: var(--shadow);
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.feature-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.feature-body {
  padding: 16px;
  display: grid;
  gap: 8px;
}
.feature-body h3 { margin: 0; color: var(--text); }
.feature-body p { margin: 0; color: var(--text-muted); }
.meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.feature-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(74, 54, 33, 0.16); }

/* Projects grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 1rem;
}

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

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(74, 54, 33, 0.16);
}

.project-card h2 {
  font-size: 1.3rem;
  margin: 0;
  color: var(--text);
}

.project-thumb {
  width: 100%;
  height: 180px;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-card p {
  margin: 0 0 0.5rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Blog page */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 16px 0 24px;
}
.search {
  flex: 1;
  min-width: 220px;
  position: relative;
}
.search input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
}
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pill {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  cursor: pointer;
}
.pill.active { border-color: var(--accent-soft); color: var(--accent-strong); background: var(--accent-soft); }

.blog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.blog-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
  grid-template-rows: 160px 1fr;
  box-shadow: var(--shadow);
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.blog-card img { width: 100%; height: 100%; object-fit: cover; }
.blog-card-body { padding: 14px; display: grid; gap: 8px; }
.blog-card h3 { margin: 0; font-family: var(--font-heading); color: var(--text); }
.blog-card .excerpt { color: var(--text-muted); }
.blog-card:hover { border-color: var(--accent-soft); transform: translateY(-2px); box-shadow: 0 12px 28px rgba(74, 54, 33, 0.16); }

.post-meta { color: var(--text-muted); font-size: 0.95rem; margin: 0.5rem 0 1rem; }
.post-body { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); color: var(--text); }
.post-img-hero {
  text-align: center;
  margin: 1.5rem 0;
}
.post-img-hero img {
  max-width: 100%;
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.post-img-hero .img-credit {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: right;
}
.post-nav {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin: 28px 0;
  flex-wrap: wrap;
}
.post-nav a { color: var(--text); padding: 10px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--border); }
.post-nav a:hover { border-color: var(--accent-soft); color: var(--accent-strong); }

/* Resume / contact */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); gap: 14px; }
.contact-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.contact-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

/* Footer */
footer {
  padding: 32px 0 26px;
  margin-top: 42px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
}
footer .footer-content { display: grid; gap: 8px; text-align: center; }

/* Code blocks */
pre, code { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
pre {
  background: #f8efe3;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  overflow: auto;
  color: var(--text);
}

/* Accessibility helpers */
:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
}
