:root {
  --ink: #101010;
  --coal: #171717;
  --charcoal: #242424;
  --ivory: #f7f3ea;
  --paper: #fffdf8;
  --sand: #e8dec8;
  --line: rgba(16, 16, 16, 0.14);
  --line-light: rgba(255, 253, 248, 0.16);
  --copper: #c87b34;
  --gold: #c6a11f;
  --rose: #e7b8a8;
  --muted: #6f6a61;
  --max: 1120px;
  --font-primary: "Avenir Next", Montserrat, Futura, "Century Gothic", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.is-authenticated {
  background: var(--paper);
}

body.admin-mode {
  background: #111;
}

[hidden] {
  display: none !important;
}

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

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.section-dark {
  color: var(--ivory);
  background-color: var(--coal);
  background-image: linear-gradient(120deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0)), url("assets/dark-texture.png");
  background-size: cover;
  background-position: center;
}

.public-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(28px, 6vw, 72px);
}

.gate-header,
.zone-header {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 18px clamp(24px, 5vw, 64px);
  border-bottom: 1px solid var(--line-light);
}

.zone-header {
  position: sticky;
  z-index: 10;
  top: 0;
  color: var(--ivory);
  background: rgba(16, 16, 16, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  width: 138px;
  flex: 0 0 auto;
}

.brand img {
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.24));
}

.gate-hero {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 430px);
  gap: clamp(48px, 9vw, 120px);
  align-items: center;
  padding: clamp(72px, 12vw, 140px) 0 clamp(64px, 8vw, 96px);
}

.minimal-gate {
  width: min(540px, 100%);
  min-height: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(34px, 7vw, 54px);
  align-items: center;
  justify-items: center;
  padding: 0;
}

.gate-logo {
  width: min(260px, 58vw);
}

.gate-logo img {
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.35));
}

.gate-copy {
  max-width: 760px;
}

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

.eyebrow {
  margin: 0 0 18px;
  color: var(--copper);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-primary);
  font-weight: 500;
  letter-spacing: 0.01em;
}

h1 {
  max-width: 820px;
  margin-bottom: 24px;
  font-size: clamp(38px, 5.4vw, 68px);
  line-height: 1.04;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.14;
}

h3 {
  margin-bottom: 12px;
  font-size: 20px;
  line-height: 1.22;
}

.lead {
  max-width: 680px;
  margin-bottom: 0;
  color: rgba(247, 243, 234, 0.76);
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.68;
}

.access-panel,
.panel,
.admin-card {
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.94);
  color: var(--ink);
}

.access-panel {
  padding: 34px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.22);
}

.access-note {
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.access-form label,
.admin-card label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.code-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.minimal-access {
  width: min(520px, 100%);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
}

.minimal-access input {
  min-height: 48px;
  color: var(--ivory);
  background: rgba(16, 16, 16, 0.32);
  border-color: var(--line-light);
}

.minimal-access input::placeholder {
  color: rgba(247, 243, 234, 0.52);
}

.minimal-access input:focus {
  border-color: rgba(198, 161, 31, 0.78);
  box-shadow: 0 0 0 3px rgba(198, 161, 31, 0.11);
}

.minimal-access .form-message {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--rose);
}

input {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: none;
}

input:focus {
  border-color: rgba(198, 161, 31, 0.75);
  box-shadow: 0 0 0 3px rgba(198, 161, 31, 0.13);
}

button,
.quiet-link {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  color: var(--ink);
  background: linear-gradient(135deg, var(--rose), var(--gold));
  border: 1px solid transparent;
  border-radius: 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.text-button {
  min-height: auto;
  padding: 0;
  color: rgba(247, 243, 234, 0.78);
  background: transparent;
  border: 0;
}

.form-message {
  min-height: 22px;
  margin: 12px 0 0;
  color: #8b372c;
  font-size: 13px;
}

.contact-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.contact-line a {
  color: var(--ink);
  font-weight: 500;
}

.zone-nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.6vw, 34px);
  color: rgba(247, 243, 234, 0.72);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.zone-nav a:hover,
.text-button:hover {
  color: var(--rose);
}

.client-hero,
.admin-hero {
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 440px);
  gap: clamp(40px, 7vw, 84px);
  align-items: end;
  padding: 118px clamp(24px, 5vw, 64px) 72px;
}

.client-hero > *,
.admin-hero > * {
  width: min(var(--max), 100%);
}

.status-grid {
  display: grid;
  gap: 1px;
  background: var(--line-light);
  border: 1px solid var(--line-light);
}

.status-grid div {
  display: grid;
  gap: 6px;
  padding: 22px;
  background: rgba(16, 16, 16, 0.58);
}

