/* ============================================================
   Llama Floors — design tokens
   Brand v2: paper/ink neutrals, cyan as the single primary accent.
   Warm oak (sand/clay/walnut) is the secondary accent tier -- card
   borders, secondary buttons, dividers, badges. Never used for
   primary actions/active states; cyan alone owns those.
   One typeface everywhere: Source Serif 4.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  --bg:          #f3f2f2;  /* page background (paper) */
  --surface:     #ffffff;  /* cards, forms -- sits above bg */
  --ink:         #201e1d;  /* text, headings */
  --ink-muted:   #5c5957;  /* secondary text */
  --rule:        #dcdad9;  /* borders, dividers */

  --cyan:        #0088b0;  /* brand accent: links, buttons, interactive */
  --cyan-dark:   #007a9e;  /* hover/pressed; also used for small cyan
                               text, where raw --cyan falls short of
                               AA contrast on --bg */
  --cyan-bg:     #e2f1f5;

  /* Warm oak -- secondary accent tier. Same light/mid/dark roles as
     the cyan/ok/warn/danger trios below: sand for subtle background
     tints, clay for mid-weight borders/accents, walnut for
     text-on-light or solid secondary fills. */
  --sand:        #dcc7a0;
  --clay:        #b8845a;
  --walnut:      #6b4530;

  --ok:          #2f7d4f;
  --ok-bg:       #e3f2e8;
  --warn:        #b5651d;
  --warn-bg:     #fbeadb;
  --warn-text:   #8a4c15;
  --danger:      #b0492f;
  --danger-dark: #94391f;
  --danger-bg:   #f7e2dc;

  --font-serif: 'Source Serif 4', Georgia, serif;

  --radius: 3px;
  --max-width: 1080px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-serif);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  font-size: 16px;
}

a { color: var(--cyan-dark); }

:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
}

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

/* ---------- Plank seam divider (signature structural motif) ----------
   Real flooring is staggered so seams never line up row to row —
   used here as literal section dividers, staggered the same way. */
.plank-seam {
  height: 14px;
  display: flex;
  width: 100%;
  overflow: hidden;
}
.plank-seam span {
  flex: 1 0 auto;
  border-right: 2px solid var(--bg);
  background: var(--sand);
}
.plank-seam.offset span:nth-child(odd) { flex-basis: 7%; }
.plank-seam.offset span:nth-child(even) { flex-basis: 11%; }

/* ---------- Header ---------- */
.site-header {
  background: var(--bg);
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
  padding: 16px 0;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand-icon { height: 30px; width: 30px; display: block; }
.brand-word {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  letter-spacing: -0.01em;
}
.brand-word b { font-weight: 700; }
.site-header nav a {
  position: relative;
  display: inline-block;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  margin-left: 20px;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}
.site-header nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -3px;
  height: 1.5px;
  background: var(--cyan);
  transition: right 0.25s ease;
}
.site-header nav a:hover {
  opacity: 1;
}
.site-header nav a:hover::after {
  right: 0;
}

/* ---------- Hero ---------- */
.hero {
  background: var(--bg);
  color: var(--ink);
  padding: 64px 0 56px;
  position: relative;
}
.hero .eyebrow {
  font-family: var(--font-serif);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan-dark);
  margin-bottom: 14px;
}
.hero h1 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(2.1rem, 4.2vw, 3.4rem);
  line-height: 1.08;
  margin: 0 0 20px;
  max-width: 16ch;
}
.hero p.lede {
  font-size: 1.1rem;
  max-width: 46ch;
  color: var(--ink-muted);
  margin: 0 0 30px;
}
.hero .cta-row { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 13px 24px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: box-shadow 0.15s ease, transform 0.1s ease;
}
.btn:hover:not(:disabled) { box-shadow: 0 4px 8px rgba(0,0,0,0.18); }
.btn:active:not(:disabled) { box-shadow: 0 1px 2px rgba(0,0,0,0.12); transform: scale(0.98); }
.btn-primary { background: var(--cyan); color: var(--bg); }
.btn-primary:hover { background: var(--cyan-dark); }
.btn-ghost { background: transparent; color: var(--walnut); border-color: var(--walnut); }
.btn-ghost:hover { background: var(--sand); }
.btn:disabled { opacity: 1; background: var(--bg); border-color: var(--bg); color: var(--rule); cursor: not-allowed; box-shadow: none; }
.btn-block { width: 100%; }

