:root {
  --bg: #090e14;
  --bg-deep: #05080d;
  --surface: rgba(18, 24, 35, 0.88);
  --line: rgba(255, 255, 255, 0.1);
  --text: #f3f5f8;
  --muted: #aeb7c7;
  --accent: #d44a43;
  --accent-soft: rgba(212, 74, 67, 0.14);
  --gold: #d5b071;
  --gold-soft: rgba(213, 176, 113, 0.12);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(212, 74, 67, 0.22), transparent 28%),
    radial-gradient(circle at top left, rgba(213, 176, 113, 0.14), transparent 24%),
    linear-gradient(180deg, #0d131b 0%, var(--bg) 42%, var(--bg-deep) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.02) 25%, transparent 25%) 0 0 / 26px 26px,
    linear-gradient(315deg, rgba(255, 255, 255, 0.015) 25%, transparent 25%) 0 0 / 26px 26px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 88%);
  pointer-events: none;
  z-index: -1;
}

a {
  color: inherit;
  text-decoration: none;
}

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

h1,
h2,
h3 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  line-height: 1.08;
}

.container {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(20px);
  background: rgba(8, 11, 17, 0.8);
  border-bottom: 1px solid var(--line);
}

.nav-shell,
.footer-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-shell {
  min-height: 78px;
  padding: 0.9rem 0;
}

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

.brand-title {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.2rem;
  font-weight: 700;
}

.brand-subtitle,
.nav-links a,
.section-copy,
.card p,
.hero-panel p,
.stat-copy,
.gallery-caption span {
  color: var(--muted);
}

.brand-subtitle {
  font-size: 0.84rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-utility {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.nav-links a {
  transition: color 180ms ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text);
}

.hero {
  padding: clamp(4.6rem, 8vw, 7rem) 0 3.5rem;
}

.hero-shell,
.stats-grid,
.two-col,
.timeline,
.gallery-layout {
  display: grid;
  gap: 1.15rem;
}

.hero-shell {
  grid-template-columns: minmax(0, 1.28fr) minmax(300px, 0.92fr);
}

.hero-copy,
.hero-panel,
.card,
.table-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.025));
  box-shadow: var(--shadow);
}

.hero-copy,
.hero-panel,
.card {
  padding: clamp(1.4rem, 4vw, 2rem);
}

.eyebrow,
.section-label,
.pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.eyebrow,
.section-label {
  padding: 0.55rem 0.8rem;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow::before,
.section-label::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  box-shadow: 0 0 0 0.28rem rgba(212, 74, 67, 0.12);
}

.hero-copy h1 {
  margin-top: 1rem;
  font-size: clamp(2.8rem, 5vw, 5rem);
  max-width: 11ch;
}

.hero-copy p,
.section-copy,
.card p {
  line-height: 1.8;
}

.hero-actions,
.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.hero-actions {
  margin-top: 1.6rem;
}

.hero-pills {
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.95rem 1.25rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.btn-small {
  padding: 0.72rem 1rem;
  font-size: 0.88rem;
}

.btn:hover,
.btn:focus-visible,
.gallery-card:hover,
.gallery-card:focus-within {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, #b53a33, #7a2223);
  border-color: rgba(213, 176, 113, 0.28);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
}

.pill,
.status-pill {
  padding: 0.48rem 0.8rem;
  font-size: 0.82rem;
}

.status-pill {
  color: var(--gold);
  border-color: rgba(213, 176, 113, 0.22);
  background: var(--gold-soft);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.field label {
  font-size: 0.92rem;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 0.95rem 1rem;
  font: inherit;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(213, 176, 113, 0.45);
  box-shadow: 0 0 0 4px rgba(213, 176, 113, 0.08);
}

.editor-card {
  margin-top: 1.5rem;
}

.editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.editor-copy,
.editor-status,
.section-status,
.section-note {
  color: var(--muted);
  line-height: 1.65;
}

.editor-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.2rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.form-grid.three-up {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.editor-actions,
.status-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.status-row {
  justify-content: space-between;
  margin-top: 1.1rem;
}

.empty-state {
  margin-top: 1.15rem;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.panel-kicker,
.stat-label,
.journal-date {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.stat-label {
  color: var(--muted);
}

.panel-kicker,
.journal-date {
  color: var(--gold);
}

.hero-panel h2,
.card h3 {
  margin-top: 0.9rem;
}

.hero-panel h2 {
  font-size: 2rem;
}

.stack-list {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.1rem;
}

.stack-list div {
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.stack-list strong {
  display: block;
}

.stack-list span {
  display: block;
  margin-top: 0.32rem;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.94rem;
}

.section {
  padding: clamp(4rem, 7vw, 6.4rem) 0;
}

.section.alt {
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.section-heading {
  margin-top: 1rem;
  font-size: clamp(2rem, 4vw, 3rem);
  max-width: 15ch;
}

.section-copy {
  margin: 1rem 0 0;
  max-width: 64ch;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 1.8rem;
}

.stat-value {
  margin-top: 0.7rem;
  font-size: clamp(1.55rem, 4vw, 2.6rem);
  font-weight: 700;
}

.two-col {
  grid-template-columns: 1.15fr 0.85fr;
  margin-top: 1.15rem;
}

.timeline,
.parts-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1.8rem;
}

.journal-entry {
  display: grid;
  gap: 0.95rem;
}

.journal-head,
.journal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.journal-entry p {
  margin: 0;
}

.journal-toolbar {
  display: inline-flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.journal-date::before {
  content: "";
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.45rem;
  border-radius: 999px;
  background: var(--accent);
}

.gallery-layout {
  grid-template-columns: 1.15fr 0.85fr;
  margin-top: 1.8rem;
  align-items: start;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.gallery-card {
  overflow: hidden;
}

.gallery-card img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.gallery-card a {
  display: block;
}

.gallery-caption {
  padding: 1rem 1.15rem 1.2rem;
}

.gallery-caption strong {
  display: block;
}

.gallery-caption time {
  display: inline-block;
  margin-bottom: 0.45rem;
  color: var(--gold);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.table-shell {
  overflow-x: auto;
}

.parts-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.parts-table th,
.parts-table td {
  padding: 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.parts-table thead th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.parts-table tfoot th,
.parts-table tfoot td {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: none;
  background: rgba(0, 0, 0, 0.16);
}

.parts-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.parts-table tbody td {
  line-height: 1.55;
}

.cost-cell {
  white-space: nowrap;
  font-weight: 700;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.action-btn:hover,
.action-btn:focus-visible {
  background: rgba(255, 255, 255, 0.09);
}

.notes-copy {
  display: block;
  margin-top: 0.32rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.status-label {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.38rem 0.72rem;
  border: 1px solid rgba(213, 176, 113, 0.2);
  background: rgba(213, 176, 113, 0.08);
  color: var(--gold);
  font-size: 0.8rem;
}

.auth-on {
  color: #91d7a0;
  border-color: rgba(145, 215, 160, 0.3);
  background: rgba(145, 215, 160, 0.08);
}

.auth-off {
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.4rem 0 2rem;
  color: var(--muted);
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 550ms ease, transform 550ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .hero-shell,
  .two-col,
  .gallery-layout,
  .timeline,
  .parts-layout {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .form-grid,
  .form-grid.three-up {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    font-size: clamp(2.4rem, 14vw, 3.5rem);
  }

  .section-heading {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}
