@font-face {
  font-family: "Basier Circle";
  src: url("./BasierCircle-Regular.otf") format("opentype");
  font-weight: 300;
}

@font-face {
  font-family: "Basier Circle";
  src: url("./BasierCircle-Medium.otf") format("opentype");
  font-weight: 400;
}

@font-face {
  font-family: "Basier Circle";
  src: url("./BasierCircle-SemiBold.otf") format("opentype");
  font-weight: 500 700;
}

:root {
  --sidebar-width: 374px;
  --bg-dark: #17191e;
  --bg-white: #ffffff;
  --bg-muted: #f4f4f4;
  --text-main: #000000;
  --text-soft: #969696;
  --line: #d8d8d8;
  --blue: #2d64e3;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: "Basier Circle", sans-serif;
  font-weight: 300;
  background: #000;
  color: #fff;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  letter-spacing: 0.048em;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.page-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar-toggle,
.sidebar-backdrop {
  display: none;
}

.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  color: #111;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

.theme-toggle-track {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #d8d8d8;
  transition: background-color 0.2s ease;
}

.theme-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
  transition: transform 0.2s ease;
}

html.theme-dark .theme-toggle {
  background: rgba(17, 17, 17, 0.92);
  color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

html.theme-dark .theme-toggle-track {
  background: var(--blue);
}

html.theme-dark .theme-toggle-thumb {
  transform: translateX(18px);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg-dark);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 20;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 34px 28px 28px;
  overflow-y: auto;
}

.sidebar-credit {
  display: inline-flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 34px;
  padding: 6px 4px 10px;
  border-radius: 16px;
  color: #fff;
  transition: background-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.sidebar-credit:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-1px);
  opacity: 0.96;
}

.sidebar-credit-label {
  color: rgba(255, 255, 255, 0.92);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.15;
}

.sidebar-credit-logo {
  width: 100%;
  max-width: 206px;
  height: auto;
}

.sidebar-source-label {
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  line-height: 1.2;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin-bottom: 28px;
  padding: 4px 0;
  border-radius: 10px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.brand:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.05;
}

.brand-text strong {
  font-size: 19px;
  font-weight: 500;
}

.brand-text span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 26px;
  margin-top: 28px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-group-title {
  margin-bottom: 8px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
}

.nav-link {
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 14px;
  line-height: 1.35;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-link.active {
  background: #fff;
  color: #000;
  font-weight: 500;
}

.sidebar-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: auto;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.sidebar-cta:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.content {
  width: calc(100% - var(--sidebar-width));
  margin-left: var(--sidebar-width);
  background: #fff;
  color: #000;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.content-inner {
  width: 100%;
  max-width: calc(824px + 240px);
  margin: 0 auto;
  padding: 180px 120px 80px;
}

.read-time {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 20px;
  padding: 12px 12px;
  border-radius: 10px;
  background: var(--bg-muted);
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1rem;
}

h1 {
  margin-bottom: 20px;
  font-size: 48px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.024em;
}

.glance-card {
  display: flex;
  margin: 60px 0;
  min-height: 200px;
  overflow: hidden;
  border: 2px solid var(--blue);
  border-left: 0;
  border-radius: 20px;
  background: var(--blue);
}

.glance-label {
  position: relative;
  width: 60px;
  min-width: 60px;
  padding: 52px 10px;
  color: #fff;
}

.glance-label-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  transform: translate(-50%, -50%) rotate(-90deg);
  white-space: nowrap;
  font-size: 18px;
  font-weight: 500;
}

.glance-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
}

.glance-icon svg {
  width: 16px;
  height: 16px;
  stroke: var(--blue);
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.glance-content {
  flex: 1;
  min-height: 200px;
  background: #fff;
}

.glance-list {
  list-style: none;
}

.glance-list > li {
  position: relative;
  padding: 16px 30px 20px;
  font-size: 16px;
  line-height: 1.5;
}

.glance-list > li:first-child {
  border-bottom: 1px solid var(--line);
}

.glance-list > li::before {
  content: "";
  position: absolute;
  top: 36px;
  left: 42px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
}

.glance-list > li:first-child::before {
  content: none;
}

.glance-list ol {
  margin: 16px 0 0 1em;
  padding-top: 10px;
}

.glance-list ol li {
  margin-top: 8px;
}

.article-section {
  margin-bottom: 20px;
}

.article-section h2 {
  margin-bottom: 20px;
  font-size: 34px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.article-section img,
.article-section p {
  margin-bottom: 20px;
}

.article-section p,
.article-list li {
  font-size: 16px;
  line-height: 1.5;
}

.article-list {
  margin: 20px 0 40px 48px;
}

.article-list li + li {
  margin-top: 20px;
}

.article-link {
  color: var(--blue);
  border-bottom: 1px solid var(--blue);
  transition: border-color 0.2s ease;
}

.article-link:hover {
  border-bottom-color: transparent;
}

.formula {
  font-weight: 500;
  white-space: nowrap;
}

.accordion-list {
  margin-bottom: 40px;
}

.accordion-item {
  margin-bottom: 2px;
  border-radius: 15px;
  background: var(--bg-muted);
  overflow: hidden;
}

.accordion-item summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  list-style: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 400;
}

.accordion-item summary::-webkit-details-marker {
  display: none;
}

.accordion-item summary::after {
  content: "+";
  flex: 0 0 auto;
  color: rgba(0, 0, 0, 0.3);
  font-size: 30px;
  line-height: 1;
}

.accordion-item[open] summary::after {
  content: "-";
}

.accordion-panel {
  padding: 0 20px 20px;
}

.accordion-panel img:last-child,
.accordion-panel p:last-child {
  margin-bottom: 0;
}

.pager {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 60px;
}

.pager-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--bg-muted);
  color: var(--text-soft);
  font-size: 16px;
  transition: opacity 0.3s ease;
}

