:root {
  --bg: #020208;
  --panel: rgba(10, 10, 24, 0.55);
  --line: rgba(255, 255, 255, 0.09);
  --text: #eef0ff;
  --muted: #8b90b8;
  --accent: #b9a6ff;
  --accent2: #7fd7ff;
  --danger: #ff7aa8;
  --ok: #7cf5b6;
  --display: "Orbitron", "Inter", system-ui, sans-serif;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  overflow: hidden; -webkit-font-smoothing: antialiased;
}
button, input { font-family: inherit; }
button { cursor: pointer; }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 45%, rgba(0, 0, 0, 0.55) 100%);
}
.screen { position: fixed; inset: 0; z-index: 2; }
.hidden { display: none !important; }

/* ---------- lock ---------- */
#lock { display: grid; place-items: center; padding: 20px; animation: fadein 1.4s ease both; }
.card {
  width: min(400px, 100%);
  padding: 44px 36px 34px;
  border-radius: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-align: center;
  animation: rise 1.2s cubic-bezier(.2, .8, .2, 1) both;
}
.emblem { width: 72px; height: 72px; margin: 0 auto 20px; display: block; filter: drop-shadow(0 0 18px rgba(185, 166, 255, 0.45)); }
.emblem .ring { transform-origin: 50% 50%; animation: tilt 9s ease-in-out infinite; }
@keyframes tilt { 50% { transform: rotate(-14deg); } }

.wordmark {
  font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: 0.3em;
  margin: 0 0 30px 0.3em; white-space: nowrap;
  background: linear-gradient(90deg, #ffffff, #cfc4ff 60%, #9fd9ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.wordmark.mini { font-size: 12px; letter-spacing: 0.26em; margin: 0; }

.field {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 5px 5px 18px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.1);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field:focus-within { border-color: rgba(185, 166, 255, 0.6); box-shadow: 0 0 0 4px rgba(185, 166, 255, 0.12); background: rgba(0, 0, 0, 0.45); }
.field input {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: 0;
  color: var(--text); font-size: 16px; letter-spacing: 0.28em; padding: 10px 0;
}
.field input::placeholder { letter-spacing: 0.02em; color: var(--muted); }
.field input:disabled, .field button:disabled { opacity: 0.45; }
.field button {
  width: 42px; height: 42px; border-radius: 50%; border: 0; display: grid; place-items: center; flex: none;
  color: #0a0a18; background: linear-gradient(135deg, #e6f2ff, var(--accent));
  transition: transform .18s, filter .18s;
}
.field button:hover { transform: scale(1.06); filter: brightness(1.08); }
.msg { min-height: 18px; margin-top: 12px; font-size: 12.5px; color: var(--danger); }
.msg.ok { color: var(--ok); }
.hint { margin: 18px 0 0; font-size: 12px; color: var(--muted); }

.shake { animation: shake .45s cubic-bezier(.36, .07, .19, .97) both; }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.unlocking { animation: unlock 0.9s cubic-bezier(.7, 0, .3, 1) forwards; }
@keyframes unlock { 50% { transform: scale(1.03); opacity: 1; } 100% { transform: scale(2.2); opacity: 0; filter: blur(12px); } }

.credit { position: absolute; bottom: 24px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--muted); letter-spacing: 0.08em; }
.credit b { color: #fff; font-weight: 600; letter-spacing: 0.12em; }

@keyframes fadein { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(28px); } }

/* ---------- browser ---------- */
#browser { display: flex; flex-direction: column; animation: fadein .8s ease both; }
.bar {
  position: relative; z-index: 3; display: flex; align-items: center; gap: 14px;
  padding: 10px 16px;
  background: rgba(6, 6, 18, 0.82); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.nav { display: flex; gap: 2px; }
.nav button, .right button {
  background: transparent; border: 0; color: var(--muted);
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  transition: background .15s, color .15s;
}
.nav button:hover, .right button:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.urlbox {
  flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 0 14px; height: 38px; border-radius: 12px;
  background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color .2s, box-shadow .2s;
}
.urlbox:focus-within { border-color: rgba(185, 166, 255, 0.5); box-shadow: 0 0 0 3px rgba(185, 166, 255, 0.1); }
.shield { color: var(--ok); display: grid; place-items: center; }
.urlbox input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--text); font-size: 14px; }
.right { display: flex; align-items: center; gap: 8px; }
.right button.text { width: auto; padding: 0 12px; font-size: 12px; font-weight: 500; }
.credit-mini { color: var(--muted); font-size: 12px; white-space: nowrap; }
.credit-mini b { color: var(--text); font-weight: 600; }
.progress {
  position: absolute; left: 0; bottom: -1px; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--accent2), var(--accent)); opacity: 0;
  transition: width .3s ease, opacity .4s;
}
.progress.on { opacity: 1; width: 70%; transition: width 8s cubic-bezier(.1, .7, .3, 1); }
.progress.done { width: 100%; opacity: 0; transition: width .2s, opacity .5s .2s; }

#frame { flex: 1; width: 100%; border: 0; background: #fff; position: relative; z-index: 2; }

.homepage {
  flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 16px 80px; z-index: 2; overflow: auto;
}
.homepage .wordmark { font-size: 22px; margin-bottom: 28px; }
.search {
  display: flex; align-items: center; gap: 12px; width: min(620px, 100%);
  padding: 6px 6px 6px 20px; border-radius: 999px; margin-bottom: 30px;
  background: rgba(8, 8, 20, 0.6); border: 1px solid var(--line);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  transition: border-color .2s, box-shadow .2s;
  animation: rise 1s cubic-bezier(.2, .8, .2, 1) both;
}
.search:focus-within { border-color: rgba(185, 166, 255, 0.55); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5), 0 0 0 4px rgba(185, 166, 255, 0.1); }
.search .glass { color: var(--muted); flex: none; }
.search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--text); font-size: 17px; padding: 12px 0; }
.search input::placeholder { color: var(--muted); }
.search button {
  width: 46px; height: 46px; border-radius: 50%; border: 0; display: grid; place-items: center; flex: none;
  color: #0a0a18; background: linear-gradient(135deg, #e6f2ff, var(--accent)); transition: transform .18s;
}
.search button:hover { transform: scale(1.06); }

.quick { display: grid; grid-template-columns: repeat(5, 92px); gap: 10px; justify-content: center; }
.quick button {
  --c: var(--accent);
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  padding: 14px 6px 12px; border-radius: 18px;
  background: rgba(8, 8, 20, 0.62); border: 1px solid var(--line); color: var(--muted);
  transition: transform .22s cubic-bezier(.2, .8, .2, 1), border-color .22s, color .22s, background .22s;
  animation: rise 1s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 45ms);
}
.quick button i {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  font-style: normal; font-weight: 700; font-size: 16px; color: #0a0a18;
  background: var(--c); transition: transform .22s, box-shadow .22s;
}
.quick button span { font-size: 11.5px; letter-spacing: 0.02em; }
.quick button:hover { transform: translateY(-4px); border-color: rgba(255, 255, 255, 0.2); color: var(--text); background: rgba(12, 12, 28, 0.6); }
.quick button:hover i { transform: scale(1.06); box-shadow: 0 8px 24px color-mix(in srgb, var(--c) 45%, transparent); }

@media (max-width: 720px) {
  .credit-mini, .wordmark.mini { display: none; }
  .bar { gap: 8px; padding: 8px 10px; }
  .card { padding: 36px 24px 28px; }
  .quick { grid-template-columns: repeat(auto-fit, 84px); }
}
