/* ============================================================
   The Serious Hobbyist — Main Stylesheet
   ============================================================

   Table of Contents:
     1.  Variables & Reset
     2.  Base Typography
     3.  Layout
     4.  Navigation
     5.  Buttons
     6.  Hero (homepage)
     7.  Home Sections (articles grid, skills grid)
     8.  Article List (long-form list view)
     9.  Skill Hub Page
    10.  Article / Prose Page
    11.  About Page
    12.  Footer
    13.  Utilities
    14.  Responsive / Mobile

   ============================================================ */


/* ── 1. Variables & Reset ─────────────────────────────────── */

:root {
  /* Colours */
  --color-bg:           #faf9f7;   /* warm off-white — main background */
  --color-surface:      #ffffff;   /* cards, nav, footer */
  --color-text:         #374151;   /* body copy */
  --color-heading:      #111827;   /* headings */
  --color-muted:        #6b7280;   /* secondary text, dates, captions */
  --color-border:       #e5e7eb;   /* dividers, card borders */
  --color-accent:       #4a7c59;   /* primary green — buttons, links, labels */
  --color-accent-dark:  #3a6347;   /* hover state for accent */
  --color-accent-light: #e8f2eb;   /* soft green backgrounds */

  /* Typography */
  --font-heading: 'Lora', Georgia, 'Times New Roman', serif;
  --font-body:    'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing & Shape */
  --radius:    8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 36px rgba(0, 0, 0, 0.09);

  /* Layout */
  --max-width:         1100px;
  --max-width-content:  720px;  /* comfortable reading width */
  --nav-height:          68px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

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


/* ── 2. Base Typography ───────────────────────────────────── */

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--color-heading);
  line-height: 1.25;
  font-weight: 600;
}

/* Fluid heading sizes — scale between small and large screens */
h1 { font-size: clamp(1.8rem,  4.5vw, 2.75rem); }
h2 { font-size: clamp(1.4rem,  3vw,   2rem);     }
h3 { font-size: clamp(1.05rem, 2vw,   1.3rem);   }

p { margin-bottom: 0; }

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


/* ── 3. Layout ────────────────────────────────────────────── */

.container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* Shared section header style */
.section-header {
  margin-bottom: 3rem;
  max-width: 600px;
}
.section-header h2 { margin-bottom: 0.75rem; }
.section-header p  { color: var(--color-muted); font-size: 1.05rem; }

.section-cta {
  margin-top: 2.5rem;
  text-align: center;
}


/* ── 4. Navigation ────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(250, 249, 247, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
  gap: 2rem;
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-heading);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-logo:hover { text-decoration: none; color: var(--color-accent); }

.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 0.25rem;
}

.nav-links > li > a {
  display: block;
  padding: 0.45rem 0.85rem;
  color: var(--color-text);
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.nav-links > li > a:hover {
  color: var(--color-accent);
  background: var(--color-accent-light);
  text-decoration: none;
}

/* Dropdown */
.has-dropdown { position: relative; }

.has-dropdown > a::after {
  content: " ▾";
  font-size: 0.7rem;
  opacity: 0.55;
}

.dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  list-style: none;
  min-width: 160px;
  padding: 0.5rem;
  z-index: 200;
}
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown { display: block; }

.dropdown li a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: var(--color-text);
  font-size: 0.9rem;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.1s, color 0.1s;
}
.dropdown li a:hover {
  background: var(--color-accent-light);
  color: var(--color-accent);
  text-decoration: none;
}

/* Hamburger button — hidden on desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius);
  transition: background 0.15s;
}
.nav-toggle:hover { background: var(--color-accent-light); }

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-heading);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}


/* ── 5. Buttons ───────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--color-accent-dark);
  box-shadow: 0 4px 14px rgba(74, 124, 89, 0.35);
}

.btn-secondary {
  background: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent);
}
.btn-secondary:hover {
  background: var(--color-accent-light);
}


/* ── 6. Hero (homepage) ───────────────────────────────────── */

