/* ==========================================================================
   chikulev.ru — Personal Editorial Monograph
   Warm cotton paper, serif + sans, uncropped archival portrait, tactile details.
   ========================================================================== */

@font-face {
  font-family: 'InterLocal';
  src: url('./Inter-Regular.woff2') format('woff2'),
       url('./Inter-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #F6F3EC;
  --paper-alt: #EFEAE0;
  --surface: #FDFCF9;
  --ink: #191816;
  --ink-soft: #5A5751;
  --ink-muted: #8C877E;
  --rule: rgba(25, 24, 22, 0.11);
  --rule-strong: rgba(25, 24, 22, 0.24);
  --accent: #A34322;
  --accent-soft: rgba(163, 67, 34, 0.10);

  --font-serif: 'Literata', 'Georgia', 'Times New Roman', serif;
  --font-sans: 'Inter', 'InterLocal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --measure: 660px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  --paper: #131210;
  --paper-alt: #1B1A17;
  --surface: #1F1D1A;
  --ink: #EAE5DC;
  --ink-soft: #A59F94;
  --ink-muted: #706B62;
  --rule: rgba(234, 229, 220, 0.11);
  --rule-strong: rgba(234, 229, 220, 0.24);
  --accent: #D97A54;
  --accent-soft: rgba(217, 122, 84, 0.14);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.68;
  transition: background-color 0.32s var(--ease), color 0.32s var(--ease);
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

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

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

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

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Page Shell & Masthead
   ========================================================================== */
.sheet {
  width: 100%;
  max-width: calc(var(--measure) + 64px);
  margin: 0 auto;
  padding: 52px 32px 96px;
}

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 60px;
}

.masthead-brand {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.masthead-nav {
  display: flex;
  align-items: baseline;
  gap: 24px;
  font-size: 14px;
  color: var(--ink-soft);
}

.masthead-nav a {
  position: relative;
  padding-bottom: 2px;
  transition: color 0.18s ease;
}

.masthead-nav a:hover,
.masthead-nav a.is-active {
  color: var(--ink);
}

.masthead-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1.5px;
  background: var(--accent);
}

.theme-text-btn {
  font-size: 13px;
  color: var(--ink-muted);
  transition: color 0.18s ease;
  margin-left: 4px;
}

.theme-text-btn:hover {
  color: var(--ink);
}

/* ==========================================================================
   Opening / Archival Uncropped Portrait Frame
   ========================================================================== */
.opening {
  margin-bottom: 56px;
}

.author-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
}

.author-frame {
  width: 72px;
  height: 88px;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--paper-alt) 100%);
  border: 1px solid var(--rule-strong);
  padding: 6px 4px 0 4px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  cursor: zoom-in;
  box-shadow: 0 2px 10px rgba(25, 24, 22, 0.05);
  transition: transform 0.35s var(--ease), border-color 0.2s ease, box-shadow 0.3s ease;
}

.author-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 -10px 14px -10px rgba(25, 24, 22, 0.22);
  pointer-events: none;
}

.author-frame:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(25, 24, 22, 0.09);
}

.author-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
  filter: grayscale(100%) contrast(1.04);
  transition: filter 0.35s ease, transform 0.35s var(--ease);
}

.author-frame:hover img {
  filter: grayscale(10%) contrast(1.02);
  transform: scale(1.03);
}

.author-name {
  font-family: var(--font-serif);
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.author-sub {
  font-size: 14px;
  color: var(--ink-muted);
  margin-top: 4px;
}

/* Editorial Prose */
.prose {
  display: flex;
  flex-direction: column;
  gap: 18px;
  font-size: 16px;
  line-height: 1.72;
  color: var(--ink);
}

.prose p {
  max-width: 62ch;
}

.prose .soft {
  color: var(--ink-soft);
}

.ink-link {
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: text-decoration-color 0.18s ease, color 0.18s ease;
}

.ink-link:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.inline-copy {
  position: relative;
  display: inline;
  border-bottom: 1px dashed var(--rule-strong);
  padding-bottom: 1px;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.inline-copy:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.copy-badge {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 5px);
  transform: translateX(-50%) translateY(4px);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 11px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.2s var(--ease);
  pointer-events: none;
}

.inline-copy.is-copied .copy-badge {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   Editorial Blocks
   ========================================================================== */
.block {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
  position: relative;
}

.block-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 22px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

/* ==========================================================================
   Skvorling Spotlight & Interactive Micro-Immersion Demo
   ========================================================================== */
.skvorling-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.skvorling-title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.015em;
}

.skvorling-demo {
  margin: 22px 0;
  padding: 20px 22px;
  background: var(--paper-alt);
  border: 1px solid var(--rule);
  border-radius: 6px;
}

.skvorling-demo-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.skvorling-toggle {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--rule-strong);
  background: var(--surface);
  transition: border-color 0.18s ease, color 0.18s ease;
}

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

.skvorling-sample {
  font-size: 15.5px;
  line-height: 1.78;
  color: var(--ink);
}

.sk-word {
  position: relative;
  display: inline;
  border-bottom: 1.5px dotted var(--accent);
  padding-bottom: 1px;
  cursor: help;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.sk-word:hover,
.sk-word.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 2px;
}

.sk-word.is-off {
  border-bottom-color: transparent;
  cursor: default;
}

