:root {
  color-scheme: dark;
  --bg: #090806;
  --bg-soft: #100e0b;
  --panel: #17130f;
  --panel-2: #211b15;
  --text: #f5ecdc;
  --muted: #c9bda6;
  --faint: #8d806b;
  --line: rgba(225, 194, 130, 0.2);
  --line-strong: rgba(225, 194, 130, 0.38);
  --gold: #d7b36a;
  --gold-2: #f0ce82;
  --teal: #83b6a5;
  --wine: #964f5a;
  --danger: #e16c62;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.42);
  --radius: 8px;
  --nav-width: 252px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.light-theme {
  color-scheme: light;
  --bg: #eee5d4;
  --bg-soft: #f8f0df;
  --panel: #fff8ea;
  --panel-2: #f1e3c9;
  --text: #17120c;
  --muted: #5f5343;
  --faint: #776b58;
  --line: rgba(87, 58, 20, 0.18);
  --line-strong: rgba(87, 58, 20, 0.34);
  --shadow: 0 20px 64px rgba(72, 48, 18, 0.18);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  background: var(--bg);
  overflow-x: hidden;
}

body {
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(9, 8, 6, 0.86), rgba(9, 8, 6, 0.98)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0, rgba(255, 255, 255, 0.025) 1px, transparent 1px, transparent 11px),
    var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

img,
video,
canvas {
  display: block;
  max-width: 100%;
}

.icon-sprite {
  display: none;
}

svg {
  width: 1.1rem;
  height: 1.1rem;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex: 0 0 auto;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--nav-width) minmax(0, 1fr);
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  overflow-x: hidden;
}

.side-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-soft) 92%, black);
  padding: 24px 18px;
  z-index: 10;
}

.brand-lockup,
.nav-button,
.button,
.icon-button,
.quick-tile,
.shutter {
  border: 0;
  cursor: pointer;
}

.brand-lockup {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 0 22px;
  color: var(--text);
  text-align: left;
  background: transparent;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: linear-gradient(145deg, rgba(215, 179, 106, 0.22), rgba(131, 182, 165, 0.08));
  border-radius: var(--radius);
  color: var(--gold-2);
}

.brand-lockup strong,
.brand-lockup small {
  display: block;
}

.brand-lockup strong {
  font-size: 0.98rem;
}

.brand-lockup small {
  color: var(--gold);
  margin-top: 2px;
}

.nav-stack {
  display: grid;
  gap: 8px;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-button:hover,
.nav-button.is-active {
  background: rgba(215, 179, 106, 0.12);
  color: var(--gold-2);
}

.nav-button:active,
.button:active,
.icon-button:active,
.quick-tile:active {
  transform: translateY(1px);
}

.app-main {
  min-width: 0;
  width: 100%;
  padding: 30px clamp(18px, 4vw, 54px) 52px;
  overflow-x: hidden;
}

.screen {
  display: none;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  min-width: 0;
}

.screen.is-active {
  display: block;
}

.screen-header {
  max-width: 720px;
  margin-bottom: 26px;
}

.screen-header.compact {
  margin-bottom: 18px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 750;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 8vw, 6.8rem);
  line-height: 0.92;
  font-weight: 700;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.3rem;
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
  letter-spacing: 0;
}

p {
  color: var(--muted);
  line-height: 1.65;
}

.hero-scene {
  position: relative;
  min-height: min(78vh, 760px);
  display: grid;
  align-items: end;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #080705;
  box-shadow: var(--shadow);
}

.hero-media {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 5, 4, 0.2) 0%, rgba(6, 5, 4, 0.3) 48%, rgba(6, 5, 4, 0.93) 100%),
    linear-gradient(90deg, rgba(6, 5, 4, 0.9), rgba(6, 5, 4, 0.08) 58%, rgba(6, 5, 4, 0.78)),
    url("../assets/images/historical-lens-hero.png") center / cover no-repeat;
  filter: saturate(0.92) contrast(1.06);
}

