/* ════════════════════════════════════════════════════════
   oc.css  —  毛艺然的窝 · Original Character page
   Requires: theme.css (variables, header, footer, reset)
════════════════════════════════════════════════════════ */

/* ── Shared section label ── */
.oc-section-label {
  font-family: 'BBHBartle', 'SourceHanSansSC', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.oc-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ════════════════════════════════════════════════════════
   HERO
════════════════════════════════════════════════════════ */
#oc-hero {
  background: var(--blue);
  color: #fff;
  min-height: calc(100vh - 54px - 38px); /* 54px header + 38px char bar */
  min-height: calc(100svh - 54px - 38px);
  display: flex;
  align-items: center;
  position: relative;
  overflow: visible;
  transition: background 0.3s;
}

/* dot-grid texture */
.oc-hero-bg-grid {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background-image:
    linear-gradient(45deg,  rgba(255,255,255,0.04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.04) 25%, transparent 25%),
    linear-gradient(45deg,  transparent 75%, rgba(255,255,255,0.04) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.04) 75%);
  background-size: 40px 40px;
  background-position: 0 0, 0 20px, 20px -20px, -20px 0;
  pointer-events: none;
}



.oc-hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 80px 20px;
  flex-wrap: wrap;
}

.oc-hero-text {
  flex: 1;
  min-width: 220px;
  animation: fadeUp 0.7s ease both;
}

.oc-eyebrow {
  font-family: 'BBHBartle', 'SourceHanSansSC', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
  margin-bottom: 12px;
}

.oc-name {
  font-family: 'Boldonse', 'SourceHanSansSC', sans-serif;
  font-size: clamp(3.5rem, 10vw, 8rem);
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin-bottom: 20px;
  word-break: break-word;
  padding: 0.15em 0;
}

.oc-name-dot {
  color: var(--yellow);
}

.oc-tagline {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.04em;
}

/* hero image / placeholder */
.oc-hero-img-wrap {
  flex-shrink: 0;
  animation: fadeUp 0.7s 0.15s ease both;
}

.oc-hero-img {
  max-height: 480px;
  max-width: 380px;
  width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 20px 40px rgba(0,0,0,0.35));
  border-radius: 0;
}

.oc-hero-img-placeholder {
  width: 320px;
  max-width: 100%;
  height: 400px;
  border: 2px dashed rgba(255,255,255,0.30);
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: 'BBHBartle', 'SourceHanSansSC', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.35);
  line-height: 1.6;
}

@media (max-width: 640px) {
  .oc-hero-inner { flex-direction: column-reverse; padding: 48px 20px; }
  .oc-hero-img-placeholder { width: 100%; height: 220px; }
  .oc-name {
    font-size: clamp(2.2rem, 11vw, 4.5rem);
    line-height: 1.15;
    padding: 0.15em 0;
  }
}

/* ════════════════════════════════════════════════════════
   PROFILE SECTION
════════════════════════════════════════════════════════ */
#oc-profile {
  padding: 72px 0;
  background: var(--bg);
  transition: background 0.3s;
}

.oc-profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 700px) {
  .oc-profile-grid { grid-template-columns: 1fr; }
}

/* ── Cards ── */
.oc-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 32px 28px;
  transition: background 0.3s, border-color 0.3s;
}

.oc-card-title {
  font-family: 'BBHBartle', 'SourceHanSansSC', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 18px;
}

.oc-bio-text {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 14px;
}
.oc-bio-text:last-child { margin-bottom: 0; }

/* stat list */
.oc-stat-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.oc-stat-list li {
  display: grid;
  grid-template-columns: minmax(100px, max-content) 1fr;
  align-items: start;
  gap: 12px 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.3s;
  min-width: 0;
}
.oc-stat-list li:last-child { border-bottom: none; }

.oc-stat-label {
  font-family: 'BBHBartle', 'SourceHanSansSC', sans-serif;
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  padding-top: 2px;
  line-height: 1.3;
}

.oc-stat-value {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.55;
  word-break: break-word;
}

/* ════════════════════════════════════════════════════════
   COLOUR PALETTE
════════════════════════════════════════════════════════ */
#oc-palette {
  padding: 56px 0;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s, border-color 0.3s;
}

.oc-palette-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.oc-swatch {
  flex: 1;
  min-width: 120px;
  max-width: 200px;
  border-radius: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
  transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
}
.oc-swatch:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--shadow);
}

.oc-swatch::before {
  content: '';
  display: block;
  height: 80px;
  background: var(--swatch-color);
}

.oc-swatch-hex,
.oc-swatch-name {
  display: block;
  padding: 6px 12px 0;
  font-family: 'BBHBartle', 'SourceHanSansSC', sans-serif;
  letter-spacing: 0.08em;
}

