﻿*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-darkest: rgb(35, 20, 28);
  --bg-dark: rgb(45, 28, 38);
  --bg-mid: rgb(55, 35, 45);
  --bg-light: rgb(70, 45, 58);
  --bg-lighter: rgb(85, 55, 70);
  --border: rgb(85, 55, 70);
  --text-primary: rgb(255, 235, 245);
  --text-secondary: rgb(200, 160, 180);
  --text-muted: rgb(150, 110, 130);
  --accent: rgb(255, 130, 180);
  --accent-hot: rgb(255, 90, 150);
  --accent-light: rgb(255, 200, 220);
  --pink-300: rgb(255, 180, 210);
  --pink-900: rgb(130, 30, 65);
}

[data-theme="light"] {
  --bg-darkest: rgb(255, 252, 254);
  --bg-dark: rgb(255, 248, 252);
  --bg-mid: rgb(255, 240, 248);
  --bg-light: rgb(245, 230, 240);
  --bg-lighter: rgb(235, 220, 230);
  --border: rgb(235, 220, 230);
  --text-primary: rgb(80, 40, 60);
  --text-secondary: rgb(130, 80, 105);
  --text-muted: rgb(170, 120, 145);
  --accent: rgb(220, 80, 140);
  --accent-hot: rgb(255, 90, 150);
  --accent-light: rgb(255, 180, 210);
  --pink-300: rgb(255, 200, 225);
  --pink-900: rgb(145, 50, 85);
}

html,
body {
  height: 100%;
}

