/* ==========================================================================
   Portfolio Stylesheet
   Palette: deep pine / terracotta / sage — warm, modern, maker-inspired
   ========================================================================== */

:root {
  /* Colors */
  --color-bg: #f7f5f0;
  --color-surface: #ffffff;
  --color-primary: #1f3a3d;
  --color-primary-light: #2c4a4e;
  --color-accent: #e07a5f;
  --color-accent-dark: #c8603f;
  --color-secondary: #81b29a;
  --color-text: #2b2b2b;
  --color-text-muted: #6b6b6b;
  --color-border: #e4e0d8;

  /* Layout */
  --max-width: 1120px;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 4px 16px rgba(31, 58, 61, 0.08);
  --shadow-hover: 0 10px 28px rgba(31, 58, 61, 0.16);
  --transition: 0.2s ease;

  /* Type */
  --font-heading: "Poppins", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
}

/* -------------------------------------------------------------------------
   Reset
   ------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

button {
  font-family: inherit;
  cursor: pointer;
}

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

h1 {
  font-size: clamp(2rem, 4vw + 1rem, 3.2rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(1.5rem, 2vw + 1rem, 2.2rem);
}

h3 {
  font-size: 1.25rem;
}

p {
  margin: 0 0 1em;
}

:focus-visible {
  outline: 3px solid var(--color-secondary);
  outline-offset: 2px;
}

/* -------------------------------------------------------------------------
   Layout helpers
   ------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  padding: 4rem 0;
}

.section-intro {
  max-width: 640px;
  margin: 0 0 2.5rem;
}

.section-intro p {
  color: var(--color-text-muted);
}

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

.placeholder-text {
  color: var(--color-text-muted);
  font-style: italic;
}

.bg-surface {
  background: var(--color-surface);
}

/* -------------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  transition: transform var(--transition), box-shadow var(--transition),
    background var(--transition), color var(--transition);
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-accent-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.btn-outline {
  background: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary);
  color: #fff;
  transform: translateY(-2px);
}

/* -------------------------------------------------------------------------
   Header / Navigation
   ------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 245, 240, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--color-primary);
  letter-spacing: 0.02em;
}

.logo span {
  color: var(--color-accent);
}

.main-nav ul {
  display: flex;
  gap: 2rem;
}

.main-nav a {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--color-text);
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

.main-nav a:hover {
  color: var(--color-accent-dark);
}

.main-nav a.active {
  color: var(--color-primary);
  border-color: var(--color-accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  padding: 0;
}

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

.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* -------------------------------------------------------------------------
   Image placeholder
   ------------------------------------------------------------------------- */
.img-placeholder {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

.img-placeholder svg {
  width: 34px;
  height: 34px;
  opacity: 0.9;
}

.img-placeholder span {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}

.img-placeholder.ratio-card {
  aspect-ratio: 4 / 3;
}

.img-placeholder.ratio-circle {
  aspect-ratio: 1 / 1;
  border-radius: 50%;
}

.img-placeholder.ratio-wide {
  aspect-ratio: 16 / 9;
}

/* -------------------------------------------------------------------------
   Hero (Home page)
   ------------------------------------------------------------------------- */
.hero {
  padding: 4.5rem 0 3rem;
}

.hero-inner {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2.5rem;
  align-items: center;
}

.hero-photo {
  width: 220px;
}

.profile-photo {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.hero-content h1 {
  margin-bottom: 0.4rem;
}

.hero-bio {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  max-width: 480px;
  margin-bottom: 1.75rem;
}

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

/* -------------------------------------------------------------------------
   Tiles grid (Home page preview tiles)
   ------------------------------------------------------------------------- */
.tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.5rem;
}

.tile {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--color-secondary);
}

.tile-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.1rem;
  color: var(--color-accent-dark);
}

.tile-icon svg {
  width: 24px;
  height: 24px;
}

.tile h3 {
  margin-bottom: 0.4rem;
}

.tile p {
  color: var(--color-text-muted);
  font-size: 0.92rem;
  margin-bottom: 1rem;
}

.tile-link {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--color-accent-dark);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.tile-link svg {
  width: 14px;
  height: 14px;
  transition: transform var(--transition);
}

.tile:hover .tile-link svg {
  transform: translateX(3px);
}

/* -------------------------------------------------------------------------
   Page header (used on all interior pages)
   ------------------------------------------------------------------------- */
.page-header {
  padding: 3.5rem 0 2.5rem;
  border-bottom: 1px solid var(--color-border);
}

