:root {
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  color: #19181e;
  background: #faf9f6;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  --ink: #19181e;
  --bg: #faf9f6;
  --purple: #6435ee;
  --pink: #ff49a5;
  --lime: #d5ff45;
  --mint: #7cf1cd;
  --muted: #615c6a;
}

* {
  box-sizing: border-box;
}

::selection {
  background: var(--lime);
  color: var(--ink);
}

body.journal-body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  min-height: 100dvh;
}

.journal-body a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.journal-body a:focus-visible,
.journal-body button:focus-visible,
.journal-body input:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 4px;
}

.journal-shell {
  width: min(1120px, calc(100% - 96px));
  margin: 0 auto;
}

/* Header matching index.html */
.journal-header {
  height: 88px;
  border-bottom: 1px solid #19181e25;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.journal-brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-size: 31px;
  font-weight: 850;
  letter-spacing: -1.7px;
  color: var(--ink);
}

.journal-brand-period {
  color: var(--purple);
}

.journal-brand-symbol {
  width: 67px;
  height: 42px;
  flex-shrink: 0;
  object-fit: contain;
}

.journal-nav {
  display: flex;
  align-items: center;
  gap: 38px;
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: -0.3px;
}

.journal-nav-link {
  padding: 6px 2px;
  color: var(--ink);
  position: relative;
  transition: color 0.18s ease;
}

.journal-nav-link:hover {
  color: var(--purple);
}

.journal-nav-link.active {
  color: var(--purple);
  font-weight: 800;
}

.journal-nav-link.active::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  bottom: 1px;
  height: 6px;
  background: var(--lime);
  transform: rotate(-1.5deg);
  z-index: -1;
}

/* Title & Search Header in Minlabs vivid style */
.journal-hero-top {
  padding: 36px 0 22px;
}

.journal-eyebrow {
  display: flex;
  gap: 9px;
  align-items: center;
  font-size: 10px;
  letter-spacing: 1.7px;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--muted);
  text-transform: uppercase;
}

.journal-eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--pink);
  border: 1px solid var(--ink);
  transform: rotate(-12deg);
  display: inline-block;
}

.journal-title {
  font-size: clamp(36px, 4.4vw, 56px);
  font-weight: 850;
  letter-spacing: -2.6px;
  line-height: 1.2;
  margin: 0;
  color: var(--ink);
  display: inline-block;
  position: relative;
  isolation: isolate;
}

.journal-title::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -6px;
  bottom: 3px;
  height: 0.24em;
  background: var(--lime);
  transform: rotate(-1deg);
  z-index: -1;
}

.journal-title-asterisk {
  display: inline-block;
  color: var(--pink);
  font-size: 0.68em;
  margin-left: 10px;
  font-weight: 400;
}

.journal-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.journal-subtitle {
  margin: 0;
  font-size: 15px;
  font-weight: 550;
  color: #5e5866;
  letter-spacing: -0.3px;
}

.journal-search-wrap {
  position: relative;
  width: min(320px, 100%);
  display: flex;
  align-items: center;
}

.journal-search-icon {
  position: absolute;
  left: 14px;
  color: var(--ink);
  pointer-events: none;
  display: flex;
}

.journal-search-input {
  width: 100%;
  height: 44px;
  background: #ffffff;
  border: 1.5px solid var(--ink);
  border-radius: 99px;
  padding: 0 54px 0 40px;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 2px 0 var(--ink);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.journal-search-input::placeholder {
  color: #7c7585;
  font-weight: 500;
}

.journal-search-input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 4px 0 var(--purple);
}

.journal-kbd {
  position: absolute;
  right: 12px;
  background: var(--bg);
  border: 1px solid var(--ink);
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, monospace;
  padding: 2px 7px;
  border-radius: 99px;
  pointer-events: none;
}

/* Filter Pills & Sort Controls */
.journal-toolbar {
  margin-top: 10px;
  padding: 16px 0;
  border-top: 1px solid #19181e25;
  border-bottom: 1px solid #19181e25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.journal-tags-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-pill {
  background: #ffffff;
  border: 1.5px solid var(--ink);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 99px;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--ink);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.filter-pill:hover {
  background: var(--lime);
  transform: translateY(-2px);
  box-shadow: 0 4px 0 var(--ink);
}

.filter-pill.active {
  background: var(--ink);
  color: var(--lime);
  box-shadow: 0 2px 0 var(--purple);
}

.journal-sort-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.post-count-text {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.6px;
}

.post-count-text strong {
  display: inline-block;
  border: 1px solid var(--ink);
  border-radius: 99px;
  padding: 2px 8px;
  background: var(--ink);
  color: var(--lime);
  font-size: 10.5px;
  margin-right: 4px;
}

.sort-switch {
  display: inline-flex;
  background: #ffffff;
  border: 1.5px solid var(--ink);
  border-radius: 99px;
  padding: 3px;
  box-shadow: 0 2px 0 var(--ink);
}

