/* YC-inspired minimal personal page */
:root {
  --yc-orange: #f26522;
  --yc-orange-hover: #d95415;
  --text: #222;
  --text-muted: #666;
  --header-bg: #fdfaf3;
  --page-bg: #edf2fa;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--page-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1rem 2rem;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.25rem 0.5rem;
  width: 100%;
  max-width: 42rem;
  background: var(--header-bg);
  padding: 0.75rem 1rem;
  margin-bottom: 2rem;
  border-radius: 0 0 8px 8px;
}

.site-header a {
  color: var(--text);
  text-decoration: none;
}

.site-header a:hover {
  color: var(--yc-orange);
}

.header-sep {
  margin: 0 0.4em;
  color: var(--text-muted);
}

.header-action {
  color: var(--yc-orange);
  font-weight: 500;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin-left: 0.5rem;
  border: 1px solid #111;
  border-radius: 4px;
  padding: 0.15em 0.25em;
}

.lang-toggle a {
  display: inline-block;
  padding: 0.15em 0.4em;
  border-radius: 2px;
  opacity: 0.65;
  transition: opacity 0.15s;
}

.lang-toggle a:hover {
  opacity: 1;
}

.lang-toggle a.active {
  opacity: 1;
  background: rgba(0, 0, 0, 0.1);
}

