:root {
  color-scheme: light;
  --bg: #f5f7f3;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --text: #1c2320;
  --muted: #6b756f;
  --line: rgba(36, 47, 40, 0.12);
  --accent: #2f7d62;
  --accent-2: #c65d45;
  --accent-3: #556fb5;
  --shadow: 0 22px 70px rgba(32, 44, 39, 0.12);
  --radius: 8px;
  --sidebar: 306px;
}

@media (prefers-color-scheme: dark) {
  body[data-theme="system"] {
    color-scheme: dark;
    --bg: #111513;
    --surface: rgba(25, 31, 28, 0.82);
    --surface-strong: #191f1c;
    --text: #eef3ef;
    --muted: #a7b0aa;
    --line: rgba(238, 243, 239, 0.12);
    --accent: #74caa8;
    --accent-2: #e1957f;
    --accent-3: #9eafea;
    --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
  }
}

body[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111513;
  --surface: rgba(25, 31, 28, 0.82);
  --surface-strong: #191f1c;
  --text: #eef3ef;
  --muted: #a7b0aa;
  --line: rgba(238, 243, 239, 0.12);
  --accent: #74caa8;
  --accent-2: #e1957f;
  --accent-3: #9eafea;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(47, 125, 98, 0.12), transparent 34rem),
    linear-gradient(135deg, rgba(85, 111, 181, 0.08), transparent 36rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

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

button,
input {
  font: inherit;
}

.site-shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 88%, transparent);
  backdrop-filter: blur(20px);
  z-index: 20;
}

.profile-card {
  display: grid;
  gap: 16px;
}

.avatar {
  width: 84px;
  height: 84px;
  border-radius: 28px;
  object-fit: cover;
  border: 3px solid color-mix(in srgb, var(--accent) 36%, transparent);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

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

.profile-card h1 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.15;
}

.profile-bio {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.profile-stats span {
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.76rem;
}

.profile-stats strong {
  display: block;
  color: var(--text);
  font-size: 1.25rem;
}

.side-nav {
  display: grid;
  gap: 6px;
  margin-top: 26px;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: var(--radius);
  color: var(--muted);
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.side-nav a:hover,
.side-nav a.active {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--text);
}

.side-nav a:hover {
  transform: translateX(2px);
}

.sidebar-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.icon-button,
.menu-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.main {
  min-width: 0;
  padding: 24px clamp(18px, 4vw, 52px) 70px;
}

.mobile-bar {
  display: none;
}

.hero {
  position: relative;
  min-height: 430px;
  display: grid;
  align-items: end;
  overflow: hidden;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
  background: #1c2320;
}

.hero-media {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  filter: saturate(1.05);
}

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

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  padding: clamp(24px, 6vw, 58px);
  color: white;
}

.hero-content h2 {
  margin-bottom: 14px;
  font-size: clamp(2rem, 5vw, 4.8rem);
  line-height: 1.04;
}

.hero-content p {
  max-width: 610px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: var(--radius);
  font-weight: 700;
}

.primary-button {
  background: #ffffff;
  color: #15201b;
}

.ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.42);
  color: white;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 360px) 1fr;
  gap: 14px;
  align-items: center;
  margin: 24px 0;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.chip {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.chip.active {
  border-color: transparent;
  background: var(--accent);
  color: white;
}

.view {
  display: grid;
  gap: 28px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
}

.section-heading a,
.section-heading span,
.section-heading p {
  margin: 0;
  color: var(--muted);
}

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

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

.post-card,
.album-card,
.anime-card,
.friend-card,
.diary-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 14px 42px rgba(25, 31, 28, 0.06);
}

.post-card {
  overflow: hidden;
}

.post-cover {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--line);
}

.post-cover img,
.album-card img,
.anime-card img,
.friend-card img,
.diary-images img,
.masonry img,
.article-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-body {
  padding: 18px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.85rem;
}

