/* ============================================================================
   Planet Topics — Dark Tech Theme (IT/Korea)
   Hand-authored utility + component CSS (no build step).
   Class names mirror Tailwind utilities used in layouts, but values are
   remapped to a deep-slate dark palette with an electric-cyan accent.
   ============================================================================ */

:root {
    --bg:          #0a0e14;   /* page background (near-black slate) */
    --bg-elev:     #0e131c;   /* slightly elevated band */
    --surface:     #131a24;   /* cards / header */
    --surface-2:   #1a2330;   /* nested chips / hovers */
    --surface-3:   #212c3b;   /* active / stronger */
    --border:      #232c3a;   /* hairline borders */
    --border-2:    #2e3a4d;
    --text:        #e6edf3;   /* primary text */
    --text-muted:  #9aa7b6;   /* secondary text */
    --text-dim:    #6b7888;   /* tertiary / meta */
    --accent:      #22d3ee;   /* electric cyan */
    --accent-2:    #38bdf8;   /* sky blue companion */
    --accent-strong:#06b6d4;
    --accent-ink:  #051016;   /* text on accent fills */
    --accent-soft: rgba(34, 211, 238, 0.12);
    --accent-soft-2: rgba(34, 211, 238, 0.20);
    --glow:        0 0 0 1px rgba(34,211,238,.25), 0 8px 30px -10px rgba(34,211,238,.35);
    --radius:      0.75rem;
}

/* ---- Reset & base ---- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI',
        'Apple SD Gothic Neo', 'Noto Sans KR', 'Roboto', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.65;
    background-color: var(--bg);
    color: var(--text);
    background-image:
        radial-gradient(900px 500px at 100% -5%, rgba(34,211,238,.08), transparent 60%),
        radial-gradient(700px 500px at -10% 0%, rgba(56,189,248,.06), transparent 55%);
    background-attachment: fixed;
}

::selection { background: var(--accent-soft-2); color: #fff; }

/* Custom dark scrollbar — distinctive tech feel */
* { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 999px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: #3a4a61; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

img { max-width: 100%; height: auto; }

/* Sticky header offsets */
.site-header { min-height: 64px; }
.site-header + main { scroll-margin-top: 84px; }
[id] { scroll-margin-top: 84px; }

/* ============================================================
   Prose (markdown article body) — dark
   ============================================================ */
.prose { color: var(--text-muted); max-width: 72ch; font-size: 1.02rem; }
.prose > * + * { margin-top: 1.1em; }

.prose h1, .prose h2, .prose h3, .prose h4 { color: var(--text); font-weight: 700; letter-spacing: -0.01em; }
.prose h1 { font-size: 2.1em; margin: 0 0 .7em; line-height: 1.15; }
.prose h2 {
    font-size: 1.6em; margin: 1.9em 0 .8em; line-height: 1.3;
    padding-bottom: .3em; border-bottom: 1px solid var(--border);
}
.prose h2::before { content: "# "; color: var(--accent); font-weight: 800; }
.prose h3 { font-size: 1.3em; margin: 1.6em 0 .6em; line-height: 1.4; }
.prose p { margin: 1.2em 0; }
.prose img { margin: 2em auto; border-radius: var(--radius); display: block; border: 1px solid var(--border); }
.prose ul, .prose ol { margin: 1.2em 0; padding-left: 1.5em; }
.prose li { margin: .5em 0; }
.prose li::marker { color: var(--accent); }
.prose strong { color: var(--text); font-weight: 700; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent-soft-2); font-weight: 500; }
.prose a:hover { color: var(--accent-2); text-decoration-color: var(--accent-2); }

.prose blockquote {
    font-style: italic; color: var(--text);
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    margin: 1.6em 0; padding: .8em 1.1em; border-radius: 0 .5rem .5rem 0;
}

.prose code {
    color: var(--accent-2); font-weight: 600; font-size: .875em;
    background-color: var(--surface-2);
    padding: .18em .42em; border-radius: .35rem;
    border: 1px solid var(--border);
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, 'Menlo', 'Consolas', monospace;
}
.prose pre {
    color: #d6e2f0; background-color: #070b11;
    overflow-x: auto; font-size: .875em; line-height: 1.7;
    margin: 1.7em 0; border-radius: var(--radius); padding: 1.1em 1.2em;
    border: 1px solid var(--border);
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, 'Menlo', 'Consolas', monospace;
}
.prose pre code { background: transparent; border: 0; padding: 0; color: inherit; font-weight: 400; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: .92em; }
.prose th, .prose td { border: 1px solid var(--border); padding: .55em .8em; text-align: left; }
.prose thead { background: var(--surface-2); color: var(--text); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.4em 0; }

