/* Agrocannava: survey-plat vernacular. Tokens per content/09_DESIGN_SYSTEM.md (colors from Ed's Logo_01, D-012). */

:root {
  --paper: #F7F8F4;
  --panel: #ECEFE8;
  --ink: #1F2A2E;
  --muted: #56615C;
  --pine: #3F5A32;
  --pine-ink: #F7F8F4;
  --accent: #8E5426;
  --contour: #C3CCC0;
  --rule: #CBD2C8;
  --focus: #8E5426;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --letter: "Barlow Semi Condensed", "Arial Narrow", Arial, sans-serif;

  --s1: 4px; --s2: 8px; --s3: 16px; --s4: 24px; --s5: 32px; --s6: 48px; --s7: 64px; --s8: 96px;
  --measure: 38rem;
  --wide: 70rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #131917;
    --panel: #1B2320;
    --ink: #E4E9E2;
    --muted: #A2ACA6;
    --pine: #A9C28F;
    --pine-ink: #131917;
    --accent: #D9A070;
    --contour: #34413B;
    --rule: #34413B;
    --focus: #D9A070;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #131917; --panel: #1B2320; --ink: #E4E9E2; --muted: #A2ACA6;
  --pine: #A9C28F; --pine-ink: #131917; --accent: #D9A070; --contour: #34413B;
  --rule: #34413B; --focus: #D9A070; color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.65;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--paper); padding: var(--s2) var(--s3); }
.skip:focus { left: var(--s3); z-index: 10; }

.wrap { width: min(100% - 2 * var(--s3), var(--wide)); margin-inline: auto; }
@media (min-width: 720px) { .wrap { width: min(100% - 2 * var(--s6), var(--wide)); } }

/* Type */
h1, h2, h3 { font-weight: 600; line-height: 1.15; margin: 0 0 var(--s3); letter-spacing: -0.01em; }
h1 { font-size: clamp(2.25rem, 1.6rem + 3.2vw, 3.6rem); max-width: 16ch; }
h2 { font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2.25rem); max-width: 22ch; }
h3 { font-size: 1.3rem; }
p, ul, ol, dl, table { margin: 0 0 var(--s3); }
.prose { max-width: var(--measure); }
.lead { font-size: 1.3rem; line-height: 1.55; max-width: 34rem; }
.small { font-size: 0.875rem; line-height: 1.5; color: var(--muted); }
.lettered { font-family: var(--letter); font-weight: 500; letter-spacing: 0.02em; }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 72px; }
.wordmark { font-family: var(--serif); font-weight: 700; font-size: 1.35rem; letter-spacing: 0.06em; text-decoration: none; }
.nav { display: none; }
.nav ul { display: flex; gap: var(--s4); list-style: none; margin: 0; padding: 0; align-items: center; }
.nav a { font-family: var(--letter); font-size: 1.05rem; text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); }
.menu summary { font-family: var(--letter); font-size: 1.05rem; cursor: pointer; list-style: none; padding: var(--s2) var(--s3); border: 1px solid var(--rule); }
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { border-color: var(--ink); }
.menu ul { position: absolute; left: 0; right: 0; margin: 0; padding: var(--s3); list-style: none; background: var(--paper); border-bottom: 1px solid var(--rule); z-index: 5; }
.menu li a { display: block; padding: var(--s2) 0; font-family: var(--letter); font-size: 1.2rem; text-decoration: none; }
@media (min-width: 760px) {
  .nav { display: block; }
  .menu { display: none; }
}

/* Buttons */
.btn { display: inline-block; font-family: var(--letter); font-weight: 600; font-size: 1.05rem; letter-spacing: 0.02em; padding: 0.75em 1.25em; text-decoration: none; border: 1.5px solid var(--pine); }
.btn-primary { background: var(--pine); color: var(--pine-ink); }
.btn-primary:hover { background: transparent; color: var(--pine); }
.btn-quiet { color: var(--pine); }
.btn-quiet:hover { background: var(--pine); color: var(--pine-ink); }
.nav .btn { padding: 0.45em 1em; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s4); }

/* Hero */
.hero { padding: var(--s6) 0 var(--s7); }
.hero .wrap { display: grid; gap: var(--s6); align-items: center; }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: 1.05fr 1fr; gap: var(--s7); } .hero { padding: var(--s8) 0; } }
.place { font-family: var(--letter); color: var(--muted); font-size: 1.05rem; margin-bottom: var(--s3); }

.theme-line { font-size: 1.2rem; line-height: 1.5; border-left: 3px solid var(--accent); padding-left: var(--s3); margin: var(--s4) 0 0; max-width: 32rem; }

/* The plat: the one bold element */
.plat { width: 100%; max-width: 560px; justify-self: center; }
.plat svg { width: 100%; height: auto; }
.plat .contour { fill: none; stroke: var(--contour); stroke-width: 1; }
.plat .bound { fill: none; stroke: var(--accent); stroke-width: 2.25; stroke-linejoin: round; }
.plat .field { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 5 5; }
.plat .label { font-family: var(--letter); fill: var(--ink); }
.plat .label.big { font-family: var(--serif); font-weight: 600; }
.plat .label.muted { fill: var(--muted); }
.plat .mark { fill: none; stroke: var(--ink); stroke-width: 1.25; }
.plat .mark-fill { fill: var(--ink); }
.plat figcaption { margin-top: var(--s2); text-align: right; }
@media (prefers-reduced-motion: no-preference) {
  .plat .bound { stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: survey 2.4s cubic-bezier(.4,0,.2,1) .3s forwards; }
  .plat .field { opacity: 0; animation: appear .6s ease 2.4s forwards; }
  .plat .label { opacity: 0; animation: appear .8s ease 2.6s forwards; }
}
@keyframes survey { to { stroke-dashoffset: 0; } }
@keyframes appear { to { opacity: 1; } }

