/* ESPRESSO & BRASS — строгая трёхцветная палитра:
   1. Фон (Espresso):  #161311
   2. Текст (Cream):   #EDE6DA
   3. Акцент (Brass):  #D4A45A
*/
:root {
  color-scheme: dark;
  --bg: #161311;
  --ink: #EDE6DA;
  --brass: #D4A45A;
  --ink-body: rgba(237, 230, 218, 0.84);
  --ink-soft: rgba(237, 230, 218, 0.66);
  --ink-faint: rgba(237, 230, 218, 0.4);
  --brass-soft: rgba(212, 164, 90, 0.14);
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --width: 980px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 36px; }

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image: radial-gradient(circle at 82% 0%, rgba(212, 164, 90, 0.065), transparent 52%);
  color: var(--ink);
  font: 400 16px/1.75 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration-color: rgba(237, 230, 218, 0.28);
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
  transition: color 180ms ease, text-decoration-color 180ms ease;
}
a:hover {
  color: var(--brass);
  text-decoration-color: var(--brass);
}
:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 4px;
  border-radius: 3px;
}

p { margin: 0 0 1.15rem; }
h1, h2, h3 { margin: 0; font-weight: 400; }

.wrap {
  width: min(var(--width), calc(100% - 56px));
  margin-inline: auto;
}
.muted { color: var(--ink-soft); }
.mono { font-family: var(--mono); font-size: 0.9em; }

.skip-link {
  position: absolute;
  z-index: 80;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  background: var(--brass);
  color: var(--bg);
  text-decoration: none;
  font-weight: 500;
  transform: translateY(-200%);
}
.skip-link:focus { transform: translateY(0); color: var(--bg); }

#page-content {
  transition: opacity 140ms ease;
}
#page-content.is-leaving {
  opacity: 0.35;
}

/* ШАПКА */
.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-block: 40px 24px;
}
.brand {
  font-family: var(--serif);
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.site-header nav {
  display: flex;
  gap: 28px;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.site-header nav a { text-decoration: none; }
.site-header nav a:hover,
.site-header nav a[aria-current="page"] { color: var(--brass); }

/* ГЛАВНЫЙ ЭКРАН */
.hero {
  padding-block: clamp(56px, 8vw, 108px) clamp(40px, 5vw, 64px);
  max-width: 680px;
}
.hero-place {
  font-size: 0.85rem;
  color: var(--brass);
  margin-bottom: 18px;
  letter-spacing: 0.01em;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 5.8vw, 4.3rem);
  line-height: 1.07;
  letter-spacing: -0.025em;
  max-width: 15ch;
}
.hero h1 em {
  font-style: italic;
  color: var(--brass);
}
.hero-lead {
  margin-top: 24px;
  max-width: 50ch;
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.75;
}
.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 28px;
  font-size: 0.92rem;
}
.hero-links a {
  text-decoration: none;
  color: var(--ink-soft);
}
.hero-links a:hover { color: var(--ink); }
.link-accent {
  color: var(--brass) !important;
  text-decoration: underline !important;
  text-decoration-color: rgba(212, 164, 90, 0.5) !important;
  text-underline-offset: 6px;
}
.link-accent:hover {
  text-decoration-color: var(--brass) !important;
}

/* РАЗДЕЛЫ ПОРТФОЛИО — воздух вместо полосок */
.section {
  padding-top: clamp(64px, 9vw, 104px);
}
.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 30px;
}
.section-title {
  font-family: var(--serif);
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.section > .section-title {
  margin-bottom: 24px;
}
.side-note {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--brass);
}

.prose-block { max-width: 58ch; }
.follow-link {
  margin-top: 20px;
  margin-bottom: 0;
  font-size: 0.92rem;
}

/* ПРОЕКТЫ КАК ТРЕКЛИСТ */
.tracklist {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 40px;
  max-width: 640px;
}
.track {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 16px;
  align-items: baseline;
}
.track-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--brass);
}
.track-body h3 {
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.25;
  margin-bottom: 8px;
}
.track-body h3 a { text-decoration: none; }
.track-body h3 a:hover { color: var(--brass); }
.track-body p {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin-bottom: 10px;
}
.track-meta {
  font-size: 0.82rem !important;
  color: var(--ink-faint) !important;
  margin-bottom: 0 !important;
  letter-spacing: 0.02em;
}

