/* ============================================================
   JOSIAH'S MAKER CAVE — LCARS THEME (TNG Computer Interface)
   © Randy Lindstrom
   ============================================================ */

:root {
  --lcars-orange:   #ff9900;
  --lcars-gold:     #ffcc00;
  --lcars-blue:     #9999ff;
  --lcars-lt-blue:  #aaccff;
  --lcars-tan:      #ffcc99;
  --lcars-red:      #cc4444;
  --lcars-purple:   #cc88ff;
  --lcars-bg:       #000000;
  --lcars-bg-panel: #0a0a1a;
  --lcars-text:     #ffcc99;
  --lcars-text-dim: #997755;
  --lcars-text-bright: #ffffff;
  --header-h: 72px;
  --footer-h: 72px;
  --radius-pill: 40px;
  --font-display: 'Orbitron', sans-serif;
  --font-mono:    'Share Tech Mono', monospace;
  --font-body:    'Exo 2', sans-serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--lcars-bg);
  color: var(--lcars-text);
  font-family: var(--font-body);
  font-size: 16px;
  overflow: hidden;
}

/* ============================================================
   LCARS HEADER / NAV
   ============================================================ */
.lcars-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 100;
  display: flex;
  align-items: stretch;
  background: var(--lcars-bg);
}

.lcars-elbow {
  width: 180px;
  flex-shrink: 0;
}

.lcars-elbow-left {
  position: relative;
  background: var(--lcars-orange);
  border-radius: var(--radius-pill) var(--radius-pill) 0 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.lcars-elbow-left::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 60px; height: 60px;
  background: var(--lcars-bg);
  border-radius: var(--radius-pill) 0 0 0;
}

.lcars-elbow-right {
  position: relative;
  background: var(--lcars-gold);
  border-radius: var(--radius-pill) var(--radius-pill) 0 0;
}

.lcars-elbow-right::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 60px; height: 60px;
  background: var(--lcars-bg);
  border-radius: 0 var(--radius-pill) 0 0;
}

.lcars-nav {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 0 8px 8px;
  flex-shrink: 0;
}

.nav-btn {
  display: inline-block;
  background: var(--lcars-orange);
  color: var(--lcars-bg);
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border: none;
  white-space: nowrap;
}

.nav-btn:hover, .nav-btn.active {
  background: var(--lcars-gold);
  color: var(--lcars-bg);
}

.nav-btn:nth-child(2) { background: var(--lcars-blue); color: #000; }
.nav-btn:nth-child(2):hover { background: var(--lcars-lt-blue); }
.nav-btn:nth-child(3) { background: var(--lcars-tan); color: #000; }
.nav-btn:nth-child(3):hover { background: var(--lcars-gold); }

.lcars-title-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 10px;
  padding-left: 16px;
  border-bottom: 4px solid var(--lcars-orange);
}

.title-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--lcars-text-dim);
  letter-spacing: 0.2em;
}

.title-main {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--lcars-orange);
  letter-spacing: 0.15em;
}

/* ============================================================
   CONTENT FRAME (scrollable)
   ============================================================ */
.content-frame {
  position: fixed;
  top: var(--header-h);
  bottom: var(--footer-h);
  left: 0; right: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--lcars-bg);
  scroll-behavior: smooth;
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  display: none;
  min-height: 100%;
  animation: fadeIn 0.3s ease;
}
.section.active { display: block; }

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

/* ============================================================
   HOME — HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 85vh;
  background: var(--lcars-bg) center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(0,0,0,0.85) 0%,
    rgba(0,0,10,0.7) 60%,
    rgba(0,0,0,0.3) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 640px;
  padding: 48px 48px 48px 80px;
}

.lcars-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  color: var(--lcars-orange);
  margin-bottom: 16px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 900;
  color: var(--lcars-text-bright);
  line-height: 1.0;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.hero-sub {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--lcars-tan);
  margin-bottom: 20px;
}

.lcars-divider-h {
  width: 120px;
  height: 4px;
  background: var(--lcars-orange);
  border-radius: 2px;
  margin: 20px 0;
}

.hero-desc {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--lcars-text);
  max-width: 480px;
  margin-bottom: 32px;
}

.lcars-btn {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #000;
  background: var(--lcars-orange);
  border: none;
  border-radius: var(--radius-pill);
  padding: 12px 32px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.lcars-btn:hover {
  background: var(--lcars-gold);
  transform: scale(1.03);
}

/* Hero side panel */
.hero-side-panel {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 40px 40px 40px 0;
  align-items: flex-end;
}

