/* --------------------------------------------------------------------------
   Woden Design — elegant, content-forward redesign
   -------------------------------------------------------------------------- */

:root {
  --bg: #faf8f3;
  --surface: #ffffff;
  --surface-soft: #f2efe7;
  --text: #1c1c1a;
  --text-muted: #6a6860;
  --border: #e6e2d7;
  --accent: #8a6a3f;
  --accent-hover: #6b5230;
  --radius: 6px;
  --shadow-sm: 0 1px 2px rgba(28, 28, 26, 0.04);
  --shadow-md: 0 6px 24px rgba(28, 28, 26, 0.06);
  --max-w: 1120px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 0.5em;
  line-height: 1.15;
}

h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; font-family: var(--font-sans); font-weight: 600; letter-spacing: 0; }

p { margin: 0 0 1em; }

small, .muted { color: var(--text-muted); font-size: 0.9rem; }

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

/* --------------------------------------------------------------------------
   Layout primitives
   -------------------------------------------------------------------------- */

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

.container-narrow {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 4.5rem 0;
}

.section-tight {
  padding: 2.5rem 0;
}

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

/* --------------------------------------------------------------------------
   Header / Nav
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 248, 243, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.01em;
}

.brand:hover { color: var(--text); text-decoration: none; }

.brand-mark {
  width: 56px;
  height: 56px;
  display: inline-block;
  color: var(--text);
  flex-shrink: 0;
}

.brand-mark svg,
.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
}

@media (max-width: 820px) {
  .brand-mark { width: 44px; height: 44px; }
  .brand { font-size: 1.3rem; gap: 0.65rem; }
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.8rem;
}

.nav a {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
}

.nav a.active,
.nav a[aria-current="page"] {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.45rem 0.7rem;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text);
}

@media (max-width: 820px) {
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.5rem 1.5rem 1.25rem;
  }
  .nav a {
    width: 100%;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
  }
  .nav a:last-child { border-bottom: none; }
  .nav.open { display: flex; }
  .nav-toggle { display: inline-block; }
}

/* --------------------------------------------------------------------------
   Masthead — full wordmark logo shown on the home page
   -------------------------------------------------------------------------- */

.masthead {
  padding: clamp(1.75rem, 5vw, 4rem) 0 clamp(0.5rem, 1.5vw, 1rem);
  text-align: center;
  color: var(--text);
}

.masthead-logo {
  width: 100%;
  max-width: clamp(200px, 28vw, 360px);
  height: auto;
  margin: 0 auto;
  color: var(--text);
}

.masthead-rule {
  display: block;
  width: clamp(40px, 5vw, 64px);
  height: 1px;
  background: var(--border);
  margin: clamp(1rem, 2.5vw, 2rem) auto 0;
  border: 0;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  padding: 5rem 0 3rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 3rem;
  align-items: center;
}

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
}

.hero h1 {
  margin-bottom: 1rem;
}

.hero-lede {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 48ch;
}

.hero-media img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.95rem;
  border: 1px solid var(--text);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  text-decoration: none;
  transform: translateY(-1px);
}

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

.btn-outline:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* --------------------------------------------------------------------------
   Grid / cards
   -------------------------------------------------------------------------- */

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 960px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: #ddd6c5;
}

.card a { color: inherit; }

/* --------------------------------------------------------------------------
   Plans catalogue (rendered from JSON)
   -------------------------------------------------------------------------- */

.plans-intro {
  max-width: 780px;
  margin: 0 auto 3rem;
  text-align: center;
}

.category {
  margin-bottom: 5rem;
  scroll-margin-top: 100px;
}

.series {
  scroll-margin-top: 100px;
}

.category-header {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 3rem;
  align-items: center;
  margin-bottom: 2.5rem;
  padding: 2.5rem 2.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.category-header img {
  max-width: 200px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 720px) {
  .category-header {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.75rem;
  }
  .category-header img { max-width: 160px; }
}

.category-header h2 {
  margin-top: 0.2rem;
}

.category-tagline {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
}

.series {
  margin-bottom: 3.5rem;
}

.series-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 2rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.series-header h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin: 0;
}

.series-tagline {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 70ch;
  margin: 0 0 1.25rem;
}

.series-bundle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--surface-soft);
  border-radius: var(--radius);
  font-size: 0.95rem;
}

.series-bundle strong { color: var(--text); }
.series-bundle .price { font-family: var(--font-serif); font-size: 1.1rem; }

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

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  text-align: left;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #ddd6c5;
  text-decoration: none;
}

.product-card .thumb {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  background: var(--surface-soft);
  border-radius: var(--radius);
  padding: 0.75rem;
}

.product-card .thumb img {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  object-fit: contain;
}

.product-card .thumb.empty {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

.product-name {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--text);
  margin: 0 0 0.25rem;
}

.product-driver {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  flex-grow: 1;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
  margin-top: auto;
  font-size: 0.9rem;
}

.product-footer .price {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--text);
  font-weight: 500;
}

