﻿/* =========================================================
   社畜觀察所 — SOFT CYBERPUNK CITY NIGHT
   ========================================================= */

@import url("https://fonts.googleapis.com/css2?family=LXGW+WenKai+TC&display=swap");

/* ── Design Tokens ────────────────────────────────────── */
:root {
  --bg:        #050716;
  --bg2:       #080b1a;
  --surface:   #0d1228;
  --surface2:  #111830;
  --border:    rgba(110,199,255,.12);
  --border-hi: rgba(110,199,255,.28);

  --blue:      #6ec7ff;
  --purple:    #9b7cff;
  --pink:      #ff7ccb;
  --teal:      #3fffd2;
  --gold:      #ffd077;
  --white:     #e8edf5;
  --muted:     #7a90b8;
  --muted2:    #3a4870;

  --border:    rgba(110,199,255,.12);
  --border-hi: rgba(110,199,255,.28);

  --blue-glow:   0 0 16px rgba(110,199,255,.35);
  --purple-glow: 0 0 16px rgba(155,124,255,.35);
  --pink-glow:   0 0 16px rgba(255,124,203,.30);

  --ff-body: "LXGW WenKai TC", "霞鶩文楷", serif;

  --max-w: 1100px;
  --r: 12px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { scroll-behavior: smooth; font-size: 24px; }
body  {
  background: var(--bg);
  color: var(--white);
  font-family: var(--ff-body);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
a   { color: var(--blue); text-decoration: none; }
ul  { list-style: none; }
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 32px; }

/* ── Animations ── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════ NAV ══════════════════ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  padding: 16px 0;
  transition: background .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(5,7,22,.85);
  border-bottom-color: var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; }
.nav-logo {
  font-size: .95rem;
  font-weight: 500;
  color: var(--white);
  letter-spacing: .04em;
}
.nav-logo small {
  display: block;
  font-size: .62rem;
  letter-spacing: .22em;
  color: var(--muted2);
  text-transform: uppercase;
  margin-top: 1px;
}
.nav-links { display: flex; gap: 28px; }
.nav-links a {
  font-size: .82rem;
  color: var(--muted);
  transition: color .2s;
}
.nav-links a:hover { color: var(--white); }
.nav-cta {
  font-size: .80rem;
  color: var(--blue);
  border: 1px solid rgba(110,199,255,.3);
  padding: 6px 16px;
  border-radius: 99px;
  transition: background .2s;
}
.nav-cta:hover { background: rgba(110,199,255,.1); color: var(--blue); }

/* ══════════════════ HERO ══════════════════ */
.hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: grid;
  align-items: center;
  overflow: hidden;
  background: var(--bg);
}

/* LEXI 圖片背景 */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-bg img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}
/* 從左往右漸層遮罩 */
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right,  rgba(5,7,22,.95) 0%, rgba(5,7,22,.80) 45%, rgba(5,7,22,.20) 80%, rgba(5,7,22,.05) 100%),
    linear-gradient(to top,    rgba(5,7,22,.80) 0%, transparent 35%);
}

/* 雨 Canvas */
#rain {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 10;
  max-width: 520px;
  padding-top: 80px;
  animation: fade-up .8s ease both;
}

.hero-eyebrow {
  font-size: .72rem;
  letter-spacing: .28em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 20px;
}

/* Glass card holding headline */
.hero-glass {
  background: rgba(8,11,26,.68);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(110,199,255,.14);
  border-radius: 16px;
  padding: 28px 32px 32px;
  margin-bottom: 28px;
}

.hero-title {
  font-size: clamp(1.2rem, 4.5vw, 2rem);
  font-weight: 700;
  line-height: 1.35;
  color: var(--white);
  margin-bottom: 14px;
}

.hero-sub {
  font-size: .95rem;
  color: rgba(232,237,245,.60);
  line-height: 1.9;
}

.hero-actions { display: flex; gap: 10px; flex-wrap: nowrap; align-items: center; }
.hero-actions .btn { white-space: nowrap; font-size: .72rem; padding: 9px 18px; }

