/* ===== Design tokens ===== */
:root {
  --bg: #f7f5f1;
  --bg-soft: #efebe3;
  --ink: #1b1b1a;
  --ink-soft: #5c5a54;
  --line: #e1dcd1;
  --dark: #15140f;
  --dark-soft: #232019;
  --accent: #a36a2e;
  --accent-dark: #7c4f1f;
  --accent-soft: #e9d9c2;
  --cream: #fffdf9;

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --container: 1180px;
  --radius: 4px;
  --shadow-soft: 0 12px 32px -16px rgba(20, 18, 12, 0.25);
  --shadow-lift: 0 24px 48px -20px rgba(20, 18, 12, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

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

p { margin: 0 0 1em; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-dark);
  font-weight: 600;
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--accent);
}

.section { padding: 96px 0; }
.section--tight { padding: 64px 0; }
.section--dark { background: var(--dark); color: var(--cream); }
.section--soft { background: var(--bg-soft); }

.section-head {
  max-width: 640px;
  margin: 0 0 48px;
}
.section-head.center { margin-inline: auto; text-align: center; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  font-family: var(--font-body);
}
.btn:hover { transform: translateY(-1px); }

.btn--primary {
  background: var(--accent);
  color: var(--cream);
}
.btn--primary:hover { background: var(--accent-dark); }

.btn--ghost {
  background: transparent;
  border-color: rgba(255,255,255,0.35);
  color: inherit;
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn--dark {
  background: var(--dark);
  color: var(--cream);
}
.btn--dark:hover { background: var(--dark-soft); }

.btn--outline {
  background: transparent;
  border-color: var(--ink);
}
.btn--outline:hover { border-color: var(--accent); color: var(--accent-dark); }

.btn--block { width: 100%; justify-content: center; }

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  transition: background 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease;
}
.site-header.is-scrolled {
  background: rgba(247, 245, 241, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--line);
  padding: 12px 32px;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--cream);
  transition: color 0.3s ease;
}
.logo span { color: var(--accent-soft); transition: color 0.3s ease; }

.nav { display: flex; align-items: center; gap: 36px; }
.nav-links { display: flex; gap: 32px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  font-size: 0.92rem;
  font-weight: 500;
  position: relative;
  padding-bottom: 4px;
  color: var(--cream);
  transition: color 0.3s ease;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 1px;
  width: 0;
  background: var(--accent);
  transition: width 0.25s ease;
}
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }
.nav-links a.active { color: var(--accent-soft); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--cream);
}
.nav-toggle span {
  width: 24px; height: 2px;
  background: currentColor;
}

.site-header.is-scrolled .logo { color: var(--ink); }
.site-header.is-scrolled .logo span { color: var(--accent); }
.site-header.is-scrolled .nav-links a { color: var(--ink); }
.site-header.is-scrolled .nav-links a.active { color: var(--accent-dark); }
.site-header.is-scrolled .nav-toggle { color: var(--ink); }

@media (max-width: 860px) {
  .site-header.is-scrolled .nav-links a { color: var(--cream); }
}

@media (max-width: 860px) {
  .nav-links {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: min(78vw, 320px);
    background: var(--dark);
    color: var(--cream);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 28px;
    padding: 0 48px;
    transform: translateX(100%);
    transition: transform 0.35s ease;
  }
  .nav-links.is-open { transform: translateX(0); }
  .nav-links a { color: var(--cream); font-size: 1.1rem; }
  .nav-toggle { display: flex; color: inherit; }
  .site-header.on-dark:not(.is-scrolled) .nav-toggle { color: var(--cream); }
}

/* ===== Hero ===== */
.hero {
  position: relative;
  background: var(--dark);
  color: var(--cream);
  overflow: hidden;
  padding-top: 120px;
}
.hero::before {
  content: "";
  position: absolute;
  top: -20%; right: -10%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(163,106,46,0.25), transparent 70%);
  z-index: 0;
}
.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
  padding-bottom: 90px;
}
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; padding-bottom: 56px; }
}
.hero-content .eyebrow { color: var(--accent-soft); }
.hero-content .eyebrow::before { background: var(--accent-soft); }
.hero h1 {
  font-size: clamp(2.4rem, 4.8vw, 3.8rem);
  margin-bottom: 22px;
}
.hero p.lead {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.78);
  max-width: 520px;
}
.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.hero-collage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 130px 130px 130px;
  gap: 14px;
}
.hero-collage a {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.hero-collage img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.hero-collage a:hover img { transform: scale(1.08); }
.hero-collage .c1 { grid-row: 1 / 3; }
.hero-collage .c2 { grid-row: 1 / 2; }
.hero-collage .c3 { grid-row: 2 / 4; }
.hero-collage .c4 { grid-row: 3 / 4; }
@media (max-width: 960px) {
  .hero-collage { grid-template-rows: 110px 110px 110px; }
}
@media (max-width: 600px) {
  .hero-collage { grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 90px 90px; }
  .hero-collage .c1 { grid-row: 1/3; grid-column: 1/2; }
  .hero-collage .c2 { grid-row: 1/2; grid-column: 2/3; }
  .hero-collage .c3 { grid-row: 1/2; grid-column: 3/4; }
  .hero-collage .c4 { grid-row: 2/3; grid-column: 2/4; }
}

.page-hero {
  position: relative;
  padding: 170px 0 70px;
  color: var(--cream);
  background: var(--dark);
  overflow: hidden;
}
.page-hero-media {
  position: absolute;
  inset: 0;
}
.page-hero-media img { width: 100%; height: 100%; object-fit: cover; opacity: 0.45; }
.page-hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(21,20,15,0.5), rgba(21,20,15,0.92));
}
.page-hero-content { position: relative; z-index: 1; max-width: 680px; }
.page-hero h1 { font-size: clamp(2.2rem, 4vw, 3.2rem); }
.page-hero p { color: rgba(255,255,255,0.8); font-size: 1.05rem; }

