:root {
  color-scheme: dark;
  --bg: #101110;
  --bg-elevated: #171816;
  --surface: #1d1e1b;
  --surface-strong: #242520;
  --line: rgba(255, 255, 255, 0.13);
  --line-strong: rgba(255, 255, 255, 0.24);
  --text: #f5f2ea;
  --muted: rgba(245, 242, 234, 0.68);
  --subtle: rgba(245, 242, 234, 0.5);
  --accent: #d94159;
  --accent-strong: #ff6175;
  --warm: #e8b35f;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: clamp(24px, 4vw, 44px) clamp(18px, 5vw, 44px) 0;
  background:
    linear-gradient(180deg, rgba(232, 179, 95, 0.035), rgba(217, 65, 89, 0.025) 34%, transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: rgba(255, 97, 117, 0.35);
}

button,
input,
textarea,
select {
  font: inherit;
}

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

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 4px;
}

#content {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
}

.single-container,
.home-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar {
  display: none;
}

.sidebar-intro {
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.site-mark {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
}

.site-name {
  color: var(--text);
  font-family: var(--mono);
  font-size: 19px;
  letter-spacing: 0;
}

.site-role,
.sidebar-intro p {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
}

.sidebar-intro p {
  margin: 14px 0 0;
}

.main-content,
#page-content {
  min-width: 0;
}

#page-content {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.main-content-article {
  order: 1;
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.images {
  order: 2;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.images figure {
  width: 100%;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(29, 30, 27, 0.76);
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  transition:
    border-color 0.25s ease,
    transform 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease;
}

.images img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #0b0c0b;
}

.images img.no-border {
  border: 0;
  background: transparent;
}

.images figcaption {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-family: var(--mono);
}

.images figcaption p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.images figcaption p:first-child {
  color: var(--text);
}

.summary {
  margin: 0;
  color: rgba(245, 242, 234, 0.84);
  font-size: 17px;
  line-height: 1.68;
  letter-spacing: 0;
}

.summary strong {
  color: var(--text);
  font-weight: 700;
}

.main-content-article .summary:first-child {
  color: var(--text);
  font-size: 18px;
}

.divider {
  width: 100%;
  height: 1px;
  background-color: var(--line);
}

nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

nav a {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 0 10px 14px;
  border-left: 1px solid var(--line);
  color: var(--subtle);
  text-decoration: none;
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

nav a:hover,
nav a.active {
  border-color: var(--accent);
  color: var(--text);
}

nav a:hover {
  transform: translateX(3px);
}

nav p {
  margin: 0;
  color: currentColor;
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: 0;
}

nav a.active p:first-child {
  color: var(--text);
}

.sidebar-subtitle {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  font-style: normal;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.sidebar-role {
  color: rgba(245, 242, 234, 0.78);
}

.sidebar-meta {
  color: var(--subtle);
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
}

.button-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: fit-content;
  max-width: 100%;
  padding: 11px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
  text-align: center;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.button-link i,
.caption-link i,
.footer-link i {
  flex: 0 0 auto;
  font-size: 0.95em;
}

.button-link:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.34);
  background: var(--surface-strong);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.24);
}

.button-link:active {
  transform: translateY(0);
}

.button-link-primary {
  border-color: rgba(255, 97, 117, 0.48);
  background: linear-gradient(135deg, rgba(217, 65, 89, 0.95), rgba(179, 43, 66, 0.96));
  color: #fff;
}

.button-link-primary:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
}

.caption-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  margin-top: 4px;
  color: var(--warm);
  font-size: 13px;
  line-height: 1.35;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color 0.2s ease, transform 0.2s ease;
}

.caption-link:hover {
  color: var(--text);
  transform: translateY(-1px);
}

.load-error {
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(255, 97, 117, 0.45);
  border-radius: 0;
  color: #ff9ca9;
  background: rgba(217, 65, 89, 0.08);
}

.embed-video-container {
  padding: 12px;
  background: var(--surface);
}

.embed-video-container .tiktok-embed {
  margin: 0;
}

.embed-video-container .tiktok-embed,
.embed-video-container .tiktok-embed iframe {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  background-color: var(--bg) !important;
}

.embed-video-container .tiktok-embed section {
  display: grid;
  min-height: 420px;
  padding: 24px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #0b0c0b;
  text-align: center;
}

.embed-video-container .tiktok-embed section a {
  color: var(--warm);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.45;
  text-decoration: none;
}

.embed-video-container .tiktok-embed section a:hover {
  color: var(--text);
}

.mobile-brand {
  position: fixed;
  top: 14px;
  left: 16px;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  gap: 1px;
  color: var(--text);
  font-family: var(--mono);
  text-decoration: none;
}

.mobile-brand span {
  font-size: 15px;
  line-height: 1.2;
}

.mobile-brand small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.hamburger {
  position: fixed;
  top: 18px;
  right: 16px;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 34px;
  height: 34px;
  padding: 9px 7px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(23, 24, 22, 0.84);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
  cursor: pointer;
  backdrop-filter: blur(14px);
}

