@import "../assets/css/markdownstyle.css";
@import "../assets/css/mystyle.css";
@import "../assets/css/monokai.css";

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --text: #172033;
  --muted: #64748b;
  --body-copy: #334155;
  --body-copy-soft: #475569;
  --border: #dbe3ed;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --accent-soft: #ecfdf5;
  --accent-border: #b7e4dc;
  --code-bg: #111827;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  --header-bg: rgba(255, 255, 255, 0.86);
  --header-border: rgba(219, 227, 237, 0.82);
  --page-glow: rgba(15, 118, 110, 0.08);
}

html[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #111827;
  --surface-soft: #1e293b;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --body-copy: #cbd5e1;
  --body-copy-soft: #b6c2d2;
  --border: #263449;
  --accent: #5eead4;
  --accent-dark: #99f6e4;
  --accent-soft: #123b3a;
  --accent-border: #1f6c66;
  --code-bg: #020617;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
  --header-bg: rgba(15, 23, 42, 0.9);
  --header-border: rgba(38, 52, 73, 0.9);
  --page-glow: rgba(94, 234, 212, 0.1);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, var(--page-glow), transparent 32rem),
    linear-gradient(180deg, #ffffff 0, var(--bg) 18rem);
  font-family: ui-sans-serif, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.62;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at top left, var(--page-glow), transparent 32rem),
    linear-gradient(180deg, #111827 0, var(--bg) 18rem);
}

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

a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

img,
video,
iframe {
  max-width: 100%;
}

img {
  height: auto;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.55rem 0.8rem;
  color: #ffffff;
  background: var(--accent);
  border-radius: 6px;
}

.skip-link:focus {
  top: 1rem;
}

.site-shell {
  width: min(100% - 2rem, 1080px);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  backdrop-filter: blur(16px);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 74px;
}

.site-brand {
  display: grid;
  gap: 0.1rem;
  color: var(--text);
}

.site-brand:hover {
  text-decoration: none;
}

.site-brand__name {
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.2;
}

.site-brand__meta {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.site-menu {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-menu a {
  display: inline-flex;
  align-items: center;
  min-height: 2.4rem;
  padding: 0.35rem 0.75rem;
  color: var(--body-copy);
  border-radius: 6px;
  font-size: 0.92rem;
  font-weight: 650;
}

.site-menu a:hover {
  color: var(--accent-dark);
  background: var(--surface-soft);
  text-decoration: none;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 2.35rem;
  padding: 0.35rem 0.75rem;
  color: var(--body-copy);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
}

.theme-toggle:hover {
  color: var(--accent-dark);
  background: var(--surface-soft);
}

.page-content {
  padding: 3.2rem 0 4rem;
}

.content-shell {
  max-width: 860px;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.6rem 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-inner p {
  max-width: 640px;
  margin: 0;
}

.footer-links {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  font-weight: 650;
}

h1,
h2,
h3,
h4 {
  color: var(--text);
  line-height: 1.2;
  letter-spacing: 0;
}

h1 {
  margin: 0 0 1.2rem;
  font-size: clamp(2rem, 3vw, 2.45rem);
}

h2 {
  margin: 2.6rem 0 0.9rem;
  font-size: 1.45rem;
}

h3 {
  margin: 2rem 0 0.65rem;
  font-size: 1.15rem;
}

p,
ul,
ol,
blockquote,
table,
pre {
  margin-top: 0;
  margin-bottom: 1rem;
}

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

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

hr {
  height: 1px;
  margin: 2.5rem 0;
  background: var(--border);
  border: 0;
}

blockquote {
  padding: 0.75rem 0.95rem;
  color: var(--body-copy-soft);
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: 0 6px 6px 0;
}

code {
  padding: 0.15rem 0.35rem;
  color: var(--text);
  background: var(--surface-soft);
  border-radius: 4px;
  font-family: "SFMono-Regular", "Cascadia Code", Consolas, monospace;
  font-size: 0.88em;
}

pre {
  overflow-x: auto;
  padding: 1rem;
  color: #e5e7eb;
  background: var(--code-bg);
  border-radius: 8px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

th,
td {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  vertical-align: top;
}

th {
  background: var(--surface-soft);
  text-align: left;
}

.home-hero {
  padding: 0.5rem 0 1.4rem;
}

.home-hero h1 {
  font-size: clamp(2.25rem, 4vw, 3rem);
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lead {
  margin-bottom: 1.1rem;
  color: var(--body-copy);
  font-size: 1.08rem;
  line-height: 1.65;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1.1rem 0 0;
}

.pill-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.3rem;
  padding: 0.3rem 0.75rem;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 700;
}

.pill-link:hover {
  background: var(--surface-soft);
  text-decoration: none;
}

.section-panel {
  margin: 1.5rem 0;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: none;
}

.section-panel h2,
.section-panel h3 {
  margin-top: 0;
}

.post-list {
  display: grid;
  gap: 0.8rem;
  padding: 0;
  margin: 1.6rem 0 0;
  list-style: none;
}

.post-card {
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.post-card h2 {
  margin: 0.2rem 0 0.4rem;
  font-size: 1.16rem;
}

.post-card h2 a {
  color: var(--text);
}

.post-card h2 a:hover {
  color: var(--accent-dark);
}

.post-meta,
.date {
  color: var(--muted);
  font-size: 0.9rem;
}

.post-excerpt {
  margin: 0;
  color: var(--body-copy-soft);
  font-size: 0.96rem;
  line-height: 1.6;
}

.publication-section {
  margin-top: 2rem;
}

.publication-section h2 {
  margin-bottom: 1rem;
}

.publication-list {
  display: grid;
  gap: 0.8rem;
}

.publication-card {
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.publication-card h3 {
  margin: 0.25rem 0 0.55rem;
  font-size: 1.16rem;
}

.publication-card p {
  margin-bottom: 0.75rem;
  color: var(--body-copy-soft);
  font-size: 0.98rem;
  line-height: 1.58;
}

.publication-meta {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.publication-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.publication-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.25rem 0.65rem;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.publication-actions a:hover {
  background: var(--surface-soft);
  text-decoration: none;
}

.post h1 {
  margin-bottom: 0.8rem;
}

.post .entry {
  margin-top: 1.5rem;
}

.video_container iframe {
  border-radius: 8px;
}

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  .site-nav,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    padding: 0.9rem 0;
  }

  .site-menu {
    justify-content: flex-start;
  }

  .site-menu a {
    padding-left: 0;
  }

  .page-content {
    padding-top: 2.2rem;
  }

  .section-panel,
  .post-card,
  .publication-card {
    padding: 1rem;
  }
}
