/* ===== Variables ===== */
:root {
  --bg:           #F5F2EC;
  --surface:      #EDEAE2;
  --border:       #D8D3C8;
  --text:         #1C1C1A;
  --muted:        #6B6660;
  --accent:       #2D5A27;
  --accent-hover: #1F3F1B;
}

/* ===== Reset / Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.65;
}

/* ===== Typography ===== */
h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 600;
  color: var(--text);
}

h1.display-name {
  font-family: 'Lora', serif;
  font-size: 2.6rem;
  font-weight: 700;
}

h2.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* ===== Layout ===== */
.container-narrow {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-wide {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 2rem;
}

section {
  padding: 3.5rem 0;
}

section + section {
  border-top: 1px solid var(--border);
}

/* ===== Navbar ===== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg);
  border-bottom: 1px solid var(--border);
}

.site-nav .inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.site-nav .brand {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
}
.site-nav .brand:hover { color: var(--accent); text-decoration: none; }

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.site-nav ul a {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
.site-nav ul a:hover,
.site-nav ul a.active { color: var(--accent); text-decoration: none; }

/* ===== Hero ===== */
.hero {
  padding: 3.5rem 0 2.5rem;
}

.hero-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  align-items: flex-start;
  justify-content: center;
}

.hero-photo {
  width: min(200px, 32vw);
  max-width: 100%;
  max-height: 45vmin;
  aspect-ratio: 3 / 4;
  height: auto;
  border-radius: 12px;
  object-fit: cover;
  object-position: center top;
  background-color: var(--surface);
  border: 1px solid var(--border);
  display: block;
}

.hero-photo-placeholder {
  width: min(200px, 32vw);
  max-width: 100%;
  max-height: 45vmin;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  background-color: var(--surface);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.75rem;
}

.hero-name {
  margin-bottom: 0.25rem;
}
.hero-role {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 0.75rem;
}
.hero-meta {
  font-size: 0.875rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  margin-bottom: 1.1rem;
}

.social-links {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.social-links a {
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  transition: color 0.15s;
  text-decoration: none;
}
.social-links a:hover { color: var(--accent); text-decoration: none; }
.social-links a img.social-logo {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  object-fit: cover;
  border-radius: 22%;
}
.social-links a:hover img.social-logo {
  opacity: 0.85;
}

/* ===== Home: About, family, hobbies ===== */
#about .section-title {
  text-align: center;
}
.home-about {
  max-width: 620px;
  margin-inline: auto;
  font-size: 0.95rem;
}
.home-about p + p {
  margin-top: 1rem;
}

.life-grid {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.life-item {
  display: grid;
  gap: 1.25rem;
  margin: 0;
  align-items: center;
}

.life-item .life-photo {
  width: 100%;
  max-height: 280px;
  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background-color: var(--surface);
  display: block;
}

.life-item figcaption {
  padding: 0 0.15rem;
}
.life-item figcaption h3 {
  font-family: 'Lora', serif;
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
  color: var(--text);
}
.life-item figcaption p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

@media (min-width: 640px) {
  .life-item {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 1.75rem;
  }
  .life-item:nth-child(even) .life-photo {
    order: 2;
  }
  .life-item:nth-child(even) figcaption {
    order: 1;
  }
}

/* ===== Home: Ins and outs (editorial) ===== */
.insouts-heading-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
  margin-bottom: 1.5rem;
}

.insouts-heading-row .section-title {
  margin-bottom: 0;
}

.insouts-heading-sep {
  color: var(--muted);
  font-size: inherit;
}

.insouts-year-select {
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.28rem 1.75rem 0.28rem 0.6rem;
  cursor: pointer;
  line-height: 1.2;
  min-height: 2.1rem;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%236b6660' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.45rem center;
}

.insouts-year-select:hover {
  border-color: var(--accent);
}

.insouts-year-select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.insouts-card {
  margin-top: 0;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: clamp(1.35rem, 4.5vw, 2rem) clamp(1.25rem, 4vw, 2.25rem);
  box-shadow: 0 12px 36px rgba(28, 28, 26, 0.05);
}

.insouts-grid {
  display: grid;
  gap: 1.5rem;
}

