:root {
  --bg: #14171c;
  --surface: #191d23;
  --line: #262b33;
  --text: #ece9e2;
  --muted: #838b99;
  --accent: #d9a24b;
  --up: #e4573d;
  --down: #4e86e8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

a {
  color: inherit;
}

/* ============ 랜딩 (홈, /) ============ */
.landing-body {
  margin: 0;
}

.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 8vw;
  position: relative;
}

.landing-clock {
  position: absolute;
  top: 26px;
  right: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.74rem;
  color: var(--muted);
  letter-spacing: 0.03em;
}

@media (max-width: 600px) {
  .landing-clock {
    position: static;
    display: block;
    text-align: center;
    margin-bottom: 10px;
  }
}

.landing-headline {
  position: absolute;
  top: 26px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  text-wrap: balance;
  opacity: 0;
  filter: blur(8px);
  transform: translateY(16px);
  animation: landing-headline-in 1100ms cubic-bezier(0.16, 1, 0.3, 1) 200ms forwards;
}

@keyframes landing-headline-in {
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-headline {
    animation: none;
    opacity: 1;
    filter: none;
    transform: none;
  }
}

@media (max-width: 600px) {
  .landing-headline {
    position: static;
    font-size: 1.35rem;
    margin: 0 0 28px;
    text-align: center;
  }
}

.landing-inner {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
}

.landing-description {
  margin: 0 auto;
  max-width: 52ch;
  text-align: center;
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 2;
}

.sentence-muted {
  display: inline-block;
  color: var(--down);
  animation: sentence-glow 6.4s ease-in-out infinite;
  animation-delay: 1900ms;
}

.sentence-accent {
  display: inline-block;
  color: var(--accent);
  animation: sentence-glow 6.4s ease-in-out infinite;
  animation-delay: 2350ms;
}

.word-mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
}

