:root {
  --bg-1: #ece9f6;
  --bg-2: #e5e3ec;
  --bg-3: #eafff4;

  --ink: #2f2b3d;
  --ink-soft: #746f86;
  --panel: #ffffff;
  --line: #d6d2e2;
  --line-strong: #c2bdd3;

  --accent: #6d5fd0;
  --accent-soft: #e7e4f7;
  --bar: #eae7f1;

  --coral: #edb3bd;
  --sky: #bacfe4;
  --mint: #b6d8c6;
  --butter: #ecdcae;
  --lav: #ccc4e4;
  --peach: #e9c9b6;

  --font-title: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Nunito", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --radius: 14px;

  --shadow-sm: 0 1px 2px rgba(52, 48, 74, 0.05), 0 6px 16px -10px rgba(52, 48, 74, 0.16);
  --shadow-md: 0 1px 3px rgba(52, 48, 74, 0.06), 0 14px 30px -14px rgba(52, 48, 74, 0.22);
  --shadow-window: 0 2px 8px rgba(52, 48, 74, 0.08), 0 26px 60px -18px rgba(52, 48, 74, 0.34);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
html.scroll-locked { overflow: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-2);
  background-image:
    radial-gradient(rgba(52, 48, 74, 0.07) 0.6px, transparent 0.6px);
  background-size: 22px 22px;
  background-attachment: fixed;
}

a { color: inherit; }

::selection { background: var(--accent-soft); color: var(--ink); }

.about__name,
.posts__heading,
.post-item__title,
.post__title,
.post__content h3 { letter-spacing: -0.015em; }

.desktop {
  max-width: 780px;
  margin: 0 auto;
  padding: 48px 20px 80px;
  text-align: center;
}

.window {
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: left;
  box-shadow: var(--shadow-sm);
}

.window__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: var(--bar);
  border-bottom: 1.5px solid var(--line);
}

.window__controls {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  padding: 0;
  display: inline-block;
}
.dot--red { background: #e299a1; }
.dot--yellow { background: #ecd291; }
.dot--green { background: #a2d3ba; }

button.dot { cursor: pointer; }
button.dot:hover { filter: brightness(1.08); }
button.dot:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.window__title {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.window__body { padding: 26px 28px; }

.window--about {
  margin-bottom: 48px;
  animation: pop-in 0.4s ease both;
}
.window__bar--about { background: var(--bar); }

.about {
  display: flex;
  gap: 22px;
  align-items: flex-start;
}

.about__avatar {
  flex-shrink: 0;
  width: 82px;
  height: 82px;
  background: var(--butter);
  border-radius: 18px;
  overflow: hidden;
  padding: 11px;
}
.about__avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.about__name {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 27px;
  line-height: 1.15;
  margin: 0 0 6px;
}

.about__tagline {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-weight: 700;
  font-style: italic;
}

.about__bio { margin: 0 0 16px; }

.about__links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.pill {
  display: inline-block;
  padding: 5px 13px;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.14s ease, border-color 0.14s ease;
}
.pill:hover { background: #e5e2f6; border-color: var(--line-strong); }

.pill__icon {
  height: 0.95em;
  width: auto;
  vertical-align: -0.14em;
  margin-right: 2px;
}
.posts__heading {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 23px;
  margin: 0 0 6px;
}

.posts__subtitle {
  margin: 0 0 24px;
  color: var(--ink-soft);
  font-size: 15.5px;
}

.posts__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.post-item {
  display: flex;
  gap: 18px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  font: inherit;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.16s ease, background 0.16s ease,
    box-shadow 0.16s ease, transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.post-item:hover {
  border-color: var(--line-strong);
  background: #fdfbff;
  transform: translateX(5px);
  box-shadow: var(--shadow-md);
}
.post-item:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }

.post-item__icon {
  flex-shrink: 0;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  font-size: 28px;
  border-radius: 13px;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  transition: transform 0.16s ease;
}
.post-item:hover .post-item__icon {
  animation: icon-wiggle 0.55s ease;
}

@keyframes icon-wiggle {
  0%   { transform: rotate(0) scale(1); }
  25%  { transform: rotate(-9deg) scale(1.12); }
  50%  { transform: rotate(8deg) scale(1.12); }
  75%  { transform: rotate(-4deg) scale(1.06); }
  100% { transform: rotate(0) scale(1); }
}

.post-item__text { min-width: 0; }

.post-item__title {
  display: block;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.25;
  margin: 0 0 5px;
}

.post-item__desc {
  display: block;
  margin: 0;
  font-size: 15.5px;
  color: var(--ink-soft);
}

.post-item__date {
  display: block;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.desktop__footer {
  margin-top: 52px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
}

.heart-egg {
  position: relative;
  display: inline-block;
  cursor: help;
  outline: none;
}
.heart-egg__icon { display: inline-block; }
.heart-egg:hover .heart-egg__icon,
.heart-egg:focus-visible .heart-egg__icon {
  animation: heartbeat 0.9s ease-in-out infinite;
}

.heart-egg__tip {
  position: absolute;
  bottom: 160%;
  left: 50%;
  transform: translateX(-50%) translateY(4px) scale(0.96);
  white-space: nowrap;
  background: var(--panel);
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 7px 12px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease,
    transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 60;
}
.heart-egg__tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--line);
}
.heart-egg:hover .heart-egg__tip,
.heart-egg:focus-visible .heart-egg__tip {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.28); }
  40% { transform: scale(1); }
  60% { transform: scale(1.18); }
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: transparent;
}

.window--post {
  position: fixed;
  z-index: 90;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(900px, calc(100vw - 32px));
  max-height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-window);
  animation: window-open 0.24s ease both;
}

.window--post.is-dragged { transform: none; }

.window--post .window__bar { cursor: grab; user-select: none; }
.window--post .window__bar:active { cursor: grabbing; }
.window--post .window__title { flex: 1; min-width: 0; }

.window__copy {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.5);
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  transition: background 0.14s ease;
}
.window__copy:hover { background: rgba(255, 255, 255, 0.85); }
.window__copy:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.window__copy.is-copied { background: rgba(255, 255, 255, 0.92); }

