:root {
  --ink: #050812;
  --paper: #edf8f5;
  --muted: #91a8b6;
  --faint: #526879;
  --line: #63dfca24;
  --line-bright: #63dfca4d;
  --gold: #63dfca;
  --gold-soft: #2f9188;
  --amber: #d0ad6d;
  --violet: #a78bfa;
  --violet-soft: #8b5cf6;
  --m1: #d0ad6d;
  --m2: #e3c76a;
  --m3: #6fb0e8;
  --m4: #a78bfa;
}

html[data-theme="light"] {
  --ink: #eceeef;
  --paper: #101519;
  --muted: #4f626d;
  --faint: #6f7d83;
  --line: #24766a2b;
  --line-bright: #24766a59;
  --gold: #176f66;
  --gold-soft: #27857b;
  --amber: #8a6a2f;
  --violet: #6a54c9;
  --violet-soft: #6a54c9;
  --m1: #8a6a2f;
  --m2: #8f7a2e;
  --m3: #2f6cb0;
  --m4: #6a54c9;
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--ink);
  color: var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  color: inherit;
  font: inherit;
}

.public-entry {
  min-height: 100vh;
  padding: 0 6vw;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 70% 22%, #d0ad6d1f, transparent 22%),
    radial-gradient(circle at 24% 52%, #8b5cf614, transparent 30%),
    radial-gradient(circle at 20% 90%, #4b69911c, transparent 28%),
    var(--ink);
}

.entry-grid {
  pointer-events: none;
  position: absolute;
  inset: 0;
  opacity: 0.33;
  background-image:
    linear-gradient(#63dfca12 1px, transparent 1px),
    linear-gradient(90deg, #63dfca12 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(#000, transparent 82%);
}

.entry-nav {
  z-index: 1;
  height: 96px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.entry-brand,
.entry-nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.entry-brand > div:last-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.entry-brand strong {
  letter-spacing: 0.16em;
  font: 600 12px Georgia, serif;
}

.entry-brand small {
  color: var(--amber);
  letter-spacing: 0.45em;
  font-size: 8px;
}

.entry-nav-actions > span {
  color: var(--faint);
  letter-spacing: 0.2em;
  font-size: 8px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border: 1px solid;
  border-image: linear-gradient(135deg, var(--amber), var(--gold)) 1;
  display: grid;
  place-items: center;
  position: relative;
  transform: rotate(45deg);
}

.brand-mark span {
  color: var(--amber);
  font: 600 13px Georgia, serif;
  position: absolute;
  transform: rotate(-45deg);
}

.brand-mark span:first-child {
  top: 3px;
  left: 7px;
}

.brand-mark span:last-child {
  right: 7px;
  bottom: 3px;
}

.brand-mark i {
  width: 1px;
  height: 54px;
  background: linear-gradient(var(--amber), var(--violet), var(--gold));
  opacity: 0.8;
  position: absolute;
}

.theme-toggle {
  border: 1px solid var(--line-bright);
  border-radius: 999px;
  background: #0c1118b8;
  color: var(--muted);
  height: 36px;
  padding: 0 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 8px;
}

.tt-icon {
  width: 13px;
  height: 13px;
  flex: none;
}

.tt-track {
  width: 28px;
  height: 15px;
  border: 1px solid var(--line-bright);
  border-radius: 999px;
  position: relative;
  flex: none;
}

.tt-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--paper);
  transform: translateX(13px);
  transition: transform 0.2s;
}

html[data-theme="light"] .tt-knob {
  transform: none;
}

html[data-theme="light"] .theme-toggle {
  background: #ffffffb5;
}

.entry-hero {
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 1280px;
  min-height: 560px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(420px, 1fr);
  align-items: center;
  gap: 8vw;
  position: relative;
}

.entry-seal {
  aspect-ratio: 1;
  width: min(32vw, 390px);
  margin: auto;
  border: 1px solid transparent;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  background:
    radial-gradient(circle at 52% 48%, #8b5cf624, transparent 62%) padding-box,
    linear-gradient(var(--ink), var(--ink)) padding-box,
    linear-gradient(150deg, var(--amber), var(--violet-soft) 55%, var(--gold)) border-box;
  box-shadow:
    0 0 0 44px #8b5cf608,
    0 0 0 88px #8b5cf604;
}

.entry-seal::before,
.entry-seal::after {
  content: "";
  border: 1px solid var(--line);
  position: absolute;
  inset: 14%;
  transform: rotate(45deg);
}

.entry-seal::after {
  inset: 29%;
  transform: rotate(0);
  border-color: #a78bfa55;
  background: radial-gradient(circle, #cdb9ff21, transparent 70%);
}

html[data-theme="light"] .entry-seal::after {
  border-color: #6a54c955;
  background: radial-gradient(circle, #6a54c918, transparent 70%);
}

.entry-seal span {
  z-index: 1;
  color: #e2d7ff;
  letter-spacing: 0.22em;
  font: 400 35px Georgia, serif;
  text-shadow: 0 0 24px #a78bfa66;
}

html[data-theme="light"] .entry-seal span {
  color: #5b46b8;
  text-shadow: none;
}

.entry-seal i {
  width: 1px;
  height: 100%;
  background: linear-gradient(
    transparent,
    var(--amber) 32%,
    #efe8ff 50%,
    var(--gold) 68%,
    transparent
  );
  position: absolute;
  transform: rotate(32deg);
}

.entry-copy {
  max-width: 690px;
}

.entry-kicker {
  color: var(--amber);
  letter-spacing: 0.24em;
  margin-bottom: 24px;
  font-size: 9px;
  display: block;
}

.entry-copy h1 {
  max-width: 720px;
  margin: 0 0 24px;
  letter-spacing: 0;
  font: 400 clamp(42px, 5.2vw, 76px) / 0.98 Georgia, serif;
}

.entry-copy p {
  color: var(--muted);
  max-width: 610px;
  margin: 0 0 34px;
  font: 400 15px / 1.75 Georgia, serif;
}

.entry-copy p::before {
  content: "";
  display: inline-block;
  width: 34px;
  height: 1px;
  background: var(--gold-soft);
  vertical-align: middle;
  margin-right: 14px;
}

.entry-signin {
  width: max-content;
  min-width: 225px;
  height: 50px;
  padding: 0 17px;
  border: 0;
  color: var(--paper);
  background: linear-gradient(100deg, var(--amber), var(--violet-soft) 62%, var(--violet-soft));
  clip-path: polygon(
    11px 0,
    100% 0,
    100% calc(100% - 11px),
    calc(100% - 11px) 100%,
    0 100%,
    0 11px
  );
  filter: drop-shadow(4px 5px 0 #8b5cf63d);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 9px;
  font-weight: 750;
  transition:
    transform 0.2s,
    filter 0.2s;
}

.entry-signin::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  background:
    linear-gradient(100deg, #17102255, transparent 60%),
    linear-gradient(100deg, #120f1e, #0f1522);
  clip-path: polygon(
    10px 0,
    100% 0,
    100% calc(100% - 10px),
    calc(100% - 10px) 100%,
    0 100%,
    0 10px
  );
}

html[data-theme="light"] .entry-signin::before {
  background: linear-gradient(100deg, #f6f2e9, #eef0f6);
}

.entry-signin:hover {
  transform: translateY(-1px);
  filter: drop-shadow(4px 5px 0 #8b5cf66b) brightness(1.08);
}

.entry-signin span {
  font-size: 17px;
}

.entry-assurance {
  color: var(--faint);
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 22px;
  font-size: 8px;
}

.entry-assurance b {
  color: var(--gold-soft);
  font-weight: 600;
}

.entry-assurance span {
  border-left: 1px solid var(--line);
  padding-left: 18px;
}

.entry-modules {
  z-index: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto 32px;
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  position: relative;
}

.entry-modules article {
  min-height: 84px;
  padding: 14px 17px;
  border-right: 1px solid var(--line);
  background: #0c1118b8;
  display: grid;
  grid-template-columns: 24px 1fr;
  align-content: center;
  gap: 5px 10px;
}

html[data-theme="light"] .entry-modules article {
  background: #ffffffa8;
}

.entry-modules article:last-child {
  border-right: 0;
}

.entry-modules article:nth-child(1) {
  border-left: 2px solid var(--m1);
}

.entry-modules article:nth-child(2) {
  border-left: 2px solid var(--m2);
}

.entry-modules article:nth-child(3) {
  border-left: 2px solid var(--m3);
}

.entry-modules article:nth-child(4) {
  border-left: 2px solid var(--m4);
}

.entry-modules article:nth-child(1) small {
  color: var(--m1);
}

.entry-modules article:nth-child(2) small {
  color: var(--m2);
}

.entry-modules article:nth-child(3) small {
  color: var(--m3);
}

.entry-modules article:nth-child(4) small {
  color: var(--m4);
}

.entry-modules small {
  color: var(--gold-soft);
  grid-row: 1 / 3;
  font: 400 11px Georgia, serif;
}

.entry-modules strong {
  letter-spacing: 0.1em;
  font-size: 9px;
}

.entry-modules span {
  color: var(--faint);
  font: 400 9px Georgia, serif;
}

.entry-footer {
  z-index: 1;
  height: 56px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  letter-spacing: 0.13em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  font-size: 7px;
}

.entry-footer b {
  color: var(--gold-soft);
  font-weight: 500;
}

@media (max-width: 860px) {
  .public-entry {
    padding: 0 22px;
  }

  .entry-nav {
    height: 78px;
  }

  .entry-nav-actions > span {
    display: none;
  }

  .entry-hero {
    min-height: auto;
    padding: 58px 0 34px;
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .entry-seal {
    width: min(72vw, 320px);
  }

  .entry-copy h1 {
    font-size: clamp(40px, 13vw, 62px);
  }

  .entry-assurance {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .entry-assurance span {
    border-left: 0;
    padding-left: 0;
  }

  .entry-modules {
    grid-template-columns: 1fr 1fr;
  }

  .entry-modules article:nth-child(2) {
    border-right: 0;
  }
}

@media (max-width: 480px) {
  .entry-brand strong {
    font-size: 10px;
  }

  .entry-signin {
    width: 100%;
  }

  .entry-modules {
    grid-template-columns: 1fr;
  }

  .entry-modules article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .entry-modules article:last-child {
    border-bottom: 0;
  }

  .entry-footer {
    height: auto;
    min-height: 56px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
  }
}

/* ---------------- install prompt ---------------- */

.install-card {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 50;
  width: min(400px, calc(100vw - 40px));
  border: 1px solid var(--line-bright);
  border-radius: 16px;
  background: #0c1118f0;
  padding: 20px 22px;
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 50px #00000080;
}

html[data-theme="light"] .install-card {
  background: #ffffffee;
}

.install-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-right: 26px;
}

.install-badge {
  flex: none;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line-bright);
  border-radius: 12px;
  display: grid;
  place-items: center;
  position: relative;
}

.install-badge .brand-mark {
  width: 22px;
  height: 22px;
}

.install-badge .brand-mark span {
  position: static;
  grid-area: 1 / 1;
  font-size: 9px;
  letter-spacing: 0;
}

.install-badge .brand-mark i {
  display: none;
}

.install-badge > b {
  color: var(--amber);
  position: absolute;
  top: 3px;
  right: 6px;
  font: 600 9px Georgia, serif;
}

.install-head small {
  color: var(--faint);
  letter-spacing: 0.2em;
  font-size: 7px;
  display: block;
  margin-bottom: 5px;
}

.install-head strong {
  font: 400 16px Georgia, serif;
}

.install-close {
  position: absolute;
  top: 14px;
  right: 14px;
  border: 0;
  background: none;
  color: var(--faint);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 4px;
}

.install-close:hover {
  color: var(--paper);
}

.install-card p {
  color: var(--muted);
  margin: 14px 0 16px;
  font: 400 12px / 1.7 Georgia, serif;
}

.install-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.install-actions button {
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 11px;
}

.install-later {
  border: 1px solid var(--line);
  background: #ffffff0d;
  color: var(--muted);
}

html[data-theme="light"] .install-later {
  background: #00000008;
}

.install-go {
  border: 0;
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
}

.install-go:hover {
  filter: brightness(1.06);
}

/* ---- hero install buttons ---- */
.entry-install {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.entry-install-kicker {
  color: var(--faint);
  font-size: 8.5px;
  letter-spacing: 0.24em;
}

.entry-install-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.install-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 190px;
  padding: 11px 18px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}

.install-btn:hover {
  border-color: var(--gold);
  color: var(--paper);
  transform: translateY(-1px);
}

.install-btn svg {
  width: 22px;
  height: 22px;
  flex: none;
  color: var(--gold);
}

.install-btn span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.install-btn small {
  font-size: 7.5px;
  letter-spacing: 0.22em;
  color: var(--faint);
}

.install-btn b {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.install-btn.is-this-device {
  border-color: var(--amber);
}

.install-btn.is-this-device small::after {
  content: " · THIS DEVICE";
  color: var(--amber);
}

.entry-install.is-installed .entry-install-row {
  opacity: 0.45;
  pointer-events: none;
}

.entry-install-note {
  color: var(--faint);
  font-size: 9.5px;
  letter-spacing: 0.06em;
}

/* ---- install guide overlay ---- */
.install-guide {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #050812d9;
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.install-guide-panel {
  position: relative;
  width: min(430px, 100%);
  background: var(--panel, #0a101c);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 30px;
  box-shadow: 0 30px 80px #00000090;
}

.install-guide-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: 0;
  background: none;
  color: var(--faint);
  font-size: 20px;
  cursor: pointer;
}

.install-guide-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.install-guide-head strong {
  color: var(--paper);
  font-size: 16px;
  letter-spacing: 0.02em;
}

.install-guide ol {
  margin: 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.install-guide ol b {
  color: var(--gold);
  font-weight: 600;
}

.install-guide-note {
  margin: 16px 0 0;
  color: var(--faint);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  line-height: 1.6;
}

@media (max-width: 560px) {
  .entry-install-row {
    flex-direction: column;
  }

  .install-btn {
    width: 100%;
  }
}
