:root {
  color-scheme: dark;
  font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
  --surface: #050505;
  --surface-low: #0b0b0b;
  --surface-panel: rgba(18, 18, 18, 0.84);
  --surface-panel-high: rgba(36, 39, 42, 0.74);
  --line: rgba(220, 226, 229, 0.12);
  --line-strong: rgba(240, 90, 0, 0.45);
  --text: #eef3f5;
  --muted: #8f979c;
  --steel: #b9c3c9;
  --orange: #f05a00;
  --orange-dark: #c74800;
  --boyer-red: #c9141b;
  --paper: #f7f4f2;
  background: var(--surface);
  color: var(--text);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 58% 34%, rgba(240, 90, 0, 0.07), transparent 32%),
    radial-gradient(circle at 42% 72%, rgba(185, 195, 201, 0.04), transparent 34%),
    var(--surface);
}

body::before {
  content: "BOYER";
  position: fixed;
  left: -10vw;
  top: 56%;
  z-index: -1;
  width: 140vw;
  color: rgba(255, 255, 255, 0.035);
  font-family: Montserrat, Inter, Segoe UI, sans-serif;
  font-size: clamp(8rem, 26vw, 34rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.75;
  transform: translateY(-8%);
}

button,
input,
select {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.public-card-route .shell {
  display: block;
}

.public-card-route .sidebar,
.public-card-route #admin-view {
  display: none;
}

.public-card-route .workspace {
  min-height: 100vh;
  padding: 0;
}

.public-card-route #public-view {
  display: block;
}

.public-card-route .public-stage {
  min-height: 100vh;
  padding: 32px 16px;
}

html:not(.public-card-route) #public-view {
  display: none;
}

html.admin-route body:not(.admin-unlocked) .shell {
  display: block;
}

html.admin-route body:not(.admin-unlocked) .sidebar {
  display: none;
}

html.admin-route body:not(.admin-unlocked) .workspace {
  min-height: 100vh;
  padding: 0;
}

html.admin-route body:not(.admin-unlocked) #admin-view {
  display: block;
}

html.admin-route body:not(.admin-unlocked) .login-gate {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 30px;
  min-height: 100vh;
  overflow: hidden;
  padding: 48px 20px;
}

.card-loading.public-card-route .contact-card,
.card-loading.public-card-route .save-contact,
.card-loading.public-card-route .public-footer {
  opacity: 0;
}

.login-gate {
  display: none;
}

.admin-locked .admin-grid,
.admin-locked .toolbar,
.admin-locked #new-card-button,
.admin-locked #sign-out-button {
  display: none;
}

.admin-locked .shell {
  display: block;
}

.admin-locked .sidebar {
  display: none;
}

.admin-locked .workspace {
  min-height: 100vh;
  padding: 0;
}

.admin-locked .login-gate {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 30px;
  min-height: 100vh;
  overflow: hidden;
  padding: 48px 20px;
}

.admin-locked .login-gate::before {
  content: "BOYER";
  position: absolute;
  left: -12vw;
  bottom: -8vw;
  z-index: 0;
  color: rgba(255, 255, 255, 0.035);
  font-family: Montserrat, Inter, Segoe UI, sans-serif;
  font-size: clamp(9rem, 28vw, 34rem);
  font-weight: 900;
  line-height: 0.72;
}

.login-brand,
.login-panel,
.login-links {
  position: relative;
  z-index: 1;
}

.login-brand {
  display: grid;
  justify-items: center;
  text-align: center;
}

.login-brand h2 {
  color: var(--orange);
  font-size: clamp(2.9rem, 7vw, 5rem);
  font-weight: 900;
  line-height: 0.95;
  margin: 0;
}

.login-brand span {
  width: min(100%, 310px);
  height: 4px;
  margin: 10px 0 8px;
  background: rgba(255, 255, 255, 0.12);
}

.login-brand p {
  color: var(--steel);
  font-weight: 800;
  margin: 0 0 18px;
}