/* ИНСТРУМЕНТЫ */
.tools-list {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 280px));
  gap: 28px 56px;
}
.tools-list dt {
  font-size: 0.8rem;
  color: var(--brass);
  margin-bottom: 4px;
}
.tools-list dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.96rem;
}

/* БЛОГ: лента постов вниз + компактная плавающая панелька справа */
.blog-layout {
  display: grid;
  grid-template-columns: minmax(0, 640px) 236px;
  justify-content: space-between;
  gap: 64px;
  align-items: start;
  padding-top: 28px;
}

.feed { min-width: 0; }
.post { scroll-margin-top: 44px; }
.post + .post { margin-top: 104px; }
.post + .post::before {
  content: "·  ·  ·";
  display: block;
  margin-bottom: 56px;
  color: var(--brass);
  opacity: 0.55;
  font-size: 1rem;
  letter-spacing: 0.25em;
}
.post-date {
  display: block;
  font-size: 0.84rem;
  color: var(--brass);
  margin-bottom: 14px;
}
.post h1 {
  margin: 0 0 32px;
  font-family: var(--serif);
  font-size: clamp(2rem, 4.2vw, 3.05rem);
  line-height: 1.12;
  font-weight: 400;
  letter-spacing: -0.025em;
}
.post h1 em {
  color: var(--brass);
  font-style: normal;
}

.prose {
  color: var(--ink-body);
  font: 400 1.14rem/1.85 var(--serif);
  overflow-wrap: anywhere;
}
.prose p { margin: 0 0 1.35em; }
.prose p:last-child { margin-bottom: 0; }
.prose h2 {
  color: var(--ink);
  font: 400 1.5rem/1.3 var(--serif);
  margin: 2em 0 0.7em;
}
.prose h3 {
  color: var(--ink);
  font: 500 1.08rem/1.4 var(--sans);
  margin: 1.7em 0 0.6em;
}
.prose a { color: var(--brass); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose strong { color: var(--ink); font-weight: 500; }
.prose code { font-family: var(--mono); font-size: 0.78em; }
.prose :not(pre) > code {
  color: var(--brass);
  background: var(--brass-soft);
  padding: 2px 6px;
  border-radius: 3px;
}
pre {
  overflow-x: auto;
  max-width: 100%;
  padding: 22px;
  margin: 28px 0;
  line-height: 1.65;
  background: rgba(237, 230, 218, 0.04);
  border-radius: 6px;
  color: var(--ink);
}
blockquote {
  border-left: 2px solid var(--brass);
  padding: 4px 0 4px 20px;
  margin: 28px 0;
  font-style: italic;
  color: var(--ink);
}
blockquote p:last-child { margin: 0; }

figure { margin: 34px 0 8px; }
figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 5px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
}
figcaption {
  margin-top: 12px;
  color: var(--ink-faint);
  font: 400 0.82rem/1.6 var(--sans);
}

.side-panel {
  position: sticky;
  top: 40px;
}
.picker-heading {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--brass);
}
.picker-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.picker-list a {
  position: relative;
  display: block;
  padding-left: 14px;
  text-decoration: none;
  color: var(--ink-soft);
  transition: color 180ms ease;
}
.picker-list a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brass);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 200ms ease, transform 200ms ease;
}
.picker-list a:hover,
.picker-list a[aria-current="true"] {
  color: var(--ink);
}
.picker-list a[aria-current="true"]::before {
  opacity: 1;
  transform: scale(1);
}
.picker-title {
  display: block;
  font-size: 0.85rem;
  line-height: 1.45;
}
.picker-list time {
  display: block;
  margin-top: 2px;
  font-size: 0.74rem;
  color: var(--ink-faint);
}
.picker-list a[aria-current="true"] time {
  color: var(--brass);
}

