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

/* ── Variables ─────────────────────────────────────────────────── */
:root {
  --bg:             #F7F5F0;
  --surface:        #EDEAE3;
  --text-primary:   #1A1A1A;
  --text-secondary: #555550;
  --accent:         #3D6491;
  --border:         #D4D0C8;
  --font-heading:   'Lora', Georgia, serif;
  --font-body:      'DM Sans', system-ui, sans-serif;
  --max-width:      760px;
  --nav-h:          56px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:             #0F0F0E;
    --surface:        #1A1A18;
    --text-primary:   #E8E6E1;
    --text-secondary: #9A9891;
    --accent:         #5B7FA6;
    --border:         #2E2E2B;
  }
}

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

html { font-size: 16px; }

body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Typography ─────────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 { font-size: 2rem;   margin-bottom: 0.5rem; }
h2 { font-size: 1.3rem; margin-top: 2rem; margin-bottom: 0.85rem; }
h3 { font-size: 1.05rem; }

p  { color: var(--text-secondary); margin-bottom: 1rem; }

main p { text-align: justify; }

a  {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease, opacity 0.15s ease;
}
a:hover { text-decoration: underline; opacity: 0.82; }

/* ── Header / Nav ───────────────────────────────────────────────── */
header {
  background-color: var(--bg);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
  position: sticky;
  top: 0;
  z-index: 100;
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.nav-name {
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-name:hover { color: var(--accent); text-decoration: none; opacity: 1; }

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

.nav-links a {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
}
.nav-links a:hover    { color: var(--accent); text-decoration: none; opacity: 1; }
.nav-links a.active   { color: var(--accent); font-weight: 500; }

/* ── Hamburger ──────────────────────────────────────────────────── */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 6px 2px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background-color: var(--text-primary);
  transition: background-color 0.15s;
}

/* ── Main content ───────────────────────────────────────────────── */
main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
  width: 100%;
}

/* ── Footer ─────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.2rem 1.5rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* ── Homepage (About) ───────────────────────────────────────────── */
.about-name    { font-size: 2.2rem; margin-bottom: 0.75rem; }
.about-tagline {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.55;
}

/* ── Section index pages ────────────────────────────────────────── */
.section-intro          { margin-bottom: 2.5rem; }
.section-intro h1       { margin-bottom: 0.35rem; }
.section-intro p        { font-size: 0.92rem; }

.entry-list             { list-style: none; border-top: 1px solid var(--border); }
.entry-list li          { border-bottom: 1px solid var(--border); padding: 0.85rem 0; }
.entry-list a           { display: block; color: var(--text-primary); font-size: 0.93rem; text-decoration: none; }
.entry-list a:hover     { color: var(--accent); text-decoration: none; }
.entry-list .entry-meta { font-size: 0.78rem; color: var(--text-secondary); margin-top: 0.2rem; }

/* ── Blog subsections ───────────────────────────────────────────── */
.blog-section           { margin-bottom: 2.5rem; }
.blog-section-title {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
  margin-top: 0;
  margin-bottom: 0.65rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.blog-section-note {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 0.35rem;
}

/* ── Individual item pages ──────────────────────────────────────── */
.item-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.item-header h1   { margin-bottom: 0.35rem; }
.item-subtitle    { font-size: 0.85rem; color: var(--text-secondary); }

/* ── Experience landing two-column cards ────────────────────────── */
.exp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 0.5rem;
}
.exp-card {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.25rem 1.25rem 1rem;
  background-color: var(--surface);
  text-decoration: none;
  display: block;
  transition: border-color 0.15s;
}
.exp-card:hover { border-color: var(--accent); text-decoration: none; opacity: 1; }
.exp-card h2    { font-size: 1rem; margin: 0 0 0.35rem; color: var(--text-primary); }
.exp-card p     { font-size: 0.83rem; color: var(--text-secondary); margin: 0; }

/* ── Prose (blog post body) ─────────────────────────────────────── */
.prose p            { margin-bottom: 1.1rem; }
.prose h2           { margin-top: 2.25rem; margin-bottom: 0.75rem; }

.prose ul {
  list-style: disc;
  padding-left: 1.4rem;
  margin-bottom: 1.1rem;
}
.prose ul li {
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

.prose img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.25rem 0;
  border: 1px solid var(--border);
  border-radius: 3px;
}

pre {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.9rem 1.1rem;
  overflow-x: auto;
  margin-bottom: 1.1rem;
}
pre code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.83rem;
  color: var(--text-primary);
  line-height: 1.5;
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 640px) {
  h1            { font-size: 1.65rem; }
  .about-name   { font-size: 1.8rem; }
  .exp-grid     { grid-template-columns: 1fr; }

  .nav-toggle   { display: flex; }
  .nav-links    {
    display: none;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background-color: var(--bg);
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-links li   { padding: 0; }
  .nav-links a    { display: block; padding: 0.8rem 1.5rem; font-size: 0.93rem; }

  header { position: relative; }
}
