/* Reset & Base */

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}
body {
  margin: 0;
  font-family: 'Pretendard', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.7;
  letter-spacing: -0.01em;
  background: var(--bg);
  color: var(--text);
}

/* Theme Variables */

:root {
  --bg: #000;
  --text: #e6edf3;
  --border: #30363d;
  --header-dim: 0.78;

  /* Home 레이아웃 */
  --header-h: 96px;
}

body.light {
  --bg: #fff;
  --text: #111;
  --border: #d0d7de;
}

@media (max-width: 768px) {
  :root {
    --header-h: 112px;
  }
}

/* Typography */

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4 {
  line-height: 1.4;
  margin-top: 2rem;
}

p {
  margin-top: 1.25rem;
}

/* Layout */

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* Home Fixed Layout */

body.home {
  overflow: auto;
}

.container.home {
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: auto;
}

/* Header & Navigation */

.site-header {
  position: relative;
  z-index: 100;
  background: var(--bg);
}

.nav {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* logo */
.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

.home-icon {
  width: 20px;
  height: 20px;
  opacity: 0.9;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

/* hover 통일 */
.logo:hover .home-icon,
#theme-toggle:hover #theme-icon,
.nav-links a:hover {
  opacity: 0.85;
}

/* nav links */
.nav-links {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  position: relative;
  padding: 0.5rem 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: currentColor;
  opacity: 0;
  transform: scaleX(0);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.nav-links a.active::after {
  opacity: 1;
  transform: scaleX(1);
}

/* Theme Toggle */

#theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
}

#theme-icon {
  width: 22px;
  height: 22px;
  transition: transform 0.15s ease;
}

body:not(.light) #theme-icon {
  transform: scale(1.15);
}

/* Home Hero Line */

.hero-line {
  display: block;
  width: 100%;
  max-width: 1000px;
  margin: clamp(1.5rem, 6vh, 3rem) auto 0;
  overflow: visible;
}

/* line base */
.line {
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* main line */
.line-main {
  stroke-width: 2.2;
  opacity: 0.95;
  animation: driftMain 26s ease-in-out infinite;
}

/* shadow line */
.line-shadow {
  stroke-width: 2.2;
  opacity: 0.15;
  filter: blur(1px);
  transform: translateY(1.5px);
  animation: driftShadow 26s ease-in-out infinite;
}

/* Motion */

@keyframes driftMain {
  0% {
    transform: translateX(-1.5px);
  }
  50% {
    transform: translateX(1.5px);
  }
  100% {
    transform: translateX(-1.5px);
  }
}

@keyframes driftShadow {
  0% {
    transform: translateX(1.5px) translateY(1.5px);
  }
  50% {
    transform: translateX(-1.5px) translateY(0);
  }
  100% {
    transform: translateX(1.5px) translateY(1.5px);
  }
}

/* Home Summary */

.home-summary {
  padding-bottom: clamp(1.5rem, 5vh, 3rem);
  margin-top: clamp(2rem, 8vh, 4rem);
  justify-content: center;
}

.home-summary-inner {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6rem;
  text-align: center;
}

.summary-block h3 {
  text-align: center;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  margin-bottom: 2rem;
}
.summary-block h3 a {
  opacity: var(--header-dim);
  transition: opacity 0.15s ease, color 0.15s ease;
}

.summary-block h3 a:hover {
  opacity: 1;
}
.summary-list a {
  font-size: 1rem;
  font-weight: 500;
}

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

.summary-list li {
  margin-bottom: 1rem;
  text-align: center;
}

.summary-date {
  display: block;
  font-size: 0.75rem;
  opacity: 0.5;
  margin-top: 0.25rem;
}

/* Mobile */

@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
  .home-flow {
    padding-bottom: 2rem;
  }

  /* Navigation*/

  .logo {
    width: 40px;
    height: 40px;
  }

  .home-icon {
    width: 20px;
    height: 20px;
  }

  .nav-links a {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.015em;
    line-height: 1;
    display: inline-flex;
    align-items: center;
  }

  #theme-icon {
    width: 20px;
    height: 20px;
  }

  #theme-toggle {
    padding: 0.35rem;
  }

  .nav {
    display: flex;
    align-items: center;
    gap: 1.1rem;
  }
  .about-image {
    max-width: 120px;
  }

  .about-content p {
    font-size: 0.9rem;
  }

  .nav-right {
    flex-direction: column;
    align-items: center;
    gap: 2px;
    /* 버튼 사이 간격 */
  }
  .menu-toggle svg {
    transform: translateY(1px);
  }

  /* SUMMAR */

  .summary-block h3 {
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    margin-bottom: 1.75rem;
  }

  .summary-list a {
    font-size: 0.95rem;
  }

  .summary-date {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    opacity: 0.45;
  }

  .summary-list li {
    margin-bottom: 1.25rem;
  }

  /* Spacing */

  .home-summary {
    margin-top: 3rem;
    padding-bottom: 4rem;
  }
  .hero-line {
    margin-top: 2rem;
    transform: none;
  }

  /* Line */

  .line-main,
  .line-shadow {
    stroke-width: 2.8;
  }
}