.sort-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sort-btn.active {
  background: var(--lime);
  color: var(--ink);
  border: 1px solid var(--ink);
}

/* Featured Hero Post Card in Minlabs Neo-Brutalist Style */
.hero-card {
  margin-top: 26px;
  display: grid;
  grid-template-columns: 1.04fr 1fr;
  background: #ffffff;
  border: 1.5px solid var(--ink);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.hero-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 0 var(--ink);
}

.hero-card-body {
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #ffffff;
}

.hero-badges {
  display: flex;
  align-items: center;
  gap: 10px;
}

.editors-pick-pill {
  background: var(--pink);
  border: 1.5px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  padding: 4px 10px;
  border-radius: 99px;
}

.hero-cat-text {
  font-size: 12px;
  font-weight: 750;
  color: var(--purple);
}

.hero-title {
  margin: 16px 0 0;
  font-size: clamp(23px, 2.3vw, 29px);
  font-weight: 850;
  line-height: 1.36;
  letter-spacing: -0.9px;
  color: var(--ink);
  word-break: keep-all;
}

.hero-summary {
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.78;
  color: #5f5968;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-meta {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid #19181e1a;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.3px;
}

/* Minlabs Vivid Thumbnail Component */
.av-thumb {
  position: relative;
  height: 218px;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  isolation: isolate;
  border-bottom: 1.5px solid var(--ink);
}

.av-thumb-hero {
  height: 100%;
  min-height: 320px;
  padding: 26px 32px;
  border-bottom: none;
  border-right: 1.5px solid var(--ink);
}

/* Vivid Minlabs Themes */
.av-theme-mint {
  background: var(--mint);
  color: var(--ink);
}

.av-theme-purple {
  background: var(--purple);
  color: #ffffff;
}

.av-theme-lime {
  background: var(--lime);
  color: var(--ink);
}

.av-theme-pink {
  background: var(--pink);
  color: var(--ink);
}

.av-theme-cream {
  background: #f2ede2;
  color: var(--ink);
}

.av-thumb-orbit {
  position: absolute;
  width: 220px;
  height: 220px;
  right: -25px;
  top: 50%;
  transform: translateY(-50%);
  border: 1px dashed rgba(25, 24, 30, 0.22);
  border-radius: 50%;
  z-index: -1;
}

.av-theme-purple .av-thumb-orbit {
  border-color: rgba(255, 255, 255, 0.28);
}

.av-thumb-spark {
  position: absolute;
  right: 108px;
  top: 44px;
  font-size: 24px;
  color: var(--pink);
  transform: rotate(12deg);
  z-index: -1;
}

.av-theme-pink .av-thumb-spark {
  color: var(--lime);
}

.av-thumb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.av-cat-pill {
  background: #ffffff;
  border: 1.5px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 750;
  padding: 4px 11px;
  border-radius: 99px;
}

.av-theme-purple .av-cat-pill {
  background: var(--lime);
  color: var(--ink);
}

.av-brand-mark {
  font-size: 15px;
  font-weight: 850;
  letter-spacing: -0.8px;
  color: inherit;
}

.av-brand-dot {
  color: var(--purple);
}

.av-theme-purple .av-brand-dot {
  color: var(--lime);
}

.av-thumb-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: auto;
  margin-bottom: 2px;
}

.av-thumb-copy {
  flex: 1;
  min-width: 0;
}

.av-sub-kicker {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.2px;
  margin-bottom: 6px;
  opacity: 0.86;
}

.av-thumb-hero .av-sub-kicker {
  font-size: 11.5px;
  background: #ffffff;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  padding: 4px 11px;
  border-radius: 99px;
  opacity: 1;
}

.av-thumb-headline {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  font-size: 19.5px;
  font-weight: 850;
  line-height: 1.26;
  letter-spacing: -0.8px;
  word-break: keep-all;
}

.av-thumb-hero .av-thumb-headline {
  font-size: clamp(23px, 2.4vw, 29px);
  line-height: 1.25;
}

.av-hl > span {
  display: inline-block;
  background: var(--lime);
  color: var(--ink);
  padding: 1px 7px;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  box-shadow: 2px 2px 0 var(--ink);
  transform: rotate(-1deg);
}

.av-theme-lime .av-hl > span {
  background: #ffffff;
  color: var(--purple);
}

.thumb-icon-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.thumb-icon-box {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: #ffffff;
  border: 2px solid var(--ink);
  box-shadow: 4px 5px 0 var(--ink);
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 5px;
  transform: rotate(-4deg);
  transition: transform 0.25s ease;
}

.journal-card:hover .thumb-icon-box,
.hero-card:hover .thumb-icon-box {
  transform: rotate(2deg) translateY(-2px);
}

.av-thumb-hero .thumb-icon-box {
  width: 94px;
  height: 94px;
  border-radius: 22px;
}

.thumb-icon-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.thumb-icon-caption {
  font-size: 10px;
  font-weight: 750;
  color: inherit;
  letter-spacing: -0.1px;
}