/* ══════════════════ BUTTONS ══════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 24px;
  border-radius: 99px;
  font-size: .84rem;
  font-weight: 500;
  transition: all .2s;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #050716;
  font-weight: 600;
}
.btn-primary:hover { opacity: .88; transform: translateY(-1px); color: #050716; }

.btn-outline {
  background: rgba(8,11,26,.6);
  backdrop-filter: blur(8px);
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--border-hi); color: var(--white); }

.btn-ghost {
  background: transparent;
  color: var(--purple);
  border: 1px solid rgba(155,124,255,.3);
}
.btn-ghost:hover { background: rgba(155,124,255,.1); color: var(--purple); }

/* ══════════════════ SECTIONS ══════════════════ */
.section { padding: 88px 0; background: var(--bg); }
.section + .section { border-top: 1px solid var(--border); }

.section-hd { margin-bottom: 44px; }
.section-eyebrow {
  display: block;
  font-size: .70rem;
  letter-spacing: .20em;
  color: var(--blue);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.section-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.3;
}
.section-sub {
  margin-top: 8px;
  font-size: .88rem;
  color: var(--muted);
}

/* Scroll fade */
.js-fade { opacity: 0; transform: translateY(18px); transition: opacity .65s ease, transform .65s ease; }
.js-fade.is-visible { opacity: 1; transform: none; }

/* ══════════════════ MOOD GRID ══════════════════ */
.mood-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.mood-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color .25s, transform .25s, box-shadow .25s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
  /* reset button styles */
  appearance: none; -webkit-appearance: none;
  font-family: inherit;
  width: 100%;
}
.mood-card:hover, .mood-card.active {
  transform: translateY(-3px);
  border-color: var(--border-hi);
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.mood-card.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(110,199,255,.25), 0 8px 32px rgba(0,0,0,.5);
}
.mood-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  border-radius: 13px 13px 0 0;
}
.mood-card-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mood-name { font-size: .85rem; font-weight: 600; color: var(--white); }
.mood-desc { font-size: .72rem; color: var(--muted); line-height: 1.5; }
.mood-cta  { margin-top: 6px; font-size: .70rem; font-weight: 500; color: var(--blue); }

/* ══════════════════ RECOMMENDATIONS ══════════════════ */
.rec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.rec-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color .2s, transform .2s;
}
.rec-card:hover { border-color: var(--border-hi); transform: translateY(-2px); }
.rec-header { display: flex; align-items: center; gap: 8px; }
.rec-type {
  font-size: .68rem; font-weight: 600; padding: 2px 8px; border-radius: 4px;
}
.rec-type--single { background: rgba(110,199,255,.12); color: var(--blue); }
.rec-type--album  { background: rgba(155,124,255,.12); color: var(--purple); }
.rec-badge {
  font-size: .60rem; color: var(--muted); border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 4px;
}
.rec-name    { font-size: .92rem; font-weight: 600; color: var(--white); line-height: 1.4; }
.rec-sample  { font-size: .72rem; color: var(--muted); line-height: 1.5; }
.rec-footer  { margin-top: auto; padding-top: 4px; }
.rec-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .75rem; padding: 6px 14px; border-radius: 6px;
  text-decoration: none; transition: background .2s;
  background: rgba(110,199,255,.10); color: var(--blue);
  border: 1px solid rgba(110,199,255,.25);
}
.rec-btn:hover { background: rgba(110,199,255,.18); color: var(--blue); }
/* thumbnail */
.rec-thumb-wrap {
  position: relative; display: block; overflow: hidden;
  border-radius: 8px 8px 0 0; aspect-ratio: 16/9; background: #000;
}
.rec-thumb { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .2s; }
.rec-thumb-wrap:hover .rec-thumb { opacity: .75; }
.rec-thumb-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  font-size: 1.6rem; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.6);
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.rec-thumb-wrap:hover .rec-thumb-play { opacity: 1; }
.rec-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.rec-duration { font-size: .65rem; color: var(--muted); margin-left: auto; }

.rec-btn--pending {
  background: transparent; color: var(--muted);
  border: 1px solid var(--border); cursor: default;
}

/* ══════════════════ TRACK CARDS ══════════════════ */
.track-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.track-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 28px 24px 24px;
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.track-card:hover {
  border-color: var(--border-hi);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
.track-num  { font-size: .68rem; color: var(--blue); letter-spacing: .14em; margin-bottom: 12px; text-transform: uppercase; }
.track-title { font-size: 1.05rem; font-weight: 600; color: var(--white); margin-bottom: 6px; }
.track-album { font-size: .78rem; color: var(--muted); }

/* ══════════════════ PLATFORM GRID ══════════════════ */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.platform-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 28px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--white);
  transition: border-color .25s, transform .25s;
}
.platform-card:hover { border-color: var(--border-hi); transform: translateY(-3px); color: var(--white); }
.platform-icon { font-size: 1.6rem; color: var(--p-color, var(--blue)); }
.platform-name { font-size: .78rem; font-weight: 500; color: var(--muted); letter-spacing: .04em; }

