:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  --canvas: #e7e9e5;
  --canvas-deep: #daddd8;
  --panel: #f7f8f5;
  --rail: #243f35;
  --rail-deep: #1d332b;
  --green: #2f654e;
  --green-hover: #254f3d;
  --green-soft: #e3ece7;
  --brass: #a8844c;
  --text: #202c28;
  --muted: #65716c;
  --muted-strong: #45534d;
  --line: rgb(55 75 67 / 15%);
  --line-strong: rgb(55 75 67 / 25%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  background:
    linear-gradient(90deg, rgb(58 78 69 / 5%) 1px, transparent 1px),
    linear-gradient(rgb(58 78 69 / 5%) 1px, transparent 1px),
    radial-gradient(circle at 72% 32%, rgb(255 255 255 / 82%), transparent 34rem),
    linear-gradient(145deg, var(--canvas), var(--canvas-deep));
  background-size: 64px 64px, 64px 64px, auto, auto;
  color: var(--text);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

.access-shell {
  display: grid;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  padding: max(1.5rem, env(safe-area-inset-top)) clamp(1rem, 4vw, 3rem) max(1.5rem, env(safe-area-inset-bottom));
  place-items: center;
}

.access-panel {
  position: relative;
  width: min(100%, 57rem);
  min-height: min(34rem, calc(100svh - 3rem));
  display: grid;
  grid-template-columns: minmax(12rem, 0.72fr) minmax(0, 1.6fr);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 0.65rem;
  background: var(--panel);
  box-shadow:
    0 1.8rem 5rem rgb(40 52 47 / 16%),
    0 1px 0 rgb(255 255 255 / 82%) inset;
}

.brand-rail {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(1.6rem, 4vw, 2.5rem);
  overflow: hidden;
  background:
    linear-gradient(145deg, rgb(255 255 255 / 4%), transparent 55%),
    linear-gradient(155deg, var(--rail), var(--rail-deep));
  color: #f4f5f1;
}

.brand-rail::before,
.brand-rail::after {
  position: absolute;
  border: 1px solid rgb(255 255 255 / 8%);
  content: "";
  pointer-events: none;
  transform: rotate(45deg);
}

.brand-rail::before {
  right: -7rem;
  bottom: -2rem;
  width: 15rem;
  height: 15rem;
}

.brand-rail::after {
  right: -3.25rem;
  bottom: 1.75rem;
  width: 7.5rem;
  height: 7.5rem;
  border-color: rgb(168 132 76 / 24%);
}

.brand-mark {
  position: relative;
  z-index: 1;
  display: grid;
  width: 3rem;
  height: 3rem;
  border: 1px solid rgb(255 255 255 / 24%);
  background: rgb(255 255 255 / 7%);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  place-items: center;
}

.brand-mark::after {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 0.72rem;
  height: 0.72rem;
  border-top: 1px solid var(--brass);
  border-left: 1px solid var(--brass);
  background: var(--rail-deep);
  content: "";
}

.brand-name {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.22rem;
  margin-top: 1rem;
}

.brand-name strong {
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.brand-name span {
  color: rgb(232 238 233 / 60%);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.rail-index {
  position: relative;
  z-index: 1;
  margin: auto 0 0;
  color: rgb(232 238 233 / 46%);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
}

.access-stage {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: clamp(1.6rem, 4vw, 2.5rem) clamp(1.75rem, 6vw, 4.25rem);
}

.stage-header,
.stage-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.67rem;
  letter-spacing: 0.04em;
}

.stage-header {
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--line);
}

.availability {
  display: flex;
  align-items: center;
  gap: 0.48rem;
}

.availability i,
.route-state i {
  width: 0.38rem;
  height: 0.38rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgb(47 101 78 / 9%);
}

.access-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  padding: clamp(3.5rem, 10vh, 5.5rem) 0 clamp(3rem, 8vh, 4.5rem);
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--green);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.access-content h1,
.vault-shell h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 2.6rem);
  font-weight: 470;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.subtitle {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  line-height: 1.6;
}

