/* ==========================================================================
   promptcraft.art — «ламповая» тема
   Тёплый CRT-полумрак, янтарное свечение, наклейки.
   ========================================================================== */

:root {
  /* Палитра */
  --void:      #171210;   /* тёплый почти-чёрный */
  --void-2:    #1E1714;
  --panel:     #241B16;
  --panel-hi:  #30241C;
  --line:      #403126;

  --phos:      #FFAE3D;   /* янтарь лампы — главный акцент */
  --phos-deep: #E0842A;
  --berry:     #FF5C7A;   /* наклейки, «новое» */
  --mint:      #7BE0C4;   /* ссылки, метаданные */

  --cream:     #F4E9D8;
  --dim:       #A6907C;
  --dimmer:    #71604F;

  /* Типографика */
  --display: 'Unbounded', 'Arial Black', sans-serif;
  --body:    'Onest', ui-sans-serif, system-ui, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, 'Courier New', monospace;

  /* Скелет */
  --wrap: 1180px;
  --r:    14px;
  --r-sm: 8px;

  --glow: 0 0 24px rgba(255, 174, 61, .28);
  --lift: 0 10px 0 -2px var(--line), 0 22px 40px rgba(0, 0, 0, .55);
}

/* ─────────────────────────── Основа ─────────────────────────── */

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 620px at 50% -8%, rgba(255, 174, 61, .10), transparent 62%),
    radial-gradient(700px 500px at 92% 8%, rgba(255, 92, 122, .07), transparent 60%),
    var(--void);
  color: var(--cream);
  font-family: var(--body);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Зерно плёнки + строчная развёртка — «лампового» без этого не бывает */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: .30;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='.42'/></svg>");
  mix-blend-mode: overlay;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: .16;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, .55) 0 1px,
    transparent 1px 3px
  );
}

.wrap {
  width: min(100% - 2.4rem, var(--wrap));
  margin-inline: auto;
}

a {
  color: var(--mint);
  text-decoration-color: color-mix(in srgb, var(--mint) 40%, transparent);
  text-underline-offset: 3px;
}
a:hover { color: var(--phos); }

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

:focus-visible {
  outline: 3px solid var(--phos);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ─────────────────────────── Типографика ────────────────────── */

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.06;
  margin: 0 0 .5em;
}

h1 { font-size: clamp(2.1rem, 5.4vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.2rem; }

.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--phos);
}

.muted { color: var(--dim); }

.meta {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--dim);
  letter-spacing: .02em;
}

/* ─────────────────────────── Лампа ──────────────────────────── */
/* Подпись сайта: настоящая радиолампа, которая греется и подрагивает. */

.lamp {
  width: 26px;
  height: 40px;
  flex: none;
  filter: drop-shadow(0 0 10px rgba(255, 174, 61, .75));
  animation: filament 5.5s ease-in-out infinite;
}
.lamp .glass  { fill: rgba(255, 174, 61, .10); stroke: var(--phos-deep); stroke-width: 1.4; }
.lamp .wire   { stroke: var(--phos); stroke-width: 1.6; fill: none; }
.lamp .base   { fill: var(--line); }
.lamp .halo   { fill: var(--phos); opacity: .30; }

@keyframes filament {
  0%, 100%  { opacity: 1; }
  46%       { opacity: .92; }
  48%       { opacity: .58; }
  50%       { opacity: 1; }
  73%       { opacity: .8; }
  75%       { opacity: 1; }
}