.sk-word.is-off:hover {
  color: inherit;
  background: transparent;
}

.sk-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 7px);
  transform: translateX(-50%) translateY(4px);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.25;
  padding: 6px 10px;
  border-radius: 5px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 30;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  transition: opacity 0.16s ease, transform 0.2s var(--ease);
}

.sk-tip .ipa {
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.72;
  margin-left: 6px;
}

.sk-word:not(.is-off):hover .sk-tip,
.sk-word:not(.is-off).is-active .sk-tip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.skvorling-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  font-size: 14.5px;
}

/* ==========================================================================
   Typographic Project Index + Floating Hover Preview
   ========================================================================== */
.index-list {
  display: flex;
  flex-direction: column;
}

.index-row {
  border-bottom: 1px solid var(--rule);
}

.index-row:first-child {
  border-top: 1px solid var(--rule);
}

.index-trigger {
  width: 100%;
  display: grid;
  grid-template-columns: 185px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 16px;
  padding: 15px 6px;
  text-align: left;
  transition: background-color 0.2s ease, padding-left 0.22s var(--ease);
}

.index-trigger:hover {
  background: var(--paper-alt);
  padding-left: 12px;
}

.index-name {
  font-weight: 500;
  font-size: 15px;
  color: var(--ink);
}

.index-summary {
  font-size: 14px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.index-arrow {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-muted);
  transition: transform 0.2s var(--ease), color 0.2s ease;
}

.index-trigger:hover .index-arrow {
  color: var(--accent);
}

.index-row.is-open .index-arrow {
  color: var(--accent);
  transform: rotate(45deg);
}

.index-detail {
  display: none;
  padding: 4px 12px 22px 12px;
  background: var(--paper-alt);
}

.index-row.is-open .index-detail {
  display: block;
}

.index-row.is-open .index-trigger {
  background: var(--paper-alt);
  padding-left: 12px;
}

.detail-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 20px;
  align-items: start;
  padding-top: 8px;
}

.detail-inner--text-only {
  grid-template-columns: 1fr;
}

.detail-text {
  font-size: 14px;
  line-height: 1.62;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13.5px;
}

.detail-thumb {
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--rule-strong);
  background: var(--surface);
  aspect-ratio: 16 / 10;
  cursor: zoom-in;
}

.detail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.hover-preview {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  box-shadow: 0 22px 48px rgba(25, 24, 22, 0.18);
  pointer-events: none;
  z-index: 150;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.18s ease, transform 0.22s var(--ease);
}

.hover-preview.is-visible {
  opacity: 1;
  transform: scale(1);
}

.hover-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* ==========================================================================
   Offline / Craft List
   ========================================================================== */
.craft-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.craft-item {
  display: grid;
  grid-template-columns: 155px minmax(0, 1fr);
  gap: 18px;
  align-items: baseline;
}

.craft-key {
  font-size: 14.5px;
  font-weight: 500;
}

.craft-desc {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.62;
}

/* ==========================================================================
   Contacts Page
   ========================================================================== */
.contact-table {
  display: flex;
  flex-direction: column;
}

.contact-line {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--rule);
}

.contact-line:first-child {
  border-top: 1px solid var(--rule);
}

.contact-k {
  font-size: 13.5px;
  color: var(--ink-muted);
}

.contact-v {
  font-size: 15px;
  color: var(--ink);
}

.contact-ops {
  display: flex;
  gap: 14px;
  font-size: 13px;
  color: var(--ink-soft);
}

.qr-inline {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 36px;
  padding: 20px;
  background: var(--paper-alt);
  border: 1px solid var(--rule);
  border-radius: 6px;
}

.qr-box {
  width: 112px;
  height: 112px;
  background: #FFFFFF;
  padding: 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

.qr-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ==========================================================================
   Footer Colophon
   ========================================================================== */
.colophon {
  margin-top: 76px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 24px;
  font-size: 13px;
  color: var(--ink-muted);
}

.colophon-links {
  display: flex;
  gap: 16px;
}

.colophon-links a:hover {
  color: var(--ink);
}

/* ==========================================================================
   Lightbox
   ========================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(18, 17, 15, 0.92);
  backdrop-filter: blur(6px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox.is-open {
  display: flex;
}

.lb-top {
  position: fixed;
  top: 20px;
  left: 28px;
  right: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #EAE5DC;
  font-size: 13px;
}

.lb-controls {
  display: flex;
  gap: 14px;
}

.lb-btn {
  color: #EAE5DC;
  font-size: 13.5px;
  opacity: 0.8;
  transition: opacity 0.15s ease;
}

.lb-btn:hover {
  opacity: 1;
}

.lb-img {
  max-width: 90vw;
  max-height: 78vh;
  border-radius: 4px;
  background: #FFFFFF;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.55);
}

.lb-cap {
  margin-top: 16px;
  color: #C7C2B8;
  font-size: 14px;
  text-align: center;
  max-width: 580px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 720px) {
  .sheet {
    padding: 32px 20px 72px;
  }

  .masthead {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 44px;
  }

  .index-trigger {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 12px;
  }

  .index-summary {
    grid-column: 1 / -1;
    white-space: normal;
  }

  .detail-inner,
  .craft-item,
  .contact-line {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .hover-preview {
    display: none !important;
  }

  .qr-inline {
    flex-direction: column;
    align-items: flex-start;
  }
}

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