:root {
  --bg-page: #171310;
  --bg-card: #211a14;
  --bg-elevated: #2a2118;
  --accent: #d9a55b;
  --accent-hover: #c8954b;
  --brand: #8a5a3b;
  --text-muted: #bfb2a2;
  --text-primary: #f4ede2;
  --line: #33291f;
  --ink-on-accent: #1a140c;
  --danger: #d98a6a;
  --ok: #7fae7a;

  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;

  --radius: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  letter-spacing: 0;
}

a { color: inherit; }

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: var(--ink-on-accent);
  padding: 10px 18px;
  border-radius: 0 0 8px 0;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}
.btn-primary {
  background: var(--accent);
  color: var(--ink-on-accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 0 4px rgba(217, 165, 91, 0.18), 0 10px 30px rgba(217, 165, 91, 0.22);
}
.btn-primary:active { transform: translateY(1px); }
.btn-lg { padding: 16px 30px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--line);
}
.btn-ghost:hover { color: var(--text-primary); border-color: var(--accent); }
.btn-mini { padding: 7px 12px; font-size: 13px; }

/* ---------- header ---------- */
.site-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 20;
  padding: 20px 0;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; color: var(--accent); flex: none; }
.brand-name { font-size: 22px; color: var(--text-primary); }
.main-nav { display: flex; gap: 24px; margin-left: auto; }
.main-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: color 180ms ease;
}
.main-nav a:hover { color: var(--text-primary); }
.header-cta { margin-left: 8px; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
}
.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(23, 19, 16, 0.94) 0%, rgba(23, 19, 16, 0.72) 46%, rgba(23, 19, 16, 0.28) 100%),
    linear-gradient(0deg, rgba(23, 19, 16, 0.95) 0%, rgba(23, 19, 16, 0.2) 40%, rgba(23, 19, 16, 0.35) 100%);
}
.hero-content { position: relative; z-index: 2; padding-top: 100px; padding-bottom: 60px; max-width: 720px; }
.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 18px;
}
.hero h1 {
  font-size: clamp(40px, 6.4vw, 66px);
  max-width: 15ch;
  margin-bottom: 20px;
}
.hero-tagline {
  font-size: 19px;
  color: var(--text-muted);
  margin: 0 0 34px;
  max-width: 44ch;
}
.hero-promises {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  margin-bottom: 38px;
}
.promise {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--text-primary);
}
.promise svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.promise strong { font-weight: 700; }

/* ---------- trust strip ---------- */
.trust {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-card);
}
.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-top: 30px;
  padding-bottom: 30px;
}
.trust-item { display: flex; align-items: center; gap: 16px; }
.trust-num {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  color: var(--accent);
  min-width: 84px;
  font-variant-numeric: tabular-nums;
}
.trust-item > span:last-child { color: var(--text-muted); font-size: 15px; }

