:root {
  --bg: #f7f3ee;
  --surface: #fbf8f3;
  --text: #171512;
  --muted: #665d50;
  --accent: #b96249;
  --accent-soft: #f0ddd2;
  --border: #ded5c6;
  --shadow: rgba(94, 60, 40, 0.14);
  --header-bg: rgba(247, 243, 238, 0.84);
  --max-width: 1080px;
  --nav-width: 1180px;
  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  --bg: #1a1814;
  --surface: #221f1a;
  --text: #f0e8d8;
  --muted: #a39580;
  --accent: #e89072;
  --accent-soft: #3a2a22;
  --border: #3a342c;
  --shadow: rgba(0, 0, 0, 0.3);
  --header-bg: rgba(26, 24, 20, 0.84);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(185, 98, 73, 0.08), transparent 38%),
    var(--bg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

a:hover {
  text-decoration-thickness: 2px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
}

.site-header-inner {
  width: min(calc(100% - 40px), var(--nav-width));
  min-height: 70px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.back-link {
  position: absolute;
  top: 50%;
  left: 24px;
  width: 40px;
  height: 40px;
  transform: translateY(-50%);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 25px;
  line-height: 1;
  text-decoration: none;
}

.back-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}

.brand {
  color: var(--text);
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  text-decoration: none;
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s, transform 0.4s, border-color 0.2s;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  transform: rotate(15deg);
}

.theme-toggle .icon-sun {
  display: block;
}

.theme-toggle .icon-moon {
  display: none;
}

html[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

.paper {
  width: min(calc(100% - 40px), var(--max-width));
  margin: 0 auto;
  padding: 64px 0 72px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  font-family: var(--serif);
  color: var(--text);
}

h1 {
  max-width: 850px;
  margin: 0;
  font-size: clamp(36px, 6vw, 58px);
  font-weight: 620;
  letter-spacing: -0.035em;
  line-height: 1.07;
}

h2 {
  margin: 0 0 16px;
  font-size: 27px;
  font-weight: 620;
  letter-spacing: -0.015em;
}

.authors {
  margin: 22px 0 4px;
  color: var(--text);
  font-size: 17px;
}

.author-me {
  color: var(--text);
  font-weight: 700;
  border-bottom: 2px solid var(--accent);
}

.venue {
  margin: 0;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 36px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  color: var(--accent);
  background: transparent;
  font: 650 15px/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  color: #fff;
  background: var(--accent);
}

.button.primary {
  color: #fff;
  background: var(--accent);
}

.hero-image {
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  object-fit: contain;
  display: block;
}

.content-grid {
  display: block;
  margin-top: 50px;
}

.abstract {
  width: 100%;
  max-width: none;
}

.abstract p {
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.8;
}

.site-footer {
  width: min(calc(100% - 40px), var(--max-width));
  margin: 0 auto;
  padding: 24px 0 40px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 720px) {
  .site-header-inner {
    width: 100%;
    min-height: 64px;
    padding: 0 14px 0 62px;
  }

  .back-link {
    left: 12px;
    width: 38px;
    height: 38px;
    font-size: 24px;
  }

  .brand {
    font-size: 15px;
  }

  .theme-toggle {
    width: 34px;
    height: 34px;
    font-size: 15px;
  }

  .paper {
    padding-top: 44px;
  }

  .content-grid {
    margin-top: 36px;
  }

  .abstract p {
    font-size: 18px;
  }
}