.hero {
  padding: 6rem 0 5rem;
  background: linear-gradient(145deg, #edf5f0 0%, var(--color-bg) 65%);
  border-bottom: 1px solid var(--color-border);
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.15;
  color: var(--color-heading);
  margin-bottom: 1.5rem;
  max-width: 680px;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--color-muted);
  max-width: 540px;
  line-height: 1.75;
  margin-bottom: 2.5rem;
}

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


/* ── 7. Home Sections ─────────────────────────────────────── */

.home-articles {
  padding: 5rem 0;
  border-bottom: 1px solid var(--color-border);
}

.home-skills {
  padding: 5rem 0;
  background: var(--color-accent-light);
}

/* Article cards (3-column grid) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
  overflow: hidden;
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: #c5deca;
  text-decoration: none;
}

.card-body {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
}

.card-title {
  font-size: 1.05rem;
  color: var(--color-heading);
  line-height: 1.35;
}

.card-excerpt {
  font-size: 0.9rem;
  color: var(--color-muted);
  line-height: 1.65;
  flex: 1;
}

.card-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-top: 0.25rem;
}

/* Skill cards */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}

.skill-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.skill-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--color-accent);
  text-decoration: none;
}

.skill-card-emoji {
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
  display: block;
}

.skill-card-name {
  font-size: 1.1rem;
  color: var(--color-heading);
}

.skill-card-tagline {
  font-size: 0.875rem;
  color: var(--color-muted);
  flex: 1;
}

.skill-card-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-top: 0.75rem;
}


/* ── Card image (thumbnail at top of card) ───────────────── */

.card-image {
  width: 100%;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--color-accent-light);
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Article illustration (below header, above prose) ─────── */

.article-illustration {
  max-width: var(--max-width-content);
  margin: 0 auto 3rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-accent-light);
}

.article-illustration img {
  width: 100%;
  display: block;
}

/* ── 8. Article List (archive view) ──────────────────────── */

.list-page-hero {
  background: var(--color-accent-light);
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 3.5rem;
}
.list-page-hero h1 { margin-bottom: 0.75rem; }
.list-page-hero p  { font-size: 1.05rem; color: var(--color-muted); max-width: 520px; }

.article-list {
  display: flex;
  flex-direction: column;
  padding-bottom: 4rem;
}

.article-list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
  color: inherit;
}
.article-list-item:last-child { border-bottom: none; }

.article-list-item:hover .article-list-content h3 { color: var(--color-accent); }

.article-list-thumb {
  width: 100px;
  height: 60px;
  flex-shrink: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-accent-light);
}

.article-list-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.article-list-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.article-list-date {
  font-size: 0.78rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.article-list-content h3 {
  font-size: 1.1rem;
  color: var(--color-heading);
  transition: color 0.15s;
  margin: 0;
}

.article-list-content p {
  font-size: 0.9rem;
  color: var(--color-muted);
  line-height: 1.6;
}

.article-list-arrow {
  color: var(--color-accent);
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 0.2rem;
  transition: transform 0.15s;
}
.article-list-item:hover .article-list-arrow {
  transform: translateX(4px);
}


/* ── 9. Skill Hub Page ────────────────────────────────────── */

.skill-hub-hero {
  background: var(--color-accent-light);
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--color-border);
}

.skill-hub-label {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

.skill-hub-intro {
  font-size: 1.1rem;
  color: var(--color-muted);
  max-width: 540px;
  margin-top: 0.75rem;
  line-height: 1.7;
}

.skill-hub-body {
  padding-top: 3rem;
  padding-bottom: 4rem;
}

.skill-hub-prose {
  margin-bottom: 3rem;
  max-width: 640px;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--color-text);
}

.skill-articles { margin-top: 1.5rem; }
.skill-articles h2 { margin-bottom: 1.5rem; }


/* ── 10. Article / Prose Page ─────────────────────────────── */

.article-page {
  padding-bottom: 5rem;
}

.article-header {
  max-width: var(--max-width-content);
  margin-inline: auto;
  padding: 3.5rem 0 2.5rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 3rem;
}

.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  color: var(--color-muted);
  text-decoration: none;
  margin-bottom: 1.5rem;
  font-weight: 500;
  transition: color 0.15s;
}
.breadcrumb:hover { color: var(--color-accent); text-decoration: none; }