/* ---------- Trust bar ---------- */
.trust-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  padding: 18px 0;
}
.trust-bar ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin: 0;
  padding: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}
.trust-bar li::before { content: "— "; color: var(--cyan-dark); }

/* ---------- Section shell ---------- */
section.block { padding: 56px 0; }
.block h2 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.9rem;
  margin: 0 0 8px;
  color: var(--ink);
}
.block .sub { color: var(--ink-muted); max-width: 60ch; margin: 0 0 32px; }

/* ---------- Job type cards ---------- */
.job-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}
.job-card {
  background: var(--surface);
  border: 2px solid var(--clay);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  text-align: left;
}
.job-card:hover { border-color: var(--cyan); }
.job-card.selected {
  border-color: var(--ok);
  background: var(--ok-bg);
}
.job-card .name { font-weight: 700; margin-bottom: 4px; }
.job-card .cap {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  color: var(--ink);
}
.job-card-photo { padding: 0; overflow: hidden; }
.job-card-photo .name, .job-card-photo .cap { padding: 0 18px; }
.job-card-photo .name { margin-top: 14px; }
.job-card-photo .cap { margin-bottom: 16px; }
.job-card-img {
  display: block;
  width: 100%;
  height: 130px;
  object-fit: cover;
  background: var(--bg);
}
.job-card-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  font-size: 0.8rem;
  font-style: italic;
  border-bottom: 1px solid var(--rule);
}

/* ---------- Capacity meter (signature element) ----------
   Fills like plank boards laid end to end, up to the weekend
   1-man-crew cap. Warn past the cap = still captured, just
   flagged as outside current weekend capacity. */
.capacity {
  margin-top: 14px;
  display: none;
}
.capacity.active { display: block; }
.capacity .label {
  font-family: var(--font-serif);
  font-size: 0.82rem;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}
.capacity .meter {
  display: flex;
  gap: 2px;
  height: 16px;
  border-radius: 2px;
  overflow: hidden;
  background: var(--rule);
}
.capacity .meter .plank {
  flex: 1;
  background: var(--ok);
}
.capacity .meter .plank.over { background: var(--warn); }
.capacity .note {
  margin-top: 8px;
  font-size: 0.88rem;
  padding: 8px 10px;
  border-radius: var(--radius);
}
.capacity .note.ok { background: var(--ok-bg); color: var(--ok); }
.capacity .note.over { background: var(--warn-bg); color: var(--warn-text); }

/* ---------- Form ---------- */
.form-shell {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 640px;
}
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
}
.field input:not([type="checkbox"]):not([type="radio"]), .field select {
  width: 100%;
  padding: 11px 12px;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  font-family: var(--font-serif);
  font-size: 0.98rem;
  background: #fff;
  color: var(--ink);
}
.field input:focus:not([type="checkbox"]):not([type="radio"]), .field select:focus { border-color: var(--cyan); }
.field input[type="checkbox"], .field input[type="radio"] { width: auto; }
.field .hint { font-size: 0.82rem; color: var(--ink-muted); margin-top: 4px; }
.field-row { display: flex; gap: 14px; }
.field-row .field { flex: 1; }

.code-input {
  font-family: var(--font-serif);
  font-variant-numeric: tabular-nums;
  font-size: 1.6rem;
  letter-spacing: 0.3em;
  text-align: center;
  max-width: 220px;
}

.error-box {
  background: var(--danger-bg);
  color: var(--danger-dark);
  padding: 12px 14px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  font-size: 0.92rem;
}
.info-box {
  background: var(--ok-bg);
  color: var(--ok);
  padding: 12px 14px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  font-size: 0.92rem;
}

/* ---------- How it works ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}
.step .num {
  font-family: var(--font-serif);
  font-variant-numeric: tabular-nums;
  color: var(--cyan-dark);
  font-size: 0.85rem;
  margin-bottom: 6px;
}
.step h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  margin: 0 0 6px;
  color: var(--ink);
}
.step p { margin: 0; color: var(--ink-muted); font-size: 0.95rem; }

/* ---------- Footer ---------- */
footer {
  background: var(--ink);
  color: #c7c5c3;
  padding: 30px 0;
  font-size: 0.85rem;
}
footer a { color: var(--cyan); }

