/* === BASE v2 — dark MySpace band-page skin ===
   Platform chrome = MySpace grammar (blue bar, blue nav strip, table
   modules) on a dark chassis. bagel's collage wall plasters the page
   behind the content well. Form controls stay LIGHT (era system
   controls). No glow, no scanlines. Cyber-v1 lives in branch
   backup/cyber-v1. */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  font-size: var(--fs);
  color: var(--text-primary);
  background-color: var(--body-bg);
  /* the plastered wall: pre-composited sticker-bomb of bagel's covers */
  background-image: url("../assets/bagel/wall-tile.jpg");
  background-repeat: repeat;
  background-size: 800px 800px;
  background-attachment: fixed;
  line-height: 1.45;
}

@media (max-width: 768px) {
  body { background-attachment: scroll; } /* fixed = jank on mobile */
}

a { color: var(--link); font-weight: bold; text-decoration: underline; }
a:visited { color: var(--link-visited); }
a:hover { color: var(--link-hover); text-decoration: underline; }

img { max-width: 100%; border: 0; }

/* era reality: form controls are LIGHT system widgets even on dark skins */
input, select, textarea {
  font-family: var(--font);
  font-size: var(--fs);
  background: #fff;
  color: #111;
  border: 1px solid #7a7a86;
}

html, body { overflow-x: hidden; }

/* === SITE WRAPPER (the content well floating on the wall) === */
.wrapper {
  width: var(--site-width);
  max-width: 100%;
  margin: 14px auto;
  background: var(--panel-bg);
  border: 1px solid #000;
  outline: 1px solid var(--border-dim);
  box-shadow: 7px 7px 0 rgba(0, 0, 0, 0.55);
}

/* === PLATFORM BAR (the blue MySpace-grammar header) === */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--plat-bar);
  border-bottom: 1px solid var(--plat-bar-edge);
  flex-wrap: wrap;
  gap: 6px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-sm);
  color: #c7d4f2;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-sm);
}

