/* ENG-003 · project60.ru · прототип портала (STD-002 palette) */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400&family=Montserrat:wght@400;500;600;700&display=swap');

:root {
  --ink: #3d3a36;
  --ink-soft: #6b6560;
  --gold: #8a7a62;
  --gold-light: #a89478;
  --gold-pale: #f0ebe3;
  --cream: #f7f5f2;
  --paper: #ffffff;
  --forest: #4a5d52;
  --forest-deep: #3a4a42;
  --line-solid: #e5e0d8;
  --shadow: rgba(61, 58, 54, 0.08);
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Montserrat', system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--ink-soft);
  background: var(--cream);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--forest); text-decoration: none; }
a:hover { color: var(--gold); text-decoration: underline; }

/* ── Prototype banner ── */
.proto-banner {
  background: var(--gold-pale);
  color: var(--forest-deep);
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.4rem 1rem;
  border-bottom: 1px solid var(--gold-light);
}

/* ── Header ── */
.portal-header {
  background: var(--paper);
  color: var(--ink);
  padding: 0.85rem clamp(1rem, 4vw, 2.5rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line-solid);
}

.portal-brand {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--forest-deep);
  letter-spacing: 0.02em;
}
.portal-brand:hover { color: var(--forest); text-decoration: none; }
.portal-brand span { color: var(--ink-soft); font-weight: 400; font-size: 0.85em; }

.portal-header--minimal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to bottom, rgba(26, 47, 40, 0.72) 0%, rgba(26, 47, 40, 0.25) 55%, transparent 100%);
  border-bottom: none;
  color: #fff;
  padding-top: max(0.75rem, env(safe-area-inset-top));
  z-index: 400;
  flex-wrap: nowrap;
  align-items: center;
}

.portal-header--minimal .portal-header-start {
  flex: 1;
  min-width: 0;
}

.portal-header--minimal .portal-header-end {
  position: relative;
  z-index: 360;
  flex-shrink: 0;
  margin-left: auto;
  background: rgba(26, 47, 40, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 0.25rem 0.35rem 0.25rem 0.65rem;
}

/* Встроенные страницы: хроника, летопись, оригиналы документов */
.portal-header--reader {
  position: sticky;
  top: 0;
  z-index: 150;
}

.nav-toggle--reader {
  background: var(--cream);
  border: 1px solid var(--line-solid);
  color: var(--forest-deep);
  font-size: 1.15rem;
  line-height: 1;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle--reader:hover {
  background: var(--gold-pale);
  border-color: var(--gold-light);
}

.portal-header--reader .portal-drawer a.is-active {
  color: var(--forest-deep);
  font-weight: 700;
}

.portal-header-start {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.portal-header-end,
.portal-header-tools {
  display: flex;
  align-items: center;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
}

.portal-locale {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-locale__link {
  color: inherit;
  text-decoration: none !important;
  opacity: 0.85;
  padding: 0.35rem 0.5rem;
  border-radius: 3px;
  min-width: 1.75rem;
  text-align: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.portal-locale__link:hover {
  opacity: 1;
}

.portal-locale__link.is-active {
  opacity: 1;
  text-decoration: none !important;
  text-underline-offset: 0.2em;
  cursor: default;
}

.portal-header--minimal .portal-locale__link {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  opacity: 0.9;
}

.portal-header--minimal .portal-locale__link.is-active {
  background: rgba(255, 255, 255, 0.22);
  opacity: 1;
  text-decoration: none !important;
  font-weight: 700;
}

.portal-brand--compact {
  font-size: 1.05rem;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}

.portal-dayline {
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.nav-toggle {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.75);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle:hover {
  background: rgba(250, 248, 244, 0.1);
}

.portal-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(16rem, 85vw);
  height: 100vh;
  height: 100dvh;
  background: var(--paper);
  border-left: 1px solid var(--line-solid);
  box-shadow: -8px 0 32px var(--shadow);
  padding: 4rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  z-index: 350;
}

.portal-drawer[hidden] {
  display: none !important;
}

.portal-drawer a {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--forest-deep);
  text-decoration: none;
}

.portal-drawer a:hover {
  color: var(--forest);
}

body.drawer-open::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(58, 74, 66, 0.35);
  z-index: 340;
  pointer-events: auto;
  cursor: pointer;
}

.portal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.portal-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}
.portal-nav a:hover,
.portal-nav a.is-active {
  color: var(--forest-deep);
  border-bottom-color: var(--forest);
  text-decoration: none;
}

/* ── Main ── */
.portal-main {
  max-width: 42rem;
  margin: 0 auto;
  padding: 2rem clamp(1rem, 4vw, 1.5rem) 3rem;
  width: 100%;
  flex: 1;
}

.portal-main--wide { max-width: 56rem; }

.portal-main--landing {
  max-width: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

/* ── Home: hero ── */
.home-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  background-color: #3a4a42;
  background-size: cover;
  background-position: center;
  text-align: center;
  color: #fff;
}

.home-hero--fallback {
  background-color: #4a5d52;
  background-image: none;
}

.home-hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(58, 74, 66, 0.42);
}

.home-hero-inner {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 38rem;
  width: 100%;
  margin: 0 auto;
  padding: 5.5rem clamp(1.25rem, 4vw, 2rem) 1.5rem;
}

.home-hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.75rem, 8vw, 4.25rem);
  font-weight: 600;
  line-height: 1.08;
  margin-bottom: 0.35rem;
  color: #fff;
  text-shadow: 0 1px 24px rgba(0, 0, 0, 0.35);
}