.hero-copy {
  position: relative;
  padding: clamp(28px, 5vw, 58px);
}

.hero-copy p {
  max-width: 560px;
  margin-bottom: 24px;
  color: #f0e2c7;
  font-size: 1.12rem;
}

.hero-actions,
.result-actions,
.capture-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-weight: 750;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button-primary {
  background: linear-gradient(135deg, #d7b36a, #a77a32);
  color: #15100a;
  border-color: rgba(240, 206, 130, 0.8);
}

.button-secondary {
  background: rgba(245, 236, 220, 0.06);
  color: var(--text);
}

.button:hover,
.icon-button:hover,
.quick-tile:hover {
  border-color: var(--gold);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.full-width {
  width: 100%;
}

.quick-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.quick-tile,
.collection-list span,
.discovery-card,
.setting-row,
.nearby-band,
.mode-card,
.result-report,
.share-card-panel,
.mode-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)),
    var(--panel);
}

.quick-tile {
  min-height: 136px;
  padding: 18px;
  color: var(--text);
  text-align: left;
}

.quick-tile strong,
.quick-tile span {
  display: block;
}

.quick-tile strong {
  margin-bottom: 10px;
}

.quick-tile span {
  color: var(--muted);
  line-height: 1.5;
}

.camera-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.38fr);
  gap: 18px;
  align-items: start;
  width: 100%;
  min-width: 0;
}

.camera-stage {
  position: relative;
  aspect-ratio: 4 / 5;
  min-height: 430px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(215, 179, 106, 0.12), transparent),
    #050504;
  box-shadow: var(--shadow);
}

.camera-stage::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(240, 206, 130, 0.34);
  border-radius: 5px;
  pointer-events: none;
}

.camera-video,
.image-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-video,
.image-preview {
  display: none;
}

.camera-video.is-visible,
.image-preview.is-visible {
  display: block;
}

.camera-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  padding: 34px;
  color: var(--muted);
  text-align: center;
}

.camera-placeholder svg {
  width: 58px;
  height: 58px;
  color: var(--gold);
}

.capture-strip {
  justify-content: center;
  grid-column: 1 / 2;
  margin-top: -78px;
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.capture-strip > * {
  pointer-events: auto;
}

.icon-button {
  display: inline-grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(20, 16, 12, 0.84);
  color: var(--gold-2);
}

.icon-button.danger {
  color: var(--danger);
}

.shutter {
  width: 70px;
  height: 70px;
  border: 4px solid rgba(245, 236, 220, 0.9);
  border-radius: 999px;
  background: rgba(215, 179, 106, 0.82);
  box-shadow: 0 0 0 8px rgba(0, 0, 0, 0.22);
}

.mode-panel {
  grid-row: span 2;
  min-width: 0;
  padding: 18px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
  margin-bottom: 14px;
}

.section-title span {
  font-weight: 800;
}

.section-title small {
  max-width: 220px;
  color: var(--faint);
  line-height: 1.4;
  text-align: right;
}

.mode-selector {
  display: grid;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
  margin-bottom: 16px;
}

.plan-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-bottom: 12px;
  padding: 7px 10px;
  border: 1px solid rgba(240, 206, 130, 0.28);
  border-radius: 999px;
  background: rgba(215, 179, 106, 0.1);
  color: var(--gold-2);
  font-size: 0.8rem;
  font-weight: 800;
}

.mode-panel .button + .button {
  margin-top: 10px;
}

.mode-option {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  min-height: 58px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.mode-option svg {
  margin-top: 2px;
  color: var(--gold);
}

.mode-option strong,
.mode-option span {
  display: block;
}

.mode-option strong {
  color: var(--text);
  font-size: 0.95rem;
}

.mode-option span {
  margin-top: 2px;
  font-size: 0.84rem;
  line-height: 1.35;
}

.mode-option.is-active {
  border-color: var(--gold);
  background: rgba(215, 179, 106, 0.12);
}

.analysis-screen {
  min-height: 72vh;
  text-align: center;
  place-content: center;
}

.analysis-screen.is-active {
  display: grid;
}

.analysis-orbit {
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  margin: 0 auto 24px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--gold-2);
  animation: rotateLens 4s linear infinite;
}