.insouts-heading {
  font-family: 'Lora', serif;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.insouts-col--in .insouts-heading {
  color: var(--accent);
}

.insouts-col--out .insouts-heading {
  color: #695550;
}

.insouts-list {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text);
}

.insouts-list li {
  margin-bottom: 0.5rem;
  padding-left: 0.2rem;
}

.insouts-list li:last-child {
  margin-bottom: 0;
}

.insouts-col--in .insouts-list ::marker {
  color: var(--accent);
}

.insouts-col--out .insouts-list ::marker {
  color: #9a837e;
}

@media (min-width: 560px) {
  .insouts-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0 2.5rem;
    align-items: start;
    position: relative;
  }
  .insouts-grid::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 0;
    border-left: 1px solid var(--border);
    transform: translateX(-50%);
    pointer-events: none;
  }
}

@media (max-width: 559px) {
  .insouts-col--in {
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
  }
}

/* ===== Resume Page ===== */
.resume-header {
  padding: 3rem 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}
.resume-header h1 { font-family: 'Lora', serif; font-size: 2rem; }
.resume-header p { color: var(--muted); margin-top: 0.4rem; }

.resume-download {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.resume-download:hover {
  background-color: var(--accent);
  color: #fff;
  text-decoration: none;
}

.resume-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 1rem;
  margin-bottom: 1.75rem;
}
.resume-entry:last-child { margin-bottom: 0; }

.resume-entry-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: contain;
  border: 1px solid var(--border);
  background: #fff;
  flex-shrink: 0;
  margin-right: 0.6rem;
  margin-top: 1px;
}
.resume-entry-header {
  display: flex;
  align-items: flex-start;
}

.resume-entry-title {
  font-weight: 700;
  font-size: 0.95rem;
}
.resume-entry-sub {
  font-size: 0.8rem;
  color: var(--muted);
}
.resume-entry-date {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
  text-align: right;
  align-self: start;
  padding-top: 1px;
}
.resume-entry ul {
  margin-top: 0.5rem;
  padding-left: 1.1rem;
  font-size: 0.875rem;
  color: var(--muted);
  grid-column: 1 / -1;
}
.resume-entry ul li { margin-bottom: 0.3rem; }
.resume-entry a { text-decoration: underline; }

.resume-entry-tools {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.6rem;
}
.resume-entry-tools .skill-tag {
  font-size: 0.75rem;
  padding: 0.2em 0.6em;
  color: var(--muted);
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.skill-tag {
  font-size: 0.82rem;
  padding: 0.3em 0.75em;
  border-radius: 5px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}
.skill-tag strong {
  font-weight: 600;
  color: var(--text);
}
.skill-tag strong::after {
  content: "|";
  font-weight: 400;
  color: var(--border);
  margin: 0 0.35em;
}
.skill-tag .skill-tag-subs {
  color: var(--muted);
  font-size: 0.78rem;
}

/* Resume two-column layout */
.resume-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  align-items: start;
  padding-bottom: 3rem;
  border-top: 1px solid var(--border);
}

.resume-sidebar {
  padding-right: 2.5rem;
  border-right: 1px solid var(--border);
}

.resume-main {
  padding-left: 2.5rem;
}

.resume-sidebar section,
.resume-main section {
  padding: 2.25rem 0;
}

.resume-skill-group {
  margin-bottom: 1.1rem;
}

.resume-skill-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.resume-entry-sidebar {
  margin-bottom: 1.25rem;
}

.resume-entry-detail {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.5rem;
  line-height: 1.55;
}

/* ===== Projects Page ===== */
.projects-header {
  padding: 3rem 0 2rem;
}
.projects-header h1 { font-family: 'Lora', serif; font-size: 2rem; }
.projects-header p { color: var(--muted); margin-top: 0.4rem; }

.project-list { list-style: none; }

.project-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 1.5rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}
.project-item:first-child { border-top: 1px solid var(--border); }

.project-title {
  font-family: 'Lora', serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.project-desc {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 0.6rem;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}
.project-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}
.project-link .bi {
  font-size: 0.75rem;
}

.project-year {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  align-self: start;
  padding-top: 0.15rem;
}

@media (max-width: 600px) {
  .project-item { grid-template-columns: 1fr; }
  .project-year { padding-top: 0; }
}

