/* Skynes Ghost theme — visual language from skynes.net */

:root {
  --bg: #0b0d12;
  --bg-elevated: #12151c;
  --bg-soft: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #e8eaef;
  --text-muted: #9aa3b5;
  --text-dim: #6b7385;
  --accent: #8b5cf6;
  --accent-2: #ec4899;
  --accent-3: #3b82f6;
  --link: #a78bfa;
  --radius: 14px;
  --radius-sm: 10px;
  --max: 1120px;
  --font: "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --logo-fill: #e8eaef;
  --header-h: 72px;
}

/* Blog stays dark like skynes.net; light only if explicitly requested */
[data-theme="light"] {
  --bg: #f6f7fb;
  --bg-elevated: #ffffff;
  --bg-soft: rgba(15, 23, 42, 0.04);
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --link: #7c3aed;
  --logo-fill: #0f172a;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

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

/* Atmosphere — grid + blobs like skynes.net */
.sk-atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.sk-atmosphere__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(139, 92, 246, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
}

.sk-atmosphere__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
}

.sk-atmosphere__blob--1 {
  width: 420px;
  height: 420px;
  top: -120px;
  left: -80px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
}

.sk-atmosphere__blob--2 {
  width: 380px;
  height: 380px;
  top: 10%;
  right: -100px;
  background: radial-gradient(circle, var(--accent-2) 0%, transparent 70%);
  opacity: 0.3;
}

.sk-atmosphere__blob--3 {
  width: 320px;
  height: 320px;
  bottom: 10%;
  left: 30%;
  background: radial-gradient(circle, var(--accent-3) 0%, transparent 70%);
  opacity: 0.25;
}

.sk-wrap {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
}

/* Header — transparent, not sticky */
.sk-header {
  position: relative;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: transparent;
  border-bottom: none;
}

.sk-header__inner {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.sk-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.sk-brand:hover {
  text-decoration: none;
  opacity: 0.92;
}

.sk-logo-svg {
  width: 34px;
  height: 38px;
  flex-shrink: 0;
}

.sk-logo-svg path {
  fill: var(--logo-fill);
}

.sk-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.sk-nav > a {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

.sk-nav > a:hover {
  color: var(--text);
  background: var(--bg-soft);
  text-decoration: none;
}

/* Language dropdown */
.sk-lang {
  position: relative;
  margin-left: 0.25rem;
}

.sk-lang__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.sk-lang__btn:hover,
.sk-lang.is-open .sk-lang__btn {
  border-color: var(--border-strong);
  background: var(--bg-soft);
}

.sk-lang__flag {
  font-size: 1rem;
  line-height: 1;
}

.sk-lang__chevron {
  color: var(--text-dim);
  font-size: 0.7rem;
  margin-left: 0.1rem;
}

.sk-lang__menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  min-width: 11.5rem;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg-elevated);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  z-index: 60;
}

.sk-lang__menu[hidden] {
  display: none;
}

.sk-lang__menu a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}

.sk-lang__menu a:hover,
.sk-lang__menu a.is-active {
  color: var(--text);
  background: var(--bg-soft);
  text-decoration: none;
}

/* Hero */
.sk-hero {
  padding: 3.5rem 0 2.25rem;
}

.sk-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 1rem;
  /* Hidden for now — keep layout spacing */
  visibility: hidden;
  pointer-events: none;
  user-select: none;
}

.sk-hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.sk-hero p {
  margin: 0;
  max-width: 36rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* Post grid */
.sk-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  padding-bottom: 3.5rem;
}

@media (max-width: 900px) {
  .sk-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.sk-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.sk-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  text-decoration: none;
}

.sk-card__media {
  aspect-ratio: 16 / 10;
  background: var(--bg-soft);
  overflow: hidden;
}

.sk-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sk-card__body {
  padding: 1.1rem 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.sk-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.sk-pill {
  display: inline-flex;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sk-card h2 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.35;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.sk-card__excerpt {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sk-card__footer {
  margin-top: auto;
  padding-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Pagination */
.sk-pagination {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  padding: 0 0 4rem;
}

.sk-pagination a {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}

.sk-pagination a:hover {
  border-color: var(--accent);
  text-decoration: none;
}

/* Post page */
.sk-post {
  padding: 2.5rem clamp(1.5rem, 6vw, 3.5rem) 4rem;
}

.sk-post__header,
.sk-content,
.sk-post__feature {
  width: 100%;
  max-width: 720px;
  margin-inline: auto;
  box-sizing: border-box;
}

.sk-post__header {
  margin-bottom: 2rem;
}

.sk-post__header h1 {
  margin: 0.5rem 0 0.75rem;
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.sk-post__meta {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.sk-post__feature {
  max-width: 920px;
  margin-bottom: 2.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.sk-post__feature img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
}

.sk-content {
  color: var(--text);
  font-size: 1.05rem;
}

.sk-content > *:first-child {
  margin-top: 0;
}

.sk-content h2,
.sk-content h3,
.sk-content h4 {
  letter-spacing: -0.02em;
  margin-top: 2em;
  margin-bottom: 0.6em;
  line-height: 1.25;
}

.sk-content p,
.sk-content ul,
.sk-content ol {
  margin: 0 0 1.15em;
  color: var(--text-muted);
}

.sk-content strong {
  color: var(--text);
}

.sk-content a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sk-content blockquote {
  margin: 1.5em 0;
  padding: 0.75rem 0 0.75rem 1.1rem;
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
}

.sk-content pre,
.sk-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.sk-content code {
  font-size: 0.9em;
  padding: 0.15em 0.4em;
  border-radius: 6px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}

.sk-content pre {
  padding: 1rem 1.1rem;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.sk-content pre code {
  padding: 0;
  border: 0;
  background: none;
}

.sk-content figure {
  margin: 1.75em 0;
}

.sk-content figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  text-align: center;
}

.sk-content hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.5em 0;
}

.sk-content .kg-card {
  margin: 1.75em 0;
}

.sk-content .kg-image-card img,
.sk-content .kg-gallery-image img {
  border-radius: var(--radius-sm);
}

/* Required by Ghost gscan — wide / full-bleed cards */
.kg-width-wide {
  position: relative;
  width: min(100vw - 2.5rem, 920px);
  max-width: none;
  margin-left: calc(50% - min(50vw - 1.25rem, 460px));
}

.kg-width-wide img {
  width: 100%;
  max-width: none;
  height: auto;
}

.kg-width-full {
  position: relative;
  width: 100vw;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

.kg-width-full img {
  width: 100%;
  max-width: 100vw;
  height: auto;
}

/* Footer */
.sk-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0 2.5rem;
  margin-top: auto;
}

.sk-footer__inner {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text-dim);
  font-size: 0.88rem;
}

.sk-footer a {
  color: var(--text-muted);
}

.sk-footer a:hover {
  color: var(--text);
}

.sk-site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.sk-main {
  flex: 1;
}

/* Hide floating i18n switcher — language is in the header */
.i18n-switcher,
#i18n-switcher-style,
.skynes-lang-switch {
  display: none !important;
}
