:root {
  --bg: #07111f;
  --bg-soft: #0d1a2b;
  --card: rgba(16, 31, 49, 0.88);
  --text: #eef6ff;
  --muted: #a6b8cc;
  --line: rgba(166, 184, 204, 0.2);
  --accent: #65d6c6;
  --accent-2: #8bb8ff;
  --code: #081321;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(101, 214, 198, 0.12), transparent 34rem),
    radial-gradient(circle at 88% 18%, rgba(139, 184, 255, 0.13), transparent 30rem),
    var(--bg);
  color: var(--text);
  line-height: 1.7;
}

a { color: var(--accent-2); text-underline-offset: 0.2em; }
a:hover { color: var(--accent); }

.skip-link {
  position: fixed;
  z-index: 10;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus { transform: translateY(0); }

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

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 850;
  letter-spacing: 0.045em;
  text-decoration: none;
}

.site-nav,
.article-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}

.site-nav { justify-content: flex-end; font-size: 0.9rem; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: var(--text); }

.language-link {
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

main { padding: 46px 0 68px; }

.journal-hero {
  padding: 28px 0 38px;
  border-bottom: 1px solid var(--line);
}

.eyebrow,
.article-meta {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.journal-hero h1,
.journal-article h1 {
  margin: 10px 0 18px;
  font-size: clamp(2.25rem, 7vw, 4.7rem);
  line-height: 1.03;
  letter-spacing: -0.045em;
}

.journal-hero p {
  max-width: 760px;
  color: #cbd9e7;
  font-size: 1.08rem;
}

.article-list {
  display: grid;
  gap: 16px;
  margin: 34px 0 0;
}

.article-card {
  display: block;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.12);
}

.article-card:hover {
  border-color: rgba(101, 214, 198, 0.55);
  transform: translateY(-1px);
}

.article-card time { color: var(--accent); font-size: 0.84rem; font-weight: 800; }
.article-card h2 { margin: 6px 0; font-size: 1.35rem; letter-spacing: -0.02em; }
.article-card p { margin: 0; color: var(--muted); }

.article-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  column-gap: 18px;
  margin: 0 0 30px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.9rem;
}

.article-nav > span { min-width: 0; }
.article-nav__newer { grid-column: 1; text-align: left; }
.article-nav__home { grid-column: 2; text-align: center; white-space: nowrap; }
.article-nav__older { grid-column: 3; text-align: right; }
.article-nav__newer a,
.article-nav__older a {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-nav.bottom { margin: 36px 0 0; }
.article-nav a { color: var(--muted); text-decoration: none; }
.article-nav a:hover { color: var(--text); }

.journal-article {
  padding: 34px clamp(20px, 5vw, 52px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
  overflow-wrap: anywhere;
}

.journal-article h2,
.journal-article h3 {
  margin-top: 2em;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.journal-article p,
.journal-article li { color: #d7e2ed; }
.journal-article strong { color: var(--text); }

.journal-article blockquote {
  margin: 1.6em 0;
  padding: 0.3em 0 0.3em 1.2em;
  border-left: 3px solid var(--accent);
  color: #dbe7f3;
}

.journal-article blockquote p { margin: 0.45em 0; }

.journal-article pre {
  overflow-x: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--code);
  line-height: 1.55;
}

.journal-article code {
  padding: 0.12em 0.35em;
  border-radius: 5px;
  background: var(--code);
  color: #dffbf7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.journal-article pre code { padding: 0; background: transparent; }

.journal-article img {
  display: block;
  width: 100%;
  height: auto;
  margin: 28px auto 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.journal-article img + em,
.journal-article p:has(> img) + p > em {
  color: var(--muted);
  font-size: 0.9rem;
}

.journal-article hr { margin: 2.5em 0; border: 0; border-top: 1px solid var(--line); }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 0 46px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}

html[lang="ko"] .journal-hero p,
html[lang="ko"] .journal-article,
html[lang="ko"] .article-card p { word-break: keep-all; }

@media (max-width: 680px) {
  .journal-shell { width: min(100% - 24px, 920px); }
  .site-header { align-items: flex-start; flex-direction: column; }
  .site-nav { justify-content: flex-start; }
  main { padding-top: 28px; }
  .journal-article { padding: 26px 18px; border-radius: 18px; }
  .article-nav {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }
  .article-nav__newer,
  .article-nav__home,
  .article-nav__older { text-align: left; }
  .article-nav__newer a,
  .article-nav__older a {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }
  .site-footer { flex-direction: column; }
}

@media print {
  body { background: #fff; color: #111; }
  .site-header, .article-nav, .site-footer, .skip-link { display: none; }
  .journal-article { border: 0; box-shadow: none; background: #fff; }
  .journal-article p, .journal-article li { color: #222; }
}
