/* ═══════════════════════════════════════════════════════
   global.css — reset, CSS variables, layout foundations
   ATK Portfolio Site
════════════════════════════════════════════════════════ */

/* ── Google Fonts (loaded here so it's first in cascade) ── */
@import url('https://fonts.googleapis.com/css2?family=Rammetto+One&family=Inter:wght@400;700;900&family=Noto+Sans+SC:wght@400;700&display=swap');

/* ── CSS Custom Properties ── */
:root {
  --bg:            #1a1c22;
  --surface:       #484a55;
  --text:          #ffffff;
  --cream:         #d4d1ba;
  --border:        rgba(255, 255, 255, 1);
  --border-dim:    rgba(255, 255, 255, 0.3);

  --sidebar-w:     48px;       /* left sidebar width */
  --nav-tab-w:     48px;       /* each right nav tab width */
  --nav-tabs:      5;          /* number of right nav tabs */
  --nav-total-w:   calc(var(--nav-tab-w) * var(--nav-tabs));

  --transition-section: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* ── Base ── */
html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--cream);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  color: inherit;
  padding: 0;
}

ul, ol {
  list-style: none;
}

/* ════════════════════════════════════════════════════════
   MAIN — full-screen section container
   Sits between left sidebar (80px) and right nav (5×80px=400px)
════════════════════════════════════════════════════════ */
#main {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: var(--nav-total-w);
  bottom: 0;
  height: 100vh;
  overflow: hidden;
  /* No transition — updated instantly by JS; section slides provide visual motion */
}

/* ════════════════════════════════════════════════════════
   SECTIONS — absolutely stacked, full-screen, slide in/out
════════════════════════════════════════════════════════ */
.section {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg);
  transition: var(--transition-section);
  isolation: isolate;
  will-change: transform;
  z-index: 1;
}

/* All non-home sections start off-screen to the right */
.section:not(.home) {
  transform: translateX(100%);
}

/* Active section is in view and on top */
.section.active {
  transform: translateX(0%) !important;
  z-index: 10;
}

/* ════════════════════════════════════════════════════════
   LEFT SIDEBAR — matches Figma: 英 · 中 stacked at bottom
════════════════════════════════════════════════════════ */
.sidebar-left {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-w);
  height: 100vh;
  border-right: 1px solid var(--border);
  background: var(--bg);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 16px;
  cursor: pointer;
}

/* 英 · 中 stacked vertically at bottom */
.lang-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.lang-btn {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  padding: 4px 8px;
  transition: opacity 0.2s;
  letter-spacing: 0.05em;
  line-height: 1.6;
}

.lang-btn:not(.active) {
  opacity: 0.35;
}

.lang-btn.active {
  opacity: 1;
}

/* The single · dot between 英 and 中 */
.lang-dot {
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  opacity: 0.6;
  margin: 1px 0;
}

/* Section label hidden — not in Figma design */
.sidebar-section-label {
  display: none;
}

/* Remove old dot-indicator styles — no longer used */
.dot-indicator { display: none; }
.lang-divider   { display: none; }

/* ════════════════════════════════════════════════════════
   RIGHT SIDEBAR NAV — 5 individually-positioned fixed tabs
════════════════════════════════════════════════════════ */
.sidebar-nav {
  /* Wrapper is invisible — each tab is individually position:fixed */
  position: fixed;
  right: 0;
  top: 0;
  height: 100vh;
  z-index: 200;
  pointer-events: none;  /* tabs handle their own clicks */
}

.nav-tab {
  width: var(--nav-tab-w);
  height: 100%;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 12px 2px;
  transition: background 0.3s, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  color: var(--text);
  position: fixed;
  top: 0;
  /* All tabs anchored at right edge; translateX moves them */
  right: 0;
  z-index: 200;
  pointer-events: all;
  cursor: pointer;
  will-change: transform;
}