/* СТРАНИЦА РЕЗЮМЕ */
.resume-wrap {
  width: min(760px, calc(100% - 56px));
  margin: 40px auto 32px;
}
.resume-wip {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 20px;
}
.resume-wip-gif {
  display: block;
  width: 144px;
  height: auto;
  margin: 22px 0 28px;
  border-radius: 6px;
}
.resume-wip h1 {
  font-family: var(--serif);
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  letter-spacing: -0.025em;
}
.resume-wip h1 em {
  color: var(--brass);
  font-style: italic;
}
.resume-wip p.muted {
  max-width: 44ch;
  margin: 14px 0 0;
}
.resume-wip .hero-links {
  justify-content: center;
}

.resume-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  font-size: 0.88rem;
}
.resume-sheet {
  background: var(--ink);
  color: var(--bg);
  padding: 56px;
  border-radius: 4px;
}
.resume-sheet a { color: inherit; }
.resume-date { font-size: 0.8rem; color: #8c642a; margin-bottom: 12px; }
.resume-header h1 { font-family: var(--serif); font-size: clamp(2.1rem, 5vw, 3rem); letter-spacing: -0.02em; }
.resume-role { font-size: 0.98rem; opacity: 0.75; margin-top: 8px; }
.resume-contacts { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 0.82rem; margin-top: 14px; }
.resume-section { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 28px; margin-top: 32px; font-size: 0.88rem; }
.resume-section h2 { font-family: var(--serif); font-size: 1rem; color: #8c642a; }
.resume-section h3 { font-size: 0.98rem; font-weight: 600; margin-bottom: 4px; }
.resume-line { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.resume-line > span, .resume-secondary { font-size: 0.8rem; opacity: 0.65; }
.resume-next { margin-top: 20px; }
.resume-skills p { display: grid; grid-template-columns: 115px 1fr; gap: 12px; margin-bottom: 8px; }
.language-list p { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 6px; }
.resume-end { margin-top: 36px; font-size: 0.78rem; opacity: 0.55; }

/* СТРАНИЦА 404 */
.error-page {
  padding-block: 88px 40px;
  max-width: 520px;
}
.error-page h1 {
  font-family: var(--serif);
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  line-height: 1.12;
  margin: 12px 0 18px;
}
.error-page h1 em {
  color: var(--brass);
  font-style: normal;
}
.error-page p {
  color: var(--ink-soft);
  margin: 0 0 24px;
}

/* ФУТЕР — с запасом снизу под плавающий плеер */
.site-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-block: 76px 124px;
  color: var(--ink-faint);
  font-size: 0.82rem;
}
.site-footer p { margin: 0; }
.site-footer a { text-decoration: none; }

/* ПАРЯЩИЙ ВИНИЛОВЫЙ ДЖАЗ-ПЛЕЕР ПОВЕРХ ВСЕХ СТРАНИЦ */
.jazz-dock {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
}

.jazz-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 16px 12px 13px;
  border-radius: 14px;
  background: rgba(22, 19, 17, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.58),
    0 0 0 1px rgba(237, 230, 218, 0.08);
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1), opacity 200ms ease;
}

.vinyl-stage {
  position: relative;
  display: block;
  width: 98px;
  height: 70px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.vinyl-disc {
  position: absolute;
  top: 2px;
  left: 22px;
  width: 66px;
  height: 66px;
  display: block;
  transform: translateX(0);
  transition: transform 550ms cubic-bezier(0.22, 1, 0.36, 1);
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.55));
}
.vinyl-stage:hover .vinyl-disc {
  transform: translateX(6px);
}
.jazz-dock.is-playing .vinyl-disc {
  transform: translateX(14px);
}
.vinyl-disc svg,
.jazz-mini-disc svg {
  display: block;
  width: 100%;
  height: 100%;
  animation: vinylSpin 16s linear infinite;
  animation-play-state: paused;
}
.jazz-dock.is-playing .vinyl-disc svg,
.jazz-dock.is-playing .jazz-mini-disc svg {
  animation-play-state: running;
}

@keyframes vinylSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.vinyl-sleeve {
  position: relative;
  z-index: 2;
  display: block;
  width: 70px;
  height: 70px;
  border-radius: 5px;
  overflow: hidden;
  background: #211c18;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55);
}
.vinyl-cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(0.32) contrast(1.06) brightness(0.84);
  transition: transform 450ms ease, filter 280ms ease;
}
.vinyl-stage:hover .vinyl-cover {
  transform: scale(1.04);
  filter: sepia(0.2) contrast(1.06) brightness(0.92);
}

