/* Generated from src/mayphus/styles.clj */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-soft: #ffffff;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --foreground: #191613;
  --muted-foreground: #6f6761;
  --accent: #6d4b3e;
  --accent-soft: rgba(109, 75, 62, 0.08);
  --line: rgba(25, 22, 19, 0.10);
  --line-strong: rgba(25, 22, 19, 0.18);
  --radius: 1.05rem;
  --content-width: 46rem;
  --reading-width: 72ch;
  --sidebar-width: 15.5rem;
  --rail-width: 15rem;
  --shadow-soft: 0 10px 24px rgba(25, 22, 19, 0.04);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #11100f;
    --bg-soft: #161412;
    --panel: #171513;
    --panel-strong: #1b1816;
    --foreground: #f2ece5;
    --muted-foreground: #b9afa4;
    --accent: #ddb39c;
    --accent-soft: rgba(221, 179, 156, 0.12);
    --line: rgba(242, 236, 229, 0.12);
    --line-strong: rgba(242, 236, 229, 0.22);
    --shadow-soft: 0 16px 40px rgba(0, 0, 0, 0.28);
  }
}

/* Base */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--foreground);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(159, 79, 44, 0.18);
  color: var(--foreground);
}

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

a:hover {
  color: var(--accent);
}

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

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

/* Shared Pages */

.site-body {
  min-height: 100vh;
}

.site-frame {
  max-width: 90rem;
  margin: 0 auto;
  padding: 2.1rem 2rem 4rem;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--rail-width);
  gap: 3rem;
  align-items: start;
}

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

.page {
  width: min(100%, var(--content-width));
}

.home-page, .archive-page, .post-page, .not-found-page {
  padding-top: 0.35rem;
}

.mobile-header {
  display: none;
}

.brand-link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  width: fit-content;
}