.primary-action {
  display: flex;
  width: 100%;
  min-height: 3.45rem;
  align-items: center;
  justify-content: space-between;
  margin-top: clamp(2.25rem, 6vh, 3.2rem);
  padding: 0.7rem 0.75rem 0.7rem 1.25rem;
  border: 1px solid var(--green);
  border-radius: 0.28rem;
  background: var(--green);
  box-shadow: 0 0.8rem 1.8rem rgb(47 101 78 / 18%);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.primary-action:hover {
  border-color: var(--green-hover);
  background: var(--green-hover);
  box-shadow: 0 0.95rem 2.1rem rgb(47 101 78 / 23%);
  transform: translateY(-1px);
}

.primary-action:active {
  transform: translateY(0);
}

.primary-action:focus-visible,
.vault-brand:focus-visible,
.vault-footer a:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 4px;
}

.action-arrow {
  display: grid;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgb(255 255 255 / 18%);
  background: rgb(255 255 255 / 7%);
  place-items: center;
}

.access-note {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.stage-footer {
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
}

/* Vault shell */
.vault-page {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.vault-header,
.vault-footer {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem clamp(1.25rem, 4vw, 3.5rem);
  background: rgb(247 248 245 / 78%);
}

.vault-header {
  border-bottom: 1px solid var(--line);
}

.vault-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: 0.25rem;
  text-decoration: none;
}

.vault-brand .brand-mark {
  width: 2.45rem;
  height: 2.45rem;
  border-color: var(--line-strong);
  background: var(--rail);
  font-size: 0.64rem;
}

.vault-brand .brand-mark::after {
  background: var(--panel);
}

.vault-brand > span:last-child {
  display: grid;
  gap: 0.06rem;
}

.vault-brand strong {
  font-size: 0.78rem;
  font-weight: 650;
}

.vault-brand small {
  color: var(--muted);
  font-size: 0.64rem;
}

.route-state {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.vault-main {
  display: grid;
  padding: clamp(2rem, 6vw, 5rem) clamp(1.25rem, 6vw, 6rem);
  place-items: center;
}

.vault-shell {
  position: relative;
  width: min(100%, 58rem);
  min-height: 24rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 6vw, 4.5rem);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 0.55rem;
  background: var(--panel);
  box-shadow: 0 1.5rem 4.5rem rgb(40 52 47 / 12%);
}

.vault-shell::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 26%;
  height: 0.24rem;
  background: linear-gradient(90deg, var(--green), var(--brass));
  content: "";
}

.vault-shell h1 {
  max-width: 13ch;
  font-size: clamp(2rem, 5vw, 3.15rem);
}

.vault-intro {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 2vw, 1.08rem);
}

.vault-boundary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: clamp(3.5rem, 9vw, 6.5rem);
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  color: var(--muted-strong);
  font-size: 0.7rem;
  letter-spacing: 0.03em;
}

.boundary-state {
  color: var(--green);
}

.vault-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.68rem;
}

.vault-footer a {
  color: var(--muted-strong);
  text-underline-offset: 0.25rem;
}

@media (max-width: 680px) {
  body {
    background-size: 48px 48px, 48px 48px, auto, auto;
  }

  .access-shell {
    padding-inline: 0.75rem;
  }

  .access-panel {
    min-height: calc(100svh - 1.5rem);
    grid-template-columns: 1fr;
  }

  .brand-rail {
    min-height: 7.25rem;
    display: grid;
    grid-template-columns: auto 1fr;
    align-content: center;
    align-items: center;
    column-gap: 0.8rem;
    padding: 1.25rem 1.4rem;
  }

  .brand-name {
    margin: 0;
  }

  .rail-index {
    position: absolute;
    top: 1.25rem;
    right: 1.4rem;
    margin: 0;
  }

  .access-stage {
    padding: 1.35rem 1.4rem;
  }

  .access-content {
    padding: clamp(3rem, 11vh, 5rem) 0;
  }

  .access-content h1 {
    font-size: clamp(1.9rem, 9vw, 2.3rem);
  }

  .vault-header,
  .vault-footer {
    padding-inline: 1rem;
  }

  .route-state {
    font-size: 0;
  }

  .route-state i {
    width: 0.45rem;
    height: 0.45rem;
  }

  .vault-main {
    padding: 1rem;
  }

  .vault-shell {
    min-height: 62vh;
  }

  .vault-boundary {
    align-items: flex-start;
    flex-direction: column;
    margin-top: 4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
