@font-face {
  font-family: "Geist Variable"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/fonts/geist.woff2) format("woff2");
}
@font-face {
  font-family: "Manrope Variable"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(/fonts/manrope.woff2) format("woff2");
}

:root {
  --bg: #000000;
  --surface: color-mix(in srgb, #101014 80%, transparent);
  --surface-2: color-mix(in srgb, #17171c 80%, transparent);
  --surface-3: color-mix(in srgb, #202026 80%, transparent);
  --surface-solid: #16161b;
  --border: color-mix(in srgb, #ffffff 15%, color-mix(in srgb, #242429 85%, transparent));
  --border-2: color-mix(in srgb, #ffffff 20%, color-mix(in srgb, #34343b 85%, transparent));
  --text: #f5f6f8;
  --muted: #9a9aa2;
  --muted-2: #6b6b73;
  --accent: #ffffff;
  --accent-contrast: #000000;
  --mesh-base: #010309;

  --sidebar-w: 240px;
  --sidebar-w-compact: 56px;

  --radius: 6px;
  --radius-sm: 5px;
  --radius-xs: 4px;

  --ease: cubic-bezier(.16, 1, .3, 1);

  --font: "Geist Variable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Manrope Variable", Manrope, "Geist Variable", ui-sans-serif, system-ui, sans-serif;

  color-scheme: dark;
  font-family: var(--font);
  font-size: 14px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text); overflow: hidden;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility; overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: transparent; border: none; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .4; }
input, textarea { font: inherit; color: inherit; outline: none; }
::selection { background: color-mix(in srgb, var(--text) 22%, transparent); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border); border-radius: 999px;
  border: 3px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--border-2); background-clip: content-box; }

/* Blackhole background */
#site-video-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--mesh-base); pointer-events: none; }
#site-video-el {
  position: absolute; top: 50%; left: 50%;
  min-width: 100%; min-height: 100%; width: auto; height: auto;
  transform: translate(-50%, -50%); object-fit: cover;
}
#site-video-overlay {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 50% 12%, rgba(1, 3, 9, .08), transparent 55%),
    linear-gradient(180deg, rgba(1, 3, 9, .32), rgba(1, 3, 9, .6));
}
#site-video-bg::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  opacity: .12; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.app { position: relative; z-index: 1; display: flex; height: 100dvh; width: 100vw; overflow: hidden; background: transparent; }

/* Flat surface base */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.icon-btn {
  width: 28px; height: 28px; border-radius: var(--radius-xs); flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted);
  transition: background-color .15s ease, color .15s ease;
}
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.icon-btn.active { background: var(--surface-3); color: var(--text); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Sidebar */
.sidebar {
  position: relative; z-index: 3; flex-shrink: 0;
  width: var(--sidebar-w);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: blur(32px) saturate(1.4);
  -webkit-backdrop-filter: blur(32px) saturate(1.4);
  border: 0; border-right: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: 0;
  overflow: hidden;
  transition: width .26s var(--ease);
}
.sidebar.compact { width: var(--sidebar-w-compact); }
.sidebar-inner { height: 100%; display: flex; flex-direction: column; padding: .5rem; gap: .5rem; }
.sidebar.compact .sidebar-inner { align-items: center; padding: .5rem .35rem; }

.header-row { display: flex; align-items: center; justify-content: space-between; gap: .4rem; padding: .15rem .35rem 0; }
.nav-group, .header-left, .header-right { display: flex; align-items: center; gap: .15rem; }
.sidebar.compact .header-row { flex-direction: column; gap: .35rem; }

.sidebar-omnibox-wrap { position: relative; margin: 0 .25rem; }
.sidebar.compact .sidebar-omnibox-wrap,
.sidebar.compact .bookmarks,
.sidebar.compact .nav-label { display: none; }

.omnibox {
  display: flex; align-items: center; gap: .45rem;
  height: 34px; padding: 0 .7rem;
  background: var(--surface); border: 1px solid transparent; border-radius: var(--radius-xs);
  color: var(--muted);
  transition: border-color .15s ease, background-color .15s ease;
}
.omnibox:hover { border-color: var(--border); }
.omnibox:focus-within { border-color: var(--accent); background: var(--surface-2); }
.omnibox input { flex: 1; min-width: 0; height: 100%; font-size: 12px; color: var(--text); }
.omnibox input::placeholder { color: var(--muted-2); }

.bookmarks { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; padding: 0 .25rem; }
.bookmark-tile, .bookmark-add {
  aspect-ratio: 1; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid transparent;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); position: relative;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.bookmark-tile:hover, .bookmark-add:hover { background: var(--surface-3); border-color: var(--border); color: var(--text); }
.bookmark-tile img { width: 22px; height: 22px; border-radius: 4px; }
.bookmark-tile span { font-size: 14px; font-weight: 600; }
.bookmark-remove {
  position: absolute; top: 3px; right: 3px;
  width: 16px; height: 16px; border-radius: var(--radius-xs);
  display: none; place-items: center;
  background: color-mix(in srgb, var(--bg) 70%, transparent); color: var(--text); font-size: 11px; line-height: 1;
}
.bookmark-tile:hover .bookmark-remove { display: grid; }
.bookmark-remove:hover { background: var(--surface-3); }

.new-tab, .tab-item, .foot-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem .7rem; border-radius: var(--radius-sm);
  color: var(--muted); font-size: 13px; width: 100%; text-align: left; white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
.new-tab svg, .foot-item svg { flex-shrink: 0; }
.new-tab:hover, .tab-item:hover, .foot-item:hover { background: var(--surface-2); color: var(--text); }
.tab-item.active, .foot-item.active { background: var(--surface-2); color: var(--text); }

.tab-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto; flex: 1; min-height: 0;
}
.tab-item {
  position: relative; cursor: grab;
  -webkit-user-select: none; user-select: none;
  overflow: hidden;
}
.tab-item:active { cursor: grabbing; }
.tab-item.dragging { opacity: .55; background: var(--surface-2); color: var(--text); }
.tab-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.tab-close {
  width: 20px; height: 20px; border-radius: var(--radius-sm); flex-shrink: 0;
  color: var(--muted); display: inline-flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s ease, background-color .15s ease, color .15s ease;
}
.tab-item:hover .tab-close, .tab-item.active .tab-close { opacity: 1; }
.tab-close:hover { background: var(--border); color: var(--text); }
.favicon {
  width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 11px; font-weight: 600; color: var(--muted);
}
.favicon img { width: 16px; height: 16px; border-radius: 3px; }
.favicon-fallback {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: var(--muted);
}