/* ─────────────────────────── Шапка ──────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--void) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}

.site-header__in {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  padding: .8rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
  color: var(--cream);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.06rem;
  letter-spacing: -.03em;
}
.brand:hover { color: var(--cream); }
.brand b { color: var(--phos); font-weight: 800; }

.nav {
  display: flex;
  align-items: center;
  gap: .3rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.nav a {
  font-family: var(--mono);
  font-size: .8rem;
  text-transform: lowercase;
  letter-spacing: .04em;
  color: var(--dim);
  text-decoration: none;
  padding: .45rem .7rem;
  border-radius: var(--r-sm);
}
.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--phos);
  background: rgba(255, 174, 61, .10);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--line);
  color: var(--cream);
  border-radius: var(--r-sm);
  padding: .4rem .6rem;
  font-family: var(--mono);
  cursor: pointer;
}

/* ─────────────────────────── Кнопки ─────────────────────────── */

.btn {
  --btn-bg: var(--phos);
  --btn-fg: #1B1207;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .62rem 1.15rem;
  border: 1.5px solid #0000;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--mono);
  font-size: .84rem;
  font-weight: 600;
  letter-spacing: .01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease;
}
.btn:hover {
  color: var(--btn-fg);
  transform: translateY(-2px);
  box-shadow: var(--glow);
}
.btn:active { transform: translateY(0); }

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--cream);
  border-color: var(--line);
}
.btn--ghost:hover { background: var(--panel-hi); box-shadow: none; }

.btn--berry { --btn-bg: var(--berry); --btn-fg: #1B0A0E; }
.btn--danger { --btn-bg: transparent; --btn-fg: var(--berry); border-color: var(--berry); }
.btn--wide { width: 100%; justify-content: center; }
.btn--sm { padding: .38rem .8rem; font-size: .76rem; }

/* ─────────────────────────── Наклейки-теги ──────────────────── */

.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: .72rem;
  padding: .2rem .58rem;
  border-radius: 4px;
  background: var(--panel-hi);
  color: var(--phos);
  border: 1px solid var(--line);
  text-decoration: none;
  white-space: nowrap;
}
.tag:hover { background: var(--phos); color: #1B1207; border-color: var(--phos); }

.tag-row { display: flex; flex-wrap: wrap; gap: .35rem; }

/* ─────────────────────────── Главный экран ──────────────────── */

.hero {
  padding: clamp(2.6rem, 8vw, 5.2rem) 0 2.2rem;
  border-bottom: 1px dashed var(--line);
  position: relative;
}

.hero h1 {
  max-width: 15ch;
  text-wrap: balance;
}
.hero h1 em {
  font-style: normal;
  color: var(--phos);
  text-shadow: 0 0 30px rgba(255, 174, 61, .5);
}

.hero p {
  max-width: 46ch;
  color: var(--dim);
  font-size: 1.05rem;
}

.hero__actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.6rem; }

/* Бегущая строка — как титры на кассете */
.ticker {
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: var(--void-2);
  margin-top: 2.4rem;
}
.ticker__track {
  display: flex;
  gap: 2.5rem;
  width: max-content;
  padding: .5rem 0;
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--dimmer);
  animation: slide 38s linear infinite;
}
.ticker__track span { white-space: nowrap; }
.ticker__track b { color: var(--phos); font-weight: 500; }

@keyframes slide {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ─────────────────────────── Лента ──────────────────────────── */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 3rem 0 1.3rem;
  flex-wrap: wrap;
}

.feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.4rem;
  padding-bottom: 3rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover {
  transform: translateY(-5px) rotate(-.35deg);
  border-color: var(--phos-deep);
  box-shadow: var(--lift);
  color: inherit;
}

.card__shot {
  aspect-ratio: 16 / 10;
  background: var(--void-2);
  overflow: hidden;
}
.card__shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.2, .7, .3, 1);
}
.card:hover .card__shot img { transform: scale(1.05); }

.card__shot--empty {
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .2em;
  color: var(--dimmer);
  background:
    repeating-linear-gradient(45deg, var(--void-2) 0 12px, var(--panel) 12px 24px);
}

.card__body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }

.card__title {
  font-family: var(--display);
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.02em;
  margin: 0;
}
.card:hover .card__title { color: var(--phos); }

