:root {
  --bg-canvas: #241c16;
  --bg-surface: #362c22;
  --bg-surface-hover: #46392d;
  --bg-band-alt: #2d231b;
  --text-primary: #f4f1ea;
  --text-muted: #c8beae;
  --accent-primary: #d4a84b;
  --accent-secondary: #8c6628;
  --border-subtle: #524334;
  --ease-kinetic: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  border-radius: 0px !important;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.65;
  overflow-wrap: anywhere;
  hyphens: auto;
}

h1, h2, h3, h4 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  line-height: 1.2;
  margin-top: 0;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.1rem, 4vw, 3.2rem); margin-bottom: 1.25rem; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); margin-bottom: 1rem; border-left: 4px solid var(--accent-primary); padding-left: 0.85rem; }
h3 { font-size: 1.3rem; margin-bottom: 0.75rem; }

p { margin-top: 0; margin-bottom: 1.25rem; max-width: 70ch; }
a { color: var(--accent-primary); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--text-primary); }

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

.band {
  padding: 4.5rem 0;
  background-color: var(--bg-canvas);
  border-bottom: 1px solid var(--border-subtle);
}

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

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

/* Header: transparent nonsticky that becomes solid on scroll, exits normally */
.site-header {
  position: relative;
  width: 100%;
  background-color: transparent;
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.25s ease;
  z-index: 20;
}

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

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text-primary);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: 1.15rem;
  margin-right: auto;
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 10px);
  grid-template-rows: repeat(2, 10px);
  gap: 2px;
}

.brand-mark span {
  background-color: var(--accent-primary);
  display: block;
}

.brand-mark span:nth-child(2), .brand-mark span:nth-child(3) {
  background-color: var(--text-primary);
}

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

.main-nav a {
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.35rem 0.2rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.main-nav a:hover, .main-nav a[aria-current="page"] {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

.mobile-menu-btn {
  display: none;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--accent-primary);
  padding: 0.4rem 0.75rem;
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
}

@media (max-width: 768px) {
  .mobile-menu-btn { display: block; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-surface);
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.5rem;
    border-bottom: 2px solid var(--accent-primary);
    gap: 0.75rem;
  }
  .main-nav.open { display: flex; }
}

/* Buttons: solid gold blocks with 4px 4px 0 offset shadow that closes on hover */
.btn {
  display: inline-block;
  background-color: var(--accent-primary);
  color: #241c16;
  font-weight: 700;
  text-decoration: none;
  padding: 0.8rem 1.4rem;
  border: 2px solid #241c16;
  box-shadow: 4px 4px 0px #f4f1ea;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  font-size: 0.95rem;
}

.btn:hover {
  color: #241c16;
  transform: translate(4px, 4px);
  box-shadow: 0px 0px 0px #f4f1ea;
}

.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border: 2px solid var(--accent-primary);
  box-shadow: 4px 4px 0px var(--accent-primary);
}

.btn-secondary:hover {
  color: var(--accent-primary);
  box-shadow: 0px 0px 0px var(--accent-primary);
}

/* Hero layout */
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: center;
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.hero-studies-stack {
  position: relative;
  min-height: 360px;
  background-color: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  padding: 1rem;
}

.study-layer {
  position: absolute;
  border: 2px solid var(--text-primary);
  background-color: var(--bg-canvas);
  padding: 0.5rem;
}

.study-layer img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.study-layer-1 {
  width: 62%;
  height: 200px;
  top: 18px;
  left: 18px;
  z-index: 1;
}

.study-layer-2 {
  width: 58%;
  height: 190px;
  top: 85px;
  right: 18px;
  z-index: 2;
  border-color: var(--accent-primary);
}

.study-layer-3 {
  width: 64%;
  height: 175px;
  bottom: 18px;
  left: 48px;
  z-index: 3;
}

.study-caption-tag {
  display: inline-block;
  background-color: var(--accent-primary);
  color: #241c16;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  margin-bottom: 0.3rem;
}

/* Cards with gold category badge crossing image edge */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.study-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s var(--ease-kinetic);
}

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

.card-media-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background-color: #1c1510;
  border-bottom: 2px solid var(--accent-primary);
}

.card-media-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.crossing-badge {
  position: absolute;
  bottom: -14px;
  left: 1.25rem;
  background-color: var(--accent-primary);
  color: #241c16;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.3rem 0.75rem;
  border: 2px solid #241c16;
  z-index: 3;
}

.card-body {
  padding: 1.75rem 1.25rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-body p {
  font-size: 0.95rem;
  color: var(--text-muted);
  flex: 1;
}

/* Labelled tile diagrams & crop sequence strips */
.tile-diagram-box {
  background-color: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  padding: 1.5rem;
  margin: 2rem 0;
}

.tile-matrix {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin: 1rem 0;
  background-color: #1a140f;
  padding: 12px;
  border: 1px solid var(--border-subtle);
}

.tile-cell {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #241c16;
  background-color: var(--text-primary);
}

.tile-cell.t-dark { background-color: #362c22; color: var(--text-primary); border: 1px solid var(--border-subtle); }
.tile-cell.t-mid { background-color: #8c6628; color: var(--text-primary); }
.tile-cell.t-gold { background-color: #d4a84b; color: #241c16; }

.crop-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin: 1.75rem 0;
}

.crop-step {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 1rem;
}

.crop-step img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  margin-bottom: 0.75rem;
  border: 1px solid var(--accent-primary);
}

.step-num {
  display: inline-block;
  background-color: var(--accent-primary);
  color: #241c16;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  margin-bottom: 0.4rem;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin: 1.75rem 0;
  border: 1px solid var(--border-subtle);
}

table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--bg-surface);
  font-size: 0.94rem;
}

th, td {
  padding: 0.9rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

th {
  background-color: #1c1611;
  color: var(--accent-primary);
  font-family: Georgia, "Times New Roman", serif;
}

/* Tool lists & FAQ */
.tool-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.tool-list li {
  background-color: var(--bg-surface);
  border-left: 4px solid var(--accent-primary);
  padding: 1.15rem;
}

.faq-item {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.faq-item h3 {
  color: var(--accent-primary);
  margin-bottom: 0.5rem;
}

/* Forms */
.studio-form {
  background-color: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  padding: 2rem;
  max-width: 720px;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 0.75rem;
  background-color: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: 2px solid var(--accent-primary);
  border-color: var(--accent-primary);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

.output-preview {
  margin-top: 1.5rem;
  padding: 1rem;
  background-color: #1a140f;
  border: 1px solid var(--accent-primary);
  white-space: pre-wrap;
  font-family: monospace;
  font-size: 0.88rem;
  display: none;
}

/* Footer */
.site-footer {
  background-color: #1a140f;
  border-top: 2px solid var(--accent-primary);
  padding: 3.5rem 0 2.5rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li { margin-bottom: 0.55rem; }

.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s var(--ease-kinetic), transform 0.6s var(--ease-kinetic);
}

@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