.home-hero-brand {
  font-size: 0.88rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 1.75rem;
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.3);
}

.home-hero-manifest {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 3vw, 1.45rem);
  line-height: 1.45;
  margin-bottom: 1rem;
  color: #fff;
  text-shadow: 0 1px 20px rgba(0, 0, 0, 0.32);
}

.home-hero-closing {
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.96);
  margin-bottom: 1.25rem;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.28);
}

.home-hero-tagline {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 2rem;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.25);
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.home-hero .portal-cta--book {
  background: rgba(255, 255, 255, 0.92);
  color: var(--forest-deep) !important;
  border: 1px solid transparent;
}

.home-hero .portal-cta--outline-light {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.72);
  color: #fff !important;
}

.home-hero .portal-cta--outline-light:hover {
  background: rgba(250, 248, 244, 0.1);
}

.home-hero-scroll {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  animation: hero-pulse-scroll 2.5s ease-in-out infinite;
}

.home-hero-scroll:hover { color: rgba(255, 255, 255, 0.95); }

@keyframes hero-pulse-scroll {
  0%, 100% { opacity: 0.55; transform: translateY(0); }
  50% { opacity: 0.95; transform: translateY(3px); }
}

/* Пульс — низ первого экрана */
.home-hero-pulse {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 1.1rem clamp(1rem, 4vw, 2rem) max(1.35rem, env(safe-area-inset-bottom));
  background: linear-gradient(
    to top,
    rgba(26, 47, 40, 0.82) 0%,
    rgba(26, 47, 40, 0.48) 55%,
    transparent 100%
  );
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.home-hero-pulse__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 0.5rem 1.5rem;
  margin-bottom: 0.55rem;
}

.home-hero-pulse__item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  min-width: 4.5rem;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none !important;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
  transition: color 0.15s, transform 0.15s;
}

.home-hero-pulse__item:hover {
  color: #fff;
  transform: translateY(-1px);
  text-decoration: none !important;
}

.home-hero-pulse__num {
  font-family: var(--font-serif);
  font-size: clamp(1.65rem, 4.5vw, 2.35rem);
  font-weight: 700;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.02em;
}