/* ══════════════════ ABOUT ══════════════════ */
.about-layout { display: flex; flex-direction: column; gap: 40px; }
.about-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 36px 40px;
  max-width: 100%;
  display: flex; flex-direction: column; gap: 14px;
  font-size: .95rem;
  color: rgba(232,237,245,.70);
  line-height: 1.9;
  overflow: hidden;
}
.about-card::before {
  content: "";
  position: absolute; top: 0; left: 0;
  width: 3px; height: 100%;
  background: linear-gradient(180deg, var(--blue), var(--purple));
  opacity: .5;
}
.about-punch { font-weight: 600; font-size: 1.05rem; color: var(--white) !important; }

.stats-row { display: flex; gap: 44px; flex-wrap: wrap; }
.stat-item  { text-align: left; }
.stat-value { display: block; font-size: 2.4rem; font-weight: 700; color: var(--blue); line-height: 1; margin-bottom: 5px; }
.stat-label { font-size: .68rem; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }

/* ══════════════════ FOOTER ══════════════════ */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 28px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-brand { font-size: .85rem; font-weight: 500; color: var(--white); }
.footer-brand small { display: block; font-size: .65rem; letter-spacing: .2em; color: var(--muted2); text-transform: uppercase; margin-top: 2px; }
.footer-copy  { font-size: .70rem; color: var(--muted2); }

/* ══════════════════ PLAYLIST CONTROLS ══════════════════ */
.rec-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.rec-title { margin-bottom: 0; }
.rec-controls { display: flex; gap: 8px; }

.rec-play-btn, .rec-stop-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: 99px; border: none;
  font-size: .80rem; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all .2s;
}
.rec-play-btn {
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #050716;
}
.rec-play-btn:hover { opacity: .85; transform: translateY(-1px); }
.rec-stop-btn {
  background: rgba(248,113,113,.15); color: #f87171;
  border: 1px solid rgba(248,113,113,.3);
}
.rec-stop-btn:hover { background: rgba(248,113,113,.25); }

/* Now Playing Bar */
.yt-now-playing {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-bright);
  border-radius: 10px; padding: 10px 16px;
  margin-bottom: 12px;
  animation: fade-up .4s ease;
}
.yt-now-label {
  font-size: .65rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--blue); white-space: nowrap;
}
.yt-now-title {
  flex: 1; font-size: .82rem; color: var(--white);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.yt-now-count {
  font-size: .70rem; color: var(--muted); white-space: nowrap;
}

/* 播放中高亮 */
.rec-card.playing {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(110,199,255,.2), 0 8px 32px rgba(0,0,0,.5);
}

/* ══════════════════ LEXI GALLERY GRID ══════════════════ */
.lexi-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
  overflow: visible;
}
.lexi-gallery-item {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(110,199,255,.15);
  background: var(--surface);
  min-width: 0;
}
.lexi-gallery-item img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  display: block;
  transition: opacity .2s;
}
.lexi-gallery-item img:hover { opacity: .85; }
/* 每 3 張圖後的形象敘述列 */
.lexi-gallery-divider {
  grid-column: 1 / -1;           /* 橫跨全部欄位 */
  padding: 28px 4px 20px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 4px 0;
}
.lexi-divider-heading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.6;
  margin-bottom: 8px;
}
.lexi-divider-body {
  font-size: .88rem;
  color: var(--muted);
  line-height: 1.8;
}

.lexi-gallery-caption {
  padding: 6px 8px;
  font-size: .68rem;
  color: var(--muted);
  background: rgba(13,18,40,.9);
  line-height: 1.4;
}
@media (max-width: 900px) {
  .lexi-gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .lexi-gallery-grid { grid-template-columns: 1fr 1fr; }
}