.status-grid span {
  color: rgba(247, 243, 234, 0.58);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-grid strong {
  color: var(--ivory);
  font-size: 18px;
  font-weight: 500;
}

.dashboard-section,
.content-section,
.contact-section,
.admin-grid {
  padding: clamp(72px, 8vw, 112px) clamp(24px, 5vw, 64px);
}

.dashboard-grid,
.section-head,
.project-grid,
.split-layout,
.document-list,
.event-grid,
.module-grid,
.process-list,
.timeline,
.admin-grid,
.contact-section {
  width: min(var(--max), 100%);
  margin: 0 auto;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.panel {
  min-height: 260px;
  padding: clamp(26px, 3vw, 36px);
}

.primary-panel {
  grid-row: span 1;
}

.panel h2 {
  font-size: clamp(26px, 3vw, 38px);
}

.panel p,
.project-grid p,
.split-layout p,
.module-grid p,
.process-list p,
.event-grid p,
.document-list p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.section-head {
  margin-bottom: clamp(34px, 5vw, 58px);
}

.section-head.narrow {
  max-width: 760px;
  margin-left: max(24px, calc((100vw - var(--max)) / 2));
}

.section-head.narrow p:last-child {
  max-width: 620px;
  color: rgba(247, 243, 234, 0.74);
}

.muted-section {
  background: var(--ivory);
}

.project-grid,
.module-grid,
.event-grid {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.project-grid {
  grid-template-columns: repeat(3, 1fr);
}

.project-grid article,
.module-grid article,
.event-grid article {
  min-height: 260px;
  padding: clamp(24px, 3vw, 34px);
  background: var(--paper);
}

.project-grid span,
.event-grid span {
  display: block;
  margin-bottom: 40px;
  color: var(--copper);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.86fr) minmax(320px, 1fr);
  gap: clamp(40px, 7vw, 88px);
  align-items: center;
}

.data-panel {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fffdf8, #f1eadb);
  box-shadow: 0 22px 70px rgba(16, 16, 16, 0.08);
}

.panel-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.panel-top span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-top strong {
  font-size: 20px;
  font-weight: 500;
}

.node-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  padding: 24px;
}

.node-grid span {
  min-height: 74px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(198, 161, 31, 0.34);
  color: var(--charcoal);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 48px;
  border-top: 1px solid var(--line-light);
  border-bottom: 1px solid var(--line-light);
}

.timeline div {
  min-height: 158px;
  padding: 26px;
  border-right: 1px solid var(--line-light);
}

.timeline div:last-child {
  border-right: 0;
}

.timeline strong {
  display: block;
  margin-bottom: 16px;
  color: var(--rose);
  font-size: 24px;
  font-weight: 500;
}

.timeline span {
  color: rgba(247, 243, 234, 0.7);
  font-size: 14px;
  line-height: 1.55;
}

.document-list {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.document-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 24px;
  background: var(--paper);
}

.document-item strong {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}

.document-item a {
  color: var(--copper);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.module-grid {
  grid-template-columns: repeat(4, 1fr);
}

.module-grid article {
  min-height: 218px;
}

.process-list {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.process-list div {
  display: grid;
  grid-template-columns: 72px 0.82fr 1.45fr;
  gap: 26px;
  align-items: baseline;
  padding: 26px;
  background: var(--paper);
}

.process-list span {
  color: var(--copper);
  font-size: 20px;
  font-weight: 500;
}

.process-list h3,
.process-list p {
  margin-bottom: 0;
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto;
  gap: 32px;
  align-items: end;
}

.admin-label {
  color: rgba(247, 243, 234, 0.68);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-hero {
  grid-template-columns: 1fr;
  min-height: 420px;
  align-items: end;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.admin-card {
  padding: 28px;
}

.admin-card h2 {
  margin-bottom: 26px;
  font-size: 26px;
}

.admin-card input {
  margin-bottom: 14px;
}

.admin-card > button {
  margin-top: 4px;
}

.item-list {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.managed-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.managed-item button {
  min-height: 34px;
  padding: 8px 10px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

@media (max-width: 980px) {
  .gate-hero,
  .client-hero,
  .dashboard-grid,
  .project-grid,
  .split-layout,
  .timeline,
  .contact-section,
  .admin-grid {
    grid-template-columns: 1fr;
  }

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

  .zone-nav {
    display: none;
  }

  .timeline div {
    border-right: 0;
    border-bottom: 1px solid var(--line-light);
  }

  .timeline div:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 640px) {
  .gate-header,
  .zone-header {
    min-height: 72px;
    padding: 16px 20px;
  }

  .brand {
    width: 118px;
  }

  .gate-hero {
    width: calc(100% - 40px);
    padding-top: 52px;
  }

  .minimal-gate {
    width: 100%;
    padding-top: 0;
  }

  h1 {
    font-size: 34px;
    line-height: 1.1;
  }

  h2 {
    font-size: 28px;
  }

  .code-row,
  .minimal-access,
  .document-item,
  .process-list div {
    grid-template-columns: 1fr;
  }

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

  .access-panel {
    padding: 24px;
  }
}
