:root {
  color-scheme: light;
  --bg: #ffffff;
  --text: #222222;
  --muted: #666666;
  --soft: #f6f6f4;
  --line: #e7e5e0;
  --primary: #5f6f64;
  --primary-strong: #3f4c44;
  --card: #ffffff;
  --shadow: 0 18px 60px rgba(18, 18, 18, 0.08);
}

:root.dark {
  color-scheme: dark;
  --bg: #111111;
  --text: #f2f2f2;
  --muted: #aaa9a5;
  --soft: #1b1b1a;
  --line: #2c2b29;
  --primary: #8b9a8f;
  --primary-strong: #c6d0c8;
  --card: #161616;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
}

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

.top-nav {
  position: fixed;
  z-index: 10;
  top: 16px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--soft) 88%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  transform: translateX(-50%);
}

.top-nav a,
.theme-toggle {
  min-height: 40px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 18px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}

.top-nav a:hover,
.top-nav a[aria-current="page"],
.theme-toggle:hover {
  color: var(--text);
  background: var(--bg);
}

.theme-toggle {
  display: inline-grid;
  width: 44px;
  min-width: 44px;
  padding: 0;
  place-items: center;
  margin-left: 6px;
  border-left: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  font-size: 24px;
  line-height: 1;
}

.site-shell {
  width: min(896px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 40px 32px 0;
  border-inline: 1px solid var(--line);
}

.section {
  padding: 80px 0;
}

.hero {
  display: grid;
  justify-items: center;
  padding-top: 128px;
  text-align: center;
}

.home-hero {
  position: relative;
  min-height: 560px;
  align-items: center;
  overflow: hidden;
  margin: 72px -32px 0;
  padding: 80px 32px 88px;
  color: white;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #111111;
}

.hero-media::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.58));
}

.hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.04);
  transition:
    opacity 900ms ease,
    transform 6000ms ease;
}

.hero-media img.is-active {
  opacity: 1;
  transform: scale(1);
}

.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
}

.home-hero .profile-avatar {
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.1);
  width: 148px;
  height: 148px;
}

.home-hero p,
.home-hero .social-row a {
  color: rgba(255, 255, 255, 0.86);
}

.home-hero .button.dark {
  background: rgba(255, 255, 255, 0.94);
  color: #151515;
}

.avatar {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--primary);
  font-size: 28px;
  font-weight: 800;
  box-shadow: 0 0 0 6px var(--bg);
}

.profile-avatar {
  display: block;
  width: 112px;
  height: 112px;
  border: 1px solid var(--line);
  border-radius: 999px;
  object-fit: cover;
  object-position: center;
  box-shadow: 0 0 0 6px var(--bg);
}

.page-avatar {
  width: 148px;
  height: 148px;
  margin: 0 auto 22px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 680px;
  margin-top: 18px;
  font-size: clamp(38px, 6vw, 56px);
  line-height: 1.1;
  letter-spacing: 0;
}

.hero p {
  max-width: 680px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 17px;
}

.hero-actions,
.social-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

.social-row {
  margin-top: 18px;
}

.social-row a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 750;
}

.button.primary {
  background: var(--primary);
  color: white;
}

.button.primary:hover {
  background: var(--primary-strong);
}

.button.dark {
  background: var(--text);
  color: var(--bg);
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
}

.section-heading {
  margin-bottom: 24px;
}

h2 {
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: 0;
}

h3 {
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: 0;
}

.section-heading p,
.split p,
.feature-strip > div > p,
.post-card p,
.resource-card p,
.faq p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
}

.timeline {
  display: grid;
  gap: 12px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}

.timeline strong {
  color: var(--text);
}

.feature-strip {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 28px;
  align-items: start;
}

.feature-grid,
.resource-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.feature-card,
.resource-card,
.post-card,
.faq details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}

.feature-card,
.resource-card {
  display: block;
  padding: 18px;
}

.feature-card:hover,
.resource-card:hover,
.post-card:hover {
  border-color: color-mix(in srgb, var(--primary) 36%, var(--line));
}

.feature-card span,
.resource-card span,
.post-card time {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.feature-card strong,
.resource-card strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 18px;
}

.post-list {
  display: grid;
  gap: 14px;
}

