/* ==========================================================================
   Gord100's Trillium Trailer Projects — modern stylesheet
   ========================================================================== */

:root {
  --green-900: #183326;
  --green-800: #1f4432;
  --green-700: #2a5a42;
  --green-600: #35714f;
  --green-500: #4a8c64;
  --green-100: #e3efe6;
  --cream-50: #fbf8f1;
  --cream-100: #f4efe3;
  --cream-200: #e9e1cd;
  --wood-500: #a9764b;
  --wood-600: #8d5e39;
  --amber-500: #e0a33e;
  --ink-900: #17211b;
  --ink-600: #45574b;
  --ink-400: #6d7c70;
  --line: #e2dccb;
  --shadow-sm: 0 1px 2px rgba(23, 33, 27, .08), 0 2px 8px rgba(23, 33, 27, .06);
  --shadow-md: 0 6px 24px rgba(23, 33, 27, .12);
  --shadow-lg: 0 16px 48px rgba(23, 33, 27, .20);
  --radius: 14px;
  --radius-sm: 9px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --header-h: 64px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink-900);
  background: var(--cream-50);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--green-700); text-decoration: none; }
a:hover { color: var(--green-600); text-decoration: underline; }
img { max-width: 100%; display: block; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--green-900);
  color: #fff;
  padding: .75rem 1rem;
  z-index: 200;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; color: #fff; text-decoration: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 248, 241, .88);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .65rem; color: var(--ink-900); }
.brand:hover { text-decoration: none; }
.brand-logo { border-radius: 10px; box-shadow: var(--shadow-sm); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--green-800); }
.brand-text em { font-style: normal; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-400); }

.site-nav { display: flex; align-items: center; gap: .15rem; }
.site-nav a {
  font-size: .88rem;
  font-weight: 500;
  color: var(--ink-600);
  padding: .45rem .65rem;
  border-radius: var(--radius-sm);
}
.site-nav a:hover { color: var(--green-800); background: var(--green-100); text-decoration: none; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: 0;
  padding: .5rem;
  cursor: pointer;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink-900); border-radius: 2px; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(224, 163, 62, .18), transparent 60%),
    radial-gradient(900px 480px at 0% 0%, rgba(74, 140, 100, .16), transparent 55%),
    var(--cream-100);
  border-bottom: 1px solid var(--line);
}
.hero-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 4.5rem 1.5rem 4rem;
  text-align: center;
}
.hero-avatar {
  width: 132px;
  height: 132px;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 auto 1.5rem;
  border: 4px solid #fff;
  box-shadow: var(--shadow-md);
}
.hero-kicker {
  margin: 0 0 .5rem;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--wood-600);
}
.hero-title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.08;
  color: var(--green-900);
  letter-spacing: -.01em;
}
.hero-lede {
  margin: 0 0 2rem;
  font-size: 1.08rem;
  color: var(--ink-600);
}
.hero-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .72rem 1.25rem;
  border-radius: 999px;
  font-size: .95rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--green-700); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--green-800); color: #fff; box-shadow: var(--shadow-md); }
.btn-ghost { background: #fff; color: var(--green-800); border-color: var(--line); }
.btn-ghost:hover { color: var(--green-700); border-color: var(--green-500); }

/* ---------- Projects intro ---------- */
.projects-intro {
  max-width: 1080px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 1rem;
  text-align: center;
}
.section-eyebrow {
  margin: 0 0 .35rem;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--wood-600);
}
.section-title {
  margin: 0 0 .5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  color: var(--green-900);
}
.section-sub { margin: 0 0 1.5rem; color: var(--ink-600); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.chip {
  font-size: .85rem;
  font-weight: 500;
  color: var(--ink-600);
  background: #fff;
  border: 1px solid var(--line);
  padding: .42rem .85rem;
  border-radius: 999px;
  transition: border-color .12s ease, color .12s ease, background .12s ease;
}
.chip:hover { color: var(--green-800); border-color: var(--green-500); background: var(--green-100); text-decoration: none; }

/* ---------- Project sections ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 0 1.5rem 2rem; }

.project {
  margin-top: 3rem;
  padding: 2rem 0 0;
  border-top: 1px solid var(--line);
}
.project:first-of-type { border-top: 0; }

.project-head {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 1rem;
  align-items: start;
}
.project-num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--amber-500);
  line-height: 1.2;
  padding-top: .1rem;
}
.project h2 {
  margin: 0 0 .5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.45rem, 3.4vw, 2rem);
  color: var(--green-900);
}
.project h2 .dim { color: var(--ink-400); font-weight: 500; }
.project-lede { margin: 0 0 .75rem; color: var(--ink-600); max-width: 72ch; }
.project-lede a { font-weight: 500; }
.warn { color: #a33b2b; }

/* Steps */
.steps {
  margin: 1.1rem 0 1.25rem;
  padding: 1.25rem 1.5rem;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green-600);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.steps h3 { margin: 0 0 .6rem; font-family: var(--font-display); font-size: 1.1rem; color: var(--green-800); }
.steps ol { margin: 0; padding-left: 1.25rem; color: var(--ink-600); }
.steps li { margin-bottom: .35rem; }
.steps li::marker { color: var(--green-600); font-weight: 600; }

/* ---------- Gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.gallery figure { margin: 0; }
.gallery a { display: block; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); background: #fff; }
.gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform .25s ease;
}
.gallery a:hover img { transform: scale(1.04); }
.gallery figcaption {
  padding: .65rem .75rem;
  font-size: .86rem;
  color: var(--ink-600);
  background: #fff;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-sm);
}

/* ---------- Back to top ---------- */
.back-to-top { text-align: center; margin: 3rem 0 1rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--green-900);
  color: var(--cream-200);
  border-top: 4px solid var(--amber-500);
}
.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2.25rem 1.5rem;
  text-align: center;
}
.footer-inner p { margin: 0 0 .35rem; }
.footer-note { font-size: .9rem; color: #a9c2b0; }
.site-footer a { color: #e8d7a8; }
.site-footer a:hover { color: #fff; }

/* ---------- Lightbox ---------- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(12, 18, 14, .94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  animation: fade .18s ease;
}
.lightbox-overlay[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.lb-figure { margin: 0; text-align: center; max-width: min(94vw, 1100px); }
.lb-figure img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  margin: 0 auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}
.lb-figure figcaption {
  margin-top: .9rem;
  color: var(--cream-200);
  font-size: .95rem;
  max-width: 70ch;
  margin-left: auto;
  margin-right: auto;
}
.lb-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  font-size: 2.2rem;
  line-height: 1;
  background: none;
  border: 0;
  color: #fff;
  cursor: pointer;
  padding: .25rem .5rem;
  border-radius: var(--radius-sm);
}
.lb-close:hover { background: rgba(255,255,255,.12); }
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.6rem;
  background: none;
  border: 0;
  color: #fff;
  cursor: pointer;
  width: 56px;
  height: 72px;
  border-radius: var(--radius-sm);
}
.lb-nav:hover { background: rgba(255,255,255,.12); }
.lb-prev { left: .5rem; }
.lb-next { right: .5rem; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--cream-50);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    padding: .5rem 1rem 1rem;
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: .7rem .75rem; border-radius: var(--radius-sm); }
}

@media (max-width: 560px) {
  .project-head { grid-template-columns: 1fr; gap: .25rem; }
  .project-num { font-size: 1.15rem; }
  .gallery { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .gallery figcaption { font-size: .78rem; padding: .5rem .55rem; }
  .hero-inner { padding: 3rem 1.25rem 3rem; }
  .hero-avatar { width: 110px; height: 110px; }
}