/* ---------- Thank you / verify centering ---------- */
.centered-block {
  min-height: 60vh;
  display: flex;
  align-items: center;
}
.centered-block .wrap { max-width: 480px; }

@media (max-width: 640px) {
  .field-row { flex-direction: column; gap: 0; }
  .hero { padding: 48px 0 40px; }
}

/* ---------- Owner portal ---------- */
.lead-card {
  background: var(--surface);
  border: 1.5px solid var(--rule);
  border-left: 5px solid var(--ok);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
}
.lead-card.flagged { border-left-color: var(--warn); }
.lead-card.far { border-left-color: var(--warn); }
.lead-card.clickable-card { cursor: pointer; }
.lead-card.clickable-card:hover { border-color: var(--cyan); }
.lead-head {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}
.lead-meta { font-size: 0.88rem; color: var(--ink-muted); margin-bottom: 6px; }
.lead-notes {
  font-size: 0.9rem;
  font-style: italic;
  color: var(--ink);
  margin-bottom: 8px;
}
.lead-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.inline-form { display: flex; gap: 6px; align-items: center; }
.inline-form select {
  padding: 8px;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  font-family: var(--font-serif);
  font-size: 0.85rem;
}
.btn-small { padding: 8px 14px; font-size: 0.85rem; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-dark); }
.btn-added { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.btn-added:hover { background: var(--ok-bg); opacity: 0.85; }
.link-btn {
  border: none; background: none; cursor: pointer;
  font-size: 0.8rem; color: var(--cyan-dark); padding: 0;
}
.link-btn.danger { color: var(--danger); }
.link-btn:hover { text-decoration: underline; }

/* ---------- Job detail sub-nav (Overview / Site visit / Expenses / Invoices) ---------- */
.job-tab {
  display: inline-block;
  padding: 9px 16px 10px;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink-muted);
  text-decoration: none;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1.5px;
}
.job-tab:hover { color: var(--ink); }
.job-tab.active { color: var(--cyan-dark); border-bottom-color: var(--cyan); }

/* ---------- Catalog / invoice line rows (aligned columns) ---------- */
.catalog-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
}
.catalog-row.inactive { opacity: 0.5; }
.catalog-row-form { display: flex; align-items: center; gap: 10px; flex: 1; flex-wrap: wrap; }
.catalog-row input[type="text"], .catalog-row input:not([type]),
.catalog-row-form input {
  padding: 7px 8px; border: 1.5px solid var(--rule); border-radius: var(--radius);
  font-family: var(--font-serif); font-size: 0.88rem;
}
.catalog-row-links { display: flex; gap: 10px; }
.cw-desc { flex: 2; min-width: 160px; }
.cw-unit { width: 80px; }
.cw-price { width: 90px; }
.cw-tax-check { width: 18px; height: 18px; }
.cw-actions { display: flex; align-items: center; }
.catalog-head {
  font-weight: 700; font-size: 0.78rem; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--ink); border-bottom: 2px solid var(--ink);
}
.catalog-head .cw-desc, .catalog-head .cw-unit,
.catalog-head .cw-price, .catalog-head .cw-tax { padding-left: 1px; }
.cw-tax { width: 60px; }
.tag {
  display: inline-block;
  font-family: var(--font-serif);
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--sand);
  color: var(--walnut);
  margin-left: 6px;
}
.tag.amber { background: var(--warn-bg); color: var(--warn-text); }
.mono { font-family: var(--font-serif); font-variant-numeric: tabular-nums; font-size: 0.85em; }

.weekend-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}
.weekend {
  background: var(--surface);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  padding: 10px;
  text-align: center;
  font-size: 0.85rem;
}
.weekend.booked { background: var(--ok-bg); border-color: var(--ok); }
.weekend .wdate { font-weight: 700; margin-bottom: 4px; }
.weekend .wopen { color: var(--ink-muted); }
.weekend .wjob { font-size: 0.78rem; }

.lead-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.lead-table td { padding: 8px 10px; border-bottom: 1px solid var(--rule); }

/* Honeypot: visually gone, still in the DOM for bots */
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

/* Next-weekend availability banner */
.avail-note {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--font-serif);
  font-size: 0.82rem;
  color: var(--cyan-dark);
}