.analysis-orbit svg {
  width: 54px;
  height: 54px;
}

@keyframes rotateLens {
  to {
    transform: rotate(360deg);
  }
}

.analysis-steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 720px;
  margin: 22px auto 0;
}

.analysis-steps span {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
}

.result-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(320px, 1.08fr);
  gap: 18px;
  align-items: start;
}

.result-media-wrap {
  position: sticky;
  top: 28px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #050504;
  box-shadow: var(--shadow);
}

.result-image {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.certainty-chip {
  position: absolute;
  left: 14px;
  bottom: 14px;
  max-width: calc(100% - 28px);
  padding: 8px 10px;
  border: 1px solid rgba(240, 206, 130, 0.45);
  border-radius: 999px;
  background: rgba(7, 6, 5, 0.76);
  color: var(--gold-2);
  font-size: 0.84rem;
  backdrop-filter: blur(10px);
}

.result-report {
  padding: 20px;
}

.result-summary {
  color: var(--text);
  font-size: 1.08rem;
}

.report-section {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.report-section h3 {
  color: var(--gold-2);
}

.report-section p,
.report-section ul {
  margin-bottom: 0;
}

.report-section ul {
  display: grid;
  gap: 8px;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.55;
}

.caveat {
  margin: 4px 0 18px;
  padding: 12px;
  border-left: 3px solid var(--teal);
  background: rgba(131, 182, 165, 0.08);
  color: var(--text);
}

.share-card-panel {
  margin-top: 18px;
  padding: 18px;
}

.share-card-panel canvas {
  width: min(100%, 420px);
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #090806;
}

.discovery-grid,
.explore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.discovery-card,
.mode-card {
  overflow: hidden;
}

.mode-card {
  cursor: pointer;
  color: inherit;
  text-align: left;
}

.discovery-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #050504;
}

.discovery-body,
.mode-card {
  padding: 16px;
}

.discovery-body strong,
.mode-card strong {
  display: block;
  margin-bottom: 7px;
  color: var(--text);
}

.discovery-body span,
.mode-card span {
  display: block;
  color: var(--muted);
  line-height: 1.45;
}

.discovery-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.discovery-actions .button {
  min-height: 38px;
  padding: 8px 11px;
  font-size: 0.9rem;
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 26px;
  color: var(--muted);
  text-align: center;
}

.nearby-band {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 20px;
  margin-bottom: 16px;
}

.nearby-band h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
}

.collection-band {
  margin-top: 18px;
}

.collection-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.collection-list span {
  padding: 10px 12px;
  color: var(--muted);
}

.settings-list {
  display: grid;
  gap: 12px;
  max-width: 780px;
}

.diagnostics-panel {
  max-width: 980px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(155deg, rgba(131, 182, 165, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)),
    var(--panel);
  box-shadow: var(--shadow);
}

.diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.diagnostic-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 12px;
  min-height: 118px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.diagnostic-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--faint);
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.04);
}

.diagnostic-ok .diagnostic-dot {
  background: var(--teal);
}

.diagnostic-warn .diagnostic-dot {
  background: var(--gold);
}

.diagnostic-bad .diagnostic-dot {
  background: var(--danger);
}

.diagnostic-item strong,
.diagnostic-item span,
.diagnostic-item small {
  display: block;
}

.diagnostic-item strong {
  margin-bottom: 6px;
  color: var(--text);
}

.diagnostic-item span {
  color: var(--gold-2);
  font-weight: 760;
}

.diagnostic-item small {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.4;
}

.diagnostic-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  min-height: 76px;
  padding: 16px;
}

.setting-row strong,
.setting-row small {
  display: block;
}

.setting-row small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.4;
}