.home-hero-pulse__label {
  font-size: clamp(0.68rem, 1.8vw, 0.78rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.78;
}

.home-hero-pulse__sep {
  display: none;
}

.home-hero-pulse .home-hero-scroll {
  margin-top: 0.65rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
}

@media (max-width: 520px) {
  .home-hero-pulse__row {
    gap: 0.45rem 1rem;
  }
  .home-hero-pulse__item {
    min-width: 3.75rem;
  }
}

@media (max-width: 640px) {
  /* На главной h1 дублирует бренд — оставляем только строку «N-й день» слева */
  body.page-home .portal-header--minimal .portal-brand--compact {
    display: none;
  }

  .portal-header--minimal .portal-dayline {
    font-size: 0.65rem;
    line-height: 1.35;
  }

  .home-hero-inner {
    padding-top: max(6.75rem, calc(env(safe-area-inset-top) + 5rem));
    justify-content: center;
  }

  .home-hero-title {
    font-size: clamp(2.25rem, 10vw, 3.25rem);
  }
}

/* ── Home: screens §5–8 ── */
.home-screen {
  max-width: 42rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 3.5rem) clamp(1rem, 4vw, 1.5rem);
}

.home-screen-title {
  font-family: var(--font-serif);
  font-size: clamp(1.65rem, 4vw, 2rem);
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.home-screen-lead {
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-bottom: 1.25rem;
}

.home-pulse {
  background: var(--paper);
  border-bottom: 1px solid var(--line-solid);
  max-width: none;
}

.home-pulse .home-screen-title,
.home-pulse .home-screen-lead,
.home-pulse .pulse-list {
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

.pulse-list {
  list-style: none;
  font-size: 1.05rem;
  line-height: 1.85;
}

.pulse-list a {
  color: var(--ink);
  text-decoration: none;
}

.pulse-list a:hover {
  color: var(--forest);
  text-decoration: underline;
}

.pulse-dot {
  color: var(--forest);
  font-size: 0.65rem;
  vertical-align: middle;
}

.pulse-update {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.today-heading {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  color: var(--forest-deep);
  margin-bottom: 1.25rem;
}

.today-timeline {
  list-style: none;
}

.today-entry {
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: 0.75rem 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line-solid);
  align-items: baseline;
}

.today-year {
  font-weight: 600;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.today-event {
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-serif);
  font-size: 1.15rem;
}

.today-event:hover {
  color: var(--forest);
}

.latest-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.85rem;
}

.latest-card {
  display: block;
  background: var(--paper);
  border: 1px solid var(--line-solid);
  border-radius: 8px;
  padding: 1.15rem 1.1rem;
  text-decoration: none !important;
  color: inherit;
  transition: box-shadow 0.15s;
}

.latest-card:hover {
  box-shadow: 0 4px 16px var(--shadow);
}

.latest-icon {
  display: block;
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
}

.latest-label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: 0.35rem;
}

.latest-title {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--forest-deep);
  line-height: 1.35;
}

.today-empty {
  font-style: italic;
  color: var(--ink-soft);
}

.home-about-text {
  margin-bottom: 1rem;
  line-height: 1.75;
}

.home-about {
  border-top: 1px solid var(--line-solid);
}

.home-about-quote {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--forest-deep);
  border-left: 3px solid var(--forest);
  margin: 1.25rem 0 1.5rem;
  padding: 0.25rem 0 0.25rem 1.25rem;
}

/* ── Home: три основы ── */
.home-pillars {
  border-top: 1px solid var(--line-solid);
  max-width: none;
  background: var(--cream);
}

.home-pillars .home-screen-title,
.home-pillars .home-screen-lead,
.home-pillars .pillars-grid {
  max-width: 52rem;
  margin-left: auto;
  margin-right: auto;
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

@media (max-width: 720px) {
  .pillars-grid { grid-template-columns: 1fr; }
}

.pillar-card {
  background: var(--paper);
  border: 1px solid var(--line-solid);
  border-radius: 10px;
  padding: 1.35rem 1.25rem;
  text-align: left;
}

.pillar-card--accent {
  border-color: var(--forest);
  box-shadow: 0 4px 20px var(--shadow);
}

.pillar-icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 0.65rem;
}

.pillar-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--forest-deep);
  margin-bottom: 0.5rem;
}

.pillar-text {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: 0.85rem;
}

.pillar-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--forest);
  text-decoration: none;
}

.pillar-link:hover { text-decoration: underline; }