/* ---------- Admin nav + link cards ---------- */
.admin-nav {
  display: flex;
  gap: 18px;
  margin-bottom: 24px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--rule);
  font-size: 0.92rem;
  font-weight: 600;
}
.admin-nav a { text-decoration: none; color: var(--cyan-dark); }
.admin-nav a:hover { text-decoration: underline; }
.admin-nav .right { margin-left: auto; font-weight: 400; }
a.link-card { display: block; text-decoration: none; color: inherit; }
a.link-card:hover { border-color: var(--cyan); }

/* ---------- Analytics ---------- */
.an-h {
  font-family: var(--font-serif);
  color: var(--ink);
  font-size: 1.2rem;
  margin: 34px 0 10px;
}
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}
.stat {
  background: var(--surface);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
}
.stat .v { font-family: var(--font-serif); font-variant-numeric: tabular-nums; font-size: 1.7rem; color: var(--ink); }
.stat .k { font-size: 0.8rem; color: var(--ink-muted); }
.lead-table .thead td {
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink);
  border-bottom: 2px solid var(--ink);
}
.mono.neg, td.neg { color: var(--danger); }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.bar-label { flex: 0 0 110px; font-size: 0.88rem; }
.bar-track { flex: 1; background: var(--rule); border-radius: 2px; height: 14px; }
.bar-fill { background: var(--ok); height: 100%; border-radius: 2px; }
.bar-val { flex: 0 0 30px; text-align: right; }
.trend { display: flex; gap: 14px; align-items: flex-end; padding: 8px 0; }
.trend-month { text-align: center; flex: 1; }
.trend-bars { display: flex; gap: 3px; align-items: flex-end; justify-content: center; height: 96px; }
.tb { width: 16px; border-radius: 2px 2px 0 0; min-height: 2px; }
.tb.rev { background: var(--ok); }
.tb.exp { background: var(--warn); }
.trend-label { font-size: 0.75rem; margin-top: 4px; }
.legend { display: inline-block; width: 11px; height: 11px; border-radius: 2px; vertical-align: -1px; }
.legend.rev { background: var(--ok); }
.legend.exp { background: var(--warn); }

/* ---------- Gallery: before/after slider ---------- */
.ba-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 560px;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1.5px solid var(--rule);
  cursor: ew-resize;
  user-select: none;
  margin: 18px 0 6px;
  background: var(--surface);
}
.ba-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.ba-before-wrap {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 50%;
  overflow: hidden;
  border-right: 3px solid var(--surface);
}
.ba-before-wrap .ba-img { width: 100vw; max-width: none; }
.ba-slider .ba-before-wrap .ba-img { width: 0; min-width: 100%; }
.ba-handle {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ba-grip {
  background: var(--cyan);
  color: var(--bg);
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(32,30,29,0.35);
  transform: translateX(-50%);
}
.ba-handle:focus-visible .ba-grip { outline: 3px solid var(--bg); }
.ba-tag {
  position: absolute;
  top: 12px;
  font-family: var(--font-serif);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(32,30,29,0.72);
  color: var(--bg);
  padding: 4px 10px;
  border-radius: 2px;
  pointer-events: none;
}
.ba-tag.left { left: 12px; }
.ba-tag.right { right: 12px; }

/* ---------- Gallery: showcase grid + lightbox ---------- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.photo-cell {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1.5px solid var(--clay);
  cursor: zoom-in;
  background: var(--surface);
}
.photo-cell img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}
.photo-cell:hover img { transform: scale(1.03); }
.photo-cell figcaption {
  font-size: 0.82rem;
  color: var(--ink-muted);
  padding: 8px 10px;
}
.photo-caption { font-size: 0.85rem; color: var(--ink-muted); margin: 4px 0 14px; }
.review-photo-placeholder {
  aspect-ratio: 4 / 3;
  max-width: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  font-size: 0.85rem;
  font-style: italic;
  background: var(--surface);
  border: 1.5px solid var(--clay);
  border-radius: var(--radius);
  margin-top: 16px;
}
.project-meta { margin-bottom: 10px; }
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(32,30,29,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  cursor: zoom-out;
}
.lightbox[hidden] {
  display: none;
}
.lightbox img { max-width: 94vw; max-height: 92vh; border-radius: 3px; }
.lb-close {
  position: absolute;
  top: 16px; right: 20px;
  background: none;
  border: none;
  color: var(--bg);
  font-size: 2.2rem;
  cursor: pointer;
}
@media (prefers-reduced-motion: reduce) {
  .photo-cell img { transition: none; }
}