.sidebar.compact .tab-list { align-items: center; width: 100%; }
.sidebar.compact .tab-item { width: 36px; height: 36px; justify-content: center; padding: 0; }
.sidebar.compact .tab-title, .sidebar.compact .tab-close { display: none; }
.sidebar.compact .new-tab { justify-content: center; padding: .6rem 0; }

.footer-nav {
  margin-top: auto; padding-top: .4rem;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: .25rem; align-items: center; width: 100%;
}
.foot-item { width: 36px; height: 36px; justify-content: center; padding: 0; border-radius: var(--radius-sm); }
.foot-item .nav-label { display: none; }

/* Content */
.content { position: relative; z-index: 1; flex: 1; min-width: 0; display: flex; flex-direction: column; }

.toolbar {
  position: relative; z-index: 20; display: none; align-items: center; gap: .5rem;
  height: 52px; padding: .5rem;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: blur(32px) saturate(1.4);
  -webkit-backdrop-filter: blur(32px) saturate(1.4);
  border: 0; border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: 0;
}
.toolbar.visible { display: flex; }
.omnibox-wrap { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; }
.toolbar .omnibox { width: 100%; height: 34px; padding: 0 .4rem 0 .85rem; border-color: var(--border); border-radius: var(--radius-sm); }
.toolbar .omnibox:hover { background: var(--surface-2); border-color: var(--border-2); }
.toolbar .omnibox:focus-within { background: var(--surface-2); border-color: var(--accent); }
.toolbar .omnibox input { font-size: 13px; }
.omnibox-star {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: var(--radius-xs);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); transition: background-color .15s ease, color .15s ease;
}
.omnibox-star:hover { background: var(--border); color: var(--text); }

.viewport {
  position: relative; flex: 1; min-height: 0;
  background: transparent; border: 0; border-radius: 0;
  overflow: hidden;
}
.viewport.browsing { background: #fff; }

iframe.page { position: absolute; inset: 0; width: 100%; height: 100%; border: none; background: #fff; display: none; }
iframe.page.visible { display: block; }

/* New tab */
.newtab { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 2rem; overflow-y: auto; background: transparent; }
.newtab::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: rgba(0, 0, 0, .1); }
.newtab::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.newtab-inner {
  position: relative; z-index: 1; width: 100%; max-width: 680px;
  display: flex; flex-direction: column; align-items: center; gap: 1.75rem;
  margin-top: -6vh; text-align: center;
}
.wordmark-wrap { display: inline-block; }
.wordmark {
  margin: 0; display: block; user-select: none;
  font-family: var(--display); font-size: clamp(40px, 7vw, 64px);
  font-weight: 600; letter-spacing: -.03em; line-height: 1; color: var(--accent);
}
.underline {
  margin: 1rem auto 0; height: 4px; width: 100%; border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 40%, transparent);
  transform-origin: center;
  animation: underline-expand .38s cubic-bezier(.22, 1, .36, 1);
}
@keyframes underline-expand { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.hero-sub { margin: 0; font-size: 13px; color: var(--muted); letter-spacing: .02em; }

.hero-search-wrap { position: relative; width: 100%; }
.hero-search {
  display: flex; align-items: center; gap: .75rem; width: 100%;
  height: 50px; padding: 0 1.2rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--muted);
  transition: border-color .15s ease, background-color .15s ease;
}
.hero-search:focus-within { background: var(--surface-2); border-color: var(--accent); }
.hero-search input { flex: 1; min-width: 0; height: 100%; font-size: 15px; color: var(--text); }
.hero-search input::placeholder { color: var(--muted-2); }