/* Sections */
.section { padding: var(--s7) 0; border-top: 1px solid var(--rule); }
@media (min-width: 720px) { .section { padding: var(--s8) 0; } }
.section.panel { background: var(--panel); }
.section.band { background: var(--pine); color: var(--pine-ink); border-top: 0; }
.band .btn { border-color: var(--pine-ink); }
.band .btn-primary { background: var(--pine-ink); color: var(--pine); }
.band .btn-primary:hover { background: transparent; color: var(--pine-ink); }
.band a { text-decoration-color: currentColor; }
.split { display: grid; gap: var(--s5); }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1.25fr; gap: var(--s7); } }

/* Title block: the plat's corner box, used for property facts */
.title-block { border: 1.5px solid var(--ink); margin: 0; max-width: 40rem; }
.title-block div { display: grid; grid-template-columns: minmax(8rem, 13rem) 1fr; border-top: 1px solid var(--rule); }
.title-block div:first-child { border-top: 0; }
.title-block dt { font-family: var(--letter); color: var(--muted); padding: var(--s2) var(--s3); border-right: 1px solid var(--rule); }
.title-block dd { margin: 0; padding: var(--s2) var(--s3); }
@media (max-width: 520px) {
  .title-block div { grid-template-columns: 1fr; }
  .title-block dt { border-right: 0; padding-bottom: 0; }
  .title-block dd { padding-top: 0; }
}

/* Tables */
.table-wrap { overflow-x: auto; max-width: 100%; }
table { border-collapse: collapse; width: 100%; font-size: 1rem; line-height: 1.5; }
th, td { text-align: left; vertical-align: top; padding: var(--s2) var(--s3) var(--s2) 0; border-bottom: 1px solid var(--rule); }
th { font-family: var(--letter); font-weight: 600; color: var(--muted); }
td:first-child { font-weight: 600; padding-right: var(--s4); }

/* Lists */
.questions { padding-left: 1.4em; max-width: var(--measure); }
.questions li { padding-left: var(--s2); margin-bottom: var(--s2); }
.questions li::marker { font-family: var(--letter); color: var(--accent); font-weight: 600; }
.plain { list-style: none; padding: 0; max-width: var(--measure); }
.plain li { padding: var(--s2) 0; border-top: 1px solid var(--rule); }
.plain li:first-child { border-top: 0; }

/* Stages (a real sequence) */
.stages { list-style: none; padding: 0; margin: 0; max-width: 46rem; counter-reset: stage -1; }
.stages li { counter-increment: stage; display: grid; grid-template-columns: 3rem 1fr; gap: var(--s3); padding: var(--s3) 0; border-top: 1px solid var(--rule); }
.stages li::before { content: counter(stage); font-family: var(--letter); font-weight: 600; font-size: 1.4rem; color: var(--accent); line-height: 1.3; }
.stages h3 { margin-bottom: var(--s1); font-size: 1.15rem; }
.stages p { margin: 0; }
.stages .status { font-family: var(--letter); color: var(--muted); font-size: 0.95rem; }
.stages .now .status { color: var(--accent); font-weight: 600; }

/* Models */
.model { border-top: 1.5px solid var(--ink); padding-top: var(--s4); margin-top: var(--s6); }
.model:first-of-type { margin-top: var(--s5); }
.model-grid { display: grid; gap: var(--s4); }
@media (min-width: 820px) { .model-grid { grid-template-columns: repeat(3, 1fr); } }
.model-grid h3 { font-family: var(--letter); font-weight: 600; font-size: 1.05rem; color: var(--muted); }
.model-grid ul { padding-left: 1.1em; font-size: 1rem; }

/* FAQ */
.faq details { border-top: 1px solid var(--rule); max-width: 46rem; }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; padding: var(--s3) 0; font-weight: 600; }
.faq details p { margin: 0 0 var(--s3); max-width: var(--measure); }

/* Structure diagram */
.tree { font-family: var(--letter); font-size: 1.05rem; border-left: 1.5px solid var(--ink); padding-left: var(--s4); max-width: 40rem; }
.tree div { padding: var(--s1) 0; }
.tree .child { padding-left: var(--s4); border-left: 1px dashed var(--muted); margin-left: var(--s2); }
.tree strong { font-family: var(--serif); }
.tree span { color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); padding: var(--s6) 0 var(--s5); }
.site-footer .wrap { display: grid; gap: var(--s4); }
@media (min-width: 820px) { .site-footer .wrap { grid-template-columns: 1fr 2fr; } }
.site-footer p { margin-bottom: var(--s2); }
.notice { font-size: 0.85rem; line-height: 1.55; color: var(--muted); max-width: 44rem; }

@media print {
  .site-header, .site-footer .notice, .actions { display: none; }
}

/* Inline styles are blocked by the CSP (style-src 'self'), so variants live here. */
.stages.from-one { counter-reset: stage 0; }
.band .theme-line { border-left-color: currentColor; }
.band .small { color: inherit; }

/* Header: Ed's logo beside the wordmark */
.wordmark { display: inline-flex; align-items: center; gap: 12px; }
.wordmark .logo { width: 48px; height: 48px; flex: none; }
