/* ════════════════════════════════════════════════════════
   SAVI SO.  —  theme.css
   Global Theme System (Matching Yiran Studio Architecture)
   Accent: #20ba72 (Mint) · Secondary: #FFD600 (Yellow)
════════════════════════════════════════════════════════ */

/* ── BRAND VARIABLES (light mode defaults) ── */
:root {
  /* Brand palette — sharp, high-contrast mint */
  --mint:          #20ba72;
  --mint-d:        #16965a;
  --yellow:        #FFD600;

  /* Semantic tokens — light mode */
  --bg:            #ffffff;
  --bg-alt:        #f4f6fa;
  --text:          #0d0d0d;
  --text-muted:    #666666;
  --header-bg:     #20ba72;
  --header-text:   #ffffff;
  --header-muted:  rgba(255, 255, 255, 0.65);
  --header-hover:  rgba(255, 255, 255, 0.12);
  --border:        rgba(0, 0, 0, 0.10);
  --shadow:        rgba(0, 0, 0, 0.12);
  --mnav-bg:       #16965a;
  --footer-bg:     #20ba72;
  --footer-text:   #ffffff;
  --header-h:      54px;
}

/* ── DARK MODE ── */
[data-theme="dark"] {
  --bg:            #09090d;
  --bg-alt:        #111118;
  --text:          #e8e8e8;
  --text-muted:    #888899;
  --header-bg:     #0a0a14;
  --header-text:   #ffffff;
  --header-muted:  rgba(255, 255, 255, 0.45);
  --header-hover:  rgba(255, 255, 255, 0.07);
  --border:        rgba(255, 255, 255, 0.08);
  --shadow:        rgba(0, 0, 0, 0.40);
  --mnav-bg:       #0d0d1a;
  --footer-bg:     #20ba72;
  --footer-text:   #ffffff;
}

/* ── BASE RESET ── */
*, *::before, *::after {
  margin: 0; padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  border-radius: 0px !important;
}

html {
  height: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Roboto', sans-serif;
  line-height: 1.6;
  overflow-x: clip;
  transition: background 0.3s, color 0.3s;
}

a, button {
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.container {
  width: 94%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 clamp(16px, 2.5vw, 36px);
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .container {
    width: 100%;
    padding: 0 18px;
  }
}

/* ════════════════════════════════════════════════════════
   HEADER
════════════════════════════════════════════════════════ */
#site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--header-bg);
  border-bottom: 2px solid rgba(0, 0, 0, 0.12);
  transition: background 0.3s ease;
}

[data-theme="dark"] #site-header {
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.header-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  font-family: 'BBHBartle', 'SourceHanSansSC', sans-serif;
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: var(--header-text);
  user-select: none;
}

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

/* ── Primary Navigation ── */
.header-nav {
  display: flex;
  align-items: center;
  height: 100%;
}

.header-nav ul {
  display: flex;
  list-style: none;
  align-items: center;
  height: 100%;
  gap: 0;
}

.header-nav ul li {
  height: 100%;
  display: flex;
  align-items: center;
}

.header-nav ul li a {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 18px;
  font-family: 'BBHBartle', sans-serif;
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--header-text);
  position: relative;
  transition: background 0.15s ease;
}

.header-nav ul li a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--yellow);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s ease;
}

.header-nav ul li a:hover {
  background: var(--header-hover);
}

.header-nav ul li a:hover::after {
  transform: scaleX(1);
}

/* ── Header Right Cluster ── */
.header-right {
  display: flex;
  align-items: center;
  height: 100%;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 100%;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--header-text);
  transition: background 0.2s ease;
}

.theme-toggle:hover {
  background: var(--header-hover);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-moon { display: block; }
.icon-sun  { display: none; }

[data-theme="dark"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun  { display: block; }

/* ── Mobile Burger ── */
.burger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 100%;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}

.burger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--header-text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
  transform-origin: center;
}

.burger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger-btn.open span:nth-child(2) { opacity: 0; width: 0; }
.burger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ════════════════════════════════════════════════════════
   MOBILE NAV (Matches Yiran Studio Hover & Structure)
════════════════════════════════════════════════════════ */
.mobile-nav {
  background: var(--mnav-bg);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  border-bottom: 1.5px solid transparent;
}

.mobile-nav.open {
  max-height: 400px;
  border-bottom-color: var(--border);
}

.mobile-nav ul {
  list-style: none;
  padding: 8px 0 16px;
  display: flex;
  flex-direction: column;
}

.mobile-nav ul li a {
  display: block;
  padding: 12px 24px;
  color: var(--header-text);
  text-decoration: none;
  font-family: 'BBHBartle', 'SourceHanSansSC', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-left: 3px solid transparent;
  transition: background 0.2s, border-color 0.2s, padding-left 0.2s;
}

.mobile-nav ul li a:hover,
.mobile-nav ul li a:active {
  background: rgba(255, 255, 255, 0.08);
  border-left-color: var(--yellow);
  padding-left: 30px;
}

/* ════════════════════════════════════════════════════════
   SCROLL-TO-TOP BUTTON (Always Mint `#20ba72` on all themes)
════════════════════════════════════════════════════════ */
#scroll-top-btn {
  width: 100%;
  height: 44px;
  background: var(--mint) !important;
  color: #ffffff !important;
  border: none !important;
  outline: none;
  box-shadow: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'BBHBartle', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0 16px;
  box-sizing: border-box;
  transition: background 0.25s, color 0.25s;
}

#scroll-top-btn:hover {
  background: var(--yellow) !important;
  color: #0d0d0d !important;
}

/* ════════════════════════════════════════════════════════
   FOOTER (Always Mint `#20ba72` on all themes)
════════════════════════════════════════════════════════ */
.site-footer {
  background: var(--mint) !important;
  color: #ffffff !important;
  text-align: center;
  padding: 0;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  font-family: 'Boldonse', 'SourceHanSansSC', sans-serif;
  transition: background 0.3s;
  border-top: none !important;
}

.footer-inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding: 16px 20px;
  box-sizing: border-box;
}

.site-footer p {
  color: #ffffff !important;
  margin: 0;
  line-height: 1.5;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 700;
}

/* ── RESPONSIVE ── */
@media (max-width: 860px) {
  .header-nav { display: none; }
  .burger-btn { display: flex; }
}