select {
  min-height: 42px;
  min-width: 148px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--text);
  padding: 8px 12px;
}

input[role="switch"] {
  width: 48px;
  height: 28px;
  accent-color: var(--gold);
}

.bottom-nav {
  display: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 50;
  width: min(92vw, 420px);
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(13, 11, 8, 0.94);
  color: var(--text);
  text-align: center;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1180px), (hover: none) and (pointer: coarse) {
  .app-shell {
    display: block;
    padding-bottom: 78px;
  }

  .side-nav {
    display: none;
  }

  .app-main {
    padding: 18px 14px 24px;
  }

  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg-soft) 94%, black);
  }

  .bottom-nav .nav-button {
    min-height: 66px;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    border-radius: 0;
    font-size: 0.72rem;
    flex-direction: column;
  }

  .hero-scene {
    min-height: 70vh;
  }

  .hero-copy {
    padding: 26px;
  }

  .quick-panel,
  .camera-layout,
  .result-layout {
    grid-template-columns: 1fr;
  }

  .camera-stage {
    min-height: auto;
  }

  .capture-strip {
    grid-column: auto;
    margin-top: -66px;
  }

  .mode-panel {
    grid-row: auto;
    margin-top: 10px;
  }

  .result-media-wrap {
    position: relative;
    top: auto;
  }

  .nearby-band,
  .setting-row {
    align-items: stretch;
    flex-direction: column;
  }

  .section-title {
    align-items: start;
    flex-direction: column;
  }

  .section-title small {
    max-width: none;
    text-align: left;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 3.2rem;
  }

  h2 {
    font-size: 1.9rem;
  }

  .hero-actions,
  .result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .shutter {
    width: 64px;
    height: 64px;
  }
}

html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(115deg, rgba(215, 179, 106, 0.065), transparent 34%, rgba(131, 182, 165, 0.05) 72%, transparent),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 6px),
    repeating-linear-gradient(90deg, rgba(215, 179, 106, 0.018) 0 1px, transparent 1px 18px);
  opacity: 0.72;
  pointer-events: none;
}

.screen.is-active {
  animation: screenIn 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.button,
.icon-button,
.nav-button,
.quick-tile,
.mode-option,
.mode-card,
.discovery-card,
.setting-row {
  will-change: transform;
}

.button:focus-visible,
.icon-button:focus-visible,
.nav-button:focus-visible,
.quick-tile:focus-visible,
.mode-option:focus-visible,
.mode-card:focus-visible,
.install-pill:focus-visible {
  outline: 2px solid var(--gold-2);
  outline-offset: 3px;
}

.mobile-app-bar {
  display: none;
}

.hero-scene {
  isolation: isolate;
  min-height: min(80vh, 780px);
}

.hero-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(240, 206, 130, 0.12), transparent 22%),
    linear-gradient(0deg, rgba(9, 8, 6, 0.86), transparent 38%);
  pointer-events: none;
}

.hero-scene::after {
  content: "";
  position: absolute;
  left: clamp(24px, 5vw, 58px);
  right: clamp(24px, 5vw, 58px);
  bottom: clamp(22px, 4vw, 48px);
  z-index: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
  opacity: 0.7;
}