/* Reduced Motion */

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* About Hero*/

.about-hero {
  display: flex;
  justify-content: center;
  max-width: 900px;
  margin: clamp(2rem, 6vh, 4rem) auto;
  padding: 0 1.5rem;
}

.about-image {
  width: 60px;
  height: 60px;
  margin-top: -50px;
  object-fit: cover;
  border-radius: 50%;
  opacity: 0.85;
  display: block;
  filter: grayscale(100%) contrast(1.05);
  box-shadow: none;
}

/* About Content*/

.about-content {
  max-width: 680px;
  margin: auto;
  padding: 1.5rem;
  text-align: center;
}

.about-content h2 {
  font-size: 1.1rem;
  letter-spacing: 0.18em;
  opacity: 0.6;
  margin-bottom: 2rem;
}

.about-content p {
  font-size: 0.95rem;
  line-height: 1.8;
  opacity: 0.85;
  margin-bottom: 1.5rem;
}

body:not(.light) .about-image {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 40px rgba(255, 255, 255, 0.05);
  opacity: 0.75;
  filter: grayscale(100%) brightness(0.92) contrast(1.06);
}

body.light .about-image {
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.about-content p:first-of-type {
  font-size: 0.95rem;
  opacity: 0.9;
}

.about-content p + p {
  font-size: 0.95rem;
  opacity: 0.72;
  margin-top: 0.75rem;
}
/* Header Right Buttons */

/* Header Right Buttons */

.nav-right {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* 버튼 공통 */
.nav-right button {
  width: 32px;
  height: 32px;
  padding: 0;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
}

.nav-right button:hover {
  opacity: 1;
}

/* 아이콘 크기 통일 */
#theme-icon,
.menu-toggle svg {
  width: 20px;
  height: 20px;
  display: block;
}

.side-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;

  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;

  min-width: 180px;
  display: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.side-menu.open {
  display: block;
}

/* Side Menu Profile */
.side-profile {
  display: flex;
  align-items: center;
  gap: 0.7rem;

  padding-bottom: 0.9rem;
  margin-bottom: 0.65rem;

  border-bottom: 1px solid var(--border);
}

.side-profile-image {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;

  filter: grayscale(100%);
  opacity: 0.85;
}

.side-profile-name {
  font-size: 0.82rem;
  font-weight: 600;
  opacity: 0.9;
}

.side-menu a {
  padding: 0.5rem 0;
  font-size: 0.85rem;
  opacity: 0.8;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.side-menu a:hover {
  opacity: 1;
  transform: translateX(2px);
}
body.light .side-menu {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.nav-right {
  position: relative;
}

.home-icon {
  opacity: var(--header-dim);
}
.nav-links a {
  opacity: var(--header-dim);
}
#theme-icon,
.menu-toggle svg {
  opacity: var(--header-dim);
}
.logo:hover .home-icon,
.nav-links a:hover,
.nav-right button:hover svg {
  opacity: 1;
}
/* SIDE LINKS */

.side-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.side-links a {
  width: 28px;
  height: 28px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  opacity: var(--header-dim);
  transition: opacity 0.15s ease;
}

.side-links a:hover {
  opacity: 1;
}

.side-links svg {
  width: 20px;
  height: 20px;
  display: block;
}
.side-links a:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 2px;
}
h1,
h2,
h3,
h4 {
  line-height: 1.4;
  margin-top: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

/* ===========================
   Home — Hero Line Wrap & Hover
   =========================== */

.hero-line-wrap {
  position: relative;
}

/* 기간 단위 토글 (차트 좌측 상단) */
.period-toggle {
  display: flex;
  gap: 0.25rem;
  width: 100%;
  max-width: 1000px;
  margin: clamp(1.5rem, 6vh, 3rem) auto -0.25rem;
}

.period-toggle .period-btn {
  -webkit-appearance: none;
  appearance: none;
  padding: 0.3rem 0.7rem;
  border: none;
  border-radius: 999px;
  background: none;
  color: var(--text);
  opacity: 0.4;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.4;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.period-toggle .period-btn:hover {
  opacity: 0.75;
}

.period-toggle .period-btn.is-active {
  opacity: 1;
  background: rgba(127, 127, 127, 0.16);
}

/* 토글 바로 아래 차트는 상단 여백 제거 */
.period-toggle + .hero-line {
  margin-top: 0;
}

/* 커브 아래 면적 채우기 */
.hero-area {
  pointer-events: none;
}

/* 0 기준선 */
.zero-baseline {
  stroke: currentColor;
  stroke-width: 1;
  opacity: 0.12;
  stroke-dasharray: 5 5;
  pointer-events: none;
}

/* X축 날짜 라벨 */
.x-axis-labels text {
  fill: currentColor;
  opacity: 0.45;
  font-size: 13px;
  font-weight: 500;
  pointer-events: none;
}

/* 수직 크로스헤어 */
.hover-vline {
  stroke: currentColor;
  stroke-width: 1;
  opacity: 0;
  transition: opacity 0.08s ease;
  pointer-events: none;
  stroke-dasharray: 4 4;
}

/* 커브 위 점 */
.hover-dot {
  fill: var(--bg);
  stroke: currentColor;
  stroke-width: 2;
  opacity: 0;
  transition: opacity 0.08s ease;
  pointer-events: none;
}

/* 툴팁 */
.equity-tooltip {
  display: none;
  position: absolute;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 10;
}

.tt-pnl {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.tt-meta {
  font-size: 0.7rem;
  opacity: 0.4;
  line-height: 1;
}

body.light .equity-tooltip {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.13);
}

/* ===========================
   Home — Section Label
   =========================== */

.section-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.45;
  margin: 0 0 1.5rem;
}

.section-label a {
  transition: opacity 0.15s ease;
}

.section-label a:hover {
  opacity: 1;
}

/* ===========================
   Home — Split Layout (Posts 좌 / Dashboard 우)
   =========================== */

.home-split {
  padding: 0 1.5rem;
  margin-top: clamp(2rem, 6vh, 3.5rem);
  padding-bottom: clamp(2rem, 6vh, 4rem);
}

.home-split-inner {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.split-col {
  display: flex;
  flex-direction: column;
}

/* ===========================
   Home — Recent Posts
   =========================== */

.recent-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.recent-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.recent-item:first-child {
  border-top: 1px solid var(--border);
}

.recent-title {
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.85;
  transition: opacity 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-title:hover {
  opacity: 1;
}

.recent-date {
  font-size: 0.75rem;
  opacity: 0.4;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* ===========================
   Home — Dashboard Metrics
   =========================== */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.metric-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.1rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.metric-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

body.light .metric-card {
  background: rgba(0, 0, 0, 0.02);
}

body.light .metric-card:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.18);
}

.metric-value {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.metric-value.positive {
  color: #3fb950;
}

.metric-value.negative {
  color: #f85149;
}

.metric-label {
  font-size: 0.72rem;
  opacity: 0.5;
  letter-spacing: 0.02em;
}

/* ===========================
   Home — Mobile
   =========================== */

@media (max-width: 768px) {
  .home-split-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

/* ===========================
   About
   =========================== */

/* 페이지 콘텐츠 컨테이너 — 화면 중앙 정렬 */
.about-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

/* 프로필: 사진 · 이름 · 태그라인 세로 중앙 정렬 */
.about-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.about-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  filter: grayscale(100%);
  opacity: 0.9;
}

.about-intro-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.about-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.about-tagline {
  font-size: 0.85rem;
  opacity: 0.5;
}

/* 본문 · 제목 모두 중앙 정렬 */
.about-container h2 {
  text-align: center;
}

.about-container p {
  text-align: center;
  margin-top: 0.5rem;
  line-height: 1.6;
}

.about-container p:first-of-type {
  margin-top: 0;
}

/* Contact — 가로 링크 행, 가운데 배치 */
.contact-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact-list li {
  margin: 0;
}

.contact-list a {
  display: inline-block;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.82rem;
  opacity: 0.75;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.contact-list a:hover {
  opacity: 1;
  background: rgba(127, 127, 127, 0.12);
}