.oc-swatch-hex {
  font-size: 0.7rem;
  color: var(--text-muted);
  padding-bottom: 2px;
}

.oc-swatch-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
  padding-bottom: 12px;
}

/* ════════════════════════════════════════════════════════
   LIKES / DISLIKES
════════════════════════════════════════════════════════ */
#oc-traits {
  padding: 72px 0;
  background: var(--bg);
  transition: background 0.3s;
}

.oc-traits-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 600px) {
  .oc-traits-grid { grid-template-columns: 1fr; }
}

.oc-traits-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 28px 24px;
  transition: background 0.3s, border-color 0.3s;
}

.oc-traits-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'BBHBartle', 'SourceHanSansSC', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.oc-traits-header svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.oc-traits-likes .oc-traits-header {
  color: #e05a5a;
}

.oc-traits-dislikes .oc-traits-header {
  color: var(--text-muted);
}

.oc-traits-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.oc-traits-list li {
  font-size: 0.9rem;
  color: var(--text);
  padding-left: 16px;
  position: relative;
  line-height: 1.5;
}

.oc-traits-likes .oc-traits-list li::before {
  content: '♥';
  position: absolute;
  left: 0;
  font-size: 0.65rem;
  color: #e05a5a;
  top: 3px;
}

.oc-traits-dislikes .oc-traits-list li::before {
  content: '×';
  position: absolute;
  left: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  top: 1px;
  line-height: 1;
}

/* ════════════════════════════════════════════════════════
   ART GALLERY
════════════════════════════════════════════════════════ */
#oc-gallery {
  padding: 72px 0 88px;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  transition: background 0.3s, border-color 0.3s;
  overflow: hidden;
}

.oc-gallery-note {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  margin-top: -14px;
}

.oc-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.oc-gallery-item {
  margin: 0;
  cursor: pointer;
  border-radius: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.3s;
}

.oc-gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px var(--shadow);
  border-color: var(--blue);
}

.oc-gallery-item img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.oc-gallery-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'BBHBartle', 'SourceHanSansSC', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.oc-gallery-item figcaption {
  padding: 10px 14px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: 'BBHBartle', 'SourceHanSansSC', sans-serif;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s;
}

.oc-gallery-item:hover figcaption {
  color: var(--blue);
}

/* ── Lightbox ── */
.oc-lightbox {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0,0,0,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(6px);
  animation: lbFadeIn 0.2s ease;
}

.oc-lightbox[hidden] {
  display: none;
}

@keyframes lbFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.oc-lightbox-img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 0;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  object-fit: contain;
  transition: transform 0.2s ease;
  transform-origin: center center;
}

.oc-lb-toolbar {
  position: absolute;
  top: 14px; right: 14px;
  display: flex;
  gap: 6px;
  z-index: 3;
}

.oc-lb-tool {
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.1);
  border: 1.5px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  font-family: 'BBHBartle', sans-serif;
  border-radius: 0;
}
.oc-lb-tool:hover {
  background: var(--yellow);
  color: #000;
  border-color: var(--yellow);
}

.oc-lb-img-wrap {
  max-width: 100%;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}
.oc-lb-img-wrap.zoomed {
  overflow: auto;
  cursor: grab;
}
.oc-lb-img-wrap.zoomed img {
  max-width: none;
  max-height: none;
}

/* ════════════════════════════════════════════════════════
   HERO SCROLL INDICATOR
════════════════════════════════════════════════════════ */
.oc-hero-scroll {
  position: absolute;
  bottom: 36px;
  left: 0; right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.50);
  font-family: 'BBHBartle', 'SourceHanSansSC', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  z-index: 1;
  animation: fadeUp 0.6s ease both 0.7s;
  pointer-events: none;
}

.oc-hero-scroll span {
  display: block;
  width: 1px;
  height: 40px;
  background: rgba(255,255,255,0.20);
  position: relative;
  overflow: hidden;
}

.oc-hero-scroll span::after {
  content: '';
  position: absolute;
  top: -100%; left: 0;
  width: 100%; height: 100%;
  background: var(--yellow);
  animation: scrollLine 2s ease-in-out infinite;
}

@keyframes scrollLine {
  0%   { top: -100%; }
  100% { top: 100%; }
}

/* ════════════════════════════════════════════════════════
   EXTRA SECTIONS (from extraSections[] in JSON)
════════════════════════════════════════════════════════ */
.oc-extra-section {
  padding: 72px 0;
  background: var(--bg);
  transition: background 0.3s;
}

.oc-extra-section.oc-extra-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s, border-color 0.3s;
}