.vinyl-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: radial-gradient(circle, rgba(22, 19, 17, 0.44), rgba(22, 19, 17, 0.14));
  opacity: 0.85;
  transition: opacity 200ms ease, color 200ms ease;
}
.vinyl-stage:hover .vinyl-overlay {
  opacity: 1;
  color: var(--brass);
}
.vinyl-overlay .icon-pause { display: none; }
.jazz-dock.is-playing .vinyl-overlay { opacity: 0; }
.jazz-dock.is-playing .vinyl-stage:hover .vinyl-overlay,
.jazz-dock.is-playing .vinyl-stage:focus-visible .vinyl-overlay { opacity: 1; }
.jazz-dock.is-playing .vinyl-overlay .icon-play { display: none; }
.jazz-dock.is-playing .vinyl-overlay .icon-pause { display: block; }

.vinyl-meta {
  width: 172px;
  min-width: 0;
}
.vinyl-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}
.vinyl-status {
  margin: 0;
  font-size: 0.7rem;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.jazz-dock.is-playing .vinyl-status {
  color: var(--brass);
}
.jazz-min-btn {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin: -3px -4px 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease;
}
.jazz-min-btn:hover {
  color: var(--ink);
  background: rgba(237, 230, 218, 0.08);
}

.vinyl-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 0.98rem;
  line-height: 1.25;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vinyl-subtitle {
  margin: 2px 0 0;
  font-size: 0.74rem;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vinyl-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
}
.text-action {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-faint);
  font: inherit;
  font-size: 0.74rem;
  text-decoration: none;
  cursor: pointer;
  transition: color 180ms ease;
}
.text-action:hover { color: var(--brass); }

/* Свёрнутое состояние — одна маленькая крутящаяся пластинка в углу */
.jazz-mini-disc {
  display: none;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.58);
  transition: transform 220ms ease, box-shadow 260ms ease;
}
.jazz-mini-disc:hover {
  transform: scale(1.07);
}
.jazz-dock.is-playing .jazz-mini-disc {
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.58),
    0 0 0 1px rgba(212, 164, 90, 0.45),
    0 0 24px rgba(212, 164, 90, 0.22);
}

.jazz-dock.is-collapsed .jazz-card {
  display: none;
}
.jazz-dock.is-collapsed .jazz-mini-disc {
  display: block;
}

/* АДАПТАЦИЯ */
@media (max-width: 900px) {
  .blog-layout {
    grid-template-columns: 1fr;
    gap: 44px;
    padding-top: 8px;
  }
  .side-panel {
    position: static;
    order: -1;
  }
  .picker-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px 20px;
  }
}

@media (max-width: 600px) {
  .wrap, .resume-wrap { width: calc(100% - 40px); }
  .site-header { padding-block: 28px 16px; }
  .hero { padding-block: 40px 32px; }
  .tools-list {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .prose { font-size: 1.06rem; }
  .post + .post { margin-top: 76px; }
  .post + .post::before { margin-bottom: 40px; }
  .resume-sheet { padding: 28px 22px; }
  .resume-section { grid-template-columns: 1fr; gap: 10px; }
  .resume-skills p { grid-template-columns: 1fr; gap: 2px; }

  .jazz-dock {
    right: 16px;
    bottom: 16px;
  }
  .jazz-card {
    max-width: calc(100vw - 32px);
    gap: 14px;
    padding: 10px 14px 10px 12px;
  }
  .vinyl-meta {
    width: auto;
    max-width: 158px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #page-content,
  .vinyl-disc,
  .vinyl-disc svg,
  .jazz-mini-disc svg,
  .vinyl-cover {
    transition: none;
    animation: none;
  }
}

@page { size: A4; margin: 15mm; }
@media print {
  :root { color-scheme: light; }
  body { background: white; color: #161311; font-size: 10pt; }
  .site-header, .site-footer, .resume-toolbar, .skip-link, .jazz-dock { display: none !important; }
  .resume-wrap { width: 100%; margin: 0; }
  .resume-sheet { padding: 0; background: white; }
}