.word-inner {
  display: inline-block;
  opacity: 0;
  transform: translateY(120%);
  animation: word-slide-in 550ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes word-slide-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sentence-glow {
  0%,
  100% {
    text-shadow: 0 0 0 rgba(217, 162, 75, 0);
    transform: scale(0.96);
  }
  50% {
    text-shadow: 0 0 16px rgba(217, 162, 75, 0.5);
    transform: scale(1.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  .word-inner {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .sentence-muted,
  .sentence-accent {
    animation: none;
  }
}

.landing-menu {
  margin-top: 64px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.landing-menu .btn {
  min-width: 150px;
  text-align: center;
  opacity: 0;
  animation: landing-btn-in 500ms ease-out forwards;
}

.landing-menu .btn-secondary {
  background: var(--down);
  border-color: var(--down);
  color: #fff;
  font-weight: 600;
}

.landing-menu .btn:nth-child(1) {
  animation-delay: 300ms;
}

.landing-menu .btn:nth-child(3) {
  animation-delay: 450ms;
}

.landing-submenu {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0 0 0 4px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
  opacity: 0;
  animation: landing-btn-in 500ms ease-out forwards;
}

.landing-menu > .landing-submenu:nth-child(2) {
  animation-delay: 380ms;
}

.landing-menu > .landing-submenu:nth-child(4) {
  animation-delay: 530ms;
}

.landing-submenu a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.76rem;
  letter-spacing: 0.01em;
  padding: 4px 6px;
  border-radius: 4px;
}

.landing-submenu a:hover {
  color: var(--text);
}

@keyframes landing-btn-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-menu .btn,
  .landing-submenu {
    animation: none;
    opacity: 1;
  }
}

@media (max-width: 600px) {
  .landing-menu {
    margin-top: 40px;
  }
}

.visitor-counter {
  position: fixed;
  bottom: 20px;
  right: 8vw;
  display: flex;
  gap: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.74rem;
  color: var(--muted);
}

.visitor-counter strong {
  color: var(--text);
  font-weight: 600;
}

@media (max-width: 600px) {
  .landing {
    display: block;
    padding: 32px 24px 100px;
  }

  .landing-inner {
    display: none;
  }

  .visitor-counter {
    right: 24px;
    bottom: 14px;
  }
}

/* ============ 앱 셸 (사이드바 + 메인) — 블로그/정보 피드 화면 ============ */
.app-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 14px 20px;
}

.sidebar .logo {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--text);
  display: block;
  margin-bottom: 14px;
}

.sidebar .logo span {
  color: var(--accent);
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.86rem;
  letter-spacing: 0.02em;
  padding: 9px 10px;
  border-radius: 4px;
}

.side-nav a:hover {
  color: var(--text);
}

.side-nav a.current {
  color: var(--text);
  background: rgba(217, 162, 75, 0.1);
}

.side-submenu {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0 0 4px 14px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

.side-submenu a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.74rem;
  letter-spacing: 0.01em;
  padding: 5px 8px;
  border-radius: 4px;
}

.side-submenu a:hover {
  color: var(--text);
}

.side-submenu a.current {
  color: var(--accent);
  font-weight: 600;
}

.main {
  padding: 30px 36px 60px;
  max-width: 980px;
}

/* ============ 기존 상단 헤더 (글쓰기/로그인/설정 화면) ============ */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.main-nav a {
  margin-left: 20px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.main-nav a:hover {
  color: var(--text);
}

/* ============ 섹션 공통 ============ */
.section {
  padding: 0 0 40px;
}

.section-label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 14px;
}

.clock-line {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.74rem;
  color: var(--muted);
  letter-spacing: 0.03em;
  margin-bottom: 26px;
}

/* ============ 블로그 목록 ============ */
.post-list {
  display: flex;
  flex-direction: column;
}

.post-item {
  display: flex;
  gap: 18px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.post-item:first-child {
  padding-top: 0;
}

.category-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.post-thumb {
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.post-item-body {
  flex: 1;
  min-width: 0;
}

.post-link {
  color: inherit;
  text-decoration: none;
  display: block;
}

.post-item h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 600;
}

.post-excerpt {
  margin: 0 0 8px;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-item time {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.74rem;
  color: var(--muted);
}

.post-item-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.post-item-actions a,
.post-item-actions button {
  font-size: 0.78rem;
  color: var(--muted);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}

.post-item-actions a:hover,
.post-item-actions button:hover {
  color: var(--text);
}

.post-item-actions .delete-post-btn:hover {
  color: var(--up);
}

/* ============ 정보 피드 2단 그리드 ============ */
.content-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 32px;
  margin-top: 8px;
}

@media (max-width: 760px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
}

.news-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
}

.news-tab-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.8rem;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.news-tab-btn:hover {
  color: var(--text);
}

.news-tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #14171c;
  font-weight: 600;
}

.news-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -6px 0 14px 18px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.news-subtabs[hidden] {
  display: none;
}

.news-subtab-btn {
  font-size: 0.74rem;
  padding: 5px 12px;
}

.stock-list,
.news-list {
  max-height: 460px;
  overflow-y: auto;
}

.stock-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0 7px 10px;
  border-left: 2px solid transparent;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
}

.stock-row.up {
  border-left-color: var(--up);
}

.stock-row.down {
  border-left-color: var(--down);
}