.product-footer .cta {
  color: var(--accent);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Product detail page
   -------------------------------------------------------------------------- */

.breadcrumbs {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { margin: 0 0.5rem; opacity: 0.5; }

.product-detail {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 4rem;
  align-items: start;
}

@media (max-width: 820px) {
  .product-detail { grid-template-columns: 1fr; gap: 2rem; }
}

.product-detail-media {
  background: var(--surface-soft);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-detail-media img {
  margin: 0 auto;
  max-height: 520px;
  width: auto;
}

.product-detail-media.empty {
  color: var(--text-muted);
  font-style: italic;
}

.product-detail h1 {
  margin-bottom: 0.25rem;
}

.product-detail .series-label {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: inline-block;
}

.product-detail .price-lg {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  color: var(--text);
  margin: 0 0 1.5rem;
}

.status-pill {
  display: inline-block;
  background: #f5ecdc;
  color: #8b6a2e;
  border: 1px solid #e5d6b5;
  border-radius: 100px;
  padding: 0.25rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.spec-table th,
.spec-table td {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  font-size: 0.95rem;
}

.spec-table th {
  font-weight: 500;
  color: var(--text-muted);
  width: 38%;
  padding-right: 1rem;
}

.siblings {
  margin-top: 5rem;
}

.siblings h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

/* --------------------------------------------------------------------------
   Builder gallery + lightbox
   -------------------------------------------------------------------------- */

.builder-gallery {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}

.builder-gallery h2 {
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}

.builder-gallery > p.muted {
  max-width: 65ch;
  margin-bottom: 1.75rem;
}

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

.gallery-tile {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.gallery-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #ddd6c5;
}

.gallery-open {
  all: unset;
  display: block;
  cursor: zoom-in;
  background: var(--surface-soft);
}

.gallery-open img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s ease;
}

.gallery-open:hover img {
  opacity: 0.92;
}

.gallery-tile figcaption {
  padding: 0.85rem 1rem 1rem;
  font-size: 0.9rem;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.gallery-tile figcaption strong {
  font-weight: 500;
  color: var(--text);
}

.gallery-tile figcaption .muted { font-size: 0.82rem; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(20, 20, 18, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 3rem;
}

.lightbox[hidden] { display: none; }

.lightbox-image {
  max-width: 100%;
  max-height: calc(100vh - 8rem);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  background: var(--bg);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(250, 248, 243, 0.12);
  color: var(--bg);
  border: 1px solid rgba(250, 248, 243, 0.2);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(250, 248, 243, 0.22);
  border-color: rgba(250, 248, 243, 0.4);
}

.lightbox-close { top: 1.25rem; right: 1.25rem; }
.lightbox-prev { left: 1.25rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 1.25rem; top: 50%; transform: translateY(-50%); }

.lightbox-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1.5rem;
  text-align: center;
  color: var(--bg);
  font-size: 0.9rem;
  padding: 0 2rem;
}

.lightbox-caption a { color: var(--bg); text-decoration: underline; text-underline-offset: 2px; }
.lightbox-caption a:hover { color: #e9d9b0; }

@media (max-width: 560px) {
  .lightbox { padding: 1rem; }
  .lightbox-close { top: 0.5rem; right: 0.5rem; }
  .lightbox-prev { left: 0.5rem; }
  .lightbox-next { right: 0.5rem; }
}

.builds {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}

.builds h2 {
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}

.builds > p.muted {
  max-width: 65ch;
  margin-bottom: 1.25rem;
}

.builds-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--border);
}

.builds-list li {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.community-hub {
  margin-top: 2rem;
  padding: 2rem 2rem 2.25rem;
  background: var(--surface-soft);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.community-hub h2 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.community-hub p {
  max-width: 68ch;
  margin-bottom: 1rem;
}

.community-hub .btn {
  margin-top: 0.25rem;
}

/* --------------------------------------------------------------------------
   Generic content page
   -------------------------------------------------------------------------- */

.page-header {
  padding: 4rem 0 2.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4rem;
}

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

.page-header p {
  color: var(--text-muted);
  max-width: 60ch;
  margin: 0 auto;
  font-size: 1.1rem;
}

.prose p { margin-bottom: 1.25em; }
.prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.5em; }

/* Links directory */
.link-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--border);
}

.link-list li {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.link-list li > :first-child {
  font-weight: 500;
}

.link-list .muted-note {
  color: var(--text-muted);
}

@media (max-width: 620px) {
  .link-list li { grid-template-columns: 1fr; gap: 0.25rem; }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  margin-top: 6rem;
  padding: 3rem 0 2rem;
  background: var(--surface-soft);
  border-top: 1px solid var(--border);
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent); }

.site-footer .location {
  font-family: var(--font-serif);
  font-style: italic;
}

/* --------------------------------------------------------------------------
   Utility
   -------------------------------------------------------------------------- */

.text-center { text-align: center; }
.flex { display: flex; gap: 1rem; flex-wrap: wrap; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }

.loading, .error {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
}
.error { color: #a0522d; }
