/* ==========================================================
   Heritage Edge — website design for every page
   ========================================================== */

/* 1. Design tokens: change a colour here, it changes everywhere */
:root {
  color-scheme: light;
  --font: "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "DM Mono", "Courier New", monospace;

  --bg: #faf9f5;            /* warm ivory background */
  --surface: #f0eee6;       /* warm grey for tiles and footer */
  --border: #e3dfd3;
  --text: #1d1d1f;
  --text-2: #6e6e73;        /* secondary text */
  --text-3: #424245;        /* footer links */
  --accent: #047857;        /* Heritage Edge green */
  --accent-hover: #065f46;
  --on-accent: #ffffff;     /* text on green buttons */
  --nav-bg: rgba(250, 249, 245, 0.85);
  --nav-border: rgba(31, 30, 29, 0.08);

    /* Carousel cards: three colours that repeat in order */
  --card-1: #123b2e;        /* forest green */
  --card-1-accent: #6ee7b7;
  --card-2: #1b2a44;        /* navy */
  --card-2-accent: #93c5fd;
  --card-3: #4a1d24;        /* burgundy */
  --card-3-accent: #fda4af;
  --card-text: #f5f5f7;


  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --container: 1024px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #262624;                          /* warm charcoal background */
  --surface: #30302e;                     /* warm grey for tiles and footer */
  --border: rgba(255, 255, 255, 0.08);
  --text: #fafafa;
  --text-2: #a1a1aa;
  --text-3: #d4d4d8;                      /* footer links */
  --accent: #10b981;
  --accent-hover: #34d399;
  --on-accent: #052e16;                   /* dark green text on green buttons */
  --nav-bg: rgba(38, 38, 36, 0.8);
  --nav-border: rgba(255, 255, 255, 0.06);
}

/* 2. Basics */
*, *::before, *::after { box-sizing: border-box; }

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

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
h1, h2, h3, p { margin: 0; }

/* 3. Layout */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* 4. Navigation */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--nav-border);
}

/* Three columns: logo on the left, links in the middle, search and toggle on the right */
.nav-inner {
  min-height: 56px;
  padding: 0 clamp(20px, 4vw, 48px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px 24px;
}

.nav-logo {
  justify-self: start;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}
.nav-logo span { color: var(--accent); }
.nav-logo { display: inline-flex; align-items: center; gap: 8px; }
.logo-mark { width: 30px; height: auto; transform: translateY(3px); }
.logo-mark .h { fill: currentColor; }
.logo-mark .e { fill: var(--accent); }

.nav-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 28px;
  font-size: 13px;
}
.nav-links a { color: var(--text); padding: 12px 0; }
.nav-links a:hover { color: var(--accent); }

.nav-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Search box (not connected yet: this is the slot Pagefind will use) */
.nav-search {
  width: 200px;
  height: 34px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 980px;
  background: var(--surface);
  color: var(--text-2);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}
.nav-search:hover { border-color: var(--text-2); }
.nav-search-label { flex: 1; text-align: left; }
.nav-search kbd {
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 11px;
}

/* Dark/light mode button */
.theme-toggle {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--text-2);
  cursor: pointer;
}
.theme-toggle:hover { background: var(--surface); color: var(--text); }