/* ===== Feature grid ===== */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
}
@media (max-width: 800px) { .features { grid-template-columns: 1fr; } }

.feature-card {
  padding: 8px 0;
}
.feature-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--accent-dark);
}
.feature-card h3 { font-size: 1.2rem; }
.feature-card p { color: var(--ink-soft); font-size: 0.96rem; }

/* ===== Category showcase ===== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
@media (max-width: 800px) { .category-grid { grid-template-columns: 1fr; } }

.category-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 460px;
  display: flex;
  align-items: flex-end;
  color: var(--cream);
  box-shadow: var(--shadow-soft);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.category-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.category-card img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.category-card:hover img { transform: scale(1.05); }
.category-card::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,18,12,0) 30%, rgba(15,14,10,0.88) 100%);
}
.category-card-body { position: relative; z-index: 1; padding: 36px; }
.category-card-body .tag {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-soft);
  font-weight: 600;
}
.category-card-body h3 { font-size: 1.7rem; margin: 8px 0 10px; }
.category-card-body p { color: rgba(255,255,255,0.78); margin-bottom: 18px; max-width: 420px; }
.category-card-body .link-arrow { font-weight: 600; font-size: 0.92rem; display: inline-flex; align-items: center; gap: 8px; }
.category-card-body .link-arrow svg { transition: transform 0.25s ease; }
.category-card:hover .link-arrow svg { transform: translateX(4px); }

/* ===== Story / about teaser ===== */
.story {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
@media (max-width: 860px) { .story { grid-template-columns: 1fr; gap: 32px; } }
.story-media { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-soft); }
.story-media img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.story-body p { color: var(--ink-soft); }
.story-stats {
  display: flex;
  gap: 40px;
  margin: 28px 0 32px;
}
.story-stats .stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--accent-dark);
}
.story-stats .stat span { font-size: 0.85rem; color: var(--ink-soft); }

/* ===== Patent list ===== */
.patent-list { display: grid; gap: 24px; }
.patent-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 22px;
  padding: 28px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.patent-item .num {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--accent);
}
.patent-item h3 { font-size: 1.15rem; margin-bottom: 8px; }
.patent-item p { color: var(--ink-soft); margin: 0; font-size: 0.95rem; }

/* ===== CTA band ===== */
.cta-band {
  background: var(--dark);
  color: var(--cream);
  padding: 80px 0;
  text-align: center;
}
.cta-band h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); max-width: 700px; margin: 0 auto 18px; }
.cta-band p { color: rgba(255,255,255,0.75); max-width: 560px; margin: 0 auto 32px; }

/* ===== Gallery ===== */
.gallery-filter {
  display: flex;
  gap: 12px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
@media (max-width: 960px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .gallery-grid { grid-template-columns: 1fr; } }

.gallery-card {
  background: var(--cream);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.gallery-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-soft); }
.gallery-card-media { position: relative; aspect-ratio: 4/5; overflow: hidden; background: var(--bg-soft); }
.gallery-card-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s ease;
}
.gallery-card:hover .gallery-card-media img { transform: scale(1.06); }
.gallery-card-media .count {
  position: absolute;
  top: 12px; right: 12px;
  background: rgba(21,20,15,0.65);
  color: var(--cream);
  font-size: 0.72rem;
  padding: 4px 9px;
  border-radius: 20px;
}
.gallery-card-body { padding: 20px 22px 24px; }
.gallery-card-body h3 { font-size: 1.05rem; margin-bottom: 8px; }
.gallery-card-body p {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gallery-card-body .inquire {
  margin-top: 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-dark);
}

/* When a category only has one example, show it as a wide featured card
   instead of a small card stranded in a multi-column grid. */