.side-block {
  width: 100px;
  padding: 10px 14px;
  border-radius: var(--radius-pill) 0 0 var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: #000;
  text-align: center;
  line-height: 1.4;
}
.side-block.orange { background: var(--lcars-orange); height: 20px; }
.side-block.gold   { background: var(--lcars-gold);   height: 16px; }
.side-block.blue   { background: var(--lcars-blue);   height: 60px; }
.side-block.orange { height: 50px; }
.side-block.tan    { background: var(--lcars-tan);    height: 14px; }

/* HOME FEATURES */
.home-features {
  padding: 40px 80px;
  background: var(--lcars-bg-panel);
  border-top: 4px solid var(--lcars-orange);
}

.feature-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.feature-card {
  border: 1px solid #222244;
  border-left: 4px solid var(--lcars-orange);
  border-radius: 0 8px 8px 0;
  padding: 24px;
  background: rgba(255,153,0,0.04);
  transition: border-color 0.2s;
}
.feature-card:nth-child(2) { border-left-color: var(--lcars-blue); }
.feature-card:nth-child(3) { border-left-color: var(--lcars-gold); }
.feature-card:hover { border-color: var(--lcars-orange); }

.feature-icon {
  font-size: 1.8rem;
  color: var(--lcars-orange);
  margin-bottom: 12px;
}
.feature-card:nth-child(2) .feature-icon { color: var(--lcars-blue); }
.feature-card:nth-child(3) .feature-icon { color: var(--lcars-gold); }

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--lcars-orange);
  margin-bottom: 10px;
}
.feature-card:nth-child(2) h3 { color: var(--lcars-blue); }
.feature-card:nth-child(3) h3 { color: var(--lcars-gold); }

.feature-card p {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--lcars-text);
}

/* ============================================================
   SECTION HEADERS (Gallery, About)
   ============================================================ */
.section-header {
  padding: 40px 80px 24px;
  border-bottom: 4px solid var(--lcars-orange);
  position: relative;
}

.lcars-elbow-section {
  position: absolute;
  top: 0; left: 0;
  width: 60px; height: 60px;
  background: var(--lcars-orange);
  border-radius: 0 0 var(--radius-pill) 0;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--lcars-orange);
  padding-left: 80px;
}

.section-sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--lcars-text-dim);
  letter-spacing: 0.15em;
  margin-top: 6px;
  padding-left: 80px;
}

/* ============================================================
   GALLERY
   ============================================================ */
#gallery-container {
  padding: 32px 80px 48px;
}

.loading-msg {
  font-family: var(--font-mono);
  color: var(--lcars-text-dim);
  padding: 40px 0;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  animation: blink 1.2s step-end infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Category heading */
.category-section {
  margin-bottom: 48px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.category-pill {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #000;
  background: var(--lcars-orange);
  padding: 6px 20px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.category-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--lcars-tan);
}

.category-line {
  flex: 1;
  height: 2px;
  background: linear-gradient(to right, var(--lcars-orange), transparent);
  border-radius: 1px;
}

/* Item grid */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.item-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item-img-wrap {
  position: relative;
  width: 100%;
  padding-top: 100%; /* 1:1 square */
  overflow: hidden;
  border-radius: 10px;
  border: 2px solid #1a1a3a;
  background: #050510;
  transition: border-color 0.2s;
}
.item-img-wrap:hover { border-color: var(--lcars-orange); }

.item-img-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

/* Fallback placeholder if no image */
.item-img-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--lcars-text-dim);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  gap: 8px;
}
.item-img-placeholder span.icon { font-size: 2rem; }

