@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@600;700&family=Manrope:wght@400;500;600;700;800&family=Oswald:wght@500;600;700&family=Unbounded:wght@700;800;900&display=swap&subset=cyrillic');

:root {
  --bg: #efede7;
  --paper: #f8f6f0;
  --ink: #090909;
  --muted: #6d6961;
  --line: #d8d2c7;
  --graphite: #1b1b1b;
  --accent: #ff4a1c;
  --radius: 8px;
  --display: "Oswald", "Arial Narrow", sans-serif;
  --body: "Manrope", system-ui, sans-serif;
  --brand: "Unbounded", var(--body);
  --hand: "Caveat", cursive;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.56), transparent 36%),
    radial-gradient(circle at 12% 12%, rgba(255, 255, 255, 0.72), transparent 24%),
    var(--bg);
  font-family: var(--body);
  letter-spacing: 0;
}

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

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

button {
  cursor: pointer;
}

.site-top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, 720px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px 12px;
  background: rgba(239, 237, 231, 0.86);
  backdrop-filter: blur(16px);
}

.logo {
  font-family: var(--brand);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.48em;
}

.top-mark {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.app-shell {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 8px 16px 42px;
}

.feed-list {
  display: grid;
  gap: 26px;
}

.feed-end {
  width: 100%;
  height: 1px;
  margin-top: 18px;
}

.load-more {
  display: block;
  width: fit-content;
  min-width: 132px;
  margin: 12px auto 0;
  border: 1px solid rgba(9, 9, 9, 0.18);
  border-radius: var(--radius);
  background: rgba(248, 246, 240, 0.74);
  color: rgba(9, 9, 9, 0.62);
  padding: 12px 20px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transform: translateY(22px);
  transition:
    opacity 520ms ease,
    transform 520ms cubic-bezier(0.2, 0.72, 0.18, 1),
    border-color 220ms ease,
    color 220ms ease,
    background 220ms ease;
}

.load-more.is-visible {
  opacity: 0.78;
  pointer-events: auto;
  transform: translateY(0);
}

.load-more:hover {
  border-color: rgba(9, 9, 9, 0.34);
  background: rgba(255, 253, 250, 0.88);
  color: var(--ink);
}

.load-more:disabled {
  opacity: 0.42;
  pointer-events: none;
}

.post-card {
  display: block;
}

.youtube-card {
  display: block;
}

.preview-card {
  display: block;
}

.youtube-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: #111;
}

.youtube-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: #111;
  color: #fff;
  padding: 0;
  overflow: hidden;
}

.video-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.02);
  transition: transform 320ms ease, filter 320ms ease;
}

.video-preview::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(0deg, rgba(0, 0, 0, 0.36), transparent 58%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.24), transparent 54%);
}

.video-preview:hover img {
  transform: scale(1.035);
  filter: saturate(1) contrast(1.05);
}

.video-play {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: clamp(62px, 18vw, 92px);
  aspect-ratio: 1.42 / 1;
  border-radius: 18px;
  background: #ff1f1f;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.32);
  transform: translate(-50%, -50%);
}

.video-play::after {
  position: absolute;
  left: 52%;
  top: 50%;
  content: "";
  width: 0;
  height: 0;
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  border-left: 22px solid #fff;
  transform: translate(-38%, -50%);
}

.youtube-frame.is-empty {
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.youtube-card-title {
  max-width: 10em;
  margin: 10px 0 0;
  font-family: var(--display);
  font-size: clamp(36px, 11vw, 68px);
  font-weight: 700;
  line-height: 0.9;
  text-transform: uppercase;
}

.poster {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--graphite);
  isolation: isolate;
}

.poster::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.74), rgba(0, 0, 0, 0.18) 48%, rgba(0, 0, 0, 0.04)),
    linear-gradient(0deg, rgba(0, 0, 0, 0.36), transparent 56%);
}

.post-card.tone-light .poster::after,
.post-card.tone-warm .poster::after {
  background:
    linear-gradient(90deg, rgba(18, 16, 14, 0.62), rgba(18, 16, 14, 0.11) 48%, rgba(255, 255, 255, 0.05)),
    linear-gradient(0deg, rgba(16, 13, 10, 0.22), transparent 58%);
}

.poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.82) contrast(1.04);
  transform: scale(1.01);
}

.poster h2 {
  position: absolute;
  left: clamp(18px, 5vw, 36px);
  bottom: clamp(12px, 4vw, 26px);
  z-index: 2;
  max-width: min(68%, 430px);
  margin: 0;
  color: #fff;
  font-family: var(--display);
  font-size: clamp(58px, 17vw, 118px);
  font-weight: 700;
  line-height: 0.82;
  text-transform: uppercase;
  text-wrap: balance;
}

.hand-note {
  position: absolute;
  left: clamp(20px, 6vw, 40px);
  top: clamp(14px, 4vw, 30px);
  z-index: 2;
  color: var(--accent);
  font-family: var(--hand);
  font-size: clamp(24px, 7vw, 44px);
  line-height: 0.9;
  transform: rotate(-7deg);
}

.post-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 2px 0;
}

.post-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.post-line span:first-child {
  color: var(--accent);
}

.read-link {
  flex: 0 0 auto;
  font-size: 15px;
  font-weight: 900;
  text-transform: uppercase;
}

.post-card p,
.preview-card p {
  max-width: 58ch;
  margin: 8px 0 0;
  color: #3d3a35;
  font-size: 15px;
  line-height: 1.55;
}

.post-card:active .poster img,
.post-card:hover .poster img {
  transform: scale(1.035);
  transition: transform 320ms ease;
}

.back-link {
  display: inline-flex;
  margin: 6px 0 18px;
  font-size: 15px;
  font-weight: 900;
  text-transform: uppercase;
}

.article {
  padding-bottom: 42px;
}

.article-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0 0 22px;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--graphite);
}

.article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-youtube-frame {
  margin-bottom: 22px;
}

.article h1 {
  max-width: 8.2em;
  margin: 14px 0 22px;
  font-family: var(--display);
  font-size: clamp(64px, 17vw, 112px);
  font-weight: 700;
  line-height: 0.84;
  text-transform: uppercase;
}

.youtube-description {
  max-width: 58ch;
  margin: 0;
  color: #282622;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.55;
}

.article-content {
  max-width: 660px;
}

.article-content p {
  margin: 0 0 22px;
  color: #282622;
  font-size: 17px;
  line-height: 1.72;
}

.article-content .lead {
  color: #111;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
}

.article-content .long-text {
  white-space: normal;
}

.article-content h2 {
  margin: 34px 0 14px;
  font-family: var(--display);
  font-size: clamp(34px, 9vw, 58px);
  line-height: 0.95;
  text-transform: uppercase;
}

.article-content blockquote {
  margin: 30px 0;
  padding: 0 0 0 18px;
  border-left: 3px solid var(--accent);
  color: var(--accent);
  font-size: clamp(24px, 7vw, 38px);
  font-weight: 700;
  line-height: 1.16;
}

.article-image {
  width: min(92%, 560px);
  margin: 30px auto;
}

.article-image img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--graphite);
}

.article-image figcaption {
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 36px 0 0;
}

.post-tags span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  color: #3b3832;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.loading,
.empty-state {
  padding: 60px 0;
}

.empty-state h1 {
  margin: 0 0 18px;
  font-family: var(--display);
  font-size: clamp(42px, 14vw, 84px);
  line-height: 0.92;
  text-transform: uppercase;
}

.primary-link {
  color: var(--accent);
  font-weight: 900;
  text-transform: uppercase;
}

.admin-body {
  background: var(--bg);
}

.admin-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 24px 16px 56px;
}

.login-panel {
  width: min(420px, 100%);
  margin: 12vh auto 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.admin-brand,
.admin-head,
.panel-title,
.save-row,
.blocks-head,
.block-actions,
.admin-post-actions {
  display: flex;
  align-items: center;
}

.admin-brand,
.admin-head,
.panel-title,
.save-row,
.blocks-head {
  justify-content: space-between;
  gap: 18px;
}

.admin-brand {
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-head {
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.admin-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

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

.editor-panel,
.posts-panel,
.preview-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 18px;
}

.side-stack {
  display: grid;
  gap: 18px;
}

.panel-title {
  margin-bottom: 18px;
}

.panel-title h1,
.panel-title h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 34px;
  line-height: 1;
  text-transform: uppercase;
}

.admin-form,
.post-form {
  display: grid;
  gap: 16px;
}

.post-kind-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ebe6dc;
}