.lang-toggle .lang-sep {
  color: var(--text-muted, #666);
  padding: 0 0.1em;
  user-select: none;
}

/* Resources bar (Age of Empires style) */
.resources-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  width: 100%;
  max-width: 42rem;
  padding: 0.5rem 0.5rem 0.5rem 0.75rem;
  margin-bottom: 0;
  background: rgba(253, 250, 243, 0.95);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.resources-bar-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.resources-ctrl-btn {
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.resources-ctrl-btn:hover {
  background: var(--yc-orange);
  color: #fff;
}

.resources-ticker-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.resource {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.resource-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.resource-value {
  font-weight: 600;
  font-size: 0.95rem;
  min-width: 1.5em;
  text-align: right;
  color: var(--text);
}

.resource-icon--red {
  color: #c00;
}

/* Pause: ticker stops, floaters fade out */
body.resources-paused .resources-ticker {
  animation-play-state: paused;
}

body.resources-paused .floater {
  opacity: 0;
  pointer-events: none;
}

/* Ticker (бегущая строка) — desktop и mobile */
.resources-bar.resources-bar--ticker .resources-ticker-wrap {
  overflow: hidden;
}

.resources-bar.resources-bar--ticker {
  justify-content: flex-start;
}

.resources-bar--ticker .resources-ticker {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.5rem 1rem;
  animation: resources-ticker 40s linear infinite;
  flex-shrink: 0;
}

.resources-bar--ticker .resources-ticker .resource {
  flex-shrink: 0;
}

.resources-bar--ticker .resources-ticker .resource-value {
  font-variant-numeric: tabular-nums;
}

@keyframes resources-ticker {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Page hero: photo + title + bio — floating zone overlays this */
.page-hero {
  position: relative;
  min-height: 280px;
}

/* Floating zone — over photo and bio, icons move along sine waves */
.floating-zone {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  pointer-events: none;
}

.floater {
  position: absolute;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 2;
  transition: transform 0.1s, opacity 0.5s ease;
  pointer-events: auto;
  left: 0;
  top: 0;
}

.floater:hover {
  transform: scale(1.2);
}

.floater:active {
  transform: scale(0.95);
}

@media (max-width: 768px) {
  .floater--preview {
    transform: scale(1.5);
    z-index: 3;
  }
}

.floater--red {
  color: #c00;
}

.floater--highlight {
  box-shadow: 0 0 0 3px var(--yc-orange);
  z-index: 3;
}

.floater-trajectory {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 1;
  color: var(--yc-orange);
  opacity: 0.85;
  transition: opacity 0.5s ease;
}

.floater-trajectory--fadeout {
  opacity: 0;
}

.page {
  max-width: 42rem;
  width: 100%;
  text-align: center;
}

.photo {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 12px;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.tagline {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.bio {
  color: var(--text);
  font-size: 1rem;
  font-style: italic;
  margin: 0 0 2rem;
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.links a {
  color: var(--yc-orange);
  text-decoration: none;
}

.links a:hover {
  color: var(--yc-orange-hover);
  text-decoration: underline;
}

.links a::after {
  content: " →";
  font-size: 0.85em;
  opacity: 0.8;
}

/* Contact actions — SAVE/CANCEL style */
.contact-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.btn-primary {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  background: var(--yc-orange);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: none;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(242, 101, 34, 0.35);
  transition: background 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
  background: var(--yc-orange-hover);
  box-shadow: 0 3px 12px rgba(242, 101, 34, 0.4);
}

.btn-link {
  color: var(--yc-orange);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.btn-link:hover {
  color: var(--yc-orange-hover);
  text-decoration: underline;
}

.btn-burgundy {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  background: #722f37;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-radius: 8px;
  border: none;
  box-shadow: 0 2px 8px rgba(114, 47, 55, 0.4);
  transition: background 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.btn-burgundy:hover {
  background: #5a252c;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 3px 12px rgba(114, 47, 55, 0.5);
}

/* Life Episodes — carousel (grechkanastya.ru style) */
.episodes {
  width: 100%;
  margin-top: 3rem;
  margin-left: -1rem;
  margin-right: -1rem;
  background: #1a1a1a;
  color: #e8e8e8;
  padding: 1.5rem 1rem 2rem;
  border-radius: 12px;
}

.episodes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem 1rem;
  max-width: 56rem;
  margin: 0 auto;
}

.episodes-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.02em;
  color: #fff;
}

.episodes-nav {
  display: flex;
  gap: 0.5rem;
}

.episodes-nav-btn {
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 6px;
  background: #333;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.episodes-nav-btn:hover {
  background: #444;
}

.episodes-nav-btn:active {
  background: #555;
}

.episodes-track-wrap {
  overflow: hidden;
  padding: 0 1rem;
}

.episodes-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.episodes-list::-webkit-scrollbar {
  display: none;
}

.episode-card {
  flex: 0 0 180px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.episode-cover {
  width: 180px;
  height: 180px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.75rem;
  background: #2a2a2a;
}

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

.episode-cover-placeholder {
  background: linear-gradient(145deg, #333 0%, #2a2a2a 100%);
}

.episode-type {
  color: #999;
  font-size: 0.8rem;
  text-transform: lowercase;
  margin-bottom: 0.2rem;
}

.episode-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 0.2rem;
}

.episode-year {
  color: #999;
  font-size: 0.85rem;
}

/* Products — same style as Life Episodes */
.products {
  width: 100%;
  margin-top: 3rem;
  margin-left: -1rem;
  margin-right: -1rem;
  background: #1a1a1a;
  color: #e8e8e8;
  padding: 1.5rem 1rem 2rem;
  border-radius: 12px;
}

.products-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem 1rem;
  max-width: 56rem;
  margin: 0 auto;
}

.products-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.02em;
  color: #fff;
}

.products-nav {
  display: flex;
  gap: 0.5rem;
}

.products-nav-btn {
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 6px;
  background: #333;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.products-nav-btn:hover {
  background: #444;
}

.products-track-wrap {
  overflow: hidden;
  padding: 0 1rem;
}

.products-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.products-list::-webkit-scrollbar {
  display: none;
}

.product-card {
  flex: 0 0 180px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.product-card-placeholder {
  width: 180px;
  height: 180px;
  border-radius: 8px;
  background: linear-gradient(145deg, #333 0%, #2a2a2a 100%);
  margin-bottom: 0.75rem;
}

.product-card-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
  line-height: 1.25;
}

.episode-card-link {
  color: inherit;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.episode-card-link:hover .episode-title {
  color: var(--yc-orange);
}

/* Map section */
.map-section {
  width: 100%;
  margin-top: 2rem;
}

.map-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

.map-container {
  width: 100%;
  height: 280px;
  border-radius: 12px;
  overflow: hidden;
  background: #e0e0e0;
}

/* Episode detail (blog page) */
.episode-detail {
  width: 100%;
  max-width: 42rem;
  padding: 0 0 2rem;
}

.episode-detail-inner {
  text-align: left;
}

.episode-back {
  display: inline-block;
  color: var(--yc-orange);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.episode-back:hover {
  text-decoration: underline;
}

.episode-detail-header {
  margin-bottom: 1.5rem;
}

.episode-detail-type {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: lowercase;
  margin-bottom: 0.25rem;
}

.episode-detail-title {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  letter-spacing: -0.02em;
}

.episode-detail-year {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.episode-detail-body {
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.episode-detail-body p {
  margin: 0 0 0.75rem;
}

.episode-detail-body p:last-child {
  margin-bottom: 0;
}

/* Episode timeline (horizontal) */
.episode-timeline-wrap {
  margin: 1.5rem 0;
}

.timeline-heading {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.episode-timeline {
  position: relative;
  padding: 0.5rem 0 1rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.timeline-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 1.25rem;
  height: 2px;
  background: var(--text-muted);
  opacity: 0.35;
}

.timeline-events {
  display: flex;
  gap: 1.5rem;
  position: relative;
  min-width: min-content;
  padding-right: 1rem;
}

.timeline-event {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
  width: 7rem;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--yc-orange);
  flex-shrink: 0;
  margin-bottom: 0.35rem;
  border: 2px solid var(--page-bg);
  box-shadow: 0 0 0 1px var(--text-muted);
}

.timeline-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
  text-align: center;
}

.timeline-label {
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
}

.episode-detail-locations h3,
.episode-detail-links h3,
.episode-detail-photos h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.location-list {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.episode-links-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.episode-links-list a {
  color: var(--yc-orange);
  text-decoration: none;
}

.episode-links-list a:hover {
  text-decoration: underline;
}

.episode-map-wrap {
  margin: 1rem 0;
}

.episode-map-wrap .map-container {
  height: 240px;
}

.episode-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.episode-photo {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
}