body {
  background: var(--bg-darkest);
  color: var(--text-primary);
  font-family: "DM Mono", monospace;
  font-weight: 300;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

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

.petals {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.petal {
  position: absolute;
  width: 6px;
  height: 8px;
  background: var(--accent);
  border-radius: 80% 0 80% 0;
  opacity: 0;
  animation: drift linear infinite;
}

@keyframes drift {
  0% {
    transform: translateY(-20px) rotate(0deg);
    opacity: 0;
  }

  5% {
    opacity: 0.18;
  }

  95% {
    opacity: 0.12;
  }

  100% {
    transform: translateY(105vh) rotate(360deg);
    opacity: 0;
  }
}

.page {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 820px;
  margin: 0 auto;
  width: 100%;
  padding: 0 2.2rem;
}

.top-bar {
  border-bottom: 1px solid var(--border);
  padding: 1.3rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 20;
  opacity: 0;
  animation: fade-up 0.5s ease forwards 0.1s;
}

.site-id {
  font-size: 0.78rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-id a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}

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

.crumb-sep {
  color: var(--bg-lighter);
}

.crumb-current {
  color: var(--text-muted);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-hot);
  box-shadow: 0 0 8px var(--accent-hot);
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

.top-right {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-left: auto;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.15rem;
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: "DM Mono", monospace;
  font-size: 1.05rem;
  line-height: 1;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.menu-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.header-link {
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.2rem 0.1rem;
  transition: color 0.15s;
}

.header-link:hover,
.header-link.active {
  color: var(--accent);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: "DM Mono", monospace;
  font-size: 1.08rem;
  line-height: 1;
  letter-spacing: 0;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.status-tag {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 2.6rem 0 3rem;
}

.kicker {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
  opacity: 0;
  animation: fade-up 0.5s ease forwards 0.3s;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.kicker::before {
  content: "";
  display: inline-block;
  width: 1.8rem;
  height: 1px;
  background: var(--accent);
}

.title {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(2.5rem, 8vw, 5.2rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin-bottom: 1.4rem;
  opacity: 0;
  animation: fade-up 0.6s ease forwards 0.45s;
}

.title em {
  font-style: italic;
  color: var(--accent);
}

.intro {
  font-size: 0.84rem;
  line-height: 1.9;
  color: var(--text-secondary);
  max-width: 52ch;
  opacity: 0;
  animation: fade-up 0.5s ease forwards 0.72s;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.section-head h2 {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 400;
}

.section-head a {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

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

.card-grid {
  display: grid;
  gap: 0.9rem;
}

.card {
  border: 1px solid var(--border);
  background: var(--bg-dark);
  padding: 0.9rem 1rem;
  transition: border-color 0.2s ease;
}

.card-reveal {
  opacity: 0;
  animation: fade-up 0.45s ease forwards;
}

.card:hover {
  border-color: var(--accent);
}

.pinned-card {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(255, 130, 180, 0.2);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.card-author {
  margin-bottom: 0.6rem;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
}

.author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border);
}

.author-name {
  color: var(--text-muted);
  font-size: 0.7rem;
  text-decoration: none;
  transition: color 0.15s;
}

.author-name:hover {
  color: var(--accent);
}

.card h3 {
  margin: 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.55rem;
  font-weight: 400;
}

.card h3 a {
  color: var(--text-primary);
}

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

.card time {
  color: var(--text-muted);
  font-size: 0.7rem;
  white-space: nowrap;
}

.card p {
  margin-top: 0.6rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.8;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.tag {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.18rem 0.4rem;
}

.post-wrap {
  flex: 1;
  width: 100%;
  padding: 2.6rem 0 3rem;
}

.post-meta {
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.3rem;
  padding-bottom: 0.8rem;
}

.post-meta h1 {
  margin: 0.2rem 0 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 0.98;
  font-weight: 400;
}

.post-meta p {
  margin: 0.5rem 0 0;
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.8;
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.post-header .kicker {
  margin-bottom: 0;
}

.post-author-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.post-author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
}

.post-author-name {
  color: var(--text-muted);
  font-size: 0.68rem;
  text-decoration: none;
  transition: color 0.15s;
}

.post-author-name:hover {
  color: var(--accent);
}

.post-body {
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.95;
}

.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4 {
  color: var(--text-primary);
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  line-height: 1.1;
  margin-top: 1.6rem;
  margin-bottom: 0.6rem;
}

.post-body p,
.post-body ul,
.post-body ol,
.post-body blockquote {
  margin: 0.8rem 0;
}

.post-body ul,
.post-body ol {
  padding-left: 1.2rem;
}

.post-body a {
  color: var(--accent-light);
}

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

.post-body code {
  font-family: "DM Mono", monospace;
  background: rgba(255, 200, 220, 0.12);
  color: var(--pink-300);
  padding: 0.15rem 0.32rem;
}

.post-body pre {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  overflow-x: auto;
  padding: 0.9rem;
}

.post-body pre code {
  background: transparent;
  padding: 0;
}

.post-body blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 0.8rem;
  color: var(--text-primary);
}

.empty-state {
  border: 1px dashed var(--border);
  padding: 1rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 1.35rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  opacity: 0;
  animation: fade 0.45s ease forwards 0.9s;
}

.footer-copy {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.55rem;
}

.footer-links a {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

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

.watermark {
  position: fixed;
  bottom: -0.05em;
  right: -0.05em;
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-size: clamp(10rem, 28vw, 22rem);
  color: transparent;
  -webkit-text-stroke: 1px var(--bg-light);
  line-height: 1;
  pointer-events: none;
  user-select: none;
  opacity: 0;
  animation: fade 1s ease forwards 0.5s;
  z-index: 0;
  transition: -webkit-text-stroke-color 0.3s;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@media (max-width: 700px) {
  .page {
    padding: 0 1.2rem;
  }

  .top-bar {
    display: flex;
    position: relative;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.6rem;
    flex-wrap: nowrap;
  }

  .site-id {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    gap: 0.35rem;
    white-space: nowrap;
  }

  .top-right {
    margin-top: 0;
    width: auto;
    position: static;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .header-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.55rem);
    width: auto;
    margin-top: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
    padding: 0.7rem;
    border: 1px solid var(--border);
    background: var(--bg-dark);
    border-radius: 0.3rem;
    z-index: 30;
    pointer-events: none;
  }

  .header-nav.open {
    display: flex;
    animation: fade 0.2s ease forwards;
    pointer-events: auto;
  }

  .header-link {
    display: block;
    width: 100%;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    padding: 0.55rem 0.6rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
    background: transparent;
    line-height: 1.2;
  }

  .header-link:hover,
  .header-link.active {
    border-color: var(--border);
    background: rgba(255, 130, 180, 0.07);
  }

  .theme-toggle {
    width: 100%;
    height: 2.25rem;
    justify-content: center;
    padding-left: 0;
  }

  .main {
    padding: 1.8rem 0 2.4rem;
  }

  .title {
    font-size: clamp(2.1rem, 13vw, 3.2rem);
    line-height: 0.97;
  }

  .intro {
    max-width: 100%;
    font-size: 0.88rem;
    line-height: 1.75;
  }

  .section-head {
    margin-top: 1.35rem;
    margin-bottom: 0.8rem;
  }

  .card h3 {
    font-size: 1.25rem;
  }

  .post-wrap {
    padding: 1.8rem 0 2.2rem;
  }

  .post-meta h1 {
    font-size: clamp(1.7rem, 10vw, 2.4rem);
  }

  .watermark {
    font-size: clamp(6.5rem, 42vw, 10rem);
    opacity: 0.55;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .card-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }

  .author-info {
    font-size: 0.7rem;
  }

  .author-avatar {
    width: 20px;
    height: 20px;
  }

  .post-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }

  .post-header .kicker {
    margin-bottom: 0.3rem;
  }

  .post-author-bar {
    font-size: 0.65rem;
  }

  .post-author-avatar {
    width: 28px;
    height: 28px;
  }
}