/* ── Home: человек + AI ── */
.home-ai {
  border-top: 1px solid var(--line-solid);
  padding-bottom: 4rem;
}

.home-ai-lead {
  line-height: 1.75;
  margin-bottom: 0.75rem;
}

.home-ai-list {
  margin: 0.5rem 0 1.25rem 1.25rem;
  line-height: 1.85;
  color: var(--ink);
}

.home-ai-quote {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--forest-deep);
  border-left: 3px solid var(--gold);
  margin: 1.5rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
}

.home-ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* ── Team & AI pages ── */
.portal-list {
  margin: 0 0 0 1.25rem;
  line-height: 1.85;
}

.team-section-label {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--ink);
  margin-bottom: 1rem;
  font-weight: 600;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
}

.team-card {
  background: var(--paper);
  border: 1px solid var(--line-solid);
  border-radius: 10px;
  padding: 1.35rem 1.25rem;
}

.team-card--human {
  border-left: 3px solid var(--gold);
  max-width: 28rem;
}

.team-card--ai {
  border-left: 3px solid var(--forest);
}

.team-card--lead {
  border-left: 3px solid var(--gold);
  background: linear-gradient(135deg, var(--paper) 0%, var(--cream) 100%);
  box-shadow: 0 4px 24px var(--shadow);
}

.ai-team-intro {
  background: var(--cream);
  border: 1px solid var(--line-solid);
  border-radius: 10px;
  padding: 1.35rem 1.5rem;
}

.ai-team-roles {
  margin-top: 0.75rem;
}

.ai-team-note {
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-top: 1rem;
  margin-bottom: 0;
}

.team-future-list li {
  list-style: none;
  margin-left: -1.25rem;
  padding-left: 0;
}

.team-future-icon {
  display: inline-block;
  width: 1.5rem;
}

.team-name {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--forest-deep);
  margin-bottom: 0.25rem;
}

.team-role {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.75rem;
}

.team-desc {
  font-size: 0.95rem;
  line-height: 1.65;
  margin: 0;
}

.team-future-list {
  columns: 2;
  margin: 0.75rem 0 0 1.25rem;
  line-height: 1.85;
}

@media (max-width: 520px) {
  .team-future-list { columns: 1; }
}

.team-future-note {
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-top: 1rem;
  font-style: italic;
}

/* ── Home: спросить память (Фаза 2 teaser) ── */
.home-ask {
  border-top: 1px solid var(--line-solid);
  max-width: none;
  background: linear-gradient(165deg, var(--forest-deep) 0%, #2d4a3e 100%);
  color: #fff;
  padding-bottom: clamp(3rem, 8vw, 4.5rem);
}

.home-ask-inner {
  max-width: 36rem;
  margin: 0 auto;
  text-align: center;
}

.home-ask-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.75rem;
}

.home-ask-title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4.5vw, 2.25rem);
  margin-bottom: 1rem;
  text-shadow: 0 1px 20px rgba(0, 0, 0, 0.25);
}

.home-ask-text {
  line-height: 1.75;
  margin-bottom: 0.75rem;
  color: rgba(255, 255, 255, 0.96);
}

.home-ask-tagline {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1.5rem;
}

.home-ask .portal-cta--book {
  background: rgba(255, 255, 255, 0.95);
  color: var(--forest-deep) !important;
  border-color: transparent;
}

.home-ask-soon {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 1rem;
  margin-bottom: 0;
}

/* ── Roadmap (AI page) ── */
.roadmap-section {
  background: var(--cream);
  border: 1px solid var(--line-solid);
  border-radius: 10px;
  padding: 1.5rem;
}

.roadmap-section h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--forest-deep);
  margin: 1.5rem 0 0.75rem;
}

.roadmap-lead {
  font-size: 1.05rem;
  line-height: 1.65;
}

.roadmap-quote {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--forest-deep);
  border-left: 3px solid var(--gold);
  margin: 1.25rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
}

.roadmap-phases {
  margin: 0.75rem 0 0 1.25rem;
  line-height: 1.85;
}

.roadmap-note {
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-top: 1.25rem;
  margin-bottom: 0;
  font-style: italic;
}