.post-card h3 {
  margin-bottom: 10px;
  font-size: 1.22rem;
  line-height: 1.35;
}

.post-card p {
  color: var(--muted);
  line-height: 1.7;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tags span {
  padding: 4px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-3) 14%, transparent);
  color: var(--accent-3);
  font-size: 0.78rem;
}

.post-card.compact {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
}

.post-card.compact .post-cover {
  aspect-ratio: auto;
  min-height: 188px;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: start;
}

.timeline {
  display: grid;
  gap: 14px;
}

.timeline.wide {
  max-width: 820px;
}

.diary-item {
  padding: 18px;
}

.diary-item time {
  color: var(--accent-2);
  font-weight: 700;
}

.diary-item p {
  margin: 10px 0 0;
  color: var(--text);
  line-height: 1.8;
}

.diary-images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.diary-images img {
  aspect-ratio: 1;
  border-radius: var(--radius);
}

.album-stack,
.album-grid,
.anime-grid,
.friend-grid {
  display: grid;
  gap: 14px;
}

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

.album-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  overflow: hidden;
}

.album-card img {
  min-height: 128px;
}

.album-card div,
.friend-card div {
  padding: 14px;
}

.album-card h3,
.friend-card h3,
.anime-card h3 {
  margin-bottom: 6px;
}

.album-card p,
.friend-card p,
.anime-card p {
  color: var(--muted);
  line-height: 1.65;
}

.masonry {
  columns: 3 220px;
  column-gap: 14px;
}

.masonry img {
  width: 100%;
  height: auto;
  margin: 0 0 14px;
  border-radius: var(--radius);
}

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

.anime-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  overflow: hidden;
}

.anime-card img {
  min-height: 190px;
}

.anime-card > div {
  padding: 16px;
}

.anime-card dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0 0;
}

.anime-card dl div {
  padding: 8px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.anime-card dt {
  color: var(--muted);
  font-size: 0.76rem;
}

.anime-card dd {
  margin: 2px 0 0;
  font-weight: 700;
}

.friend-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.friend-card img {
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  border-radius: 20px;
}

.friend-card div {
  min-width: 0;
  padding: 0;
}

.friend-card span {
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 700;
}

.article-page {
  max-width: 900px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 16px;
  color: var(--accent);
  font-weight: 700;
}

.article-cover {
  aspect-ratio: 16 / 8;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.article-header {
  padding: 26px 0 14px;
}

.article-header h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.08;
}

.article-header p {
  color: var(--muted);
  line-height: 1.8;
}

.prose {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  line-height: 1.9;
}

.prose h1,
.prose h2,
.prose h3 {
  margin: 1.2em 0 0.55em;
}

.prose p {
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
}

.prose img {
  border-radius: var(--radius);
  margin: 20px 0;
}

.prose code {
  padding: 2px 6px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent-3) 14%, transparent);
}

.empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

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

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 318px);
    transform: translateX(-104%);
    transition: transform 180ms ease;
  }

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

  .mobile-bar {
    position: sticky;
    top: 0;
    z-index: 12;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    margin: -24px -18px 18px;
    padding: 0 18px;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-strong) 88%, transparent);
    backdrop-filter: blur(18px);
  }

  .brand {
    font-weight: 800;
  }

  .main {
    padding-inline: 18px;
  }

  .toolbar,
  .post-grid,
  .two-column,
  .album-grid,
  .anime-grid,
  .friend-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .hero {
    min-height: 360px;
  }

  .hero-content {
    padding: 24px;
  }

  .post-card.compact,
  .album-card,
  .anime-card {
    grid-template-columns: 1fr;
  }

  .post-card.compact .post-cover,
  .album-card img,
  .anime-card img {
    aspect-ratio: 16 / 9;
    min-height: 0;
  }

  .diary-images,
  .anime-card dl {
    grid-template-columns: 1fr;
  }

  .prose {
    padding: 18px;
  }
}