.gallery-grid:has(.gallery-card:only-child) {
  grid-template-columns: 1fr;
}
.gallery-card:only-child {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 880px;
}
.gallery-card:only-child .gallery-card-media { aspect-ratio: auto; }
.gallery-card:only-child .gallery-card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 36px 40px;
}
.gallery-card:only-child .gallery-card-body p { -webkit-line-clamp: 5; }
@media (max-width: 700px) {
  .gallery-card:only-child { grid-template-columns: 1fr; }
}

/* ===== Compare cards (problem vs solution) ===== */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
@media (max-width: 760px) { .compare-grid { grid-template-columns: 1fr; } }

.compare-card {
  padding: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.compare-card.bad { background: var(--bg-soft); }
.compare-card.good {
  background: var(--dark);
  color: var(--cream);
  border-color: var(--dark);
  box-shadow: var(--shadow-lift);
}
.compare-card .compare-label {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  opacity: 0.7;
}
.compare-card h3 { font-size: 1.3rem; margin: 8px 0 22px; }
.compare-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.compare-card li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 0.96rem;
  line-height: 1.4;
}
.compare-card.bad li::before {
  content: "✕";
  color: #b4453a;
  font-weight: 700;
  flex-shrink: 0;
}
.compare-card.good li::before {
  content: "✓";
  color: var(--accent-soft);
  font-weight: 700;
  flex-shrink: 0;
}

/* ===== How it works (icon + text) ===== */
.mechanism {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 620px;
  margin: 0 auto;
}
.mechanism-icon {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

/* ===== Photo mosaic (proof gallery) ===== */
.photo-mosaic {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.photo-mosaic a {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 3/4;
  box-shadow: var(--shadow-soft);
}
.photo-mosaic img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.photo-mosaic a:hover img { transform: scale(1.06); }
@media (max-width: 760px) {
  .photo-mosaic { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  background: rgba(15,14,10,0.92);
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox.is-open { display: flex; }
.lightbox-inner {
  background: var(--cream);
  max-width: 980px;
  width: 100%;
  max-height: 88vh;
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
}
@media (max-width: 760px) {
  .lightbox-inner { grid-template-columns: 1fr; overflow-y: auto; }
}
.lightbox-media { position: relative; background: var(--dark); }
.lightbox-media img { width: 100%; height: 100%; object-fit: cover; max-height: 88vh; }
.lightbox-nav {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  display: flex; justify-content: space-between;
  width: 100%; padding: 0 12px;
}
.lightbox-nav button {
  background: rgba(255,255,255,0.85);
  border: none;
  width: 38px; height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
}
.lightbox-thumbs {
  position: absolute; bottom: 14px; left: 0; right: 0;
  display: flex; gap: 8px; justify-content: center;
}
.lightbox-thumbs span {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
}
.lightbox-thumbs span.active { background: var(--cream); }
.lightbox-body { padding: 36px; overflow-y: auto; }
.lightbox-body h3 { font-size: 1.4rem; margin-bottom: 14px; }
.lightbox-body p { color: var(--ink-soft); }
.lightbox-close {
  position: absolute;
  top: 18px; right: 18px;
  z-index: 2;
  background: rgba(255,255,255,0.85);
  border: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
}

/* ===== Contact ===== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 56px;
}
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }

.contact-info-item {
  display: flex;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.contact-info-item:last-child { border-bottom: none; }
.contact-info-item .icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.contact-info-item strong { display: block; margin-bottom: 4px; }
.contact-info-item span, .contact-info-item a { color: var(--ink-soft); font-size: 0.95rem; }

.form-card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px;
}
.form-row { margin-bottom: 20px; }
.form-row label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--ink);
  transition: border-color 0.2s ease;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-row textarea { resize: vertical; min-height: 130px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 540px) { .form-grid-2 { grid-template-columns: 1fr; } }

.form-message {
  display: none;
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 0.9rem;
}
.form-message.is-success { display: block; background: #e7f3e6; color: #2c5c2a; }
.form-message.is-error { display: block; background: #f8e6e3; color: #8a2e1f; }

.honeypot { position: absolute; left: -9999px; opacity: 0; }

/* ===== Footer ===== */
.site-footer {
  background: var(--dark);
  color: rgba(255,255,255,0.7);
  padding: 64px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }
.footer-grid h4 {
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-grid a:hover { color: var(--accent-soft); }
.footer-logo { font-family: var(--font-display); font-size: 1.6rem; color: var(--cream); margin-bottom: 14px; }
.footer-logo span { color: var(--accent); }
.footer-bottom {
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  flex-wrap: wrap;
  gap: 10px;
}

/* ===== Reveal animation =====
   Content is visible by default so it never depends on JS running.
   Only once main.js confirms it can observe scroll position (html.js-reveal)
   do elements start hidden and fade in via IntersectionObserver. */
.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.js-reveal [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}