/* ── Photo grid (home, dnevnik) ── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

@media (max-width: 480px) {
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
}

.photo-grid-item {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line-solid);
  background: var(--line-solid);
}

.photo-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.photo-grid-item:hover img { transform: scale(1.03); }

.photo-caption {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* ── Home hero (legacy) ── */
.hero-dark {
  background: linear-gradient(165deg, var(--forest-deep) 0%, #243d34 50%, var(--forest) 100%);
  color: #faf8f4;
  text-align: center;
  padding: clamp(3rem, 8vw, 5rem) clamp(1.25rem, 4vw, 2rem) clamp(2.5rem, 6vw, 4rem);
  position: relative;
  overflow: hidden;
}

.hero-dark::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 100%, rgba(212, 168, 83, 0.12), transparent);
  pointer-events: none;
}

.hero-dark .inner { position: relative; max-width: 36rem; margin: 0 auto; }

.hero-dark h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.1rem, 5.5vw, 3.1rem);
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  color: #faf8f4;
}

.hero-dark .lead {
  font-size: 1.05rem;
  line-height: 1.7;
  color: rgba(250, 248, 244, 0.88);
  margin-bottom: 1rem;
}

.hero-dark .motto {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--gold-light);
  margin: 1.5rem 0;
}

.hero-dark .portal-cta {
  margin-top: 0.5rem;
  background: var(--gold);
  color: var(--forest-deep) !important;
}
.hero-dark .portal-cta:hover {
  background: var(--gold-light);
}

.hero-dark .hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.hero-dark .portal-cta--ghost {
  background: transparent;
  border: 1px solid rgba(250, 248, 244, 0.45);
  color: #faf8f4 !important;
}
.hero-dark .portal-cta--ghost:hover {
  background: rgba(250, 248, 244, 0.1);
  border-color: var(--gold-light);
}

/* ── Pulse strip (home) ── */
.pulse-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: var(--paper);
  border-bottom: 1px solid var(--line-solid);
  margin: 0 calc(-1 * clamp(1rem, 4vw, 1.5rem));
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px var(--shadow);
}

@media (max-width: 640px) {
  .pulse-strip { grid-template-columns: repeat(2, 1fr); }
}

.pulse-strip .pulse-item {
  border: none;
  border-radius: 0;
  border-right: 1px solid var(--line-solid);
  padding: 1.15rem 0.75rem;
}
.pulse-strip .pulse-item:last-child { border-right: none; }

/* ── Home grid ── */
.home-grid {
  display: grid;
  grid-template-columns: 1fr 18rem;
  gap: 2rem;
  align-items: start;
  margin-bottom: 2.5rem;
}

@media (max-width: 820px) {
  .home-grid { grid-template-columns: 1fr; }
}

.home-aside .portal-section { margin-bottom: 1.5rem; }

/* ── Path cards ── */
.path-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.path-card {
  display: block;
  background: var(--paper);
  border: 1px solid var(--line-solid);
  border-radius: 10px;
  padding: 1.25rem 1.35rem;
  text-decoration: none !important;
  transition: transform 0.15s, box-shadow 0.15s;
  color: inherit;
}

.path-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--shadow);
  border-color: var(--gold-light);
}

.path-card .path-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 0.35rem;
}

.path-card .path-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--forest-deep);
  margin-bottom: 0.35rem;
}

.path-card .path-desc {
  font-size: 0.82rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* ── Featured card ── */
.featured-card {
  background: var(--forest-deep);
  color: #faf8f4;
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 2rem;
}

.featured-card .feed-date { color: var(--gold-light); }

.featured-card .feed-title {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  color: #faf8f4;
  margin: 0.35rem 0 0.5rem;
}
.featured-card .feed-title a { color: inherit; text-decoration: none; }
.featured-card .feed-title a:hover { color: var(--gold-light); }

.featured-card .feed-lede { color: rgba(250, 248, 244, 0.82); font-size: 0.92rem; }

.featured-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold-light);
}

/* ── Page header (inner pages) ── */
.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line-solid);
}