.window--post [data-close] { position: relative; }
.window--post [data-close]::before {
  content: "\00D7";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  color: #6e2b34;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.window--post .window__controls:hover [data-close]::before,
.window--post [data-close]:hover::before,
.window--post [data-close]:focus-visible::before {
  opacity: 1;
}

.window--post .window__body {
  overflow-y: auto;
}

.post__meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 10px;
}

.post__title {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 30px;
  line-height: 1.2;
  margin: 0 0 20px;
}

.post__content { font-size: 17px; line-height: 1.72; }
.post__content p { margin: 0 0 16px; }
.post__content h3 {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 21px;
  margin: 40px 0 12px;
  padding-top: 30px;
  border-top: 1.5px dashed var(--line-strong);
}
.post__content h3::before {
  content: "✦";
  margin-right: 9px;
  color: var(--accent);
  font-size: 0.82em;
  vertical-align: 1px;
}
.post__content a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2.5px;
  text-decoration-color: rgba(109, 95, 208, 0.4);
  transition: text-decoration-color 0.14s ease;
}
.post__content a:hover { text-decoration-color: currentColor; }
.post__content ul,
.post__content ol { padding-left: 24px; margin: 0 0 16px; }
.post__content li { margin-bottom: 10px; }
.post__content blockquote {
  margin: 0 0 16px;
  padding: 6px 0 6px 16px;
  border-left: 3px solid var(--accent);
  color: var(--ink-soft);
  font-style: italic;
}
.post__content img { max-width: 100%; border-radius: 8px; }
.post__content .post__images {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 18px;
}
.post__content .post__images img {
  height: auto;
  width: auto;
  max-height: 420px;
  max-width: calc(50% - 6px);
  border-radius: 14px;
  border: 1.5px solid var(--line);
}
.post__content .post__images figcaption {
  flex-basis: 100%;
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-soft);
  font-style: italic;
}

.post__content .callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0 0 18px;
  padding: 14px 16px;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
}
.post__content .callout__icon { font-size: 20px; line-height: 1.5; flex-shrink: 0; }
.post__content .callout p { margin: 0; }

.post__content .flow {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
  margin: 4px 0 20px;
}
.post__content .flow__step {
  flex: 1;
  min-width: 108px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 5px;
  padding: 14px 10px;
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.post__content .flow__icon { font-size: 24px; }
.post__content .flow__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}
.post__content .flow__sub {
  font-size: 12px;
  line-height: 1.3;
  color: var(--ink-soft);
}
.post__content .flow__arrow {
  display: flex;
  align-items: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--line-strong);
}
.post__content code {
  background: var(--bg-1);
  padding: 1px 6px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 0.9em;
  font-weight: 700;
}
.post__content pre {
  margin: 0 0 16px;
  padding: 14px 16px;
  background: #efecf8;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
}
.post__content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: 400;
  white-space: pre;
}
.post__content pre .tok-kw { color: #c026a8; font-weight: 700; }
.post__content pre .tok-type { color: #1d7fc0; }
.post__content pre .tok-str { color: #2f9e44; }
.post__content pre .tok-num { color: #e8710a; }
.post__content pre .tok-prop { color: #0d9488; }
.post__content pre .tok-attr { color: #7048e8; }
.post__content pre .tok-com { color: #8a86a0; font-style: italic; }
.post__content pre [class^="tok-"] { font-weight: 700; }

@keyframes pop-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes window-open {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.97); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .window__body { padding: 20px; }
  .about { flex-direction: column; align-items: center; text-align: center; }
  .about__links { justify-content: center; }
  .post__title { font-size: 25px; }
  .window--post .window__bar { cursor: default; }
  .post__content .post__images img { max-width: 80%; max-height: 60vh; }
  .post__content .flow { flex-direction: column; }
  .post__content .flow__arrow { transform: rotate(90deg); }
}