/* ============================================================
   Line clamp
   ============================================================ */
.line-clamp-2 { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.line-clamp-3 { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }

/* ============================================================
   Layout containers
   ============================================================ */
.container { width: 100%; margin-left: auto; margin-right: auto; padding-left: 1rem; padding-right: 1rem; }
@media (min-width: 640px)  { .container { max-width: 640px; } }
@media (min-width: 768px)  { .container { max-width: 768px; } }
@media (min-width: 1024px) { .container { max-width: 1024px; } }
@media (min-width: 1280px) { .container { max-width: 1180px; } }

.grid { display: grid; gap: 1rem; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0,1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .md\:flex { display: flex; }
    .md\:flex-col { flex-direction: column; }
    .md\:flex-row { flex-direction: row; }
    .md\:flex-row-reverse { flex-direction: row-reverse; }
    .md\:w-1\/2 { width: 50%; }
    .md\:w-1\/3 { width: 33.333333%; }
    .md\:w-2\/3 { width: 66.666667%; }
    .md\:h-full { height: 100%; }
    .md\:self-stretch { align-self: stretch; }
    .md\:p-12 { padding: 3rem; }
    .md\:pt-10 { padding-top: 2.5rem; }
    .md\:pb-12 { padding-bottom: 3rem; }
    .md\:text-5xl { font-size: 3rem; line-height: 1.05; }
    .md\:text-lg { font-size: 1.125rem; line-height: 1.75rem; }
}
@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
}

/* ============================================================
   Positioning (for hero/badges)
   ============================================================ */
.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; }
.top-0 { top: 0; } .top-4 { top: 1rem; }
.left-4 { left: 1rem; } .right-4 { right: 1rem; } .bottom-4 { bottom: 1rem; }
.inset-0 { inset: 0; }
.z-10 { z-index: 10; } .z-50 { z-index: 50; }

/* ============================================================
   Transitions & motion
   ============================================================ */