.page-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.85rem, 4vw, 2.35rem);
  color: var(--forest-deep);
  margin-bottom: 0.5rem;
}

.page-header .page-intro {
  font-size: 1rem;
  color: var(--ink-soft);
  max-width: 36rem;
}

/* ── Sections ── */
.portal-section { margin-bottom: 2rem; }

.portal-section h2 {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  color: var(--forest-deep);
  margin-bottom: 1rem;
}

.section-link {
  font-size: 0.82rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

/* ── Pulse (generic) ── */
.pulse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  gap: 0.75rem;
}

.pulse-item {
  background: var(--paper);
  border: 1px solid var(--line-solid);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}

.pulse-item .num {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.1;
}

.pulse-item .label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  margin-top: 0.35rem;
}

.pulse-meta {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 0.65rem;
}

/* ── Feed ── */
.feed-list { list-style: none; }

.feed-item {
  background: var(--paper);
  border: 1px solid var(--line-solid);
  border-radius: 8px;
  padding: 1rem 1.15rem;
  margin-bottom: 0.65rem;
  transition: box-shadow 0.15s;
}

.feed-item:hover { box-shadow: 0 4px 16px var(--shadow); }

.feed-item--build { border-left: 3px solid var(--forest); }

.feed-date {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold);
  margin-bottom: 0.25rem;
}

.feed-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--forest-deep);
  margin-bottom: 0.35rem;
}

.feed-title a { color: inherit; text-decoration: none; }
.feed-title a:hover { color: var(--gold); }

.feed-lede { font-size: 0.88rem; color: var(--ink-soft); }

/* ── Dnevnik · year wheel ── */
.dnevnik-shell {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0;
  min-height: min(560px, calc(100vh - 12rem));
  margin-top: 1.25rem;
  border: 1px solid var(--line-solid);
  border-radius: 12px;
  overflow: hidden;
  background: var(--paper);
}

.dnevnik-shell__years {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--cream);
  border-right: 1px solid var(--line-solid);
}

.dnevnik-shell__feed {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.dnevnik-panel-label {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--forest);
  text-align: center;
  padding: 0.85rem 0.5rem 0.65rem;
  border-bottom: 1px solid var(--line-solid);
  background: var(--cream);
}

.dnevnik-shell .year-wheel {
  flex: 1;
  position: relative;
  overflow: hidden;
  cursor: ns-resize;
  min-height: 0;
  --year-item-h: 56px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 14%, #000 86%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 14%, #000 86%, transparent 100%);
}

.dnevnik-shell .year-wheel__band {
  position: absolute;
  left: 0.35rem;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  height: var(--year-item-h, 56px);
  pointer-events: none;
  border-top: 1px solid var(--line-solid);
  border-bottom: 1px solid var(--line-solid);
  background: rgba(245, 236, 215, 0.35);
  z-index: 0;
}

.dnevnik-shell .year-wheel__scroller {
  position: relative;
  z-index: 1;
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.dnevnik-shell .year-wheel__scroller::-webkit-scrollbar { display: none; }

.dnevnik-shell .year-wheel__list {
  list-style: none;
  margin: 0;
  padding-left: 0;
  padding-right: 0;
}

.dnevnik-shell .year-wheel__list > li {
  height: var(--year-item-h, 56px);
  margin: 0;
  padding: 0;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

.dnevnik-shell .year-wheel__item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--ink-soft);
  opacity: 0.45;
  line-height: 1;
  transition: font-size 0.28s ease, opacity 0.28s ease, color 0.28s ease;
}

.dnevnik-shell .year-wheel__item.is-active {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--forest-deep);
  opacity: 1;
}

.dnevnik-shell .year-wheel__hint {
  flex-shrink: 0;
  font-size: 0.62rem;
  text-align: center;
  color: var(--ink-soft);
  padding: 0.35rem 0.25rem 0.65rem;
  opacity: 0.7;
}

.dnevnik-feed-meta {
  flex-shrink: 0;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--forest-deep);
  padding: 0.85rem 1.15rem 0.5rem;
  border-bottom: 1px solid var(--line-solid);
  background: var(--cream);
}

