:root {
  --bg: #07080a;
  --bg-elevated: #12141a;
  --panel: #16181f;
  --border: rgba(255, 255, 255, 0.1);
  --text: #e8e6e7;
  --muted: #9a9da3;
  --accent: #00e5ff;
  --accent-dim: rgba(0, 229, 255, 0.14);
  --danger: #ff8a80;
  --ok: #7dffa8;
  --bezel: #1a1c22;
  --bezel-edge: #2a2d36;
  --screen: #0b0c10;
  --font: "Hanken Grotesk", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(0, 229, 255, 0.08), transparent 55%),
    radial-gradient(900px 500px at 90% 10%, rgba(0, 51, 160, 0.22), transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
}

body {
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

/* ——— Gate / login ——— */
.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.gate-card {
  width: min(420px, 100%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
    var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 32px 28px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.gate-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 28px;
}

.gate-brand img {
  height: 40px;
  width: auto;
}

.gate-caption {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.gate-card h1 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.gate-card .lede {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus {
  border-color: rgba(0, 229, 255, 0.55);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease, background 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.btn-primary {
  width: 100%;
  margin-top: 8px;
  background: #fff;
  color: #111;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent);
  color: #041018;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 8px 12px;
  font-size: 0.85rem;
}

.gate-error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 138, 128, 0.1);
  border: 1px solid rgba(255, 138, 128, 0.35);
  color: var(--danger);
  font-size: 0.9rem;
  line-height: 1.4;
}

.gate-hint {
  margin: 18px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

/* ——— Viewer shell ——— */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 11, 14, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-bar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.app-bar-left img {
  height: 28px;
  width: auto;
}

.app-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.app-meta .title {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-meta .sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
}

.app-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.app-bar-right .email {
  font-size: 0.8rem;
  color: var(--muted);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 28px 16px 40px;
}

/* Tablet bezel */
.tablet {
  width: min(1100px, 100%);
  aspect-ratio: 4 / 3;
  max-height: calc(100vh - 140px);
  background: linear-gradient(145deg, var(--bezel-edge), var(--bezel));
  border-radius: 28px;
  padding: 18px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 40px 100px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative;
}

.tablet::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 72px;
  height: 6px;
  border-radius: 999px;
  background: #0a0b0e;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.tablet-screen {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: var(--screen);
  border: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
}

.tablet-screen iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #0b0c10;
}

.tablet-loading,
.tablet-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  background: var(--screen);
  color: var(--muted);
  font-size: 0.95rem;
}

.tablet-error {
  color: var(--danger);
}

/* Breadcrumb */
.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--muted);
}

.crumb a:hover {
  color: var(--accent);
}

.crumb-current {
  color: var(--text);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Viewer nav rail */
.nav-rail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 11, 14, 0.55);
}

.nav-rail-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
  min-width: 0;
}

.nav-rail-meta #nav-position {
  font-weight: 700;
  font-size: 0.9rem;
}

.nav-rail .btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Section strip under tablet */
.strip {
  border-top: 1px solid var(--border);
  padding: 14px 20px 22px;
  background: rgba(0, 0, 0, 0.25);
}

.strip-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.strip-track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.strip-item {
  flex: 0 0 auto;
  min-width: 160px;
  max-width: 220px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 0.85rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.strip-item:hover {
  border-color: rgba(0, 229, 255, 0.45);
}

.strip-item.active {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.strip-title {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Hub gallery */
.hub {
  max-width: 1280px;
  margin: 0 auto;
  padding: 36px 20px 72px;
}

.hub-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.hub-brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hub-brand h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.03em;
}

.hub-brand p {
  margin: 0;
  color: var(--muted);
  max-width: 48ch;
  line-height: 1.45;
}

.section-jump {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.section-jump a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.section-jump a:hover {
  color: var(--text);
  border-color: rgba(0, 229, 255, 0.45);
}

.gallery-section {
  margin-bottom: 40px;
  scroll-margin-top: 88px;
}

.section-head {
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 0 0 4px;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.gallery {
  display: grid;
  gap: 16px;
}

.gallery-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.03), transparent 40%),
    var(--panel);
  min-height: 168px;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  border-color: rgba(0, 229, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.card .pill {
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #041018;
  background: var(--accent);
  border-radius: 999px;
  padding: 3px 8px;
}

.card .id {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.card h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
  flex: 1;
}

.card .cta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

@media (max-width: 1100px) {
  .gallery-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .gallery-4 {
    grid-template-columns: 1fr;
  }

  .tablet {
    aspect-ratio: 3 / 4;
    max-height: none;
    border-radius: 22px;
    padding: 12px;
  }

  .app-bar-right .email {
    display: none;
  }

  .stage {
    padding: 16px 12px 28px;
  }

  .crumb {
    display: none;
  }

  .nav-rail {
    padding: 10px 12px;
  }
}