/* ===== Blog Page ===== */
.blog-header {
  padding: 3rem 0 2rem;
}
.blog-header h1 { font-family: 'Lora', serif; font-size: 2rem; }
.blog-header p { color: var(--muted); margin-top: 0.4rem; }

.post-list { list-style: none; }

.post-item {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}
.post-item:first-child { border-top: 1px solid var(--border); }

.post-date {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  min-width: 90px;
}
.post-title {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 500;
}
.post-title a { color: var(--text); }
.post-title a:hover { color: var(--accent); text-decoration: none; }

.post-read-time {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.empty-state {
  text-align: center;
  padding: 3rem 0;
  color: var(--muted);
}
.empty-state p { font-size: 0.9rem; margin-top: 0.5rem; }

/* ===== Footer ===== */
.site-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}
.site-footer .inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ===== Blog Post Page ===== */
.post-header {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}
.post-back {
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}
.post-heading {
  font-family: 'Lora', serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}
.post-meta {
  font-size: 0.82rem;
  color: var(--muted);
}
.post-byline {
  font-size: 0.92rem;
  color: var(--text);
  margin: 0 0 0.25rem;
  line-height: 1.5;
}
.post-byline p {
  margin: 0;
}
.post-disclaimer {
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
  margin: 0 0 0.85rem;
}
.post-byline + .post-meta {
  margin-top: 0.35rem;
}
.post-meta-sep {
  margin: 0 0.35rem;
}

.post-content {
  max-width: 680px;
  padding-bottom: 4rem;
  font-size: 1rem;
  line-height: 1.75;
}
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
  margin-top: 2.25rem;
  margin-bottom: 0.6rem;
}
.post-content h1 { font-size: 1.6rem; }
.post-content h2 { font-size: 1.25rem; }
.post-content h3 { font-size: 1.05rem; }
.post-content h4 {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.post-content h3 + h4 {
  margin-top: 0.25rem;
  margin-bottom: 0.9rem;
}
.post-content p  { margin-bottom: 1.25rem; }
.post-content ul,
.post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}
.post-content li { margin-bottom: 0.35rem; }
.post-content a  { text-decoration: underline; text-underline-offset: 2px; }
.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 0 0.5rem 1.25rem;
  margin: 1.5rem 0;
  color: var(--muted);
  font-style: italic;
}
.post-content code {
  font-family: 'Menlo', 'Consolas', monospace;
  font-size: 0.875em;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15em 0.4em;
}
.post-content pre {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}
.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
}
.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}
.post-content img {
  max-width: 100%;
  border-radius: 6px;
  border: 1px solid var(--border);
  margin: 1rem 0;
}
.post-content table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin: 1.25rem 0 1.5rem;
  font-size: 0.95rem;
  line-height: 1.55;
}
.post-content th,
.post-content td {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.post-content th {
  background-color: var(--surface);
  font-weight: 600;
}
.post-content th:first-child,
.post-content td:first-child {
  width: 8%;
  white-space: nowrap;
  text-align: center;
}
.post-content th:nth-child(2),
.post-content td:nth-child(2) {
  width: 32%;
}

/* ===== Post Navigation ===== */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}
.post-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.post-nav-next {
  text-align: right;
  align-items: flex-end;
}
.post-nav-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.post-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  line-height: 1.3;
}
.post-nav a:hover {
  color: var(--accent);
}

/* ===== Utilities ===== */
.text-muted { color: var(--muted); }

/* ===== Responsive ===== */
@media (max-width: 600px) {
  h1.display-name { font-size: 2rem; }

  .site-nav ul { gap: 1rem; }

  .hero-photo,
  .hero-photo-placeholder {
    width: min(160px, 44vw);
    max-height: 50vmin;
    aspect-ratio: 3 / 4;
    height: auto;
  }

  .resume-entry { grid-template-columns: 1fr; }
  .resume-entry-date { text-align: left; }

  .resume-layout { grid-template-columns: 1fr; }
  .resume-sidebar {
    padding-right: 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.25rem;
  }
  .resume-main { padding-left: 0; }

  .site-footer .inner { flex-direction: column; gap: 0.5rem; text-align: center; }
}

/* ===== Scroll reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