.card__excerpt { font-size: .9rem; color: var(--dim); margin: 0; }

.card__foot {
  margin-top: auto;
  padding-top: .6rem;
  border-top: 1px dashed var(--line);
  display: flex;
  align-items: center;
  gap: .9rem;
  font-family: var(--mono);
  font-size: .74rem;
  color: var(--dimmer);
}

/* Ярлык «есть архив» — приклеен поверх обложки под углом */
.sticker {
  position: absolute;
  top: .8rem;
  right: -.35rem;
  z-index: 2;
  transform: rotate(4deg);
  background: var(--berry);
  color: #1B0A0E;
  font-family: var(--mono);
  font-weight: 700;
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .22rem .6rem;
  border-radius: 3px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .5);
}
.sticker--amber { background: var(--phos); color: #1B1207; transform: rotate(-3deg); }

/* ─────────────────────────── Страница поста ─────────────────── */

.post {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
}

.post__head { margin-bottom: 1.8rem; }
.post__head h1 { margin-bottom: .6rem; text-wrap: balance; }

.post__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .9rem;
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--dim);
}

.post__cover {
  border-radius: var(--r);
  border: 1px solid var(--line);
  overflow: hidden;
  margin-bottom: 2rem;
}

.prose { font-size: 1.06rem; }
.prose p { margin: 0 0 1.15em; }
.prose code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--panel-hi);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: .1em .35em;
  color: var(--phos);
}
.prose blockquote {
  margin: 1.6em 0;
  padding: .3rem 0 .3rem 1.2rem;
  border-left: 3px solid var(--phos);
  color: var(--dim);
  font-style: italic;
}

/* Галерея */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .8rem;
  margin: 2rem 0;
}
.gallery figure { margin: 0; }
.gallery img {
  width: 100%;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  cursor: zoom-in;
  transition: transform .2s ease;
}
.gallery img:hover { transform: scale(1.02); border-color: var(--phos-deep); }
.gallery figcaption { font-family: var(--mono); font-size: .72rem; color: var(--dimmer); padding-top: .35rem; }

/* Блок скачивания — стилизован под подписанную дискету */
.downloads {
  margin: 2.4rem 0;
  border: 1.5px solid var(--phos-deep);
  border-radius: var(--r);
  background:
    linear-gradient(180deg, rgba(255, 174, 61, .07), transparent 40%),
    var(--panel);
  overflow: hidden;
}
.downloads__head {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .7rem 1.1rem;
  border-bottom: 1px dashed var(--line);
  font-family: var(--mono);
  font-size: .76rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--phos);
}

.dl {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .85rem 1.1rem;
  border-bottom: 1px dashed var(--line);
}
.dl:last-child { border-bottom: 0; }
.dl__icon { flex: none; color: var(--phos); }
.dl__name { font-weight: 600; word-break: break-all; }
.dl__sub { font-family: var(--mono); font-size: .74rem; color: var(--dimmer); }
.dl .btn { margin-left: auto; flex: none; }

.locked {
  padding: 1rem 1.1rem;
  font-size: .92rem;
  color: var(--dim);
}

/* ─────────────────────────── Комментарии ────────────────────── */

.comments { margin-top: 3.4rem; }

.comment {
  display: flex;
  gap: .9rem;
  padding: 1.05rem 0;
  border-top: 1px dashed var(--line);
}

.avatar {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: .95rem;
  color: #1B1207;
  background: var(--phos);
  user-select: none;
}
.avatar--sm { width: 30px; height: 30px; border-radius: 9px; font-size: .78rem; }

.comment__head {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  flex-wrap: wrap;
  margin-bottom: .2rem;
}
.comment__name { font-weight: 700; }
.comment__body { margin: 0; white-space: pre-wrap; word-break: break-word; }

.role-chip {
  font-family: var(--mono);
  font-size: .64rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--berry);
  border: 1px solid var(--berry);
  border-radius: 4px;
  padding: 0 .3rem;
}