.login-brand strong {
  color: rgba(238, 243, 245, 0.32);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.login-panel {
  width: min(100%, 620px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 7px solid var(--orange);
  border-radius: 8px;
  background: rgba(17, 17, 17, 0.94);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.52);
  padding: 36px 40px 34px;
  text-align: center;
}

.login-panel h3 {
  color: #ffffff;
  font-size: 1.85rem;
  margin: 0 0 10px;
}

.login-copy,
.login-policy {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.login-principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 36px 0 30px;
}

.login-principles div {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.login-principles span {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(238, 243, 245, 0.5);
  font-size: 1.25rem;
}

.login-principles strong {
  color: rgba(238, 243, 245, 0.36);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.login-sso-button {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: var(--orange);
  color: #ffffff;
  cursor: pointer;
  font-weight: 900;
  min-height: 58px;
  padding: 14px 18px;
}

.login-sso-button:hover {
  background: var(--orange-dark);
}

.domain-rule {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  margin: 34px 0 22px;
}

.domain-rule span {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.domain-rule strong {
  color: rgba(238, 243, 245, 0.28);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-policy {
  font-size: 0.78rem;
}

.login-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  color: rgba(238, 243, 245, 0.28);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-links a {
  color: rgba(238, 243, 245, 0.32);
  text-decoration: none;
}

.login-links a:hover {
  color: var(--orange);
}

.admin-unlocked .admin-grid {
  display: grid;
}

.admin-unlocked .login-gate {
  display: none;
}

.sidebar {
  background: rgba(7, 7, 7, 0.92);
  border-right: 1px solid var(--line);
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px;
  backdrop-filter: blur(20px);
}

.brand {
  display: grid;
  gap: 14px;
}

.brand-logo {
  width: 180px;
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.42));
}

.eyebrow,
.company {
  margin: 0 0 4px;
  color: var(--orange);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sidebar-copy {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0;
}

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

h1 {
  margin-bottom: 0;
  font-family: Montserrat, Inter, Segoe UI, sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
}

h2 {
  margin-bottom: 6px;
  font-family: Montserrat, Inter, Segoe UI, sans-serif;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(212, 228, 250, 0.04);
  color: var(--text);
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
}

.nav-button.active,
.nav-button:hover {
  border-color: var(--line-strong);
  background: rgba(255, 87, 34, 0.14);
}

.workspace {
  padding: 34px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.public-stage {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 26px;
  min-height: calc(100vh - 68px);
  overflow: hidden;
  padding: 42px 0 38px;
}

.ghost-logo {
  position: absolute;
  left: 50%;
  top: 49%;
  z-index: 0;
  width: min(94vw, 980px);
  max-width: none;
  opacity: 0.055;
  pointer-events: none;
  transform: translate(-50%, -50%);
  filter: grayscale(1) brightness(1.9);
}

.contact-card {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --lift: 0px;
  width: min(100%, 440px);
  position: relative;
  z-index: 1;
  overflow: hidden;
  background:
    linear-gradient(180deg, var(--paper), var(--paper));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: #0f1114;
  transform:
    perspective(1100px)
    rotateX(var(--tilt-x))
    rotateY(var(--tilt-y))
    translateY(var(--lift));
  transform-origin: center center;
  transition: transform 180ms ease, box-shadow 180ms ease;
  will-change: transform;
}

.contact-card.is-tilting {
  box-shadow:
    0 34px 96px rgba(0, 0, 0, 0.54),
    0 0 44px rgba(255, 87, 34, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition-duration: 80ms;
}

.photo-header {
  position: relative;
  height: 450px;
  overflow: hidden;
  background: #111c29;
}

.profile-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.82) contrast(1.08);
}

.photo-divider {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  z-index: 1;
  display: block;
  width: 100%;
  height: 90px;
}

.identity-block {
  display: grid;
  justify-items: start;
  padding: 30px 42px 24px;
  text-align: left;
}

.identity-block h2 {
  color: #05070a;
  font-size: 1.72rem;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 8px;
}

.identity-block p {
  margin-bottom: 4px;
}

.identity-block #card-title {
  color: #12161a;
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-subtitle {
  color: #1b1f23;
  font-weight: 700;
  font-style: italic;
}

.card-logo {
  position: absolute;
  right: 20px;
  bottom: 0;
  z-index: 2;
  width: 145px;
  max-width: 30%;
  height: auto;
  opacity: 0.9;
}

.contact-list {
  display: grid;
  gap: 17px;
  margin: 0;
  padding: 0;
}

.contact-list a {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 16px;
  align-items: center;
  color: #202428;
  padding: 5px 20px;
  text-decoration: none;
}

.contact-list dt {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--orange);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(240, 90, 0, 0.22);
}

.contact-list dt svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.contact-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.save-contact,
.primary-action,
.secondary-action {
  border-radius: 6px;
  min-height: 46px;
  padding: 12px 18px;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.save-contact,
.primary-action {
  border: 1px solid var(--orange);
  background: var(--orange);
  color: #ffffff;
  box-shadow: 0 14px 32px rgba(255, 87, 34, 0.28);
}

.save-contact:hover,
.primary-action:hover {
  background: var(--orange-dark);
}

.secondary-action {
  border: 1px solid var(--line-strong);
  background: rgba(185, 195, 201, 0.06);
  color: var(--steel);
}

.save-contact {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  overflow: hidden;
  max-height: 65px;
  min-height: 40px;
  padding: 9px 17px;
  border-color: #ff7a24;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 42%),
    linear-gradient(135deg, var(--orange), var(--boyer-red));
  animation: ctaPulse 2.2s ease-in-out infinite;
}

.save-contact svg {
  position: relative;
  z-index: 1;
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.save-contact span {
  position: relative;
  z-index: 1;
}

@keyframes ctaPulse {
  0%,
  100% {
    box-shadow:
      0 12px 28px rgba(240, 90, 0, 0.28),
      0 0 0 0 rgba(240, 90, 0, 0.36);
  }

  50% {
    box-shadow:
      0 16px 38px rgba(240, 90, 0, 0.42),
      0 0 0 8px rgba(240, 90, 0, 0);
  }
}

.public-footer {
  color: rgba(212, 228, 250, 0.42);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.admin-status {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 6px 0 0;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(280px, 1fr);
  gap: 18px;
}

.editor-panel,
.list-panel {
  background: var(--surface-panel);
  border: 1px solid var(--line);
  border-top: 5px solid var(--orange);
  border-radius: 8px;
  padding: 18px;
  backdrop-filter: blur(20px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.editor-panel {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  border: 1px solid rgba(180, 202, 214, 0.26);
  border-radius: 4px;
  padding: 10px 11px;
  background: rgba(1, 15, 31, 0.86);
  color: var(--text);
}

input:focus,
select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 87, 34, 0.16);
  outline: none;
}

.list-panel {
  display: grid;
  gap: 10px;
  align-content: start;
}

.card-row {
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  padding: 14px;
  text-align: left;
  cursor: pointer;
}

.card-row:hover {
  border-color: var(--line-strong);
  background: rgba(240, 90, 0, 0.08);
}

.card-row span {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.card-row.muted {
  opacity: 0.78;
}

.status-pill {
  border: 1px solid rgba(240, 90, 0, 0.42);
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(255, 87, 34, 0.12);
  color: var(--steel);
  font-size: 0.8rem;
  font-weight: 800;
}

.empty-state {
  color: var(--muted);
  margin: 0;
}

button:disabled {
  cursor: wait;
  opacity: 0.6;
}

@media (max-width: 760px) {
  .shell,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding: 18px;
  }

  .workspace {
    padding: 18px;
  }

  .public-stage {
    min-height: auto;
    padding-top: 0;
  }

  .contact-card {
    transform: none;
    transition: none;
  }

  .photo-header {
    height: 390px;
  }

  .photo-divider {
    height: 86px;
  }

  .identity-block {
    padding-left: 28px;
    padding-right: 28px;
  }

  .card-logo {
    right: 16px;
    bottom: 0;
    width: 120px;
  }

  .contact-list {
    padding-left: 30px;
    padding-right: 30px;
  }

  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-actions {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .contact-card {
    transform: none;
    transition: none;
  }

  .save-contact {
    animation: none;
  }
}