.brand-avatar {
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line-strong);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.brand-name {
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand-role {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.sidebar {
  position: sticky;
  top: 2rem;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-top: 0.3rem;
}

.sidebar-copy, .sidebar-updated, .mobile-copy, .rail-text, .section-description, .page-description, .post-lead, .archive-description, .zh-copy, .rime-section-copy, .rime-help-text {
  margin: 0;
  color: var(--muted-foreground);
}

.sidebar-section, .rail-section {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.sidebar-section + .sidebar-section, .rail-section + .rail-section {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.sidebar-heading, .rail-heading, .rime-summary-label {
  margin: 0;
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.sidebar-nav, .sidebar-connect, .rail-panel {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.mobile-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
}

.sidebar-nav a, .sidebar-connect a, .mobile-nav a, .rail-links a {
  width: fit-content;
  color: var(--foreground);
}

.sidebar-nav a:hover, .sidebar-connect a:hover, .mobile-nav a:hover, .rail-links a:hover {
  color: var(--accent);
}

.sidebar-updated {
  font-size: 0.88rem;
}

.rail {
  position: sticky;
  top: 2rem;
}

.rail-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rail-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.rail-text-strong {
  color: var(--foreground);
  font-weight: 600;
}

/* Typography and Intro */

.eyebrow {
  margin: 0;
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.page-title, .post-title, .zh-title {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(2.3rem, 5vw, 4.6rem);
  line-height: 1.04;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.archive-title, .section-title {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.archive-title {
  font-size: 1.35rem;
  line-height: 1.14;
}

.page-description, .post-lead, .zh-copy {
  max-width: 38rem;
  font-size: 1.02rem;
}

.archive-intro, .post-header, .zh-hero {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Feature: Archive and Home */

.archive-island {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tag-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  padding-bottom: 0.25rem;
}

.tag-button, .pill-button {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 0.52rem 0.82rem;
  font-size: 0.8rem;
  line-height: 1;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.tag-button:hover, .pill-button:hover {
  border-color: var(--line-strong);
  color: var(--foreground);
}

.tag-button.is-active {
  background: var(--accent-soft);
  border-color: rgba(159, 79, 44, 0.28);
  color: var(--accent);
}

.archive-list, .story-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.archive-item, .story-list-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  padding: 1.05rem 0 1.2rem;
  border-bottom: 1px solid var(--line);
  transition: transform 160ms ease, color 160ms ease;
}

.archive-item:first-child {
  padding-top: 0.15rem;
}

.archive-item:last-child, .story-list-item:last-child {
  border-bottom: 0;
}

.archive-item-top, .story-list-meta, .story-kicker-row, .post-meta, .mobile-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  justify-content: space-between;
}

.archive-copy, .story-list-copy, .lead-story-copy, .connect-copy {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.archive-copy {
  max-width: 42rem;
}

.archive-date, .story-date, .post-date, .story-kicker {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.archive-arrow, .story-link {
  align-self: center;
  font-weight: 600;
  color: var(--muted-foreground);
  transition: transform 160ms ease, color 160ms ease;
}

.archive-arrow {
  display: none;
}

.story-link:hover {
  transform: translateX(0.2rem);
  color: var(--accent);
}

.archive-tags, .badge-row, .rime-summary-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.12rem 0.46rem;
  font-size: 0.56rem;
  font-weight: 600;
}

.badge-outline {
  border: 1px solid rgba(25, 22, 19, 0.09);
  color: rgba(111, 103, 97, 0.82);
  background: transparent;
}

.badge-solid, .rime-summary-pill {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(159, 79, 44, 0.14);
}

.mini-badge {
  font-size: 0.52rem;
  padding: 0.1rem 0.4rem;
}

.archive-tags .badge {
  opacity: 0.7;
}

.empty-state {
  padding: 1.1rem 0;
  color: var(--muted-foreground);
}

/* Feature: Post */

.post-header {
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.7rem;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  justify-content: flex-start;
  align-items: center;
  padding-top: 0.1rem;
}

.post-prose {
  font-size: 1.03rem;
  line-height: 1.85;
  color: var(--foreground);
  max-width: var(--reading-width);
}

.post-prose > :first-child {
  margin-top: 0;
}

.post-prose p, .post-prose ul, .post-prose ol, .post-prose blockquote, .post-prose pre {
  margin: 0 0 1.25rem;
}

.post-prose h2, .post-prose h3 {
  margin: 2.4rem 0 1rem;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.12;
}

.post-prose h2 {
  font-size: 1.8rem;
}

.post-prose h3 {
  font-size: 1.38rem;
}

.post-prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.15em;
}

.post-prose blockquote {
  padding-left: 1.1rem;
  border-left: 2px solid var(--line-strong);
  color: var(--muted-foreground);
}

.post-prose code {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.9em;
  background: rgba(25, 22, 19, 0.06);
  border-radius: 0.35rem;
  padding: 0.14rem 0.3rem;
}

.post-prose pre {
  overflow-x: auto;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: rgba(255, 252, 247, 0.78);
  box-shadow: var(--shadow-soft);
}

.post-prose pre code {
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.post-prose img {
  margin: 1.6rem 0;
  border-radius: 0.9rem;
  border: 1px solid var(--line);
}

/* TOC and 404 */

.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.toc-links, .not-found-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.toc-link {
  padding-left: 0.75rem;
  border-left: 1px solid transparent;
  color: var(--muted-foreground);
}

.toc-link.is-child {
  padding-left: 1.35rem;
  font-size: 0.94rem;
}

.toc-link.is-active {
  color: var(--foreground);
  border-left-color: var(--accent);
}

.not-found-list a {
  width: fit-content;
}

/* Feature: Chinese and Rime */

.zh-frame {
  min-height: 100vh;
  padding: 2.1rem 2rem 4rem;
}

.zh-main {
  width: min(100%, 90rem);
  margin: 0 auto;
}

.zh-header {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding-bottom: 1.25rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.zh-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
}

.zh-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: min(100%, var(--content-width));
}

.zh-hero {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 38rem;
}

.rime-page {
  width: 100%;
}

.rime-app-root {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.rime-config-shell {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.rime-hero-card, .rime-section, .rime-summary-card, .rime-notes-card, .rime-preview-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem 1.35rem;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-soft);
}

.rime-hero-copy, .rime-primary-column, .rime-summary-column, .rime-section-header, .rime-summary-block {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.rime-summary-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rime-summary-block {
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: rgba(255, 252, 247, 0.44);
}

.rime-config-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(18rem, 0.95fr);
  gap: 1.2rem;
}

.rime-primary-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rime-section-title {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.rime-platform-grid, .rime-option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.rime-platform-button, .rime-build-button {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 0.95rem 1rem;
  background: rgba(255, 252, 247, 0.55);
  color: var(--foreground);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.rime-platform-button:hover, .rime-build-button:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.rime-platform-button.is-active, .rime-option-card.is-selected {
  border-color: rgba(159, 79, 44, 0.28);
  background: var(--accent-soft);
}

.rime-platform-label, .rime-option-title {
  font-weight: 600;
}

.rime-platform-hint, .rime-option-id, .rime-inline-note, .rime-preview-hint {
  font-size: 0.82rem;
  color: var(--muted-foreground);
}

.rime-option-card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  padding: 0.9rem 0.95rem;
  background: rgba(255, 252, 247, 0.52);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.rime-option-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: flex-start;
}

.rime-option-card input {
  margin: 0;
  accent-color: var(--accent);
}

.rime-option-card:hover {
  border-color: var(--line-strong);
}

.rime-option-card.is-auto {
  opacity: 0.82;
}

.rime-option-copy {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.rime-option-title-row, .rime-skin-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: flex-start;
}

.rime-skin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(16rem, 0.9fr);
  gap: 0.9rem;
  align-items: start;
}

.rime-skin-card {
  min-height: 5.7rem;
  justify-content: space-between;
}

.rime-skin-card.is-previewing {
  border-color: rgba(159, 79, 44, 0.34);
  background: rgba(109, 75, 62, 0.08);
}

.rime-preview-panel {
  min-height: 100%;
}

.keyboard-preview {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.keyboard-preview-label {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.keyboard-preview-grid {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.keyboard-preview-row, .keyboard-preview-space-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
}

.keyboard-preview-key, .keyboard-preview-space {
  display: grid;
  place-items: center;
  min-width: 2.1rem;
  height: 2.2rem;
  padding: 0 0.45rem;
  border: 1px solid rgba(25, 22, 19, 0.10);
  border-radius: 0.65rem;
  background: rgba(25, 22, 19, 0.05);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.82rem;
}

.keyboard-preview-key.is-wide {
  min-width: 3.2rem;
}

.keyboard-preview-key.is-blank {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.keyboard-preview-space {
  width: 8.4rem;
}

.rime-summary-column {
  position: sticky;
  top: 2rem;
  align-self: start;
}

.rime-summary-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.26rem 0.62rem;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.2;
}

.rime-build-button {
  width: 100%;
  justify-content: center;
  font-weight: 600;
}

.rime-build-button.is-disabled, .rime-build-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.rime-error-text {
  margin: 0;
  color: #a53d2f;
}

/* Responsive */

@media (max-width: 80rem) {
  .site-frame {
    grid-template-columns: 14rem minmax(0, 1fr);
    gap: 2rem;
  }

  .rail {
    display: none;
  }
}

@media (max-width: 1120px) {
  .rime-config-grid {
    grid-template-columns: 1fr;
  }

  .rime-summary-column {
    position: static;
  }
}

@media (max-width: 860px) {
  .site-frame {
    display: block;
    padding: 1.2rem 1rem 3rem;
  }

  .zh-frame {
    padding: 1.2rem 1rem 3rem;
  }

  .mobile-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    display: flex;
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
  }

  .mobile-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.9rem;
  }

  .sidebar, .rail {
    display: none;
  }

  .page {
    width: 100%;
  }

  .archive-item, .story-list-item {
    grid-template-columns: 1fr;
  }

  .archive-arrow {
    display: none;
  }

  .archive-title {
    font-size: 1.34rem;
  }

  .page-title, .post-title, .zh-title {
    font-size: clamp(2rem, 12vw, 3.2rem);
  }

  .zh-header-row {
    align-items: flex-start;
  }

  .rime-platform-grid, .rime-option-grid, .rime-skin-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .archive-item-top, .post-meta {
    align-items: flex-start;
  }

  .tag-filter {
    gap: 0.5rem;
  }

  .tag-button, .pill-button {
    padding: 0.48rem 0.7rem;
    font-size: 0.76rem;
  }

  .rime-hero-card, .rime-section, .rime-summary-card, .rime-notes-card, .rime-preview-panel {
    padding: 1rem;
  }
}