.hero-copy {
  z-index: 2;
  max-width: 860px;
  text-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.hero-badge-row {
  position: absolute;
  top: clamp(22px, 4vw, 44px);
  left: clamp(28px, 5vw, 58px);
  right: clamp(28px, 5vw, 58px);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-badge-row span,
.result-meta-strip span,
.share-specs span,
.install-pill {
  border: 1px solid rgba(240, 206, 130, 0.28);
  background: rgba(9, 8, 6, 0.54);
  color: #f0dec0;
  backdrop-filter: blur(16px);
}

.hero-badge-row span {
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 760;
}

.brand-seal {
  position: absolute;
  right: clamp(28px, 5vw, 58px);
  bottom: clamp(34px, 6vw, 72px);
  display: grid;
  width: clamp(72px, 10vw, 118px);
  height: clamp(72px, 10vw, 118px);
  place-items: center;
  border: 1px solid rgba(240, 206, 130, 0.36);
  border-radius: 50%;
  background: rgba(9, 8, 6, 0.48);
  color: var(--gold-2);
  backdrop-filter: blur(14px);
  animation: slowTurn 18s linear infinite;
}

.brand-seal svg {
  width: 48%;
  height: 48%;
}

@keyframes slowTurn {
  to {
    transform: rotate(360deg);
  }
}

.button-primary {
  box-shadow: 0 14px 36px rgba(167, 122, 50, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.button-secondary,
.icon-button,
.nav-button.is-active,
.quick-tile,
.mode-card,
.discovery-card,
.setting-row,
.mode-panel,
.result-report,
.share-card-panel,
.nearby-band {
  backdrop-filter: blur(18px);
}

.button:hover,
.icon-button:hover,
.quick-tile:hover,
.mode-option:hover,
.mode-card:hover,
.discovery-card:hover {
  transform: translateY(-2px);
}

.quick-tile,
.mode-card,
.discovery-card {
  position: relative;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

.quick-tile::before,
.mode-card::before,
.discovery-card::before,
.setting-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--gold), rgba(131, 182, 165, 0.25));
  opacity: 0;
  transition: opacity 180ms ease;
}

.quick-tile:hover::before,
.mode-card:hover::before,
.discovery-card:hover::before,
.setting-row:hover::before {
  opacity: 1;
}

.camera-stage {
  isolation: isolate;
  min-height: 540px;
}

.camera-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(245, 236, 220, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(245, 236, 220, 0.035) 1px, transparent 1px);
  background-size: 33.333% 33.333%;
  opacity: 0.42;
  pointer-events: none;
}

.camera-topline {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(240, 206, 130, 0.24);
  border-radius: var(--radius);
  background: rgba(7, 6, 5, 0.56);
  color: var(--muted);
  font-size: 0.78rem;
  backdrop-filter: blur(16px);
}

.camera-topline strong {
  color: var(--gold-2);
  font-size: 0.82rem;
}

.camera-placeholder strong {
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
}

.camera-guides span {
  position: absolute;
  z-index: 4;
  width: 34px;
  height: 34px;
  border-color: rgba(240, 206, 130, 0.68);
  pointer-events: none;
}

.camera-guides span:nth-child(1) {
  top: 78px;
  left: 24px;
  border-top: 2px solid;
  border-left: 2px solid;
}

.camera-guides span:nth-child(2) {
  top: 78px;
  right: 24px;
  border-top: 2px solid;
  border-right: 2px solid;
}

.camera-guides span:nth-child(3) {
  left: 24px;
  bottom: 112px;
  border-bottom: 2px solid;
  border-left: 2px solid;
}

.camera-guides span:nth-child(4) {
  right: 24px;
  bottom: 112px;
  border-bottom: 2px solid;
  border-right: 2px solid;
}

.capture-strip {
  gap: 16px;
}

.icon-button {
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.32);
}

.shutter {
  position: relative;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.shutter::after {
  content: "";
  position: absolute;
  inset: 11px;
  border-radius: inherit;
  background: rgba(245, 236, 220, 0.9);
}

.shutter:hover {
  transform: scale(1.04);
  box-shadow: 0 0 0 9px rgba(215, 179, 106, 0.18), 0 18px 42px rgba(0, 0, 0, 0.36);
}

.mode-panel {
  position: relative;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.2);
}