.stock-name {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stock-badge {
  flex-shrink: 0;
  font-size: 0.66rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.stock-price {
  text-align: right;
  flex-shrink: 0;
  min-width: 150px;
}

.stock-change {
  font-size: 0.78rem;
}

.stock-change.up {
  color: var(--up);
}

.stock-change.down {
  color: var(--down);
}

.stock-change.flat {
  color: var(--muted);
}

.news-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.news-item:last-child {
  border-bottom: none;
}

.news-item a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.87rem;
  line-height: 1.5;
}

.news-item a:hover {
  text-decoration: underline;
}

.news-meta {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 4px;
}

/* ============ 순위 리스트 (OTT/박스오피스 공용) ============ */
.rank-subhead {
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.rank-list {
  max-height: 460px;
  overflow-y: auto;
}

.rank-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.rank-item:last-child {
  border-bottom: none;
}

.rank-num {
  flex-shrink: 0;
  width: 18px;
  font-weight: 700;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.rank-title {
  flex: 1;
  min-width: 0;
  font-size: 0.87rem;
  color: var(--text);
}

.rank-meta {
  flex-shrink: 0;
  font-size: 0.68rem;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ============ 스포츠/취미 (준비 중) ============ */
.feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 34px;
}

.feed-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
}

.feed-card h3 {
  margin: 0 0 8px;
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 600;
}

.empty {
  color: var(--muted);
  font-size: 0.86rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 22px 0;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

/* ============ 폼 (글쓰기/로그인/설정) ============ */
.post-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 620px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.form-row input[type="text"],
.form-row input[type="password"],
.form-row select,
.form-row textarea {
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
}

.form-row select {
  max-width: 200px;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-row textarea {
  resize: vertical;
  line-height: 1.6;
}

.thumbnail-preview {
  margin-top: 8px;
  max-width: 240px;
  border-radius: 4px;
  border: 1px solid var(--line);
}

.form-actions {
  display: flex;
  gap: 10px;
}

.btn {
  padding: 10px 20px;
  border-radius: 4px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: #14171c;
  font-weight: 600;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.form-error {
  color: var(--up);
  font-size: 0.86rem;
}

.form-success {
  color: #7bc47f;
  font-size: 0.86rem;
}

.field-hint {
  margin: -2px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.field-hint code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 5px;
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.attachment-chip {
  font-size: 0.76rem;
  padding: 3px 9px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
}

.attachment-chip.done {
  color: var(--text);
  border-color: var(--accent);
}

.attachment-chip.failed {
  color: var(--up);
  border-color: var(--up);
}

/* ============ 글 보기 (post.html) ============ */
.post-title {
  font-size: 1.7rem;
  margin: 0 0 8px;
  text-wrap: balance;
}

.post-date {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--muted);
}

.post-hero-image {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  margin: 20px 0;
}

.post-body {
  margin-top: 24px;
  font-size: 1rem;
  line-height: 1.85;
}

.post-body p {
  margin: 0 0 1.1em;
}

.post-body img {
  display: block;
  max-width: 100%;
  border-radius: 6px;
  border: 1px solid var(--line);
  margin: 1.2em 0;
}

.post-body h1,
.post-body h2,
.post-body h3 {
  margin: 1.4em 0 0.6em;
  line-height: 1.4;
}

.post-body a {
  color: var(--accent);
}

.post-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 0.9em;
}

.post-body pre {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  overflow-x: auto;
}

.post-body pre code {
  border: none;
  padding: 0;
}

.post-body blockquote {
  margin: 1em 0;
  padding: 4px 16px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

/* ============ 댓글/답글 ============ */
.comments-section {
  border-top: 1px solid var(--line);
  padding-top: 32px;
  margin-top: 40px;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
}

.comment {
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
}

.comment-list > .comment:first-child {
  border-top: none;
  padding-top: 0;
}

.comment-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

.comment-author {
  font-weight: 600;
  font-size: 0.9rem;
}

.comment-date {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  color: var(--muted);
}

.comment-content {
  margin: 0 0 6px;
  font-size: 0.92rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.comment-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 4px;
}

.comment-actions button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 0.76rem;
  color: var(--muted);
  font-family: inherit;
}

.comment-actions button:hover {
  color: var(--accent);
}

.reply-form-slot:not(:empty) {
  margin: 10px 0;
  padding: 12px;
  background: var(--surface);
  border-radius: 6px;
  border: 1px solid var(--line);
}

.reply-form .form-row,
.comment-form .form-row {
  margin-bottom: 10px;
}

.reply-form textarea,
.comment-form textarea {
  resize: vertical;
}

.comment-form {
  max-width: none;
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 16px 20px;
  }

  .side-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .main {
    padding: 24px 20px 50px;
  }

  .header-inner {
    flex-direction: column;
    height: auto;
    padding: 12px 0;
    gap: 8px;
  }
}