/* 3-Column Post Grid in Minlabs Neo-Brutalist Card Style */
.journal-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.journal-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #ffffff;
  border: 1.5px solid var(--ink);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.journal-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 0 var(--ink);
}

.journal-card-thumb-frame {
  overflow: hidden;
}

.journal-card-body {
  padding: 18px 22px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.journal-card-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.42;
  letter-spacing: -0.6px;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: keep-all;
}

.journal-card-summary {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.75;
  color: #6e6875;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.journal-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.journal-tag-chip {
  font-size: 10.5px;
  font-weight: 700;
  color: #295844;
  background: #e0faef;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1.4;
}

.journal-tag-chip:nth-child(even) {
  color: #5934ad;
  background: #f0e9ff;
}

.journal-card-meta {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #19181e1a;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-arrow-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--ink);
  background: var(--lime);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-size: 14px;
  transition: transform 0.2s ease;
}

.journal-card:hover .card-arrow-circle {
  transform: rotate(10deg);
  background: var(--pink);
}

/* Empty State */
.journal-empty {
  margin: 40px 0;
  padding: 48px 24px;
  text-align: center;
  background: #ffffff;
  border: 1.5px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 3px 0 var(--ink);
  color: var(--muted);
}

/* Post Detail View */
.post-detail-wrap {
  max-width: 820px;
  margin: 36px auto 64px;
}

.post-back-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.post-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 750;
  color: var(--ink);
  padding: 8px 14px;
  background: #ffffff;
  border: 1.5px solid var(--ink);
  border-radius: 99px;
  box-shadow: 0 2px 0 var(--ink);
}

.post-back-link:hover {
  background: var(--lime);
}

.post-detail-card {
  background: #ffffff;
  border: 1.5px solid var(--ink);
  border-radius: 22px;
  box-shadow: 0 4px 0 var(--ink);
  padding: 36px 42px 44px;
}

.post-detail-title {
  font-size: clamp(26px, 3.6vw, 38px);
  font-weight: 850;
  line-height: 1.32;
  letter-spacing: -1.1px;
  margin: 14px 0 18px;
  color: var(--ink);
  word-break: keep-all;
}

.post-detail-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 20px;
  border-bottom: 1.5px solid #19181e20;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}

.post-detail-thumb {
  margin: 26px 0 32px;
  border-radius: 18px;
  overflow: hidden;
  border: 1.5px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
}

.post-detail-thumb .av-thumb-hero {
  border-right: none;
}

.post-content {
  font-size: 16px;
  line-height: 1.88;
  color: var(--ink);
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
  color: var(--ink);
  margin: 34px 0 12px;
  letter-spacing: -0.6px;
  font-weight: 850;
}

.post-content p {
  margin: 0 0 18px;
  word-break: keep-all;
}

.post-content a {
  color: var(--purple);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.post-content blockquote {
  margin: 22px 0;
  padding: 16px 22px;
  border: 1.5px solid var(--ink);
  border-left: 6px solid var(--purple);
  background: var(--bg);
  border-radius: 12px;
  box-shadow: 3px 3px 0 var(--ink);
  font-weight: 650;
}

.post-content pre {
  margin: 22px 0;
  padding: 18px 20px;
  background: #19181e;
  color: #f8fafc;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  box-shadow: 3px 3px 0 var(--purple);
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13.5px;
  line-height: 1.65;
}

.post-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #f0e9ff;
  color: #4c23c4;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.9em;
  font-weight: 650;
}

.post-content pre code {
  background: none;
  color: inherit;
  padding: 0;
}

.post-content ul {
  margin: 0 0 20px;
  padding-left: 22px;
}

.post-content li {
  margin-bottom: 8px;
}

.post-inline-img {
  max-width: 100%;
  border-radius: 14px;
  margin: 20px 0;
  border: 1.5px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
}

/* Footer matching index.html */
.journal-footer {
  border-top: 1px solid #19181e25;
  margin-top: 48px;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 11px;
  color: #6e6875;
}

.journal-footer-links {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.journal-footer-links a {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-weight: 600;
}

.journal-footer-links a:hover {
  color: var(--purple);
}

@media (max-width: 1020px) {
  .journal-shell {
    width: calc(100% - 64px);
  }
  .hero-card {
    grid-template-columns: 1fr;
  }
  .av-thumb-hero {
    min-height: 250px;
    border-right: none;
    border-bottom: 1.5px solid var(--ink);
  }
  .hero-card-body {
    padding: 26px 28px;
  }
  .journal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .journal-shell {
    width: calc(100% - 40px);
  }
  .journal-header {
    height: 72px;
  }
  .journal-brand {
    font-size: 27px;
  }
  .journal-brand-symbol {
    width: 58px;
    height: 37px;
  }
  .journal-nav {
    gap: 20px;
    font-size: 14px;
  }
  .journal-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .journal-search-wrap {
    width: 100%;
  }
  .post-detail-card {
    padding: 24px 20px 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
  .hero-card:hover,
  .journal-card:hover {
    transform: none;
  }
}