.more-posts {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

.more-posts-link {
  min-height: 58px;
  border-radius: 10px;
  font-size: 20px;
  font-weight: 950;
  padding: 16px 30px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 34px;
}

.pagination div {
  display: flex;
  gap: 8px;
}

.pagination a,
.pagination span {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
  padding: 8px 12px;
}

.pagination a[aria-current="page"] {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.pagination span {
  color: var(--muted);
}

.post-card {
  position: relative;
  padding: 22px;
}

.post-card h3 {
  margin-top: 8px;
}

.post-card h3 .post-title-link {
  display: inline;
  margin-top: 0;
  color: var(--text);
  font-size: inherit;
  font-weight: inherit;
}

.post-card h3 .post-title-link:hover {
  color: var(--primary-strong);
}

.post-card .post-excerpt-link {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: inherit;
  font-weight: inherit;
  line-height: 1.75;
}

.post-card .post-excerpt-link:hover {
  color: var(--text);
}

.post-card a {
  display: inline-flex;
  margin-top: 16px;
  color: var(--primary-strong);
  font-size: 14px;
  font-weight: 800;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag-list a,
.tag-index-item {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 800;
}

.tag-list a {
  margin-top: 0;
  padding: 4px 9px;
}

.tag-index {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.search-tag-grid {
  margin-top: 18px;
  gap: 12px;
}

.tag-index-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
}

.search-tag-item {
  min-height: 46px;
  border-radius: 8px;
  font-size: 15px;
  padding: 10px 14px;
}

.tag-index-item span {
  color: var(--muted);
}

.search-box {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--text);
  font-weight: 800;
}

.search-box input {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  padding: 10px 12px;
}

.search-status {
  margin-bottom: 18px;
  color: var(--muted);
}

.search-result-list {
  margin-bottom: 34px;
}

.search-tag-heading {
  margin-top: 10px;
}

.contact-section h2 {
  margin-bottom: 18px;
}

.contact-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  gap: 24px;
}

.contact-email,
.contact-whatsapp {
  justify-content: center;
  width: fit-content;
}

.archive {
  display: grid;
  gap: 34px;
}

.archive-month h2 {
  margin-bottom: 14px;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.calendar-day {
  min-height: 92px;
  border: 1px solid var(--line);
  margin: -1px 0 0 -1px;
  padding: 8px;
  background: var(--card);
}

.calendar-day-empty {
  background: color-mix(in srgb, var(--soft) 54%, transparent);
}

.calendar-day time {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.calendar-day a {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
}

.calendar-day a:hover {
  color: var(--primary-strong);
}

.calendar-day.has-post {
  background: color-mix(in srgb, var(--primary) 7%, var(--card));
}

.faq {
  display: grid;
  gap: 12px;
}

.faq details {
  padding: 16px 18px;
}

.faq summary {
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.footer {
  width: min(896px, 100%);
  margin: 0 auto;
  padding: 40px 32px 56px;
  border-inline: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.article {
  position: relative;
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 120px 28px 72px;
}

.share-bar {
  position: fixed;
  top: 160px;
  right: max(24px, calc((100vw - 760px) / 2 - 132px));
  z-index: 4;
}

.share-trigger,
.share-menu a,
.share-menu button {
  min-width: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 10px;
  text-align: center;
}

.share-trigger {
  min-width: 112px;
  min-height: 48px;
  border-color: var(--primary);
  background: var(--primary);
  color: white;
  font-size: 18px;
  font-weight: 900;
  padding: 10px 18px;
}

.share-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  display: grid;
  gap: 8px;
  min-width: 240px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 10px;
}

.share-preview {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 10px;
}

.share-preview strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}

.share-preview span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.share-preview small {
  color: var(--primary-strong);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.share-menu[hidden] {
  display: none;
}

.share-menu a,
.share-menu button {
  width: 100%;
  box-shadow: none;
}

.share-menu p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.share-trigger:hover,
.share-menu a:hover,
.share-menu button:hover {
  border-color: color-mix(in srgb, var(--primary) 42%, var(--line));
  color: var(--primary-strong);
}

.article-nav {
  margin-bottom: 36px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.article-nav-bottom {
  margin-top: 48px;
  margin-bottom: 0;
}

.article h1 {
  margin-top: 0;
  font-size: clamp(34px, 5vw, 48px);
}

.article-meta {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}

.toc {
  display: grid;
  gap: 8px;
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  padding: 18px;
}

.toc h2 {
  font-size: 18px;
}

.toc a {
  color: var(--primary-strong);
  font-size: 14px;
  font-weight: 750;
}

.toc-level-3 {
  padding-left: 18px;
}

.article-content {
  margin-top: 42px;
}

.article-content h2 {
  margin-top: 34px;
}

.article-content p,
.article-content ul,
.article-content figure,
.article-content .table-wrap {
  margin-top: 14px;
  color: var(--text);
}

.article-content figure {
  margin-inline: 0;
}

.article-content img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.article-content li + li {
  margin-top: 8px;
}

.table-wrap {
  overflow-x: auto;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.article-content th,
.article-content td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.article-content th {
  background: var(--soft);
  font-weight: 800;
}

.article-content tr:nth-child(even) td {
  background: color-mix(in srgb, var(--soft) 54%, transparent);
}

@media (max-width: 720px) {
  .top-nav {
    width: calc(100% - 20px);
    justify-content: center;
    overflow-x: auto;
  }

  .site-shell,
  .footer {
    padding-inline: 20px;
    border-inline: 0;
  }

  .hero {
    padding-top: 108px;
  }

  .home-hero {
    min-height: 520px;
    margin: 72px -20px 0;
    padding: 72px 20px;
  }

  .section {
    padding: 58px 0;
  }

  .split,
  .feature-strip,
  .feature-grid,
  .resource-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .timeline li {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .calendar-weekdays,
  .calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-weekdays {
    display: none;
  }

  .calendar-day-empty {
    display: none;
  }

  .share-bar {
    position: fixed;
    right: 18px;
    bottom: max(18px, env(safe-area-inset-bottom));
    top: auto;
    z-index: 20;
    margin: 0;
  }

  .share-trigger {
    min-width: 72px;
    min-height: 72px;
    border-radius: 999px;
    box-shadow: 0 16px 42px rgba(63, 76, 68, 0.22);
    font-size: 18px;
    padding: 0 14px;
  }

  .share-menu {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    max-height: min(78vh, 680px);
    overflow-y: auto;
    border-radius: 18px 18px 0 0;
    padding: 18px 18px max(22px, env(safe-area-inset-bottom));
    box-shadow: 0 -18px 52px rgba(0, 0, 0, 0.18);
  }

  .share-menu a,
  .share-menu button {
    min-height: 54px;
    border-radius: 12px;
    font-size: 18px;
    box-shadow: none;
  }

  .share-preview {
    padding: 14px;
  }

  .share-preview strong {
    font-size: 18px;
  }

  .share-preview span {
    font-size: 15px;
  }
}

.studio-page {
  background: var(--soft);
}

.studio-shell {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 48px 24px 72px;
}

.studio-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.studio-header h1 {
  margin-top: 4px;
}

.studio-header p,
.studio-help p,
.studio-actions p {
  color: var(--muted);
}

.studio-kicker {
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.studio-workspace {
  display: grid;
  grid-template-columns: minmax(240px, 0.42fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.studio-panel,
.studio-form,
.studio-help {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.studio-panel {
  padding: 18px;
}

.studio-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.studio-panel-head h2 {
  font-size: 20px;
}

.studio-panel button {
  border: 0;
  cursor: pointer;
}

.studio-posts {
  display: grid;
  gap: 8px;
}

.studio-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.studio-pagination div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.studio-pagination button,
.studio-pagination span {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  padding: 6px 10px;
}

.studio-pagination button[aria-current="page"] {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.studio-pagination button:disabled,
.studio-pagination span {
  color: var(--muted);
}

.studio-post-item {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  padding: 12px;
  color: var(--text);
  font: inherit;
  text-align: left;
}

.studio-post-item:hover,
.studio-post-item[aria-current="true"] {
  border-color: color-mix(in srgb, var(--primary) 42%, var(--line));
}

.studio-post-item span,
.studio-empty {
  color: var(--muted);
  font-size: 13px;
}

.studio-form {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.studio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.studio-form label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
}

.studio-form input,
.studio-form select,
.studio-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
}

.studio-form input {
  min-height: 42px;
  padding: 8px 10px;
}

.studio-form select {
  min-height: 42px;
  padding: 8px 10px;
}

.studio-form textarea {
  resize: vertical;
  padding: 10px;
}

.studio-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.studio-toolbar .button {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

.studio-body {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.studio-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.studio-actions button {
  border: 0;
  cursor: pointer;
}

.button.danger {
  background: #b42318;
  color: white;
}

.studio-actions p[data-tone="success"] {
  color: #177245;
}

.studio-actions p[data-tone="error"] {
  color: #b42318;
}

.studio-help {
  margin-top: 18px;
  padding: 20px 24px;
}

.studio-help code {
  display: block;
  margin-top: 12px;
  overflow-x: auto;
  border-radius: 8px;
  background: var(--bg);
  padding: 12px;
  color: var(--text);
}

.studio-help .button {
  margin-top: 14px;
  border: 0;
  cursor: pointer;
}

@media (max-width: 720px) {
  .studio-header,
  .studio-workspace,
  .studio-grid {
    grid-template-columns: 1fr;
  }

  .studio-header {
    display: grid;
    align-items: start;
  }
}
