:root {
  --bg-page: #1b1714;
  --bg-card: #26211d;
  --bg-elevated: #2e2722;
  --brand: #b56a3c;
  --accent: #e2a25b;
  --accent-soft: rgba(226, 162, 91, 0.14);
  --text-primary: #f4ede4;
  --text-muted: #b8aa9a;
  --text-faint: #a08f7d;
  --kromka: #e2a25b;
  --danger: #e08b7a;
  --ok: #9fc09a;

  --font-heading: "Prata", "Georgia", "Times New Roman", serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius: 0.05rem;
  --radius-lg: 0.35rem;
  --container: 1160px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);

  --shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.6);
}

* {
  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: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 0.6em;
  color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.45rem); }

p { margin: 0 0 1em; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 100;
  background: var(--accent);
  color: var(--bg-page);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-lg);
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 0.75rem;
}

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.4rem;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--accent);
  color: #241c14;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: #f0b572;
  border-color: #f0b572;
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: rgba(244, 237, 228, 0.25);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---------- Public header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(27, 23, 20, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(226, 162, 91, 0.18);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--text-primary);
}

.brand:hover { text-decoration: none; }

.brand-mark {
  width: 30px;
  height: 30px;
  color: var(--accent);
  flex: 0 0 auto;
}

.site-nav {
  display: flex;
  gap: 1.75rem;
  align-items: center;
}

.site-nav a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--kromka);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 3rem;
  align-items: center;
  padding-block: 4.5rem;
}

.hero-eyebrow {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.82rem;
  margin-bottom: 1rem;
}

.hero-lead {
  color: var(--text-muted);
  font-size: 1.15rem;
  max-width: 30ch;
}

.hero-actions {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
}

.hero-note {
  margin-top: 1.4rem;
  color: var(--text-faint);
  font-size: 0.9rem;
}

.hero-visual {
  position: relative;
}

.hero-visual img,
.gallery-card img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-lg);
}

.hero-credit {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.82rem;
  color: var(--text-faint);
}

/* ---------- Sections ---------- */
.section {
  padding-block: 6rem;
}

.section-alt {
  background: var(--bg-card);
}

.section-head {
  max-width: 46ch;
  margin-bottom: 2.5rem;
}

.section-kicker {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.8rem;
  margin-bottom: 0.6rem;
}

.section-lead {
  color: var(--text-muted);
}

/* ---------- Stages ---------- */
.stages {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  counter-reset: stage;
}

.stage {
  position: relative;
  padding: 1.5rem 1.25rem 1.5rem 0;
  border-top: 1px solid rgba(226, 162, 91, 0.3);
  transition: background 0.15s ease;
}

.stage:first-child {
  border-top-left-radius: var(--radius-lg);
}

.stage::before {
  counter-increment: stage;
  content: counter(stage, decimal-leading-zero);
  display: block;
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
  transition: transform 0.15s ease, color 0.15s ease;
}

.stage:hover {
  background: rgba(226, 162, 91, 0.06);
}

.stage:hover::before {
  transform: translateY(-2px);
}

.stage h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.02rem;
  margin-bottom: 0.3rem;
}

.stage p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

.stage-sub {
  font-size: 0.82rem;
  color: var(--text-faint);
  margin-top: 0.4rem !important;
}

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.gallery-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(244, 237, 228, 0.06);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.gallery-card:hover {
  transform: translateY(-4px);
  border-color: var(--kromka);
}

.gallery-card-body {
  padding: 1.15rem 1.25rem 1.25rem;
}

.gallery-card h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.gallery-card .cat {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.gallery-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.gallery-card .credit {
  font-size: 0.8rem;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.warranty {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: var(--ok);
  font-weight: 600;
}

/* ---------- Lead form ---------- */
.lead-form-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.form-card {
  background: var(--bg-card);
  border: 1px solid rgba(226, 162, 91, 0.2);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.field {
  margin-bottom: 1.25rem;
}

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.4rem;
}

.field input,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.9rem;
  background: var(--bg-page);
  border: 1px solid rgba(244, 237, 228, 0.18);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
  outline: none;
}

.field .hint {
  font-size: 0.82rem;
  color: var(--text-faint);
  margin-top: 0.35rem;
}

.field .error {
  font-size: 0.85rem;
  color: var(--danger);
  margin-top: 0.35rem;
  font-weight: 500;
}

.field input[aria-invalid="true"] {
  border-color: var(--danger);
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-note {
  font-size: 0.85rem;
  color: var(--text-faint);
  margin-top: 1rem;
}

.form-cta {
  width: 100%;
}

.lead-aside {
  color: var(--text-muted);
}

.lead-aside ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.lead-aside li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.8rem;
}

.lead-aside li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid rgba(226, 162, 91, 0.18);
  padding-block: 2.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
  align-items: center;
}