/* ─────────────────────────── Формы ──────────────────────────── */

.field { margin-bottom: 1.1rem; }

label {
  display: block;
  font-family: var(--mono);
  font-size: .76rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: .38rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: .72rem .9rem;
  background: var(--void-2);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--cream);
  font-family: var(--body);
  font-size: 1rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { resize: vertical; min-height: 120px; line-height: 1.6; }

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--phos);
  box-shadow: 0 0 0 3px rgba(255, 174, 61, .16);
}

input::placeholder, textarea::placeholder { color: var(--dimmer); }

input[type="file"] {
  font-family: var(--mono);
  font-size: .82rem;
  padding: .6rem;
  cursor: pointer;
}
input[type="file"]::file-selector-button {
  background: var(--panel-hi);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--phos);
  font-family: var(--mono);
  font-size: .78rem;
  padding: .35rem .7rem;
  margin-right: .7rem;
  cursor: pointer;
}

.hint { font-size: .8rem; color: var(--dimmer); margin-top: .3rem; }

.auth {
  max-width: 430px;
  margin: 4rem auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 2rem 1.9rem;
  box-shadow: var(--lift);
}
.auth h1 { font-size: 1.75rem; margin-bottom: .3rem; }
.auth > p.muted { margin-top: 0; font-size: .92rem; }

/* ─────────────────────────── Сообщения ──────────────────────── */

.flash {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  padding: .75rem 1rem;
  border-radius: var(--r-sm);
  border-left: 3px solid var(--mint);
  background: color-mix(in srgb, var(--mint) 12%, var(--panel));
  margin: 1.1rem 0;
  font-size: .93rem;
}
.flash--err  { border-color: var(--berry); background: color-mix(in srgb, var(--berry) 12%, var(--panel)); }
.flash--warn { border-color: var(--phos);  background: color-mix(in srgb, var(--phos) 12%, var(--panel)); }

.errors { list-style: none; padding: 0; margin: 0; }
.errors li { margin: .2rem 0; }

.empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--dim);
  border: 1px dashed var(--line);
  border-radius: var(--r);
}
.empty h3 { color: var(--cream); }

/* ─────────────────────────── Пагинация ──────────────────────── */

.pager {
  display: flex;
  justify-content: center;
  gap: .4rem;
  padding: 1rem 0 4rem;
  flex-wrap: wrap;
}
.pager a, .pager span {
  font-family: var(--mono);
  font-size: .84rem;
  padding: .45rem .8rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  text-decoration: none;
  color: var(--dim);
}
.pager a:hover { border-color: var(--phos); color: var(--phos); }
.pager .is-current { background: var(--phos); color: #1B1207; border-color: var(--phos); }

/* ─────────────────────────── Подвал ─────────────────────────── */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.2rem 0 3rem;
  margin-top: auto;
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--dimmer);
}
.site-footer__in { display: flex; gap: 1rem; justify-content: space-between; flex-wrap: wrap; }

/* ─────────────────────────── Лайтбокс ──────────────────────── */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  place-items: center;
  padding: 2rem;
  background: rgba(10, 7, 5, .93);
  backdrop-filter: blur(6px);
  cursor: zoom-out;
}
.lightbox.is-open { display: grid; }
.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: var(--r-sm);
  box-shadow: 0 0 60px rgba(255, 174, 61, .2);
}

/* ─────────────────────────── Адаптив ────────────────────────── */

@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav-toggle { display: block; }
  .nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding-bottom: .6rem;
  }
  .nav.is-open { display: flex; }
  .site-header__in { flex-wrap: wrap; }
  .feed { grid-template-columns: 1fr; }
  .dl { flex-wrap: wrap; }
  .dl .btn { margin-left: 0; width: 100%; justify-content: center; }
}

/* ─────────────────────────── Меньше движения ────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .card:hover { transform: none; }
}