.pager-link:hover {
  opacity: 0.7;
}

.pager-link-primary {
  background: var(--blue);
  color: #fff;
}

html.theme-dark .content {
  background: #0f1012;
  color: #f3f4f6;
}

html.theme-dark .read-time,
html.theme-dark .accordion-item,
html.theme-dark .pager-link {
  background: #181a1f;
  color: #b8bec8;
}

html.theme-dark .pager-link-primary {
  background: var(--blue);
  color: #fff;
}

html.theme-dark .glance-content {
  background: #121419;
}

html.theme-dark .glance-list > li:first-child {
  border-bottom-color: rgba(255, 255, 255, 0.14);
}

html.theme-dark .glance-list > li::before {
  background: rgba(255, 255, 255, 0.18);
}

html.theme-dark .accordion-item summary::after {
  color: rgba(255, 255, 255, 0.35);
}

html.theme-dark .article-link {
  color: #7ea2ff;
  border-bottom-color: #7ea2ff;
}

html.theme-dark .pager-link:hover,
html.theme-dark .sidebar-cta:hover {
  opacity: 0.86;
}

.arrow {
  display: inline-flex;
  width: 24px;
  height: 20px;
}

.arrow svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.arrow.left {
  transform: scaleX(-1);
}

strong {
  font-weight: 500;
}

.read-time,
.nav-group-title,
.nav-link,
.pager-link,
.accordion-item summary,
.theme-toggle,
.sidebar-cta {
  letter-spacing: 0.04em;
}

@media (min-width: 1280px) {
  .pager {
    flex-direction: row;
    justify-content: space-between;
  }
}

@media (max-width: 1024px) {
  .page-shell {
    display: block;
  }

  .sidebar-toggle {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 60;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 0;
    border-radius: 999px;
    background: rgba(17, 17, 17, 0.92);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .sidebar-toggle-lines {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
  }

  .sidebar-toggle-lines span {
    display: block;
    width: 16px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  body.sidebar-open .sidebar-toggle-lines span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  body.sidebar-open .sidebar-toggle-lines span:nth-child(2) {
    opacity: 0;
  }

  body.sidebar-open .sidebar-toggle-lines span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 39;
    display: block;
    background: rgba(0, 0, 0, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    inset: 0 auto 0 0;
    width: min(86vw, 340px);
    min-height: 100vh;
    z-index: 50;
    border-top-right-radius: 18px;
    border-bottom-right-radius: 18px;
    transform: translateX(calc(-100% - 12px));
    transition: transform 0.25s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-inner {
    height: 100%;
    max-height: none;
    padding: 74px 20px 20px;
  }

  .sidebar-cta {
    margin-top: 20px;
  }

  .content {
    width: 100%;
    margin-left: 0;
  }

  .content-inner {
    padding: 88px 32px 80px;
  }
}

@media (max-width: 767px) {
  .theme-toggle {
    gap: 10px;
    padding: 10px 12px;
    font-size: 12px;
  }

  .sidebar-inner {
    padding: 74px 16px 20px;
  }

  .sidebar-credit {
    gap: 10px;
    margin-bottom: 22px;
    padding: 2px 0 6px;
  }

  .sidebar-credit-label {
    font-size: 14px;
  }

  .sidebar-credit-logo {
    max-width: 170px;
  }

  .sidebar-source-label {
    margin-bottom: 6px;
  }

  .content-inner {
    padding: 88px 16px 80px;
  }

  .read-time {
    margin-bottom: 16px;
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 12px;
  }

  h1 {
    margin-bottom: 16px;
    font-size: 32px;
  }

  .glance-card {
    margin: 44px 0;
  }

  .glance-label-inner {
    font-size: 16px;
  }

  .glance-list > li {
    padding: 16px 30px 20px;
    font-size: 14px;
  }

  .glance-list > li::before {
    top: 22px;
    left: 16px;
  }

  .article-section h2 {
    margin-bottom: 16px;
    font-size: 24px;
  }

  .article-section p,
  .article-list li,
  .pager-link {
    font-size: 14px;
  }

  .article-list {
    margin-left: 32px;
  }

  .formula {
    white-space: normal;
  }

  .accordion-list {
    margin-bottom: 32px;
  }

  .accordion-item summary {
    padding: 16px;
    font-size: 14px;
  }

  .accordion-panel {
    padding: 0 16px 16px;
  }
}