/* Suggestions */
.suggestions {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40;
  list-style: none; margin: 0; padding: .3rem;
  background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .5);
  max-height: 50vh; overflow-y: auto;
}
.suggestions li {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .6rem; border-radius: var(--radius-xs); cursor: pointer;
  font-size: 13px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background-color .12s ease, color .12s ease;
}
.suggestions li.selected, .suggestions li:hover { background: var(--surface-2); color: var(--text); }
.sidebar-omnibox-wrap .suggestions { background: var(--surface-solid); }

/* Panels */
.panel { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; padding: 24px; }
.panel.visible { display: flex; }
.panel-card {
  position: relative; width: min(440px, 100%); padding: 20px;
  background: #000; border: 1px solid var(--border); border-radius: var(--radius);
}
.panel-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.panel-badge {
  width: 28px; height: 28px; border-radius: var(--radius-xs); flex-shrink: 0;
  display: grid; place-items: center; color: var(--muted); background: var(--surface-2);
}
.panel-card h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.panel-card p { margin: 0 0 14px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.panel-card textarea, .chat-log {
  width: 100%; min-height: 90px; padding: 9px 10px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-xs);
  color: var(--text); resize: none; font-size: 13px;
}
.panel-card textarea::placeholder { color: var(--muted-2); }
.chat-log { min-height: 160px; overflow: auto; margin-bottom: 12px; color: var(--muted); line-height: 1.55; }
.row { display: flex; gap: 8px; }
.row-end { margin-top: 12px; justify-content: flex-end; }
.chat-input { flex: 1; height: 34px; }

.panel-section {
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 10px;
}
.setting { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.setting input { accent-color: var(--accent); }

.primary {
  height: 34px; padding: 0 14px; border-radius: var(--radius-xs); flex-shrink: 0;
  background: var(--text); color: var(--bg); font-size: 13px; font-weight: 600;
  transition: filter .15s ease;
}
.primary:hover:not(:disabled) { filter: brightness(.92); }
.ghost {
  height: 34px; padding: 0 14px; border-radius: var(--radius-xs);
  color: var(--muted); font-size: 13px; font-weight: 500;
  transition: background-color .15s ease, color .15s ease;
}
.ghost:hover { background: var(--surface-2); color: var(--text); }

/* Modal */
.modal-scrim {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: flex-start; justify-content: center; padding-top: 22vh;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden;
  transition: opacity .18s ease, visibility .18s ease;
}
.modal-scrim.open { opacity: 1; visibility: visible; }
.modal {
  width: min(420px, 90vw); padding: 1.1rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 24px 60px -10px rgba(0, 0, 0, .6);
  transform: translateY(6px); transition: transform .18s var(--ease);
}
.modal-scrim.open .modal { transform: none; }
.modal h3 { margin: 0 0 .85rem; font-size: 14px; font-weight: 600; }
.modal-field {
  margin-bottom: .9rem; padding: .6rem .75rem;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-xs);
  transition: border-color .15s ease;
}
.modal-field:focus-within { border-color: var(--accent); }
.modal-field input { width: 100%; font-size: 14px; color: var(--text); }
.modal-field input::placeholder { color: var(--muted-2); }
.modal-actions { display: flex; justify-content: flex-end; gap: .45rem; }

/* Lock screen */
.lock-screen {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 24px;
  background: var(--bg); color: var(--text);
}
.lock-screen[hidden] { display: none; }
.lock-box {
  width: min(320px, 100%);
  display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center;
}
.lock-box h2 { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.lock-box p { margin: 0; font-size: 13px; color: var(--muted); }
.lock-pin {
  width: 100%; height: 40px; padding: 0 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xs);
  color: var(--text); font-size: 16px; text-align: center; letter-spacing: .3em;
}
.lock-pin:focus { border-color: var(--accent); }
.lock-pin[hidden] { display: none; }

/* Toast */
.toast {
  position: fixed; right: 16px; bottom: 16px; z-index: 110;
  padding: 12px 16px; max-width: min(340px, calc(100vw - 32px));
  background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .32);
  font-size: 13px; color: var(--text);
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: none; }

.mobile-toggle {
  position: fixed; top: 10px; left: 10px; z-index: 30;
  display: none; width: 34px; height: 34px; border-radius: var(--radius-sm);
}

@media (max-width: 820px) {
  .sidebar { position: absolute; top: 0; bottom: 0; left: 0; z-index: 20; }
  .sidebar.compact { width: 0; border-right-width: 0; pointer-events: none; }
  .mobile-toggle { display: inline-flex; }
}

@media (prefers-reduced-motion: reduce) {
  #site-video-el { display: none; }
  .underline { animation: none; }
  *, *::before, *::after {
    transition-duration: .12s !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .sidebar, .toolbar { background: var(--surface-solid); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .modal-scrim { background: rgba(0, 0, 0, .92); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

@media (prefers-contrast: more) {
  .glass, .sidebar, .toolbar { border-color: rgba(255, 255, 255, .5); }
  .panel-card, .modal { border-color: rgba(255, 255, 255, .5); }
  :root { --muted: rgba(255, 255, 255, .85); --muted-2: rgba(255, 255, 255, .7); }
}
