@font-face {
  font-family: "Satoshi";
  src: url("assets/fonts/Satoshi-Variable.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Satoshi";
  src: url("assets/fonts/Satoshi-VariableItalic.woff2") format("woff2");
  font-weight: 300 900;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: "Satoshi", system-ui, -apple-system, BlinkMacSystemFont;
  --bg: #060620;
  --panel: #0b0b2e;
  --sidebar: #050517;
  --text: #f0f6fc;
  --muted: #9da7c2;
  --accent: #00dbff;
  --accent-strong: #00a6cc;
  --border: #1a1a40;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at 15% 15%, rgba(0, 219, 255, 0.25), transparent 45%),
              radial-gradient(circle at 80% 0%, rgba(0, 166, 204, 0.25), transparent 40%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

.app-shell {
  display: flex;
  height: 100vh;
}

.auth-locked .app-shell {
  filter: blur(18px);
  pointer-events: none;
  user-select: none;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.9rem 1.2rem;
  border-radius: 0.75rem;
  background: rgba(0, 219, 255, 0.2);
  border: 1px solid rgba(0, 219, 255, 0.4);
  color: var(--text);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 7;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.auth-gate {
  position: fixed;
  inset: 0;
  background: rgba(6, 6, 32, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.auth-card {
  width: min(360px, 90vw);
  padding: 2rem;
  background: #09091f;
  border: 1px solid rgba(0, 219, 255, 0.3);
  border-radius: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55);
}

.auth-card h2 {
  margin: 0;
}

.auth-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.auth-card input {
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.75rem;
  color: var(--text);
  font-size: 1rem;
}

.auth-card input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 219, 255, 0.25);
}

.auth-card button {
  border: none;
  border-radius: 0.8rem;
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: #05121a;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.8rem;
  cursor: pointer;
}

.auth-error {
  min-height: 1rem;
  font-size: 0.85rem;
  color: #ff7b7b;
}

.sidebar {
  width: clamp(260px, 26vw, 360px);
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: 18px 0 40px rgba(0, 0, 0, 0.35);
  overflow-y: auto;
}

.sidebar__header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar__search {
  display: block;
}

.sidebar__search input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.sidebar__search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 219, 255, 0.25);
}

.sidebar__filters {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar__filters.is-collapsed .filter-chips {
  display: none;
}

.filter-toggle {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.55rem 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.filter-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  background: rgba(0, 219, 255, 0.1);
}

.filter-toggle span {
  font-size: 1rem;
  transform: rotate(-90deg);
  transition: transform 0.2s;
}

.filter-toggle[aria-expanded="true"] span {
  transform: rotate(0deg);
}

.filter-label {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.filter-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  padding: 0.35rem 0.9rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.filter-chip[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(0, 219, 255, 0.15);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.sidebar__header h1 {
  margin: 0;
  font-size: 1.6rem;
}

.sidebar__logo {
  width: 160px;
  display: block;
}

.sidebar__header p {
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.project-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.project-tab {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.project-tab:hover {
  border-color: rgba(0, 219, 255, 0.6);
}

.project-tab[aria-selected="true"] {
  border-color: var(--accent);
  box-shadow: 0 10px 25px rgba(0, 219, 255, 0.18);
  transform: translateX(6px);
  background: rgba(0, 219, 255, 0.08);
}

.project-tab__title {
  font-weight: 600;
}

.project-tab__description {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

.project-tab__status {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.6rem;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 219, 255, 0.5);
  background: rgba(0, 219, 255, 0.12);
  color: var(--accent);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.detail-panel {
  flex: 1;
  padding: 3rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: linear-gradient(135deg, rgba(6, 6, 32, 0.6), rgba(6, 6, 32, 0.95));
  overflow-y: auto;
}

.project-card {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: clamp(1.6rem, 2vw, 2.8rem);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.project-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.project-updated {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.project-header h2 {
  margin: 0;
  flex: 1;
}

.copy-link-btn {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.copy-link-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.copy-link-btn:not([disabled]):hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 219, 255, 0.12);
}

.status-pill {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(0, 219, 255, 0.1);
  border: 1px solid rgba(0, 219, 255, 0.5);
  color: var(--accent);
}

.project-context {
  color: var(--muted);
  font-size: 0.9rem;
}

h2 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.8rem, 2.4vw, 2.4rem);
}

h3 {
  margin: 0 0 0.6rem;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
}

p {
  margin: 0;
  line-height: 1.5;
}

ul {
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.5;
  color: rgba(240, 246, 252, 0.9);
}

li + li {
  margin-top: 0.4rem;
}

.iframe-wrapper {
  border: 1px solid rgba(0, 219, 255, 0.2);
  border-radius: 0.9rem;
  overflow: hidden;
  min-height: 320px;
  margin-bottom: 1rem;
  position: relative;
}

.iframe-top-controls {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  gap: 0.4rem;
}

.iframe-wrapper:fullscreen {
  border-radius: 0;
  border: none;
  margin: 0;
  padding: 0;
}

iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  display: block;
  background: #050709;
}

.iframe-wrapper:fullscreen .iframe-top-controls {
  top: 1rem;
  right: 1rem;
}

.iframe-wrapper:fullscreen iframe {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
}

.iframe-top-controls button {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: var(--text);
  padding: 0.35rem 0.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.iframe-top-controls button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.iframe-top-controls button svg {
  pointer-events: none;
}

.info-sections {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.info-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.6rem;
}

.info-tab {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.info-tab[aria-selected="true"] {
  border-color: var(--accent);
  background: rgba(0, 219, 255, 0.1);
  color: var(--text);
}

.info-panels {
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.25);
}

.info-panel[hidden] {
  display: none;
}

.empty-state {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 1rem 0 0;
}

.error-state {
  color: #ff9c9c;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.retry-inline {
  align-self: flex-start;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  padding: 0.35rem 1rem;
  cursor: pointer;
  font-size: 0.85rem;
}

@media (max-width: 960px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    overflow-x: auto;
  }

  .project-tabs {
    flex-direction: row;
    flex-wrap: nowrap;
    width: 100%;
  }

  .project-tab {
    min-width: 220px;
  }

  .detail-panel {
    padding: 1.5rem;
  }
}