.post-kind-switch button {
  min-height: 42px;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.post-kind-switch button.active {
  background: var(--ink);
  color: #fff;
}

.form-row {
  display: grid;
  gap: 14px;
}

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

label {
  display: grid;
  gap: 7px;
  color: #3e3b35;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdfa;
  color: var(--ink);
  outline: none;
  padding: 12px 13px;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
}

.cover-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px dashed #bdb4a6;
  border-radius: var(--radius);
  background: #e7e1d7;
}

.cover-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-frame span {
  position: absolute;
  right: 12px;
  bottom: 10px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(9, 9, 9, 0.78);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.youtube-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f1ede4;
}

.youtube-admin-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px dashed #bdb4a6;
  border-radius: var(--radius);
  background: #111;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.youtube-admin-preview .youtube-frame,
.compact-youtube-frame {
  width: 100%;
  height: 100%;
  border-radius: 0;
}

.blocks-head {
  align-items: flex-start;
  margin-top: 6px;
}

.seo-box {
  display: grid;
  gap: 14px;
  margin-top: 4px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f1ede4;
}

.blocks-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 28px;
  text-transform: uppercase;
}

.block-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.block-actions button,
.ghost-action,
.admin-post-actions button,
.admin-post-actions a {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.primary-action {
  border: 0;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  padding: 13px 18px;
  font-weight: 900;
  text-transform: uppercase;
}

.text-block {
  display: grid;
  grid-template-columns: 150px 1fr 42px;
  gap: 10px;
  align-items: start;
  margin-bottom: 10px;
}

.block-main {
  display: grid;
  gap: 8px;
}

.block-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  text-transform: none;
}

.inline-image-upload {
  display: grid;
  gap: 7px;
}

.inline-image-frame {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px dashed #bdb4a6;
  border-radius: var(--radius);
  background: #e7e1d7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.inline-image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.text-block-tools {
  display: grid;
  gap: 5px;
}

.text-block-tools button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-size: 22px;
  line-height: 1;
}

.admin-preview {
  display: grid;
  gap: 18px;
}

.admin-preview .poster h2 {
  font-size: clamp(42px, 7vw, 68px);
}

.admin-preview .hand-note {
  font-size: 27px;
}

.admin-preview .article-content p {
  font-size: 14px;
  line-height: 1.62;
}

.admin-preview .article-content .lead {
  font-size: 16px;
}

.admin-preview .article-content h2 {
  font-size: 30px;
}

.admin-preview .article-content blockquote {
  font-size: 22px;
}

.admin-preview .article-image {
  width: min(92%, 320px);
  margin: 18px auto;
}

.form-error,
.save-message {
  min-height: 22px;
  margin: 0;
  color: var(--accent);
  font-weight: 800;
}

.admin-posts {
  display: grid;
  gap: 12px;
}

.admin-post {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.admin-post:last-child {
  border-bottom: 0;
}

.admin-post img {
  width: 96px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  object-fit: cover;
}

.admin-post h3 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 23px;
  line-height: 0.95;
  text-transform: uppercase;
}

.admin-post p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-post-actions {
  flex-wrap: wrap;
  gap: 7px;
}

@media (min-width: 900px) {
  .site-top,
  .app-shell {
    width: min(100%, 640px);
  }

  .app-shell {
    padding-bottom: 70px;
  }
}

@media (max-width: 820px) {
  .admin-grid,
  .form-row.two,
  .text-block {
    grid-template-columns: 1fr;
  }

  .admin-shell {
    padding-inline: 12px;
  }

  .editor-panel,
  .posts-panel,
  .login-panel {
    padding: 14px;
  }
}

@media (max-width: 430px) {
  .site-top,
  .app-shell {
    padding-inline: 12px;
  }

  .feed-list {
    gap: 24px;
  }

  .poster h2 {
    font-size: clamp(50px, 17vw, 76px);
  }

  .post-card-bottom {
    align-items: flex-start;
  }
}