.site-footer a {
  color: var(--text-muted);
}

.site-footer a:hover {
  color: var(--accent);
}

/* ---------- Admin shell ---------- */
.admin-body {
  display: grid;
  grid-template-columns: 16rem 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  background: var(--bg-card);
  border-right: 1px solid rgba(244, 237, 228, 0.08);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.admin-sidebar .brand {
  font-size: 1.15rem;
  padding-inline: 0.5rem;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  font-weight: 500;
}

.admin-nav a:hover {
  background: rgba(244, 237, 228, 0.05);
  color: var(--text-primary);
  text-decoration: none;
}

.admin-nav a.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.sidebar-logout {
  margin-top: auto;
}

.count-inline {
  margin-top: 1rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.admin-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 2rem;
  border-bottom: 1px solid rgba(244, 237, 228, 0.08);
  min-height: 68px;
}

.admin-topbar h1 {
  font-family: var(--font-body);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0;
}

.admin-topbar .user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.admin-content {
  padding: 1.75rem 2rem;
  max-width: 1100px;
  width: 100%;
}

/* ---------- Applications table ---------- */
.app-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.app-search {
  flex: 1;
  min-width: 220px;
}

.app-search input {
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid rgba(244, 237, 228, 0.18);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(244, 237, 228, 0.08);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}

table.apps {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

table.apps thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--bg-card);
  box-shadow: inset 0 -1px 0 rgba(244, 237, 228, 0.12);
}

table.apps tbody td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(244, 237, 228, 0.06);
  vertical-align: middle;
}

table.apps tbody tr {
  height: 56px;
}

table.apps tbody tr:hover {
  background: rgba(244, 237, 228, 0.03);
}

table.apps .num {
  font-variant-numeric: tabular-nums;
}

table.apps .initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.82rem;
}

.app-status-cell {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.empty-state {
  text-align: left;
  padding: 3rem 2rem;
  color: var(--text-muted);
}

.empty-state h2 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.pagination a {
  color: var(--text-muted);
  padding: 0.4rem 0.7rem;
  border: 1px solid rgba(244, 237, 228, 0.18);
  border-radius: var(--radius-lg);
}

.pagination a:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

.pagination .current {
  color: var(--accent);
  font-weight: 600;
}

.pagination .count {
  margin-left: auto;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* ---------- Status scale ---------- */
.status-scale {
  display: flex;
  gap: 0;
  margin-block: 1.25rem 1.75rem;
  flex-wrap: wrap;
}

.status-tick {
  position: relative;
  flex: 1;
  min-width: 130px;
  padding-top: 0.9rem;
}

.status-tick::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(244, 237, 228, 0.15);
  border-radius: 2px;
}

.status-tick.done::before {
  background: var(--accent);
}

.status-tick.current::before {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(226, 162, 91, 0.6);
}

.status-tick .tick-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.status-tick.done .tick-label,
.status-tick.current .tick-label {
  color: var(--text-primary);
}

.status-tick .tick-date {
  font-size: 0.78rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* ---------- Detail card ---------- */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.detail-block {
  background: var(--bg-card);
  border: 1px solid rgba(244, 237, 228, 0.08);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.detail-block h2 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.6rem;
  border-bottom: 1px solid rgba(244, 237, 228, 0.06);
}

.detail-row dt {
  color: var(--text-muted);
}

.detail-row dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.contact-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid rgba(226, 162, 91, 0.2);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
}

.login-card .brand {
  margin-bottom: 1.5rem;
}

.login-error {
  background: rgba(224, 139, 122, 0.12);
  border: 1px solid rgba(224, 139, 122, 0.4);
  color: var(--danger);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

/* ---------- Thanks / Licenses ---------- */
.thanks-hero,
.licenses-page {
  padding-block: 5rem;
}

.thanks-card {
  max-width: 640px;
  background: var(--bg-card);
  border: 1px solid rgba(226, 162, 91, 0.2);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
}

.license-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
}

.license-list li {
  background: var(--bg-card);
  border: 1px solid rgba(244, 237, 228, 0.08);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
}

.license-list .title {
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.license-list .meta {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.license-list .license {
  color: var(--ok);
  font-size: 0.85rem;
  font-weight: 600;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .admin-body {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid rgba(244, 237, 228, 0.08);
  }
  .admin-nav {
    flex-direction: row;
    gap: 0.4rem;
  }
  .admin-nav a {
    min-height: 40px;
    white-space: nowrap;
  }
  .hero-grid,
  .lead-form-wrap,
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .stages {
    grid-template-columns: repeat(3, 1fr);
  }
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .site-nav {
    display: none;
  }
  .stages {
    grid-template-columns: 1fr;
  }
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  .admin-topbar,
  .admin-content {
    padding-inline: 1rem;
  }
  .pagination .count {
    margin-left: 0;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