.hamburger-line {
  width: 100%;
  height: 2px;
  border-radius: 0;
  background-color: var(--text);
  transform-origin: center;
  transition:
    transform 0.24s ease,
    opacity 0.2s ease,
    background-color 0.2s ease;
}

.hamburger:hover .hamburger-line {
  background-color: var(--accent-strong);
}

.hamburger.active .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: block;
  overflow-y: auto;
  background: rgba(16, 17, 16, 0.96);
  backdrop-filter: blur(16px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px);
  transition:
    opacity 0.25s ease,
    transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0.28s;
}

.mobile-nav-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition:
    opacity 0.25s ease,
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0s;
}

.mobile-nav-content {
  width: min(100%, 440px);
  min-height: 100%;
  margin: 0 auto;
  padding: 88px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.24s ease,
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.mobile-nav-overlay.active .mobile-nav-content {
  opacity: 1;
  transform: translateY(0);
}

.mobile-nav-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
}

.mobile-nav-heading span {
  font-size: 22px;
  line-height: 1.2;
}

.mobile-nav-heading small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.mobile-nav-content nav {
  gap: 10px;
}

.mobile-nav-content nav a {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.025);
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.24s ease,
    transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.2s ease,
    background 0.2s ease;
}

.mobile-nav-content nav a:hover,
.mobile-nav-content nav a.active {
  transform: translateY(0);
  border-color: rgba(255, 97, 117, 0.58);
  background: rgba(217, 65, 89, 0.12);
}

.mobile-nav-content nav a p {
  font-size: 16px;
}

.mobile-nav-overlay.active .mobile-nav-content nav a {
  opacity: 1;
  transform: translateY(0);
}

.mobile-nav-overlay.active .mobile-nav-content nav a:nth-child(1) { transition-delay: 0.05s; }
.mobile-nav-overlay.active .mobile-nav-content nav a:nth-child(2) { transition-delay: 0.08s; }
.mobile-nav-overlay.active .mobile-nav-content nav a:nth-child(3) { transition-delay: 0.11s; }
.mobile-nav-overlay.active .mobile-nav-content nav a:nth-child(4) { transition-delay: 0.14s; }
.mobile-nav-overlay.active .mobile-nav-content nav a:nth-child(5) { transition-delay: 0.17s; }
.mobile-nav-overlay.active .mobile-nav-content nav a:nth-child(6) { transition-delay: 0.2s; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-color: rgba(0, 0, 0, 0.9);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  max-width: min(100%, 1100px);
  max-height: 88vh;
  border-radius: 0;
  object-fit: contain;
  transform: scale(0.97);
  transition: transform 0.2s ease;
}

.modal.show .modal-content {
  transform: scale(1);
}

.close {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1201;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(23, 24, 22, 0.88);
  color: var(--text);
  cursor: pointer;
  font-size: 30px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.close:hover {
  color: var(--accent-strong);
  border-color: rgba(255, 255, 255, 0.35);
  background: var(--surface);
}

.site-footer {
  width: 100%;
  margin-top: clamp(48px, 8vw, 88px);
  padding: 26px clamp(18px, 5vw, 44px) 38px;
  border-top: 1px solid var(--line);
  background: rgba(16, 17, 16, 0.94);
}

.footer-inner {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.footer-inner p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.footer-link:hover {
  color: var(--text);
  transform: translateY(-1px);
}

.fade-in {
  animation: fadeIn 0.28s ease both;
}

.fade-out {
  animation: fadeOut 0.24s ease both;
}

@media (hover: hover) and (pointer: fine) {
  .images figure:hover {
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(36, 37, 32, 0.82);
    background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
  }
}

@media (max-width: 767px) {
  body {
    padding-top: 76px;
  }
}

@media (max-width: 520px) {
  .summary,
  .main-content-article .summary:first-child {
    font-size: 16px;
    line-height: 1.62;
  }

  .action-group {
    flex-direction: column;
  }

  .button-link {
    width: 100%;
  }

  .images figure {
    padding: 10px;
  }

  .site-footer {
    padding-bottom: 32px;
  }
}

@media (min-width: 768px) {
  .mobile-brand,
  .hamburger,
  .mobile-nav-overlay {
    display: none !important;
  }

  .single-container,
  .home-container {
    display: grid;
    grid-template-columns: minmax(210px, 250px) minmax(0, 1fr);
    gap: clamp(28px, 5vw, 56px);
    align-items: start;
  }

  .sidebar {
    position: sticky;
    top: 28px;
    display: block;
    min-width: 0;
  }

  .main-content {
    min-width: 0;
  }

  #page-content {
    gap: 34px;
  }

  .images {
    max-width: 560px;
  }

  .footer-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

@media (min-width: 1120px) {
  #page-content {
    display: grid;
    grid-template-columns: minmax(300px, 430px) minmax(340px, 1fr);
    gap: clamp(34px, 4.5vw, 64px);
    align-items: start;
  }

  .images {
    order: 0;
    max-width: none;
  }

  .main-content-article {
    order: 0;
    position: sticky;
    top: 28px;
    max-width: 540px;
    padding-top: 2px;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
