/*
 * modern.css
 * Loop 1 foundation: modern minimalist baseline for jverbus.github.io
 */

:root {
  color-scheme: light dark;

  --bg: #fbfcfe;
  --surface: #ffffff;
  --surface-muted: #f5f7fb;
  --text: #111827;
  --text-muted: #4b5563;
  --heading: #0f172a;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --accent: #1f6feb;
  --accent-hover: #1558b9;
  --selection-bg: #dbeafe;

  --font-sans: Inter, "Avenir Next", Avenir, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  --shadow-soft: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.10);
  --radius: 12px;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  --max-content: 720px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: clamp(16px, 1.1vw, 18px);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-sans);
  line-height: 1.75;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--selection-bg);
  color: var(--text);
}

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

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

a:focus-visible,
button:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 2px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: var(--space-4);
  top: var(--space-4);
  z-index: 1000;
  background: #111827;
  color: #fff;
  padding: var(--space-2) var(--space-3);
  border-radius: 8px;
}

#page {
  min-height: 100vh;
}

.the-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(12px);
  background: rgba(251, 252, 254, 0.88);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(17, 24, 39, 0.04);
}

.unit-head-inner,
.unit-body-inner {
  width: 100%;
  max-width: calc(var(--max-content) + 2 * var(--space-4));
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.nav-global ul {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  list-style: none;
  margin: 0;
  padding: var(--space-3) 0;
}

.nav-global .logo {
  margin-right: auto;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.nav-global .logo a {
  color: var(--text);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 730;
  letter-spacing: 0.006em;
}

.nav-global li:not(.logo) a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  font-weight: 550;
  color: var(--text-muted);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.34rem 0.72rem;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease, transform 120ms ease;
  text-decoration: none;
}

.nav-global li:not(.logo) a:hover {
  color: var(--text);
  border-color: var(--border);
  background: rgba(17, 24, 39, 0.04);
  text-decoration: none;
  transform: translateY(-0.5px);
}

.nav-global li.active a {
  color: var(--text);
  border-color: #b8cae9;
  background: #f7fbff;
}

.nav-global li.active a::before {
  content: "";
  width: 0.34rem;
  height: 0.34rem;
  border-radius: 999px;
  background: var(--accent);
  margin-right: 0.42rem;
  opacity: 0.9;
}

.body {
  min-height: calc(100vh - 8rem);
  padding: var(--space-8) 0 var(--space-10);
}

.entry-content {
  width: 100%;
  max-width: var(--max-content);
  margin: 0 auto;
}

.the-footer {
  border-top: 1px solid var(--border);
  margin-top: var(--space-4);
}

.unit-foot-inner {
  width: 100%;
  max-width: calc(var(--max-content) + 2 * var(--space-4));
  margin: 0 auto;
  padding: var(--space-6) var(--space-4) var(--space-8);
}

.footer-meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer-meta a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.footer-meta a:hover {
  color: var(--text);
  text-decoration: none;
  border-bottom-color: var(--border-strong);
}

h1,
h2,
h3,
h4 {
  margin: var(--space-10) 0 var(--space-3);
  line-height: 1.22;
  color: var(--heading);
  letter-spacing: -0.012em;
  font-weight: 670;
}

h1,
.h1 {
  font-size: clamp(1.9rem, 3.1vw, 2.55rem);
}

h2,
.h2 {
  font-size: clamp(1.55rem, 2.35vw, 2.05rem);
}

.entry-content > h2 {
  border-top: 1px solid var(--border);
  padding-top: var(--space-8);
}

h3,
.h3 {
  font-size: clamp(1.18rem, 1.8vw, 1.36rem);
}

h4,
.h4 {
  font-size: 1.02rem;
}

p,
ul,
ol,
blockquote,
pre,
table {
  margin: 0 0 var(--space-6);
}

.entry-content > p,
.entry-content > ul,
.entry-content > ol,
.entry-content > blockquote,
.entry-content > pre,
.entry-content > table {
  max-width: 68ch;
}

ul,
ol {
  padding-left: 1.3rem;
}

li + li {
  margin-top: 0.25rem;
}

strong {
  font-weight: 650;
}

blockquote {
  border-left: 3px solid #cbd5e1;
  padding: 0.1rem 0 0.1rem 1rem;
  color: var(--text-muted);
}

code,
kbd,
samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

p code,
li code {
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #e0e7ff;
  border-radius: 6px;
  padding: 0.08rem 0.34rem;
}

pre {
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: var(--space-4);
  overflow: auto;
  box-shadow: var(--shadow-soft);
}

pre code {
  color: inherit;
  background: transparent;
  border: 0;
  padding: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 0.75rem;
  text-align: left;
}

th {
  background: var(--surface-muted);
  font-weight: 600;
}

img,
video {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

.unit-article header {
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
}

.unit-article .entry-title {
  margin: 0;
}

.meta {
  margin-top: var(--space-8);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.list-linear {
  list-style: none;
  margin: 0 0 var(--space-2);
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.list-linear .list-head {
  font-weight: 600;
  color: #374151;
  margin-right: 0.35rem;
}

.list-linear a span {
  display: inline-block;
  font-size: 0.78rem;
  line-height: 1;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #1f2937;
  background: #f3f4f6;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.34rem 0.5rem;
}

.pagination ul {
  list-style: none;
  margin: var(--space-8) 0 var(--space-4);
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.gotop {
  margin: var(--space-6) 0 0;
  font-size: 0.92rem;
}

.home-intro {
  margin-bottom: var(--space-8);
  color: var(--text-muted);
  font-size: 1.02rem;
}

.post-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.home-archive-link {
  margin: var(--space-6) 0 var(--space-2);
}

.home-archive-link a {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  color: var(--text-muted);
  border-bottom: 1px solid transparent;
  text-decoration: none;
}

.home-archive-link a::after {
  content: "→";
  font-size: 0.95em;
}

.home-archive-link a:hover {
  color: var(--text);
  border-bottom-color: var(--border-strong);
  text-decoration: none;
}

.post-list-item {
  border: 1px solid #e8edf4;
  border-radius: 12px;
  background: var(--surface);
  padding: var(--space-4) var(--space-5, 1.25rem);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  transition: transform 160ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.post-list-item:hover {
  transform: translateY(-1.5px);
  border-color: #dce5f0;
  box-shadow: 0 9px 20px rgba(15, 23, 42, 0.08);
}

.post-list-date {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.post-list-title {
  margin: 0 0 0.4rem;
  font-size: 1.14rem;
  line-height: 1.35;
}

.post-list-title a {
  color: var(--text);
  text-decoration: none;
}

.post-list-title a:hover {
  color: var(--accent-hover);
}

.post-list-description {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.post-header {
  margin-bottom: var(--space-3);
}

.post-date {
  margin: var(--space-2) 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.post-summary {
  margin: var(--space-3) 0 0;
  color: var(--text-muted);
  font-size: 1.03rem;
  line-height: 1.65;
  max-width: 64ch;
}

.layout-post .entry-content p,
.layout-post .entry-content ul,
.layout-post .entry-content ol,
.layout-post .entry-content blockquote,
.layout-post .entry-content pre,
.layout-post .entry-content table {
  max-width: 68ch;
}

.layout-post .entry-content > h2,
.layout-post .entry-content > h3,
.layout-post .entry-content > h4 {
  margin-top: var(--space-10);
}

.layout-post .entry-content hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--space-10) 0;
}

.layout-post .entry-content blockquote {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-left: 3px solid #8aa4cf;
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
}

.layout-post .entry-content blockquote p:last-child {
  margin-bottom: 0;
}

.layout-post .entry-content ul,
.layout-post .entry-content ol {
  padding-left: 1.25rem;
}

.layout-post .entry-content li::marker {
  color: #94a3b8;
}

.layout-post .pagination ul {
  margin-top: var(--space-10);
  border-top: 1px solid var(--border);
  padding-top: var(--space-4);
}

.layout-post .pagination a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.34rem 0.62rem;
  text-decoration: none;
  color: var(--text-muted);
}

.layout-post .pagination a:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-muted);
}

.layout-page .unit-article header {
  margin-bottom: var(--space-8);
}

.layout-page .entry-content > h2 {
  margin-top: var(--space-10);
}

.layout-page .entry-content > h3 {
  margin-top: var(--space-8);
  color: var(--heading);
}

.layout-page .entry-content > p:first-of-type {
  font-size: 1.05rem;
  color: #374151;
}

.layout-page .entry-content ul {
  margin-bottom: var(--space-8);
}

.layout-page .entry-content li {
  margin-bottom: 0.55rem;
}

.page-publications .entry-content > ul {
  list-style: none;
  padding: 0;
  margin-bottom: var(--space-8);
  display: grid;
  gap: var(--space-3);
}

.page-publications .entry-content > ul > li {
  border: 1px solid #e8edf4;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  padding: 0.95rem 1rem;
  margin-bottom: 0;
  transition: transform 160ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.page-publications .entry-content > ul > li:hover {
  transform: translateY(-1px);
  border-color: #dce5f0;
  box-shadow: 0 9px 20px rgba(15, 23, 42, 0.08);
}

.page-publications .entry-content > ul > li strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--heading);
  line-height: 1.45;
}

.page-publications .entry-content > ul > li p {
  margin-bottom: 0.42rem;
  line-height: 1.58;
}

.page-publications .entry-content > ul > li p:last-child {
  margin-bottom: 0;
}

.page-publications .entry-content > ul > li em {
  color: var(--text-muted);
}

.page-publications .entry-content > h2 {
  margin-top: var(--space-12);
}

.page-publications .entry-content > h3 {
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}

@media (max-width: 760px) {
  html {
    font-size: 15.8px;
  }

  .body {
    padding-top: var(--space-6);
  }

  .nav-global ul {
    gap: var(--space-2);
    flex-wrap: wrap;
  }

  .nav-global .logo {
    width: 100%;
    margin-right: 0;
    margin-bottom: 0.15rem;
  }

  .post-list-item {
    padding: var(--space-4);
  }

  .post-list-title {
    font-size: 1.05rem;
  }

  .unit-foot-inner {
    padding: var(--space-4) var(--space-4) var(--space-5);
  }

  .footer-meta {
    font-size: 0.84rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media print {
  :root {
    --bg: #fff;
    --text: #000;
    --text-muted: #111;
    --border: #ddd;
  }

  .the-header,
  .the-footer,
  .gotop,
  .skip-link {
    display: none !important;
  }

  .body {
    padding: 0;
    min-height: auto;
  }

  .entry-content {
    max-width: 100%;
  }

  a {
    color: #000;
    text-decoration: underline;
  }
}

@media (prefers-contrast: more) {
  :root {
    --text: #0b1020;
    --text-muted: #334155;
    --heading: #05070d;
    --border: #c5cedc;
    --border-strong: #9aa8bd;
    --accent: #0b5ad5;
    --accent-hover: #0849ad;
  }

  .nav-global li:not(.logo) a,
  .footer-meta,
  .post-list-date {
    color: var(--text);
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f19;
    --surface: #0f172a;
    --surface-muted: #111c32;
    --text: #b8c5d9;
    --text-muted: #8ea0bb;
    --heading: #e8f0ff;
    --border: #233046;
    --border-strong: #31415f;
    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    --selection-bg: #1e3a8a;
    --shadow-soft: none;
  }

  .the-header {
    background: rgba(11, 15, 25, 0.9);
    box-shadow: 0 1px 0 rgba(148, 163, 184, 0.08);
  }

  .nav-global li:not(.logo) a:hover {
    background: rgba(148, 163, 184, 0.08);
  }

  .nav-global li.active a {
    background: rgba(96, 165, 250, 0.12);
    border-color: #3b82f6;
  }

  .nav-global li.active a::before {
    background: #93c5fd;
  }

  p code,
  li code {
    background: #1e293b;
    color: #bfdbfe;
    border-color: #334155;
  }

  pre {
    background: #020617;
    border-color: #1e293b;
  }

  .layout-page .entry-content > p:first-of-type,
  .home-intro,
  .post-date,
  .post-summary,
  .post-list-date,
  .post-list-description,
  .footer-meta,
  .meta {
    color: #9fb2cc;
  }

  .list-linear .list-head {
    color: #c2d1e6;
  }

  .post-list-item {
    border-color: #2a3953;
    box-shadow: none;
  }

  .post-list-item:hover {
    border-color: #3a4f71;
    box-shadow: 0 8px 18px rgba(2, 6, 23, 0.45);
  }

  .page-publications .entry-content > ul > li {
    background: #101a2f;
    border-color: #2a3953;
    box-shadow: none;
  }

  .page-publications .entry-content > ul > li:hover {
    border-color: #3a4f71;
    box-shadow: 0 8px 18px rgba(2, 6, 23, 0.45);
  }

  .page-publications .entry-content > ul > li p,
  .page-publications .entry-content > ul > li em {
    color: #a7bad3;
  }
}
