:root {
  --bg: #0b0d10;
  --bg-lift: #151820;
  --ink: #e6e8ec;
  --muted: #9aa0ab;
  --soft: #6e7480;
  --line: rgba(230, 232, 236, 0.12);
  --copper: #c4895a;
  --copper-deep: #9a6a3e;
  --copper-soft: rgba(196, 137, 90, 0.2);
  --sans: "Bricolage Grotesque", Georgia, serif;
  --ui: "IBM Plex Sans", "Helvetica Neue", sans-serif;
}

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

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

body {
  font-family: var(--ui);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.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;
}

/* Gate */
body.site-locked > :not(.site-gate):not(script) {
  visibility: hidden;
  pointer-events: none;
}

.site-gate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse 55% 40% at 50% 20%, rgba(196, 137, 90, 0.12), transparent 60%),
    var(--bg);
}

body.site-locked .site-gate {
  display: grid;
}

body.site-unlocking .site-gate {
  animation: gate-out 0.45s ease forwards;
  pointer-events: none;
}

.site-gate-card {
  width: min(22rem, 100%);
  text-align: center;
}

.site-gate-eyebrow,
.menubar-meta,
.window-kind,
.window-status,
.menu-panel-label,
.menu-link-status {
  font-family: var(--ui);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--soft);
}

.site-gate-title {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(1.8rem, 5vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.site-gate-copy {
  margin: 0.75rem 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.site-gate-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.35rem;
}

.site-gate-form input,
.site-gate-form button {
  width: 100%;
  min-height: 2.85rem;
  padding: 0.7rem 1rem;
  border-radius: 0.35rem;
  font: inherit;
}

.site-gate-form input {
  border: 1px solid var(--line);
  background: rgba(8, 10, 14, 0.7);
  color: var(--ink);
  outline: none;
}

.site-gate-form input:focus {
  border-color: rgba(196, 137, 90, 0.55);
  box-shadow: 0 0 0 3px var(--copper-soft);
}

.site-gate-form button {
  border: 0;
  background: var(--copper);
  color: #1a120c;
  font-family: var(--sans);
  font-weight: 700;
  cursor: pointer;
}

.site-gate-form button:hover {
  background: #d49a6c;
}

.site-gate-error {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  color: #d97a6c;
}

/* Desktop */
.desktop {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100svh;
  opacity: 0;
}

body.is-ready .desktop {
  animation: fade-in 0.7s ease forwards;
}

.desktop-wallpaper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.55) brightness(0.42) contrast(1.05);
  z-index: 0;
}

.desktop-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse 70% 55% at 50% 45%, transparent 30%, rgba(11, 13, 16, 0.55) 100%),
    linear-gradient(180deg, rgba(11, 13, 16, 0.35), rgba(11, 13, 16, 0.2) 40%, rgba(11, 13, 16, 0.5));
  pointer-events: none;
}

.menubar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 2.4rem;
  padding: 0.35rem 0.85rem;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 14, 18, 0.78);
  backdrop-filter: blur(12px);
}

.menubar-brand,
.menubar-item {
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  border-radius: 0.25rem;
}

.menubar-brand {
  font-family: var(--sans);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--copper);
}

.menubar-brand:hover,
.menubar-item:hover {
  background: rgba(230, 232, 236, 0.06);
}

.menubar-nav {
  display: flex;
  gap: 0.15rem;
}

.menubar-item {
  font-size: 0.88rem;
  color: var(--muted);
}

.menubar-meta {
  margin: 0 0 0 0.35rem;
  margin-left: auto;
}

.menu-panel {
  position: absolute;
  top: 2.55rem;
  left: 0.65rem;
  z-index: 25;
  width: min(18rem, calc(100% - 1.3rem));
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: rgba(14, 16, 20, 0.94);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(-0.35rem);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.menu-panel.is-open {
  opacity: 1;
  transform: translateY(0);
}

.menu-panel-label {
  margin: 0 0 0.55rem;
}

.menu-panel-list {
  display: grid;
  gap: 0.3rem;
}

.menu-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.65rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 0.35rem;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.menu-link:hover {
  border-color: var(--line);
  background: rgba(196, 137, 90, 0.1);
}

.menu-link span:first-child {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.92rem;
}

/* Domain icons on wallpaper */
.desktop-icons {
  position: absolute;
  inset: 2.6rem 0 0;
  z-index: 5;
}

.desk-icon {
  position: absolute;
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  width: 4.6rem;
  padding: 0.2rem;
  border: 0;
  background: none;
  color: var(--ink);
  transform: translate(-50%, -50%);
  cursor: pointer;
}

.desk-icon-folder {
  width: 2.55rem;
  height: 2rem;
  border-radius: 0.28rem;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--mark) 75%, #fff) 0 22%, var(--mark) 22% 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 8px 18px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(0, 0, 0, 0.25);
}

.desk-icon-label {
  max-width: 5.2rem;
  padding: 0.15rem 0.35rem;
  border-radius: 0.2rem;
  background: rgba(8, 10, 14, 0.72);
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
  line-height: 1.2;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

.desk-icon:hover .desk-icon-folder,
.desk-icon.is-active .desk-icon-folder {
  transform: scale(1.06);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.16) inset,
    0 0 0 2px color-mix(in srgb, var(--mark) 55%, transparent),
    0 10px 22px rgba(0, 0, 0, 0.4);
}

.desk-icon:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 3px;
}

/* Window */
.window {
  position: absolute;
  z-index: 30;
  left: 50%;
  top: 52%;
  width: min(34rem, calc(100% - 1.5rem));
  max-height: min(70svh, 28rem);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: rgba(14, 16, 22, 0.94);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, -46%) scale(0.96);
  opacity: 0;
  overflow: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.window.is-open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.window-chrome {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--line);
  background: rgba(18, 20, 26, 0.95);
}

.window-controls {
  display: flex;
  gap: 0.35rem;
}

.window-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #3a404a;
}

.window-dot-close {
  background: #c4895a;
}

.window-title {
  margin: 0;
  flex: 1;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 700;
}

.window-close {
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

.window-close:hover {
  color: var(--ink);
}

.window-body {
  padding: 1.15rem 1.25rem 1.4rem;
  overflow: auto;
}

.window-kind {
  margin: 0;
}

.window-status {
  display: inline-block;
  margin: 0.45rem 0 0;
  padding: 0.18rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 0.2rem;
}

.window-status[data-status="foundation"],
.window-status[data-status="live"] {
  color: var(--copper);
  border-color: color-mix(in srgb, var(--copper) 45%, transparent);
}

.window-heading {
  margin: 0.55rem 0 0;
  font-family: var(--sans);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.window-def {
  margin: 0.85rem 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 1.02rem;
}

.window-note {
  margin: 1rem 0 0;
  color: var(--soft);
  font-size: 0.84rem;
  line-height: 1.45;
}

@keyframes fade-in {
  to {
    opacity: 1;
  }
}

@keyframes gate-out {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@media (max-width: 720px) {
  .menubar-meta {
    display: none;
  }

  .desk-icon {
    width: 3.8rem;
  }

  .desk-icon-folder {
    width: 2.2rem;
    height: 1.7rem;
  }

  .desk-icon-label {
    font-size: 0.62rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.is-ready .desktop,
  body.site-unlocking .site-gate,
  .window,
  .menu-panel {
    animation: none;
    transition: none;
  }

  body.is-ready .desktop {
    opacity: 1;
  }
}