.dnevnik-shell__feed .feed-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem 1rem 1rem;
  margin: 0;
}

.dnevnik-feed-empty {
  padding: 1.5rem 1rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
  text-align: center;
  list-style: none;
}

@media (max-width: 820px) {
  .dnevnik-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .dnevnik-shell__years {
    border-right: none;
    border-bottom: 1px solid var(--line-solid);
    max-height: 140px;
  }
  .dnevnik-shell .year-wheel {
    mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent) !important;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent) !important;
  }
  .dnevnik-shell .year-wheel__list {
    display: flex;
    flex-direction: row !important;
    height: auto !important;
    padding: 0 40vw !important;
  }
  .dnevnik-shell .year-wheel__list > li {
    width: 4.5rem;
    height: 3.5rem;
    flex-shrink: 0;
  }
  .dnevnik-shell__feed .feed-list {
    max-height: 420px;
  }
}

.feed-tag {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--gold-pale);
  color: var(--forest);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  margin-top: 0.5rem;
}

/* ── Today ── */
.today-list {
  list-style: none;
  border-left: 2px solid var(--gold-pale);
  padding-left: 1.25rem;
}

.today-item {
  position: relative;
  margin-bottom: 1.1rem;
}

.today-item::before {
  content: '';
  position: absolute;
  left: -1.42rem;
  top: 0.35rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
}

.today-year {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--forest);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.today-empty {
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-style: italic;
}

/* ── CTA ── */
.portal-cta {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  text-decoration: none !important;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  background: var(--forest-deep);
  color: var(--paper) !important;
  border: 1px solid var(--forest-deep);
}

.portal-cta:hover {
  background: var(--forest);
  border-color: var(--forest);
}

.portal-cta--book {
  background: var(--forest-deep);
  color: var(--paper) !important;
  border: 1px solid var(--forest-deep);
}

.portal-cta--secondary {
  background: transparent;
  color: var(--forest-deep) !important;
  border: 1px solid var(--line-solid);
}

.portal-cta--secondary:hover {
  background: var(--cream);
}

/* ── Book promo (istoriya) ── */
.book-promo {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line-solid);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 520px) {
  .book-promo { grid-template-columns: 1fr; text-align: center; }
}

.book-cover {
  width: 7rem;
  height: 9.5rem;
  background: linear-gradient(145deg, var(--forest-deep), var(--forest));
  border-radius: 4px 8px 8px 4px;
  box-shadow: 4px 4px 12px var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.75rem;
  font-family: var(--font-serif);
  font-size: 0.75rem;
  color: var(--gold-light);
  line-height: 1.3;
}

.book-promo h2 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--forest-deep);
  margin-bottom: 0.5rem;
}

/* ── Article ── */
.portal-article h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  color: var(--forest-deep);
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.portal-article .article-lede {
  font-size: 1.08rem;
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line-solid);
}

.portal-article h2 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--forest);
  margin: 1.75rem 0 0.75rem;
}

.portal-article p { margin-bottom: 1rem; }

.portal-article blockquote {
  border-left: 3px solid var(--gold);
  padding: 0.75rem 1rem;
  margin: 1.25rem 0;
  background: var(--gold-pale);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--forest-deep);
}

.portal-original {
  margin-top: 2.5rem;
  padding: 1.25rem;
  background: var(--paper);
  border: 1px dashed var(--line-solid);
  border-radius: 8px;
  font-size: 0.88rem;
}

.portal-original a { font-weight: 600; }

.portal-next {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line-solid);
  font-family: var(--font-serif);
  font-size: 1.1rem;
}

/* ── Chapters ── */
.chapter-list { list-style: none; }

.chapter-list li {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line-solid);
}

.chapter-list .ch-date {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
}

.chapter-list .ch-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--forest-deep);
}

/* ── Footer ── */
.portal-footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.75rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--line-solid);
  background: var(--paper);
}

.portal-footer a { color: var(--forest); }

.embed-note {
  font-size: 0.85rem;
  background: var(--gold-pale);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}