.transition-colors { transition: color .2s, background-color .2s, border-color .2s; }
.transition-shadow { transition: box-shadow .3s; }
.transition-transform { transition: transform .4s cubic-bezier(.2,.7,.2,1); }
.transition-all { transition: all .25s ease; }
.duration-300 { transition-duration: .3s; }
.duration-500 { transition-duration: .5s; }
.group:hover .group-hover\:scale-105 { transform: scale(1.05); }
.group:hover .group-hover\:text-accent { color: var(--accent); }
.hover\:scale-105:hover { transform: scale(1.05); }
.animate-pulse { animation: pulse 2s cubic-bezier(.4,0,.6,1) infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
.fade-in { animation: fade-in .5s ease-out; }
@keyframes fade-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ============================================================
   COLOR REMAP — dark surfaces
   Light backgrounds become dark elevated surfaces.
   ============================================================ */
.bg-white      { background-color: var(--surface); }
.bg-gray-50    { background-color: var(--bg); }
.bg-gray-100   { background-color: var(--surface-2); }
.bg-gray-200   { background-color: var(--surface-3); }
.bg-gray-600   { background-color: #3a4658; }
.bg-gray-700   { background-color: #2b3545; }
.bg-gray-900   { background-color: #06090e; }
.bg-slate-700  { background-color: #2b3545; }
.bg-slate-900  { background-color: #06090e; }
.bg-blue-50    { background-color: var(--accent-soft); }
.bg-blue-100   { background-color: var(--accent-soft-2); }
.bg-indigo-50  { background-color: var(--accent-soft); }
.bg-purple-50  { background-color: var(--accent-soft); }
.bg-purple-100 { background-color: var(--accent-soft-2); }
.bg-amber-50   { background-color: var(--accent-soft); }
.bg-blue-600, .bg-blue-700, .bg-sky-500, .bg-sky-600, .bg-amber-500 {
    background-color: var(--accent); color: var(--accent-ink);
}

/* Text colors */
.text-gray-900, .text-gray-800, .text-slate-900 { color: var(--text); }
.text-gray-700, .text-slate-700 { color: var(--text); }
.text-gray-600, .text-slate-600 { color: var(--text-muted); }
.text-gray-500, .text-slate-500 { color: var(--text-dim); }
.text-gray-400 { color: var(--text-dim); }
.text-gray-300 { color: var(--text-muted); }
.text-white { color: #ffffff; }
.text-blue-400, .text-indigo-400 { color: var(--accent); }
.text-blue-600, .text-blue-700, .text-blue-800, .text-blue-900,
.text-indigo-600, .text-indigo-700, .text-indigo-800, .text-indigo-900,
.text-purple-600, .text-purple-900 { color: var(--accent); }
.text-amber-700, .text-amber-900 { color: var(--accent-2); }

/* Hover text/bg */
.hover\:bg-blue-100:hover  { background-color: var(--accent-soft-2); }
.hover\:bg-blue-700:hover  { background-color: var(--accent-strong); }
.hover\:bg-gray-700:hover  { background-color: var(--surface-3); }
.hover\:bg-sky-600:hover   { background-color: var(--accent-strong); }
.hover\:text-blue-300:hover,
.hover\:text-blue-600:hover,
.hover\:text-blue-800:hover { color: var(--accent-2); }
.hover\:text-white:hover    { color: #ffffff; }
.hover\:text-orange-600:hover { color: var(--accent-2); }

/* Borders */
.border-gray-100, .border-gray-200, .border-slate-200, .border-slate-300 { border-color: var(--border); }
.border-gray-800 { border-color: var(--border-2); }
.border-blue-200, .border-blue-300, .border-blue-500,
.border-indigo-200, .border-purple-500, .border-amber-200, .border-amber-500 { border-color: var(--accent-soft-2); }

/* Gradients (hero / feature panels) → branded cyan→sky on dark */
.bg-gradient-to-r,
.bg-gradient-to-br,
.bg-gradient-to-b,
.bg-gradient-to-bl { background-image: linear-gradient(135deg, var(--accent-strong), #2563eb 90%); color: #fff; }

/* ============================================================
   Spacing utilities
   ============================================================ */
.space-y-2 > * + * { margin-top: .5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-8 > * + * { margin-top: 2rem; }
.gap-2 { gap: .5rem; } .gap-3 { gap: .75rem; } .gap-4 { gap: 1rem; } .gap-6 { gap: 1.5rem; } .gap-8 { gap: 2rem; }

.p-3 { padding: .75rem; } .p-4 { padding: 1rem; } .p-5 { padding: 1.25rem; } .p-6 { padding: 1.5rem; } .p-8 { padding: 2rem; }
.px-2 { padding-left: .5rem; padding-right: .5rem; }
.px-3 { padding-left: .75rem; padding-right: .75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-1 { padding-top: .25rem; padding-bottom: .25rem; }
.py-1\.5 { padding-top: .375rem; padding-bottom: .375rem; }
.py-2 { padding-top: .5rem; padding-bottom: .5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.pl-4 { padding-left: 1rem; } .pt-6 { padding-top: 1.5rem; } .pb-8 { padding-bottom: 2rem; }

.m-0 { margin: 0; }
.mb-2 { margin-bottom: .5rem; } .mb-3 { margin-bottom: .75rem; } .mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; } .mb-8 { margin-bottom: 2rem; } .mb-12 { margin-bottom: 3rem; }
.mt-4 { margin-top: 1rem; } .mt-6 { margin-top: 1.5rem; } .mt-8 { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; } .mt-16 { margin-top: 4rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.-mx-8 { margin-left: -2rem; margin-right: -2rem; }
.-mt-8 { margin-top: -2rem; }

/* ============================================================
   Typography utilities
   ============================================================ */
.text-xs  { font-size: .75rem; line-height: 1rem; }
.text-sm  { font-size: .875rem; line-height: 1.25rem; }
.text-base{ font-size: 1rem; line-height: 1.5rem; }
.text-lg  { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl  { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-5xl { font-size: 3rem; line-height: 1.05; }

.font-medium { font-weight: 500; } .font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; } .font-extrabold { font-weight: 800; }
.uppercase { text-transform: uppercase; }
.italic { font-style: italic; }
.text-center { text-align: center; }
.leading-tight { line-height: 1.2; } .leading-snug { line-height: 1.375; } .leading-relaxed { line-height: 1.65; }
.tracking-wider { letter-spacing: .05em; } .tracking-tight { letter-spacing: -.02em; }

/* ============================================================
   Display / flex
   ============================================================ */
.block { display: block; } .inline-block { display: inline-block; }
.inline-flex { display: inline-flex; } .flex { display: flex; }
.hidden { display: none; }
.flex-wrap { flex-wrap: wrap; } .flex-col { flex-direction: column; } .flex-row { flex-direction: row; }
.flex-1 { flex: 1 1 0%; }
.items-center { align-items: center; } .items-baseline { align-items: baseline; } .items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; } .justify-center { justify-content: center; }
.self-stretch { align-self: stretch; }

.w-full { width: 100%; } .h-full { height: 100%; } .h-auto { height: auto; }
.w-2 { width: .5rem; } .h-2 { height: .5rem; }
.h-32 { height: 8rem; } .h-48 { height: 12rem; } .h-64 { height: 16rem; }
.max-h-64 { max-height: 16rem; } .max-h-96 { max-height: 24rem; }
.max-w-none { max-width: none; }
.max-w-2xl { max-width: 42rem; } .max-w-5xl { max-width: 64rem; } .max-w-6xl { max-width: 72rem; }
.aspect-video { aspect-ratio: 16 / 9; }

.overflow-hidden { overflow: hidden; } .overflow-x-auto { overflow-x: auto; }
.object-cover { object-fit: cover; }

/* ============================================================
   Radius / shadow / borders — dark, with cyan glow on hover
   ============================================================ */
.rounded     { border-radius: .375rem; }
.rounded-lg  { border-radius: .6rem; }
.rounded-xl  { border-radius: var(--radius); }
.rounded-r   { border-radius: 0 .375rem .375rem 0; }
.rounded-full{ border-radius: 9999px; }

.shadow     { box-shadow: 0 1px 2px rgba(0,0,0,.4); }
.shadow-md  { box-shadow: 0 4px 14px -6px rgba(0,0,0,.6); }
.shadow-lg  { box-shadow: 0 12px 30px -12px rgba(0,0,0,.7); }
.shadow-xl  { box-shadow: 0 20px 45px -15px rgba(0,0,0,.75); }
.hover\:shadow-md:hover { box-shadow: 0 4px 14px -6px rgba(0,0,0,.6); }
.hover\:shadow-xl:hover { box-shadow: var(--glow); }

.border    { border-width: 1px; border-style: solid; border-color: var(--border); }
.border-b  { border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: var(--border); }
.border-t  { border-top-width: 1px; border-top-style: solid; border-top-color: var(--border); }
.border-l-4{ border-left-width: 4px; border-left-style: solid; border-left-color: var(--accent); }

.backdrop-blur { backdrop-filter: blur(10px); }

/* ============================================================
   Component polish
   ============================================================ */

/* Header — glassy dark bar with accent hairline */
.site-header {
    background-color: rgba(13, 18, 26, 0.82) !important;
    backdrop-filter: saturate(140%) blur(12px);
    border-bottom: 1px solid var(--border);
    box-shadow: none !important;
}
.site-header .logo a { color: var(--text) !important; letter-spacing: -.02em; }
.site-header .logo a:hover { color: var(--accent) !important; }

/* Cards (post cards, panels using .bg-white) get borders + hover lift */
.post-card,
article.bg-white,
.bg-white.rounded-lg,
.bg-white.rounded-xl {
    border: 1px solid var(--border);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.post-card:hover,
article.bg-white:hover {
    transform: translateY(-3px);
    border-color: var(--accent-soft-2);
    box-shadow: var(--glow);
}

/* Card thumbnail height match on md+ */
@media (min-width: 768px) {
    .post-card > div { display: flex; }
    .post-card > div > div:first-child { display: flex; align-self: stretch; }
    .post-card > div > div:first-child > a { display: flex; width: 100%; }
    .post-card > div > div:first-child > a > img { width: 100%; height: 100%; object-fit: cover; }
}

/* Badges / pills (rounded-full small chips) */
.rounded-full.text-xs,
.rounded-full.text-sm {
    border: 1px solid var(--accent-soft-2);
}

/* Footer */
.site-footer { background-color: #06090e; border-top: 1px solid var(--border); color: var(--text-muted); }
.site-footer h3 { color: var(--text); }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent); }

/* Tag links / pills inside content */
.tag-link, a.tag {
    display: inline-block; background: var(--surface-2); color: var(--text-muted);
    border: 1px solid var(--border); padding: .2rem .6rem; border-radius: 999px;
    font-size: .8rem; transition: all .2s;
}
.tag-link:hover, a.tag:hover { color: var(--accent); border-color: var(--accent-soft-2); background: var(--accent-soft); }

/* Buttons (accent-filled) */
.btn-accent, .bg-blue-600 a, a.bg-blue-600 {
    color: var(--accent-ink);
}

/* Focus visibility for a11y */
a:focus-visible, button:focus-visible {
    outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px;
}