/* Show the moon in light mode, the sun in dark mode */
.icon-sun { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

/* Smaller screens: links move to their own row, search shrinks to an icon */
@media (max-width: 860px) {
  .nav-inner { grid-template-columns: 1fr auto; padding-top: 6px; }
  .nav-links { grid-column: 1 / -1; grid-row: 2; }
  .nav-search { width: 44px; height: 44px; padding: 0; justify-content: center; border: none; background: none; }
  .nav-search-label, .nav-search kbd { display: none; }
}

/* 5. Buttons and links */
.btn {
  display: inline-block;
  font-size: 17px;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: 980px;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-dark { background: var(--text); color: var(--bg); }
.btn-dark:hover { opacity: 0.85; color: var(--bg); }
.btn-small { font-size: 12px; padding: 7px 14px; }
.link-arrow { font-size: 17px; font-weight: 500; }

/* 6. Homepage — hero */
.hero {
  text-align: center;
  padding: clamp(64px, 9vw, 120px) 20px clamp(56px, 7vw, 96px);
}
.hero-eyebrow {
  margin-bottom: 12px;
  font-size: clamp(17px, 1.6vw, 21px);
  font-weight: 600;
  color: var(--accent);
}
.hero-title {
  max-width: 900px;
  margin: 0 auto;
  font-size: clamp(44px, 7vw, 88px);
  line-height: 1.04;
  font-weight: 700;
  letter-spacing: -0.035em;
}
.hero-intro {
  max-width: 640px;
  margin: 20px auto 0;
  font-size: clamp(19px, 2vw, 24px);
  line-height: 1.35;
  color: var(--text-2);
}
.hero-actions {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 16px 28px;
}

/* 7. Footer */
.site-footer {
  margin-top: 64px;
  background: var(--surface);
  font-size: 12px;
  color: var(--text-2);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 24px;
  padding-top: 32px;
}
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-heading { font-weight: 600; color: var(--text); }
.footer-col a { color: var(--text-3); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  margin-top: 28px;
  padding: 16px 0 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

/* 8. Homepage — highlights carousel */
.section-title {
  font-size: clamp(36px, 4.6vw, 56px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.section-title span { color: var(--text-2); }

.highlights { padding: clamp(72px, 8vw, 110px) 0 40px; }

.carousel {
  margin-top: 36px;
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px max(20px, calc((100% - 984px) / 2)) 24px;
  scroll-padding-inline: max(20px, calc((100% - 984px) / 2));
}

.highlight-card {
  scroll-snap-align: start;
  flex: 0 0 min(340px, 82vw);
  min-height: 460px;
  padding: 32px 28px;
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  color: var(--card-text);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  transition: transform 0.2s ease;
}
.highlight-card:hover { color: var(--card-text); transform: scale(1.015); }

/* The repeating colour sequence: 1, 2, 3, then back to 1 */
.highlight-card:nth-child(3n+1) { --card-bg: var(--card-1); --card-accent: var(--card-1-accent); }
.highlight-card:nth-child(3n+2) { --card-bg: var(--card-2); --card-accent: var(--card-2-accent); }
.highlight-card:nth-child(3n)   { --card-bg: var(--card-3); --card-accent: var(--card-3-accent); }

.card-top { display: flex; flex-direction: column; gap: 8px; }
.card-bottom { display: flex; flex-direction: column; gap: 10px; }

.card-tag { font-size: 13px; font-weight: 600; color: var(--card-accent); }
.card-headline {
  font-size: 28px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.card-point {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.09);
  font-size: 14px;
  font-weight: 500;
}
.card-cta { margin-top: 8px; font-size: 15px; font-weight: 500; color: var(--card-accent); }

/* 9. Homepage — every project, four steps */
.steps-section {
  margin-top: 40px;
  padding: clamp(64px, 8vw, 110px) 0;
  background: var(--surface);
}
.section-intro {
  max-width: 820px;
  margin-top: 18px;
  font-size: 19px;
  line-height: 1.5;
  color: var(--text-2);
}
.steps {
  margin: 44px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}
.step {
  padding: 26px 24px 28px;
  border-radius: var(--radius);
  background: var(--bg);
}
.step-number { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.step-title {
  margin-top: 10px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.step-text {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-3);
}
.steps-link { display: inline-block; margin-top: 28px; }

/* 10. Homepage — knowledge hub */
.hub-section {
  padding: clamp(72px, 8vw, 110px) 0 40px;
  text-align: center;
}
.hub-section .section-intro { margin: 16px auto 0; }

.tracks {
  margin: 56px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 40px 24px;
}
.track {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.track-icon { color: var(--accent); }
.track-name {
  min-height: 2.5em;          /* room for two lines, so the dividers line up */
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-size: 21px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.track-rule { width: 100%; height: 1px; background: var(--border); }
.track-text {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-3);
}
.track-link {
  margin-top: auto;           /* keeps every link on the same line */
  font-size: 15px;
  font-weight: 500;
}
.track-soon {
  margin-top: auto;
  font-size: 15px;
  color: var(--text-2);
}

@media (max-width: 600px) {
  .track-name { min-height: 0; }
}

/* 11. Homepage — about me */
.about-section { padding: clamp(64px, 8vw, 100px) 20px 0; }

.about-card {
  max-width: 1000px;
  margin: 0 auto;
  padding: clamp(40px, 6vw, 72px) clamp(24px, 5vw, 64px);
  border-radius: var(--radius-lg);
  background: var(--surface);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 32px 64px;
}
.about-text { flex: 999 1 420px; min-width: 0; }
.about-plan {
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}
.about-bio {
  margin-top: 16px;
  font-size: 19px;
  line-height: 1.5;
  color: var(--text-2);
}
.about-links {
  flex: 1 1 200px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 17px;
  font-weight: 500;
}
.about-links .btn { text-align: center; }

/* 12. Page headers (Projects now, other pages later) */
.page-header { padding: clamp(64px, 8vw, 110px) 0 clamp(32px, 4vw, 48px); }
.page-eyebrow {
  margin-bottom: 10px;
  font-size: 17px;
  font-weight: 600;
  color: var(--accent);
}
.page-title {
  max-width: 900px;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.035em;
}
.page-title span { color: var(--text-2); }
.page-intro {
  max-width: 680px;
  margin-top: 18px;
  font-size: clamp(18px, 1.8vw, 21px);
  line-height: 1.5;
  color: var(--text-2);
}

/* 13. Projects page */
.project-list { padding-bottom: 40px; }
.project-list .container { display: flex; flex-direction: column; gap: 16px; }

.project-row {
  padding: clamp(28px, 4vw, 44px);
  border-radius: var(--radius-lg);
  background: var(--surface);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: start;
  gap: 32px 48px;
}

.project-tag { font-size: 13px; font-weight: 600; color: var(--accent); }
.project-title {
  margin-top: 8px;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.project-headline {
  margin-top: 10px;
  font-size: 17px;
  line-height: 1.45;
  color: var(--text-2);
}
.project-context { margin-top: 10px; font-size: 13px; color: var(--text-2); }

.project-links {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}
.project-links .btn { font-size: 15px; padding: 10px 20px; }
.project-links .link-arrow { font-size: 15px; }

.project-steps {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.project-step {
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.project-step dt {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.project-step dd {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-3);
}

@media (max-width: 800px) {
  .project-row { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .project-steps { grid-template-columns: 1fr; }
}

/* 14. Blog page - ” list of posts */
.post-list { padding-bottom: 40px; }
.post-list .container { display: flex; flex-direction: column; gap: 12px; }

.post-row {
  padding: 24px 28px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px 32px;
  transition: transform 0.2s ease;
}
.post-row:hover { color: var(--text); transform: translateY(-2px); }

.post-date { font-family: var(--mono); font-size: 13px; color: var(--text-2); }
.post-tag { margin-bottom: 4px; font-size: 13px; font-weight: 600; color: var(--accent); }
.post-title {
  font-size: clamp(20px, 2.4vw, 26px);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.post-summary { margin-top: 6px; font-size: 16px; line-height: 1.5; color: var(--text-2); }
.post-arrow { font-size: 26px; line-height: 1; color: var(--accent); }

/* Shown until the first post exists */
.post-empty {
  padding: clamp(28px, 4vw, 44px);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.post-empty-title {
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.post-empty-text { margin-top: 8px; font-size: 17px; color: var(--text-2); }

@media (max-width: 600px) {
  .post-row { grid-template-columns: 1fr; padding: 20px; }
  .post-arrow { display: none; }
}

/* 15. Blog post - ” a single post */
.post .container { max-width: 720px; }

.post-header {
  padding: clamp(48px, 7vw, 96px) 0 clamp(28px, 4vw, 40px);
  margin-bottom: 36px;
  border-bottom: 1px solid var(--border);
}
.post-back { display: inline-block; margin-bottom: 24px; font-size: 15px; }
.post-heading {
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.03em;
}

/* The writing itself: spacing between paragraphs, headings, lists, quotes and code */
.post-body { padding-bottom: 80px; font-size: 18px; line-height: 1.7; }
.post-body > * + * { margin-top: 1.1em; }
.post-body h2 { margin-top: 1.8em; font-size: 26px; line-height: 1.25; letter-spacing: -0.02em; }
.post-body h3 { margin-top: 1.5em; font-size: 20px; line-height: 1.3; }
.post-body ul, .post-body ol { padding-left: 1.3em; }
.post-body li + li { margin-top: 0.4em; }
.post-body a { text-decoration: underline; text-underline-offset: 3px; }
.post-body blockquote {
  margin: 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--accent);
  color: var(--text-2);
}
.post-body code {
  font-family: var(--mono);
  font-size: 0.9em;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface);
}
.post-body pre {
  overflow-x: auto;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 14px;
  line-height: 1.6;
}
.post-body pre code { padding: 0; background: none; }
.post-body img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.post-body hr { margin: 2em 0; border: none; border-top: 1px solid var(--border); }


/* 16. About page */
.about-block { padding-top: clamp(48px, 6vw, 80px); }
.about-contact { padding-bottom: clamp(64px, 8vw, 100px); }
 
/* Background: one row per role, date on the left */
.timeline {
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}
.timeline-row {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 6px 32px;
}
.timeline-when { padding-top: 4px; font-family: var(--mono); font-size: 13px; color: var(--text-2); }
.timeline-role {
  font-size: clamp(19px, 2.2vw, 22px);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.timeline-org { margin-top: 2px; font-size: 15px; font-weight: 600; color: var(--accent); }
.timeline-text { max-width: 640px; margin-top: 8px; font-size: 16px; line-height: 1.55; color: var(--text-2); }
.timeline-link { display: inline-block; margin-top: 10px; font-size: 15px; font-weight: 500; }
 
/* Skills: a tile per group, each skill as a small pill */
.skill-groups {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.skill-group { padding: 24px; border-radius: var(--radius); background: var(--surface); }
.skill-title {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.skill-list {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.skill-list li {
  padding: 6px 12px;
  border-radius: 980px;
  background: var(--bg);
  font-size: 14px;
  line-height: 1.3;
}
 
/* Now: label on the left, what I'm doing on the right */
.now-list { margin: 32px 0 0; display: grid; gap: 12px; }
.now-item {
  padding: 22px 26px;
  border-radius: var(--radius);
  background: var(--surface);
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 6px 32px;
}
.now-item dt {
  padding-top: 4px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.now-item dd { margin: 0; font-size: 17px; line-height: 1.55; }
 
/* Get in touch */
.contact-card {
  padding: clamp(40px, 6vw, 72px) clamp(24px, 5vw, 64px);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.contact-links {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 28px;
}
 
@media (max-width: 600px) {
  .timeline-row, .now-item { grid-template-columns: 1fr; }
}
 