.article-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.article-description {
  font-size: 1.1rem;
  color: var(--color-muted);
  line-height: 1.65;
  margin-bottom: 1rem;
}

.article-meta {
  font-size: 0.85rem;
  color: var(--color-muted);
  font-weight: 500;
}

/* Prose — the actual article body */
.prose {
  max-width: var(--max-width-content);
  margin-inline: auto;
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--color-text);
}

.prose > * + * { margin-top: 1.5rem; }

.prose h2 {
  font-size: 1.5rem;
  margin-top: 3rem;
  margin-bottom: 1rem;
}

.prose h3 {
  font-size: 1.15rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.prose p { margin-bottom: 1.5rem; }

.prose ul,
.prose ol {
  padding-left: 1.75rem;
  margin-bottom: 1.5rem;
}
.prose li { margin-bottom: 0.5rem; }

.prose a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.prose a:hover { color: var(--color-accent-dark); }

.prose strong {
  font-weight: 600;
  color: var(--color-heading);
}

.prose em { font-style: italic; }

.prose blockquote {
  border-left: 3px solid var(--color-accent);
  padding: 1rem 1.5rem;
  background: var(--color-accent-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  margin: 2rem 0;
}
.prose blockquote p { margin: 0; color: var(--color-heading); }

.prose hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 3rem 0;
}

.prose code {
  background: #f3f4f6;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}


/* ── 11. About Page ───────────────────────────────────────── */

.page-hero {
  background: var(--color-accent-light);
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 3.5rem;
}
.page-hero h1 { margin-bottom: 0.75rem; }
.page-hero p  { font-size: 1.05rem; color: var(--color-muted); max-width: 520px; }

.page-body {
  padding-bottom: 5rem;
}


/* ── 12. Footer ───────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 2.5rem 0;
  background: var(--color-surface);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-brand {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-heading);
  font-size: 1rem;
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--color-muted);
}


/* ── 13. Utilities ────────────────────────────────────────── */

/* Badge pill */
.badge {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
}

/* "Start here" featured article card */
.start-here-card {
  display: flex;
  align-items: stretch;
  background: var(--color-surface);
  border: 2px solid var(--color-accent);
  border-radius: var(--radius-lg);
  text-decoration: none;
  margin-bottom: 3rem;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.start-here-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}

.start-here-image {
  flex: 0 0 38%;
  max-width: 38%;
  overflow: hidden;
  background: var(--color-accent-light);
}

.start-here-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.start-here-inner {
  padding: 2rem 2.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.start-here-title {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--color-heading);
  line-height: 1.3;
}

.start-here-description {
  font-size: 1rem;
  color: var(--color-muted);
  line-height: 1.65;
  max-width: 600px;
}

.start-here-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-top: 0.25rem;
}

.coming-soon {
  text-align: center;
  color: var(--color-muted);
  font-style: italic;
  padding: 3rem 0;
  font-size: 1rem;
}


/* ── 14. Responsive / Mobile ──────────────────────────────── */

@media (max-width: 768px) {

  /* Show hamburger, hide desktop nav */
  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    padding: 0.75rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .nav-links.is-open { display: flex; }

  /* Position the header so the dropdown is inside the sticky bar */
  .site-header { position: sticky; overflow: visible; }

  .nav-links > li > a {
    padding: 0.75rem 1rem;
    font-size: 1rem;
  }

  /* Remove the ▾ arrow on mobile */
  .has-dropdown > a::after { content: ""; }

  /* Show skill dropdown inline instead of floating */
  .dropdown {
    display: block;
    position: static;
    box-shadow: none;
    border: none;
    border-top: 1px solid var(--color-border);
    border-radius: 0;
    padding: 0.25rem 0 0.25rem 1rem;
    margin-top: 0;
  }

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

  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }

  /* Grids */
  .card-grid    { grid-template-columns: 1fr; }
  .skills-grid  { grid-template-columns: 1fr 1fr; }

  /* Start-here card stacks on mobile */
  .start-here-card { flex-direction: column; }
  .start-here-image { flex: none; max-width: 100%; height: 180px; }

  /* Article header padding */
  .article-header { padding: 2.5rem 0 2rem; }

  /* Footer stack */
  .footer-inner { flex-direction: column; text-align: center; }
}

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