.topbar-links { color: #6e84bd; }
.topbar-links a {
  color: #dce6fa;
  font-weight: normal;
}
.topbar-links a:visited { color: #dce6fa; }
.topbar-links a:hover { color: #fff; }

.logo-area {
  display: flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
}

/* logo.png is black line art — white sticker chip, slight tilt */
.logo-img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  display: inline-block;
  background: var(--white);
  padding: 2px;
  transform: rotate(-2deg);
  box-shadow: 1px 1px 0 rgba(0,0,0,0.5);
}

.logo-name {
  font-size: var(--t-lg);
  font-weight: bold;
  color: #fff;
  font-family: var(--font);
  letter-spacing: -0.5px;
  display: block;
  line-height: 1.1;
}

.logo-sub {
  font-size: var(--t-xs);
  color: #9fb6e8;
  display: block;
  font-weight: normal;
  font-family: var(--font);
}

.search-box { display: flex; gap: 3px; }

.search-box input {
  width: 150px;
  padding: 2px 4px;
  font-size: var(--t-base);
}

.search-box button {
  padding: 2px 10px;
  background: var(--grad-control);
  color: #e3e3ea;
  border: 2px outset var(--border-hard);
  font-size: var(--t-xs);
  cursor: pointer;
  font-family: var(--font);
  font-weight: bold;
}

.search-box button:active { border-style: inset; }

.cart-icon { font-size: var(--fs); }
.cart-icon a { color: #dce6fa; font-weight: bold; }
.cart-icon a:visited { color: #dce6fa; }
.cart-icon a:hover { color: #fff; }

.cart-count {
  background: var(--red);
  color: white;
  font-size: var(--t-xs);
  padding: 0 4px;
  font-weight: bold;
}

/* === NAV STRIP (lighter blue, pipe-separated era links) === */
.navbar {
  background: var(--plat-nav);
  padding: 3px 10px;
  font-size: var(--t-base);
  font-family: var(--font);
  border-bottom: 1px solid var(--plat-bar-edge);
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.navbar a {
  color: #dce6fa;
  text-decoration: none;
  padding: 0 2px;
  font-size: var(--t-base);
  font-weight: normal;
}

.navbar a:visited { color: #dce6fa; }
.navbar a:hover { text-decoration: underline; color: #fff; }
.navbar a b { font-weight: bold; color: #fff; }
.navbar .sep { color: #7b90c4; margin: 0 4px; }

/* === MAIN LAYOUT === */
.main {
  display: flex;
  min-height: 400px;
}

/* === SIDEBAR (the profile's left column) === */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  border-right: 1px solid var(--border-dim);
  background: var(--panel-bg);
  padding: 0 0 8px;
  font-size: var(--fs-sm);
}

/* blue family header cell — flat, no glow, no tracking games */
.sidebar-title {
  background: var(--blue-hd);
  color: var(--blue-hd-text);
  padding: 3px 8px;
  font-size: var(--t-base);
  font-weight: bold;
  border-top: 1px solid var(--blue-cell-border);
  border-bottom: 1px solid var(--plat-bar-edge);
  font-family: var(--font);
  margin-top: 8px;
}

.sidebar > .sidebar-title:first-child { margin-top: 0; }

.sidebar ul { list-style: none; margin: 0; padding: 0; }

.sidebar li { border-bottom: 1px solid #1d1d24; }

.sidebar li a {
  display: block;
  padding: 3px 8px;
  color: var(--link);
  text-decoration: none;
  font-size: var(--t-base);
  font-weight: bold;
}

.sidebar li a:visited { color: var(--link-visited); }

.sidebar li a:hover {
  background: var(--blue-cell-b);
  color: var(--link-hover);
  text-decoration: underline;
}

.sidebar li a.active {
  background: var(--blue-cell-a);
  color: #fff;
}

.cat-count { color: var(--text-dim); font-size: var(--t-xs); font-weight: normal; }

.sidebar-info {
  padding: 6px 8px;
  font-size: var(--t-xs);
  color: var(--text-muted);
  line-height: 1.7;
  font-family: var(--font);
}

.sidebar-info b { color: var(--text-primary); }
.sidebar-info a { font-size: var(--t-xs); }

/* vendor info box: the contained Silk Road terminal artifact */
.sidebar-info.vendor-box {
  font-family: var(--font-mono);
  color: #9fd49f;
  background: #0e130e;
  border: 1px solid #1d2e1d;
  margin: 8px;
  padding: 6px 8px;
}
.sidebar-info.vendor-box b { color: var(--green-live); }

/* === PROFILE WIDGET (blue family) === */
.profile-widget {
  border: 1px solid var(--blue-cell-border);
  margin: 8px;
  background: var(--surface-bg);
}

.profile-widget-header {
  background: var(--blue-hd);
  color: var(--blue-hd-text);
  padding: 3px 8px;
  font-size: var(--t-base);
  font-weight: bold;
  border-bottom: 1px solid var(--plat-bar-edge);
  font-family: var(--font);
}

.profile-widget-body {
  padding: 8px;
  font-size: var(--t-base);
  line-height: 1.6;
  color: var(--text-muted);
}

/* avatar art is white-paper line art — taped print chip */
.profile-widget-body img {
  padding: 3px;
  background: var(--white);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.5);
  transform: rotate(-1.5deg);
}

/* === BLURB BOX (orange content family) === */
.blurb-box {
  border: 1px solid var(--or-border);
  margin-bottom: 10px;
  background: var(--surface-bg);
}

.blurb-box-title {
  background: var(--or-hd);
  padding: 3px 8px;
  font-size: var(--t-base);
  font-weight: bold;
  color: var(--or-hd-text);
  border-bottom: 1px solid #1c0f04;
  font-family: var(--font);
}

.blurb-box-body {
  padding: 8px;
  font-size: var(--t-base);
  line-height: 1.6;
  color: var(--text-muted);
}

.blurb-box-body b { color: var(--or-text); }

/* "extended network" banner — the one light platform artifact */
.network-banner {
  background: var(--white);
  color: #181818;
  font-family: var(--font);
  font-size: var(--t-md);
  font-weight: bold;
  text-align: center;
  padding: 12px 8px;
  margin-bottom: 10px;
  border: 1px solid #000;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.55);
}

/* === CONTENT === */
.content {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  background: var(--panel-bg);
  overflow: hidden;
  position: relative;
}

/* === PRODUCTS — photo prints taped to the page, not cards === */
.products {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 10px;
  align-items: flex-start;
  max-width: 100%;
  padding: 4px 2px 8px;
}

.product-block {
  width: 172px;
  cursor: pointer;
  padding: 6px 6px 8px;
  background: var(--white);
  color: #1d1d1d;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.55);
  transform: rotate(-1.4deg);
}

.product-block:nth-child(2n) { transform: rotate(1.2deg); }
.product-block:nth-child(3n) { transform: rotate(-0.6deg); }

.product-block:hover {
  transform: rotate(0deg);
  box-shadow: 4px 4px 0 rgba(0,0,0,0.6);
}

.product-block-img {
  width: 100%;
  height: 165px;
  background: #ddd8cc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--t-xs);
  color: #777;
  text-align: center;
  margin-bottom: 5px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.product-block-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-block-name {
  font-size: var(--t-base);
  color: #1d1d1d;
  font-weight: bold;
  line-height: 1.3;
  margin-bottom: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font);
}

.product-block-price {
  font-size: var(--t-base);
  color: #b51e1e;
  font-weight: bold;
}

.product-block-vendor {
  font-size: var(--t-xs);
  color: #8a8578;
  margin-top: 2px;
  font-family: var(--font);
}

/* shop page: listings become dense marketplace ROWS (P2P table energy) */
[data-theme="silkroad"] .products { display: block; padding: 0; }

[data-theme="silkroad"] .product-block,
[data-theme="silkroad"] .product-block:nth-child(2n),
[data-theme="silkroad"] .product-block:nth-child(3n) {
  width: 100%;
  transform: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  background: var(--surface-bg);
  color: var(--text-primary);
  box-shadow: none;
  border: 0;
  border-bottom: 1px solid #23232b;
  padding: 6px 8px;
  margin: 0;
}

[data-theme="silkroad"] .product-block:nth-child(odd) { background: #18181f; }

[data-theme="silkroad"] .product-block:hover {
  background: var(--blue-cell-b);
  transform: none;
}

[data-theme="silkroad"] .product-block-img {
  width: 56px;
  height: 56px;
  margin: 0;
  flex-shrink: 0;
  background: var(--white);
  padding: 2px;
  box-shadow: 1px 1px 0 rgba(0,0,0,0.5);
}

[data-theme="silkroad"] .product-block-name {
  color: var(--link);
  text-decoration: underline;
  flex: 1;
  white-space: normal;
  margin: 0;
}

[data-theme="silkroad"] .product-block:hover .product-block-name { color: var(--link-hover); }

[data-theme="silkroad"] .product-block-price {
  color: var(--red-bright);
  min-width: 64px;
  text-align: right;
  order: 3;
}

[data-theme="silkroad"] .product-block-vendor {
  color: var(--text-dim);
  margin: 0;
  min-width: 110px;
  order: 2;
}

/* === PRODUCT DETAIL (marketplace listing panel) === */
.detail-panel {
  border: 1px solid var(--blue-cell-border);
  padding: 10px;
  margin-bottom: 10px;
  background: var(--surface-bg);
  display: none;
}

.detail-panel.open { display: block; }

.detail-inner { display: flex; gap: 12px; }

.detail-left { flex-shrink: 0; }

/* listing photo as a big print */
.detail-img {
  width: 230px;
  height: 270px;
  background: var(--white);
  padding: 6px;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.detail-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-thumbs { display: flex; gap: 4px; margin-top: 6px; }

.detail-thumbs .thumb {
  width: 50px;
  height: 50px;
  object-fit: cover;
  background: var(--white);
  padding: 2px;
  cursor: pointer;
  opacity: 0.7;
  box-shadow: 1px 1px 0 rgba(0,0,0,0.5);
}

.detail-thumbs .thumb:hover { opacity: 1; }

.detail-thumbs .thumb.sel { opacity: 1; outline: 2px solid var(--link); }

/* === VARIANT CONTROLS (bevel era buttons) === */
.colors { display: flex; gap: 3px; margin: 3px 0 6px; }

.color-btn {
  padding: 3px 8px;
  border: 2px outset var(--border-hard);
  background: var(--grad-control);
  color: #e3e3ea;
  font-size: var(--t-base);
  cursor: pointer;
  font-family: var(--font);
}

.color-btn:hover { color: #fff; }

.color-btn.sel {
  border-style: inset;
  background: var(--blue-cell-a);
  color: #fff;
  font-weight: bold;
}

.color-btn:active { border-style: inset; }

.detail-info h3 {
  font-size: var(--fs-lg);
  color: var(--text-primary);
  margin-bottom: 3px;
  font-family: var(--font);
}

.detail-info .price {
  font-size: var(--fs-xl);
  color: var(--red-bright);
  font-weight: bold;
  margin-bottom: 4px;
}

.detail-info .desc {
  font-size: var(--fs);
  color: var(--text-muted);
  margin-bottom: 6px;
}

.detail-info label {
  font-size: var(--fs-sm);
  font-weight: bold;
  color: var(--text-muted);
}

.sizes { display: flex; gap: 2px; margin: 3px 0 6px; }

.sz {
  padding: 2px 8px;
  border: 2px outset var(--border-hard);
  background: var(--grad-control);
  color: #e3e3ea;
  font-size: var(--t-base);
  cursor: pointer;
  font-family: var(--font);
}

.sz:hover, .sz.sel {
  border-style: inset;
  background: var(--blue-cell-a);
  color: #fff;
}

/* the one gel moment: the buy button */
.add-btn {
  padding: 5px 16px;
  background: linear-gradient(180deg, #ea6e5c 0%, #cf4636 48%, #b23a2e 52%, #c94a3a 100%);
  color: #fff;
  border: 1px solid #7a201a;
  border-radius: 3px;
  font-weight: bold;
  font-size: var(--fs);
  cursor: pointer;
  font-family: var(--font);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), 1px 1px 0 rgba(0,0,0,0.4);
  text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
}

.add-btn:hover { background: linear-gradient(180deg, #f07d6b 0%, #d8503f 48%, #bc4034 52%, #d25444 100%); }

.add-btn:active {
  box-shadow: inset 1px 1px 3px rgba(0,0,0,0.45);
}

.close-btn {
  float: right;
  background: none;
  border: none;
  color: var(--text-muted);
  text-decoration: underline;
  cursor: pointer;
  font-size: var(--fs);
  font-family: var(--font);
}

.close-btn:hover { color: var(--link-hover); }

/* === FOOTER === */
.footer {
  border-top: 1px solid var(--border-dim);
  padding: 10px 12px;
  font-size: var(--t-xs);
  color: var(--text-dim);
  text-align: center;
  background: #121218;
  font-family: var(--font);
}

.footer a {
  color: var(--link);
  font-size: var(--t-xs);
  margin: 0 4px;
  font-weight: normal;
}

.footer a:visited { color: var(--link-visited); }
.footer a:hover { color: var(--link-hover); }

/* === HAMBURGER (mobile) === */
.hamburger { display: none; cursor: pointer; }

.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: #dce6fa;
  margin: 3px 0;
}

.nav-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(8, 10, 20, 0.96);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.nav-overlay.active { display: flex; }
.nav-overlay a { color: #dce6fa; font-size: var(--t-lg); text-decoration: none; font-weight: bold; font-family: var(--font); }
.nav-overlay a:hover { text-decoration: underline; }

/* === INFO BAR === */
.infobar {
  padding: 4px 8px;
  font-size: var(--t-base);
  color: var(--blue-hd-text);
  background: var(--blue-hd);
  border-bottom: 1px solid var(--plat-bar-edge);
  margin-bottom: 10px;
  font-family: var(--font);
  font-weight: bold;
}

.infobar a { color: #dce6fa; }

/* === BLINK === */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.blink { animation: blink 1.2s step-end infinite; }

/* === STATUS BADGE (live-signal green, sanctioned) === */
.status-online {
  display: inline-block;
  background: var(--green-live);
  color: #06280f;
  font-size: var(--t-xs);
  font-weight: bold;
  padding: 1px 5px;
  font-family: var(--font);
  cursor: pointer;
}

/* === BRACKET LINKS === */
.bracket-link {
  font-size: var(--t-xs);
  color: var(--link);
  font-weight: normal;
}

.bracket-link:hover { color: var(--link-hover); }
.bracket-link:before { content: "["; color: var(--text-dim); }
.bracket-link:after { content: "]"; color: var(--text-dim); }

/* === HR === */
hr {
  border: none;
  border-top: 1px solid #26262e;
  margin: 6px 0;
}

/* === INTERESTS / DETAILS TABLE (blue label/value grammar) === */
.interests-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-base);
}

.interests-table td {
  padding: 3px 8px;
  border: 1px solid var(--blue-cell-border);
  vertical-align: top;
  color: #c9d4ee;
  background: var(--blue-cell-b);
}

.interests-table td:first-child {
  background: var(--blue-cell-a);
  font-weight: bold;
  color: var(--blue-label-text);
  width: 74px;
  font-family: var(--font);
  font-size: var(--t-base);
}

/* === FRIEND GRID (Top 8) === */
.friend-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 6px;
}

.friend-grid a {
  display: block;
  width: 62px;
  text-align: center;
  text-decoration: none;
  font-size: var(--t-xs);
  color: var(--link);
  font-weight: bold;
}

.friend-grid a:hover { color: var(--link-hover); }

.friend-grid img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  display: block;
  margin: 0 auto 3px;
  background: var(--white);
  padding: 2px;
  box-shadow: 1px 1px 0 rgba(0,0,0,0.5);
}

/* === GUESTBOOK / COMMENTS (orange comment-table grammar) === */
.comment-block {
  padding: 6px 8px;
  font-size: var(--t-base);
  background: var(--or-cell-b);
  border: 1px solid var(--or-border);
  border-left: 4px solid var(--or-cell-a);
  margin-bottom: 6px;
  color: var(--or-text);
}

.comment-author {
  font-weight: bold;
  color: var(--or-hd-text);
}

.comment-date {
  font-size: var(--t-xs);
  color: #9a8468;
  margin-left: 8px;
}

/* === MICRO COMPONENTS === */
.tc { text-align: center; }

.pw-avatar {
  width: 84px;
  height: 84px;
  object-fit: contain;
  margin-bottom: 4px;
}

.pw-name { color: var(--text-primary); font-weight: bold; font-size: var(--t-md); }

.meta {
  font-size: var(--t-xs);
  color: var(--text-dim);
  font-family: var(--font);
}

.title-meta { font-weight: normal; color: #b89a76; font-size: var(--t-xs); }

.new-flag { color: var(--red-bright); font-size: var(--t-xs); }

.sc-embed { padding: 8px; }

.links-inline { font-size: var(--t-xs); }

/* === QUALITY FLOOR === */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 1px #000, 0 0 0 3px var(--link);
}

@media (max-width: 768px) {
  input, textarea, select { font-size: 16px; } /* stop iOS focus zoom */
}