.item-sku {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  color: var(--lcars-orange);
}

.item-desc {
  font-family: var(--font-body);
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--lcars-text);
}

/* No items state */
.no-items {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--lcars-text-dim);
  padding: 12px 0;
  letter-spacing: 0.1em;
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 24px;
  padding: 32px 80px 48px;
}

.lcars-panel {
  background: var(--lcars-bg-panel);
  border: 1px solid #1a1a3a;
  border-top: 4px solid var(--lcars-orange);
  border-radius: 0 0 8px 8px;
  padding: 28px;
  position: relative;
}

.lcars-panel:nth-child(2) { border-top-color: var(--lcars-blue); }
.lcars-panel:nth-child(3) { border-top-color: var(--lcars-gold); }

.full-width { grid-column: 1 / -1; }

.panel-label {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--lcars-orange);
  margin-bottom: 16px;
}
.lcars-panel:nth-child(2) .panel-label { color: var(--lcars-blue); }
.lcars-panel:nth-child(3) .panel-label { color: var(--lcars-gold); }

.lcars-panel p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--lcars-text);
  margin-bottom: 12px;
}
.lcars-panel p:last-child { margin-bottom: 0; }

/* Stats row */
.stat-row {
  display: flex;
  gap: 24px;
  margin-top: 20px;
  border-top: 1px solid #1a1a3a;
  padding-top: 20px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--lcars-blue);
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--lcars-text-dim);
  text-transform: uppercase;
  margin-top: 4px;
}

/* ============================================================
   LCARS FOOTER (static)
   ============================================================ */
.lcars-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--footer-h);
  background: var(--lcars-bg);
  border-top: 4px solid var(--lcars-orange);
  display: flex;
  align-items: stretch;
  z-index: 100;
}

.footer-left, .footer-right {
  display: flex;
  align-items: stretch;
  gap: 4px;
  padding: 8px 0 0;
  flex-shrink: 0;
}

.footer-left { padding-left: 8px; padding-right: 8px; }
.footer-right { padding-right: 8px; padding-left: 8px; }

.footer-block {
  border-radius: var(--radius-pill) var(--radius-pill) 0 0;
  width: 40px;
}
.footer-block.orange { background: var(--lcars-orange); }
.footer-block.gold   { background: var(--lcars-gold); width: 24px; }
.footer-block.blue   { background: var(--lcars-blue); }
.footer-block.tan    { background: var(--lcars-tan); width: 24px; }

.footer-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
}

.license-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--lcars-tan);
  text-align: center;
  line-height: 1.3;
}

.license-icon {
  color: var(--lcars-orange);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.license-text strong { color: var(--lcars-text-bright); }

.copyright-bar {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--lcars-text-dim);
  letter-spacing: 0.12em;
}

/* ============================================================
   SCROLLBAR STYLING
   ============================================================ */
.content-frame::-webkit-scrollbar { width: 6px; }
.content-frame::-webkit-scrollbar-track { background: #050510; }
.content-frame::-webkit-scrollbar-thumb {
  background: var(--lcars-orange);
  border-radius: 3px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --header-h: 58px;
    --footer-h: 80px;
  }

  .lcars-elbow { width: 100px; }
  .title-main { font-size: 0.85rem; }
  .hero-content { padding: 32px 24px; }
  .hero-side-panel { display: none; }
  .section-header { padding: 32px 24px 16px; }
  .section-title { padding-left: 60px; font-size: 1rem; }
  .section-sub { padding-left: 60px; }
  #gallery-container { padding: 20px 24px 40px; }
  .about-layout { grid-template-columns: 1fr; padding: 20px 24px 40px; }
  .home-features { padding: 24px; }
  .license-text { font-size: 0.64rem; }
  .footer-content { gap: 2px; }
}

@media (max-width: 480px) {
  .lcars-elbow { width: 60px; }
  .lcars-elbow-left::after { width: 40px; height: 40px; }
  .nav-btn { font-size: 0.6rem; padding: 5px 10px; }
  .items-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