/* ---------- category blocks ---------- */
.category { padding: 88px 0 0; }
.category-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 32px;
}
.category-head h2 { font-size: clamp(30px, 4vw, 42px); }
.category-count {
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ---------- project card (veneer sample) ---------- */
.project-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}
.project-card::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms ease;
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(217, 165, 91, 0.45);
  box-shadow: var(--shadow);
}
.project-card:hover::after { transform: scaleX(1); }
.project-card:focus-within {
  border-color: var(--accent);
  transform: translateY(-4px);
}
.project-card:focus-within::after { transform: scaleX(1); }
.project-media { position: relative; aspect-ratio: 4 / 3; background: var(--bg-elevated); }
.project-media img { width: 100%; height: 100%; object-fit: cover; }
.tier-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(23, 19, 16, 0.78);
  color: var(--accent);
  border: 1px solid rgba(217, 165, 91, 0.4);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.project-body { padding: 20px 20px 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.project-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.project-title-row h3 { font-size: 22px; }
.project-price {
  color: var(--accent);
  font-weight: 700;
  font-size: 17px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.project-desc { color: var(--text-muted); font-size: 14.5px; margin: 0; }
.project-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: auto 0 0;
  font-size: 13.5px;
  color: var(--text-muted);
}
.project-specs div { display: flex; gap: 6px; }
.project-specs dt { color: var(--text-muted); }
.project-specs dt::after { content: ":"; }
.project-specs dd { margin: 0; color: var(--text-primary); }
.project-credit {
  margin: 0;
  padding: 10px 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.82;
}

/* ---------- measurement ---------- */
.measure { padding: 96px 0; }
.measure-head { max-width: 640px; margin-bottom: 44px; }
.measure-head h2 { font-size: clamp(30px, 4vw, 42px); margin-bottom: 16px; }
.measure-head p { color: var(--text-muted); font-size: 17px; }
.free-mark {
  color: var(--accent);
  border-bottom: 2px dashed var(--accent);
  padding-bottom: 2px;
}
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 0;
  margin: 0 0 40px;
}
.step {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.step-num {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}
.step h3 { font-size: 19px; margin-bottom: 8px; }
.step p { color: var(--text-muted); font-size: 14px; margin: 0; }

/* ---------- lead form ---------- */
.lead {
  padding: 0 0 96px;
}
.lead-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.lead-copy h2 { font-size: clamp(30px, 4vw, 42px); margin-bottom: 18px; }
.lead-copy p { color: var(--text-muted); font-size: 17px; max-width: 42ch; }
.lead-form {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.field { display: flex; flex-direction: column; gap: 8px; border: none; margin: 0; padding: 0; }
.field label, .field legend {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}
.field input[type="text"],
.field input[type="tel"],
.field input[type="search"],
.field input[type="password"] {
  background: var(--bg-page);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  padding: 13px 14px;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.field input::placeholder { color: var(--text-muted); opacity: 0.55; }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(217, 165, 91, 0.18); }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field-error {
  margin: 0;
  font-size: 13px;
  color: var(--danger);
}
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span {
  display: inline-block;
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, background-color 180ms ease;
}
.chip input:checked + span {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(217, 165, 91, 0.1);
}
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip:hover span { border-color: var(--accent); color: var(--text-primary); }
.honeypot { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }
.form-status { margin: 0; font-size: 15px; min-height: 22px; }
.form-status-success { color: var(--ok); }
.form-status-error { color: var(--danger); }
.btn[disabled] { opacity: 0.65; cursor: not-allowed; }
.btn.is-sending { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.75; } }

/* success card replaces form */
.success-card {
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: 14px;
  padding: 32px;
}
.success-card h3 { font-size: 24px; margin-bottom: 12px; }
.success-card .ticket {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.success-card p { color: var(--text-muted); margin: 12px 0 0; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-card); padding: 40px 0; }
.footer-inner { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.footer-brand p { color: var(--text-muted); font-size: 14px; margin: 8px 0 0; max-width: 32ch; }
.footer-contact p { margin: 0 0 6px; color: var(--text-muted); font-size: 14px; }
.footer-contact a { color: var(--accent); text-decoration: none; }
.footer-contact a:hover { text-decoration: underline; }
.footer-admin a { color: var(--text-muted); font-size: 14px; text-decoration: none; }
.footer-admin a:hover { color: var(--text-primary); }

/* =========================================================
   ADMIN
   ========================================================= */
.auth-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-shell { width: 100%; max-width: 420px; }
.auth-brand { margin-bottom: 28px; }
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px;
}
.auth-card h1 { font-size: 26px; margin-bottom: 8px; }
.auth-sub { color: var(--text-muted); margin: 0 0 24px; font-size: 15px; }
.auth-card .lead-form { background: transparent; border: none; padding: 0; }

.app-body { background: var(--bg-page); }
.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--line);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.sidebar-brand { padding: 4px 8px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  min-height: 44px;
  transition: background-color 180ms ease, color 180ms ease;
}
.side-link svg { width: 20px; height: 20px; flex: none; }
.side-link:hover { color: var(--text-primary); background: var(--bg-elevated); }
.side-link.is-active { color: var(--accent); background: rgba(217, 165, 91, 0.1); font-weight: 600; }

.app-main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-card);
}
.topbar-title h1 { font-size: 20px; }
.topbar-sub { color: var(--text-muted); font-size: 13px; }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.user-chip {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}
.logout-form { margin: 0; }
.icon-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0;
}
.icon-btn svg { width: 22px; height: 22px; }

.content { padding: 24px; overflow-y: auto; flex: 1; }
.toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.search-box {
  position: relative;
  flex: 1;
  min-width: 240px;
  max-width: 380px;
}
.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}
.search-box input {
  width: 100%;
  padding: 11px 12px 11px 38px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
}
.search-box input:focus { outline: none; border-color: var(--accent); }
.toolbar-count { color: var(--text-muted); font-size: 14px; }

/* table */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
  max-height: calc(100vh - 260px);
  overflow-y: auto;
}
.data-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg-elevated);
  text-align: left;
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 12px 16px;
  box-shadow: inset 0 -1px 0 var(--line);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background-color 150ms ease; }
.data-table tbody tr:hover { background: rgba(217, 165, 91, 0.05); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.strong { font-weight: 600; }
.th-actions { text-align: right; }
.actions-cell { text-align: right; white-space: nowrap; }
.actions-cell .btn { margin-left: 6px; }
.muted { color: var(--text-muted); }

/* badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-new { background: rgba(217, 165, 91, 0.16); color: var(--accent); }
.badge-in_progress { background: rgba(138, 90, 59, 0.3); color: #e0b98a; }
.badge-done { background: rgba(127, 174, 122, 0.16); color: var(--ok); }
.badge-rejected { background: rgba(217, 138, 106, 0.14); color: var(--danger); }

.empty-state {
  text-align: left;
  padding: 56px 24px;
  background: var(--bg-card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.empty-state h2 { font-size: 22px; margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); margin: 0; }

.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 14px;
}
.pagination button {
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-family: var(--font-body);
}
.pagination button:hover { border-color: var(--accent); }
.pagination button[disabled] { opacity: 0.4; cursor: not-allowed; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 60;
  box-shadow: var(--shadow);
}
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
}

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .main-nav { display: none; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .lead-grid { grid-template-columns: 1fr; gap: 28px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 260px;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 220ms ease;
  }
  .sidebar.is-open { transform: translateX(0); }
  .icon-btn { display: inline-flex; }
  .topbar-sub { display: none; }
}

@media (max-width: 640px) {
  .container { padding: 0 18px; }
  .hero-content { padding-top: 80px; }
  .hero h1 { font-size: 38px; }
  .hero-promises { flex-direction: column; gap: 14px; }
  .trust-grid { grid-template-columns: 1fr; gap: 18px; }
  .card-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .category { padding-top: 60px; }
  .lead-form { padding: 22px; }
  .header-cta { display: none; }
}

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