.mode-option {
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.mode-option.is-active {
  box-shadow: inset 0 0 0 1px rgba(240, 206, 130, 0.28), 0 10px 28px rgba(215, 179, 106, 0.1);
}

.capture-note {
  margin: 12px 0 0;
  color: var(--faint);
  font-size: 0.86rem;
  line-height: 1.45;
  text-align: center;
}

.analysis-orbit {
  box-shadow: 0 0 0 14px rgba(215, 179, 106, 0.045), 0 0 60px rgba(215, 179, 106, 0.14);
}

.analysis-steps span {
  animation: pulseStep 1.8s ease-in-out infinite;
}

.analysis-steps span:nth-child(2) {
  animation-delay: 180ms;
}

.analysis-steps span:nth-child(3) {
  animation-delay: 360ms;
}

@keyframes pulseStep {
  50% {
    border-color: rgba(240, 206, 130, 0.48);
    color: var(--text);
  }
}

.result-layout {
  grid-template-columns: minmax(310px, 0.9fr) minmax(360px, 1.1fr);
  gap: 22px;
}

.result-media-wrap {
  isolation: isolate;
}

.result-media-wrap::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 38%;
  background: linear-gradient(0deg, rgba(7, 6, 5, 0.88), transparent);
  pointer-events: none;
}

.certainty-chip,
.result-media-caption {
  z-index: 2;
}

.result-media-caption {
  position: absolute;
  right: 14px;
  bottom: 14px;
  max-width: calc(100% - 170px);
  color: rgba(245, 236, 220, 0.78);
  font-size: 0.78rem;
  text-align: right;
}

.result-report {
  padding: 22px;
  background:
    linear-gradient(155deg, rgba(240, 206, 130, 0.1), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    var(--panel);
  box-shadow: var(--shadow);
}

.result-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.result-meta-strip span {
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 760;
}

.confidence-meter {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.confidence-meter div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
}

.confidence-meter strong {
  color: var(--gold-2);
}

.confidence-meter small {
  color: var(--faint);
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 800;
}

.confidence-meter > span {
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(245, 236, 220, 0.08);
}

.confidence-meter i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold-2));
  transition: width 620ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.result-summary {
  position: relative;
  margin-bottom: 18px;
  padding-left: 18px;
  border-left: 3px solid var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.24rem;
  line-height: 1.55;
}

.report-section {
  display: grid;
  gap: 7px;
}

.report-section h3 {
  margin: 0;
  font-size: 0.92rem;
  text-transform: uppercase;
}

.report-section li::marker {
  color: var(--gold);
}

.caveat {
  border-left-color: var(--teal);
  box-shadow: inset 0 0 0 1px rgba(131, 182, 165, 0.08);
}

.share-card-panel {
  background:
    linear-gradient(155deg, rgba(131, 182, 165, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012)),
    var(--panel);
}

.share-studio {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(260px, 1fr);
  gap: 22px;
  align-items: center;
}

.share-device {
  width: min(100%, 420px);
  margin: 0 auto;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #15110d, #090806);
  box-shadow: 0 22px 72px rgba(0, 0, 0, 0.42);
}

.share-device-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  color: var(--gold-2);
  font-size: 0.78rem;
  font-weight: 800;
}

.share-device-top span {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(240, 206, 130, 0.34), transparent);
}

.share-canvas-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(240, 206, 130, 0.2);
  border-radius: 6px;
}

.share-card-panel canvas {
  width: 100%;
  border: 0;
  border-radius: 0;
}

.share-sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 20%, rgba(255, 255, 255, 0.12), transparent 42%);
  transform: translateX(-120%);
  animation: sheen 3.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes sheen {
  45%,
  100% {
    transform: translateX(120%);
  }
}

.share-details h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
}

.share-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.share-specs span {
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 760;
}

.discovery-card img {
  filter: saturate(0.92) contrast(1.04);
}

.discovery-body {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent);
}

.empty-state {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01)),
    rgba(215, 179, 106, 0.04);
}

.toast {
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
}