/* Multi-card grid */
.oc-extra-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.oc-extra-card.oc-card {
  /* inherits .oc-card styles */
}

.oc-extra-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 4px;
}

.oc-extra-list li {
  font-size: 0.88rem;
  color: var(--text);
  padding-left: 16px;
  position: relative;
  line-height: 1.5;
}

.oc-extra-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  font-size: 0.75rem;
  color: var(--blue);
  top: 1px;
}

/* Gallery empty state */
.oc-gallery-empty {
  font-size: clamp(0.75rem, 2vw, 0.95rem);
  color: var(--text-muted);
  font-family: 'BBHBartle', 'SourceHanSansSC', sans-serif;
  letter-spacing: 0.10em;
  text-align: center;
  grid-column: 1 / -1;
  padding: 80px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  overflow: hidden;
}

#oc-gallery-glitch {
  display: inline-block;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease, filter 0.35s ease;
  will-change: transform, opacity;
}

#oc-gallery-glitch.slide-out {
  transform: translateY(-12px);
  opacity: 0;
  filter: blur(3px);
}

#oc-gallery-glitch.slide-prep {
  transform: translateY(12px);
  opacity: 0;
  filter: blur(3px);
  transition: none !important;
}

#oc-gallery-glitch.slide-in {
  transform: translateY(0);
  opacity: 1;
  filter: blur(0);
}

/* fadeUp keyframe (shared) */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════════════════════════════
   OC CHARACTER SUB-BAR
════════════════════════════════════════════════════════ */
#oc-char-bar {
  background: var(--blue-d);
  border-bottom: 2px solid rgba(0,0,0,0.18);
  position: sticky;
  top: var(--header-h, 54px); /* sits flush below the main header */
  z-index: 490;
  transition: background 0.3s;
}

[data-theme="dark"] #oc-char-bar {
  background: #08081a;
  border-bottom-color: rgba(255,255,255,0.06);
}

.oc-char-bar-inner {
  display: flex;
  align-items: center;
  height: 38px;
  gap: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.oc-char-bar-inner::-webkit-scrollbar { display: none; }

.oc-char-bar-label {
  font-family: 'BBHBartle', 'SourceHanSansSC', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.40);
  flex-shrink: 0;
  padding-right: 8px;
  border-right: 1px solid rgba(255,255,255,0.14);
}

#oc-char-bar-list {
  list-style: none;
  display: flex;
  align-items: center;
  height: 100%;
  gap: 2px;
  padding: 0;
}

.oc-char-link {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 100%;
  padding: 0 14px;
  text-decoration: none;
  color: rgba(255,255,255,0.70);
  font-family: 'BBHBartle', 'SourceHanSansSC', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: color 0.18s, background 0.18s;
  position: relative;
}

.oc-char-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--yellow);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s ease;
}

.oc-char-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.07);
}

.oc-char-link:hover::after,
.oc-char-link.oc-char-active::after {
  transform: scaleX(1);
}

.oc-char-link.oc-char-active {
  color: #fff;
}

.oc-char-species {
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.40);
  font-family: 'Roboto', sans-serif;
}

.oc-char-link.oc-char-active .oc-char-species,
.oc-char-link:hover .oc-char-species {
  color: rgba(255,255,255,0.65);
}

/* ════════════════════════════════════════════════════════
   MOBILE FIXES
════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .oc-hero-inner { flex-direction: column-reverse; padding: 48px 20px; }
  .oc-hero-img-placeholder { width: 100%; height: 220px; }
  .oc-name {
    font-size: clamp(2.2rem, 11vw, 4.5rem);
    line-height: 1.15;
    padding: 0.15em 0;
  }
  .oc-hero-img { max-height: 300px; max-width: 100%; }
}

@media (max-width: 540px) {
  /* Stat table — stack label above value on small screens */
  .oc-stat-list li {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  /* Palette — 2 per row on small screens */
  .oc-palette-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .oc-swatch {
    max-width: none;
  }

  /* Profile grid — stack */
  .oc-profile-grid {
    grid-template-columns: 1fr;
  }

  /* Extra card grid — single col */
  .oc-extra-card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .oc-hero-inner { padding: 36px 14px 48px; gap: 24px; }
  .oc-hero-text { min-width: 0; width: 100%; }
  .oc-name {
    font-size: clamp(2rem, 10vw, 4rem);
    line-height: 1.15;
    padding: 0.15em 0;
  }
  .oc-card { padding: 22px 18px; }
  #oc-profile { padding: 48px 0; }
  #oc-traits { padding: 48px 0; }
  #oc-gallery { padding: 48px 0 60px; }
  .oc-extra-section { padding: 48px 0; }
  .oc-gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .oc-traits-card { padding: 20px 16px; }
}