.page-header h1 {
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--color-text-muted);
  max-width: 620px;
  font-size: 1.05rem;
  margin: 0;
}

/* -------------------------------------------------------------------------
   Maker Story page
   ------------------------------------------------------------------------- */
.story-content {
  max-width: 720px;
  font-size: 1.05rem;
}

.story-content h2 {
  margin-top: 1.8em;
}

.pull-photo {
  margin: 2.5rem 0;
  max-width: 720px;
}

.pull-photo .img-placeholder {
  height: 280px;
}

/* -------------------------------------------------------------------------
   Filter bar (Projects page)
   ------------------------------------------------------------------------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2.5rem;
}

.filter-btn {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.88rem;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  transition: all var(--transition);
}

.filter-btn:hover {
  border-color: var(--color-secondary);
  color: var(--color-primary);
}

.filter-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* -------------------------------------------------------------------------
   Project cards
   ------------------------------------------------------------------------- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.75rem;
}

.project-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}

.project-card.is-hidden {
  display: none;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.project-card .img-placeholder {
  border-radius: 0;
}

.card-body {
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-category {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-secondary);
  background: rgba(129, 178, 154, 0.14);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.8rem;
}

.card-body h3 {
  margin-bottom: 0.5rem;
}

.card-body p {
  color: var(--color-text-muted);
  font-size: 0.94rem;
  margin-bottom: 0;
}

/* -------------------------------------------------------------------------
   Skill badges
   ------------------------------------------------------------------------- */
.skills-group {
  margin-bottom: 2.75rem;
}

.skills-group h2 {
  margin-bottom: 1.2rem;
}

.badge-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 0.7rem 1.15rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--color-primary);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.badge:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--color-secondary);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  flex-shrink: 0;
}

/* -------------------------------------------------------------------------
   Scouting & Leadership page
   ------------------------------------------------------------------------- */
.rank-panel {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 3rem;
}

.rank-badge {
  width: 90px;
  height: 90px;
  flex-shrink: 0;
}

.rank-panel h2 {
  margin-bottom: 0.3rem;
}

.rank-panel p {
  margin: 0;
  color: var(--color-text-muted);
}

.leadership-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.leadership-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.4rem;
}

.leadership-card h3 {
  margin-bottom: 0.3rem;
  font-size: 1.05rem;
}

.leadership-card .role-dates {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-secondary);
  margin-bottom: 0.5rem;
}

.leadership-card p {
  color: var(--color-text-muted);
  font-size: 0.92rem;
  margin: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
}

.stat-card {
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.6rem;
  text-align: center;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--color-secondary);
  display: block;
  margin-bottom: 0.3rem;
}

.stat-label {
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  opacity: 0.85;
}

.service-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.service-list li:first-child {
  border-top: 1px solid var(--color-border);
}

.service-list strong {
  color: var(--color-text);
  font-weight: 600;
}

/* -------------------------------------------------------------------------
   Timeline (Preparation Journey page)
   ------------------------------------------------------------------------- */
.timeline {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding-left: 2rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--color-border);
}

.timeline-entry {
  position: relative;
  padding-bottom: 2.5rem;
}

.timeline-entry:last-child {
  padding-bottom: 0;
}

.timeline-entry::before {
  content: "";
  position: absolute;
  left: -2rem;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 3px solid var(--color-bg);
  box-shadow: 0 0 0 2px var(--color-accent);
}

.timeline-date {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent-dark);
  margin-bottom: 0.4rem;
}

.timeline-entry h3 {
  margin-bottom: 0.4rem;
}

.timeline-entry p {
  color: var(--color-text-muted);
  margin: 0;
}

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 2rem 0;
  margin-top: 3rem;
}

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

.footer-inner p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--color-text-muted);
}

.footer-nav {
  display: flex;
  gap: 1.25rem;
}

.footer-nav a {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  transition: color var(--transition);
}

.footer-nav a:hover {
  color: var(--color-accent-dark);
}

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-photo {
    width: 160px;
    margin: 0 auto;
  }

  .hero-bio {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .rank-panel {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .main-nav {
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition);
  }

  .main-nav.is-open {
    max-height: 400px;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1.5rem 1.5rem;
  }

  .main-nav a {
    display: block;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--color-border);
  }

  section {
    padding: 2.75rem 0;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1.1rem;
  }

  .stat-number {
    font-size: 1.8rem;
  }
}