@media (max-width: 1180px), (hover: none) and (pointer: coarse) {
  .mobile-app-bar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    min-height: calc(62px + env(safe-area-inset-top, 0px));
    padding: calc(8px + env(safe-area-inset-top, 0px)) 14px 8px;
    border-bottom: 1px solid var(--line);
    background: rgba(9, 8, 6, 0.78);
    backdrop-filter: blur(22px);
  }

  body.light-theme .mobile-app-bar {
    background: rgba(248, 240, 223, 0.78);
  }

  .mobile-brand {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    text-align: left;
  }

  .mobile-brand .brand-mark {
    width: 38px;
    height: 38px;
  }

  .mobile-brand strong,
  .mobile-brand small {
    display: block;
  }

  .mobile-brand strong {
    font-size: 0.92rem;
  }

  .mobile-brand small {
    color: var(--gold);
    font-size: 0.78rem;
  }

  .install-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
  }

  .app-shell {
    display: block;
    padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px));
  }

  .app-main {
    padding: 14px 12px 28px;
  }

  .bottom-nav {
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(9, 8, 6, 0.82);
    backdrop-filter: blur(22px);
    box-shadow: 0 -18px 60px rgba(0, 0, 0, 0.38);
  }

  body.light-theme .bottom-nav {
    background: rgba(248, 240, 223, 0.86);
  }

  .bottom-nav .nav-button {
    min-height: 62px;
  }

  .bottom-nav .nav-button span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hero-scene {
    min-height: calc(100svh - 156px);
  }

  .hero-badge-row {
    top: 18px;
    left: 18px;
    right: 18px;
  }

  .brand-seal {
    display: none;
  }

  .hero-copy {
    padding: 96px 22px 30px;
  }

  .quick-panel {
    display: flex;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
  }

  .quick-tile {
    flex: 0 0 min(82vw, 330px);
    scroll-snap-align: start;
  }

  .camera-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .camera-stage {
    width: 100%;
    min-height: auto;
    height: min(62svh, 560px);
    max-height: 560px;
    aspect-ratio: auto;
  }

  .capture-strip {
    grid-column: auto;
    width: 100%;
    margin: -68px 0 6px;
    gap: 14px;
  }

  .mode-panel {
    grid-row: auto;
    width: 100%;
    margin-top: 8px;
    padding: 16px;
  }

  .mode-selector {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
  }

  .mode-option {
    flex: 0 0 min(82vw, 280px);
    scroll-snap-align: start;
  }

  .result-layout,
  .share-studio {
    grid-template-columns: 1fr;
  }

  .result-report {
    padding: 18px;
  }

  .share-details {
    order: -1;
  }
}

@media (max-width: 560px) {
  .app-main {
    padding: 12px 10px 22px;
  }

  .screen-header {
    margin-bottom: 14px;
  }

  .screen-header p {
    font-size: 0.94rem;
    line-height: 1.45;
  }

  .hero-badge-row span {
    padding: 7px 9px;
    font-size: 0.7rem;
  }

  .hero-copy p {
    font-size: 1rem;
  }

  .camera-topline {
    left: 12px;
    right: 12px;
    top: 12px;
  }

  .camera-stage {
    min-height: 300px;
    height: min(54svh, 440px);
    max-height: 440px;
  }

  .camera-stage::after {
    inset: 12px;
  }

  .capture-strip {
    margin-top: -62px;
    gap: 12px;
  }

  .icon-button {
    width: 44px;
    height: 44px;
  }

  .shutter {
    width: 64px;
    height: 64px;
  }

  .mode-panel {
    padding: 14px;
  }

  .section-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .section-title small {
    max-width: none;
    text-align: left;
  }

  .mode-option {
    flex-basis: min(78vw, 250px);
  }

  .mode-option strong {
    font-size: 0.88rem;
  }

  .mode-option span {
    font-size: 0.78rem;
  }

  .result-actions .button {
    flex: 1 1 100%;
  }

  .share-card-panel {
    padding: 14px;
  }

  .share-device {
    padding: 8px;
  }

  .camera-guides span:nth-child(1),
  .camera-guides span:nth-child(2) {
    top: 68px;
  }

  .result-summary {
    font-size: 1.1rem;
  }

  .confidence-meter div {
    align-items: start;
    flex-direction: column;
  }

  .result-media-caption {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