/* ══════════════════ STARTUP SCREEN ══════════════════ */
#startup {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #050716;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: opacity .8s ease, visibility .8s ease;
  overflow: hidden;
}
#startup.hiding {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
#startup-rain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.startup-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.startup-line {
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #6ec7ff88, transparent);
  animation: startup-expand .8s ease .2s forwards;
}
.startup-line--bottom {
  animation-delay: .4s;
}
@keyframes startup-expand {
  to { width: 240px; }
}
.startup-handle {
  font-size: .70rem;
  letter-spacing: .35em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
  animation: startup-fadein .6s ease .5s forwards;
}
.startup-brand {
  font-size: clamp(2.2rem, 8vw, 4rem);
  font-weight: 700;
  color: var(--white);
  letter-spacing: .04em;
  opacity: 0;
  transform: translateY(16px);
  animation: startup-rise .7s ease .35s forwards;
  line-height: 1.15;
}
.startup-tagline {
  font-size: clamp(.78rem, 2.5vw, .92rem);
  color: var(--muted);
  letter-spacing: .06em;
  opacity: 0;
  animation: startup-fadein .6s ease .75s forwards;
  max-width: 340px;
}
@keyframes startup-rise {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes startup-fadein {
  to { opacity: 1; }
}

/* ══════════════════ RESPONSIVE ══════════════════ */

/* ── 平板 768px ── */
@media (max-width: 768px) {
  html { font-size: 19px; }
  .container { padding: 0 20px; }

  /* Nav */
  .nav-links { display: none; }
  .nav-inner { padding: 0 20px; }

  /* Hero */
  .hero-content { max-width: 100%; padding-top: 60px; padding-left: 20px; padding-right: 20px; }
  .hero-title   { font-size: clamp(1.3rem, 5vw, 2.2rem); }
  .hero-glass   { padding: 20px 22px 24px; }
  .hero-actions { gap: 8px; }
  .hero-actions .btn { font-size: .65rem; padding: 8px 14px; }

  /* Grids */
  .mood-grid    { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .rec-grid     { grid-template-columns: repeat(2, 1fr); }
  .track-grid   { grid-template-columns: repeat(2, 1fr); }
  .platform-grid{ grid-template-columns: repeat(2, 1fr); }

  /* LEXI */
  .lexi-gallery-grid { grid-template-columns: repeat(2, 1fr); }

  /* About */
  .stats-row    { gap: 28px; }
  .about-card   { padding: 28px 24px; }

  /* Section */
  .section { padding: 64px 0; }
  .footer-inner { flex-direction: column; text-align: center; gap: 10px; }
}

/* ── 手機 480px ── */
@media (max-width: 480px) {
  html { font-size: 16px; }
  .container { padding: 0 16px; }

  /* Nav */
  .nav-logo small { display: none; }
  .nav-cta { padding: 5px 12px; font-size: .72rem; }

  /* Hero：文字全寬、背景圖靠右顯示 */
  .hero { min-height: 100svh; align-items: flex-end; }
  .hero-content { padding: 0 16px 60px; max-width: 100%; }
  .hero-bg img  { object-position: 65% top; }
  .hero-bg::after {
    background:
      linear-gradient(to top, rgba(5,7,22,.95) 0%, rgba(5,7,22,.55) 45%, rgba(5,7,22,.10) 100%);
  }
  .hero-glass   { padding: 18px 18px 20px; }
  .hero-title   { font-size: clamp(1.4rem, 7vw, 2rem); }
  .hero-sub     { font-size: .78rem; }
  .hero-eyebrow { display: none; }
  .hero-actions { gap: 8px; flex-wrap: wrap; }
  .hero-actions .btn { font-size: .68rem; padding: 8px 14px; }

  /* Moods: 1 欄 */
  .mood-grid { grid-template-columns: 1fr; gap: 10px; }

  /* Recs / Track: 1 欄 */
  .rec-grid   { grid-template-columns: 1fr; }
  .track-grid { grid-template-columns: 1fr; }
  .platform-grid { grid-template-columns: repeat(2, 1fr); }

  /* LEXI gallery: 1 欄 */
  .lexi-gallery-grid { grid-template-columns: 1fr; }

  /* Section */
  .section      { padding: 48px 0; }
  .section-hd   { margin-bottom: 28px; }
  .section-title{ font-size: 1.2rem; }
  .about-card   { padding: 22px 16px; }
  .stats-row    { gap: 20px; }
  .stat-value   { font-size: 1.8rem; }
  .footer-inner { flex-direction: column; text-align: center; gap: 8px; }
  .footer-brand small { display: none; }

  /* 推薦清單 header */
  .rec-header-row { flex-direction: column; align-items: flex-start; }

  /* Startup */
  .startup-brand { font-size: clamp(1.8rem, 10vw, 3rem); }
}