/* Default (unvisited): stack from right edge using translateX only */
.nav-tab[data-index="1"] { transform: translateX(calc(-1 * var(--nav-tab-w) * 4)); }
.nav-tab[data-index="2"] { transform: translateX(calc(-1 * var(--nav-tab-w) * 3)); }
.nav-tab[data-index="3"] { transform: translateX(calc(-1 * var(--nav-tab-w) * 2)); }
.nav-tab[data-index="4"] { transform: translateX(calc(-1 * var(--nav-tab-w) * 1)); }
.nav-tab[data-index="5"] { transform: translateX(0); }

.nav-tab:hover { background: var(--surface); }
.nav-tab.active { background: var(--surface); }

/* Visited tabs: slide to left side via translateX from right:0 anchor */
/* Distance = -(viewport width) + sidebar + own position among visited */
.nav-tab.visited[data-index="1"] { transform: translateX(calc(-100vw + var(--sidebar-w) + var(--nav-tab-w) * 1)); }
.nav-tab.visited[data-index="2"] { transform: translateX(calc(-100vw + var(--sidebar-w) + var(--nav-tab-w) * 2)); }
.nav-tab.visited[data-index="3"] { transform: translateX(calc(-100vw + var(--sidebar-w) + var(--nav-tab-w) * 3)); }
.nav-tab.visited[data-index="4"] { transform: translateX(calc(-100vw + var(--sidebar-w) + var(--nav-tab-w) * 4)); }
.nav-tab.visited[data-index="5"] { transform: translateX(calc(-100vw + var(--sidebar-w) + var(--nav-tab-w) * 5)); }

.nav-num {
  font-family: 'Rammetto One', cursive;
  font-size: 18px;
  color: var(--text);
  line-height: 1;
  writing-mode: horizontal-tb;
}

.nav-label {
  font-family: 'Noto Sans SC', 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
  color: var(--cream);
  writing-mode: vertical-rl;
  letter-spacing: 0.1em;
}

/* ════════════════════════════════════════════════════════
   SHARED SECTION ELEMENTS
════════════════════════════════════════════════════════ */

/* Large section number (01, 02, etc.) */
.sec-number {
  font-family: 'Rammetto One', cursive;
  font-size: clamp(48px, 6vw, 96px);
  color: var(--text);
  opacity: 0.15;
  line-height: 1;
  user-select: none;
  margin-bottom: 8px;
}

/* Play button (visual only) */
.play-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  border: 2px solid rgba(255, 255, 255, 0.5);
  transition: background 0.3s, transform 0.3s;
}

.play-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.08);
}

.play-btn img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

/* ════════════════════════════════════════════════════════
   ACCORDION COMPONENT
════════════════════════════════════════════════════════ */
.accordion-item {
  border-top: 1px solid var(--border);
}

.accordion-item:last-child {
  border-bottom: 1px solid var(--border);
}

.accordion-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  text-align: left;
  transition: color 0.2s;
}

.accordion-btn:hover {
  color: var(--cream);
}

.acc-num {
  font-family: 'Rammetto One', cursive;
  font-size: 18px;
  color: var(--cream);
  min-width: 32px;
}

.acc-label {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 14px;
  font-weight: 700;
  flex: 1;
  letter-spacing: 0.05em;
}

.acc-arrow {
  font-size: 20px;
  color: var(--cream);
  transition: transform 0.3s;
}

.accordion-item.open .acc-arrow {
  transform: rotate(90deg);
}

.accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.accordion-item.open .accordion-panel {
  max-height: 400px;
}

.accordion-panel > * {
  padding-bottom: 16px;
  font-size: 13px;
  color: var(--cream);
  line-height: 1.8;
}

/* ════════════════════════════════════════════════════════
   CAROUSEL / SLIDESHOW DOTS
════════════════════════════════════════════════════════ */
.carousel-dots,
.slideshow-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}

.cdot,
.sdot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transition: background 0.3s, transform 0.3s;
  cursor: pointer;
}

.cdot.active,
.sdot.active {
  background: var(--text);
  transform: scale(1.3);
}
