/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

/* ===== THEMES ===== */
:root {
  --bg:        #F5F0E8;
  --bg-subtle: #EDE5D5;
  --text:      #1A1208;
  --muted:     #8C7D68;
  --accent:    #4A7C59;
  --border:    #D8CFBE;
  --header-bg: rgba(245, 240, 232, 0.94);
  --thumb:     #ffffff;
  --track:     #C0B5A0;
  --panel:     rgba(255, 255, 255, .22);
  --scroll-base-1: #d8ccbb;
  --scroll-base-2: #cfc0ac;
  --scroll-base-3: #bea98f;
  --scroll-edge-1: #bca88f;
  --scroll-edge-2: #ae9578;
  --scroll-edge-3: #9d8264;
  --scroll-ink: #3b2a1a;
  --scroll-line: rgba(76, 56, 38, .28);
}

[data-theme="dark"] {
  --bg:        #0D0C0A;
  --bg-subtle: #161410;
  --text:      #E8E0D0;
  --muted:     #8A7E6E;
  --accent:    #78BF90;
  --border:    #252219;
  --header-bg: rgba(13, 12, 10, 0.94);
  --thumb:     #E8E0D0;
  --track:     #302C26;
  --panel:     rgba(255, 255, 255, .035);
  --scroll-base-1: #5a4b3d;
  --scroll-base-2: #4e4135;
  --scroll-base-3: #43372d;
  --scroll-edge-1: #665544;
  --scroll-edge-2: #564636;
  --scroll-edge-3: #46392e;
  --scroll-ink: #e7d7c3;
  --scroll-line: rgba(220, 196, 170, .22);
}

/* ===== LANGUAGE ===== */
[data-lang="en"] .ru { display: none; }
[data-lang="ru"] .en { display: none; }

/* ===== BASE ===== */
html { font-size: 18px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background .3s, color .3s;
}
h1, h2, h3 { font-family: 'Lora', Georgia, serif; line-height: 1.16; }

/* ===== LAYOUT ===== */
.wrap {
  width: min(100% - clamp(28px, 7vw, 112px), 1280px);
  margin: 0 auto;
}
.wide-wrap { width: min(100% - clamp(28px, 8vw, 128px), 1360px); }

/* ===== HEADER ===== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background .3s, border-color .3s;
}
.header-top {
  height: 72px;
  padding: 0 clamp(16px, 5vw, 48px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.header-left  { display: flex; align-items: center; }
.header-right { display: flex; align-items: center; justify-content: flex-end; }
.site-name {
  font-family: 'Lora', serif;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-decoration: none;
  color: var(--text);
  transition: color .2s;
  text-transform: lowercase;
}
.site-name em,
.footer-logo em {
  font-family: 'Inter', sans-serif;
  font-size: .64em;
  font-style: normal;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: none;
}
.site-name:hover { color: var(--accent); }

/* Sub-nav */
.sub-nav {
  height: 40px;
  border-top: 1px solid var(--border);
  padding: 0 clamp(16px, 5vw, 48px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}
.sub-nav a {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  padding: 0 16px;
  height: 40px;
  display: flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
  margin-bottom: -1px;
}
.sub-nav a:hover { color: var(--text); }
.sub-nav a.active { color: var(--text); border-bottom-color: var(--accent); }

/* ===== THEME TOGGLE ===== */
.theme-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px;
  color: var(--muted);
}
.t-icon { width: 13px; height: 13px; opacity: .3; transition: opacity .3s; flex-shrink: 0; }
.t-icon.on { opacity: 1; }
.t-track {
  width: 34px; height: 19px;
  background: var(--track);
  border-radius: 10px;
  position: relative;
  transition: background .3s;
  flex-shrink: 0;
}
.t-dot {
  width: 13px; height: 13px;
  background: var(--thumb);
  border-radius: 50%;
  position: absolute; top: 3px; left: 3px;
  transition: transform .28s cubic-bezier(.4, 0, .2, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
[data-theme="dark"] .t-dot { transform: translateX(15px); }

/* ===== LANG TOGGLE ===== */
.lang-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .06em;
  color: var(--muted);
  transition: border-color .2s, color .2s;
  display: flex;
  align-items: center;
  gap: 5px;
}
.lang-btn:hover { border-color: var(--muted); color: var(--text); }
.lang-btn .hi { color: var(--text); font-weight: 700; }
.lang-sep { opacity: .3; }

/* ===== FOOTER ===== */
footer { border-top: 1px solid var(--border); padding: 40px 0; text-align: center; }
.footer-logo {
  font-family: 'Lora', serif;
  font-size: .9rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: .04em;
  display: inline-block;
  transition: color .2s;
  text-transform: lowercase;
}
.footer-logo:hover { color: var(--text); }

/* ===== SHARED ===== */
.kicker,
.sec-label,
.hero-tag {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}
.placeholder-image,
.about-photo {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  transition: background-color .3s ease, border-color .3s ease;
}

/* ===== HERO ===== */
.hero { padding: 96px 0 80px; border-bottom: 1px solid var(--border); }
.hero h1 {
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  font-weight: 600;
  color: var(--text);
  max-width: 980px;
  margin-bottom: 22px;
}
.hero-sub { font-size: 1rem; color: var(--muted); max-width: 760px; line-height: 1.85; }

/* ===== ABOUT PAGE ===== */
.about-intro {
  padding: clamp(52px, 7vw, 88px) 0 clamp(70px, 8vw, 110px);
  display: grid;
  grid-template-columns: minmax(260px, 36%) minmax(0, 1fr);
  gap: clamp(34px, 6vw, 82px);
  align-items: start;
}
.about-image {
  aspect-ratio: 1.02 / 1.18;
  width: 100%;
  min-height: 360px;
}
.about-text {
  max-width: 780px;
  padding-top: 2px;
}
.about-text p {
  font-size: clamp(1rem, 1.18vw, 1.12rem);
  line-height: 1.88;
  margin-bottom: 22px;
  color: var(--text);
}
.about-text p:first-child {
  font-size: clamp(1.08rem, 1.4vw, 1.28rem);
  line-height: 1.76;
}
.about-text p:last-child { margin-bottom: 0; }
.page-header, .about-profile, .about-body, .principles { display: none; }

/* ===== POSTS SECTION / HOME ===== */
.posts-section { padding: 80px 0; }
.posts-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0; }
.posts-header h2 { font-size: 1.5rem; font-weight: 600; color: var(--text); }
.view-all, .read-more { font-size: .78rem; font-weight: 600; color: var(--accent); text-decoration: none; transition: opacity .2s; }
.view-all:hover, .read-more:hover { opacity: .7; }
.post-item { padding: 34px 0; border-top: 1px solid var(--border); }
.post-item:first-of-type { margin-top: 40px; }
.post-item:last-child { border-bottom: 1px solid var(--border); }
.post-meta { font-size: .76rem; color: var(--muted); margin-bottom: 10px; }
.post-item h3 { font-size: 1.35rem; font-weight: 600; margin-bottom: 8px; line-height: 1.35; }
.post-item h3 a { text-decoration: none; color: var(--text); transition: color .2s; }
.post-item h3 a:hover { color: var(--accent); }
.post-excerpt { font-size: .94rem; color: var(--muted); line-height: 1.7; max-width: 800px; margin-bottom: 14px; }

/* ===== BLOG PAGE ===== */
.blog-shell { width: 100%; }
.blog-list-page {
  padding-top: 0;
  padding-bottom: 70px;
  margin: 0 auto;
}
.blog-subnav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  margin-bottom: 24px;
  padding-bottom: 0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 112px;
  z-index: 20;
  background: var(--header-bg);
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  transition: background-color .3s ease, border-color .3s ease;
}
.blog-subnav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  line-height: 1;
  padding: 0 14px;
  text-decoration: none;
  color: var(--muted);
  font-family: 'Lora', Georgia, serif;
  font-size: .72rem;
  font-style: italic;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  transition: color .3s ease;
}
.blog-subnav-link::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 2px;
  background: transparent;
  transition: background-color .3s ease;
}
.blog-subnav-link:hover { color: var(--text); }
.blog-subnav-link.is-active {
  color: var(--text);
}
.blog-subnav-link.is-active::after {
  background: var(--accent);
}
.entry-list { display: grid; gap: 46px; }
.story-card {
  display: grid;
  grid-template-columns: minmax(220px, 32%) minmax(0, 1fr);
  gap: clamp(24px, 3vw, 44px);
  align-items: start;
  padding-top: 30px;
  border-top: 0;
  transition: border-color .3s ease, background-color .3s ease;
}
.story-image {
  aspect-ratio: 1.42 / 1;
  min-height: 150px;
  display: block;
  text-decoration: none;
  transition: transform .2s, opacity .2s;
}
.story-image:hover { transform: translateY(-2px); opacity: .9; }
.story-copy { min-width: 0; }
.story-copy h2 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: clamp(1.15rem, 1.8vw, 1.65rem);
  line-height: 1.08;
  letter-spacing: .02em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.story-copy h2 a { text-decoration: none; transition: color .2s; }
.story-copy h2 a:hover { color: var(--accent); }
.story-date { color: var(--muted); font-size: .8rem; margin-bottom: 14px; }
.story-excerpt { color: var(--muted); line-height: 1.72; max-width: 680px; }

/* ===== ARTICLES MOSAIC ===== */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 2.3vw, 32px);
  padding-top: 20px;
}
.article-tile { min-width: 0; }
.article-tile-image {
  display: block;
  width: 100%;
  aspect-ratio: 1.45 / 1;
  background-size: cover;
  background-position: center;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}
.article-tile-date {
  font-size: .72rem;
  color: var(--muted);
  margin-bottom: 7px;
  text-transform: lowercase;
}
.article-tile-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: clamp(1.05rem, 1.3vw, 1.45rem);
  line-height: 1.18;
  letter-spacing: .01em;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.article-tile-title a { text-decoration: none; }
.article-tile-title a:hover { color: var(--accent); }
.article-tile-excerpt {
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.55;
}

/* ===== DIARY SCROLL ===== */
.diary-scroll {
  margin: 26px auto 0;
  width: min(100%, 820px);
  position: relative;
  background:
    radial-gradient(120% 90% at 50% 36%, rgba(255,255,255,.2) 0%, rgba(255,255,255,0) 62%),
    linear-gradient(90deg, var(--scroll-base-3) 0%, var(--scroll-base-2) 8%, var(--scroll-base-1) 50%, var(--scroll-base-2) 92%, var(--scroll-base-3) 100%);
  border: 1px solid var(--scroll-line);
  border-radius: 0;
  box-shadow:
    0 10px 24px rgba(38, 24, 12, .16),
    inset 12px 0 16px rgba(72, 46, 26, .12),
    inset -12px 0 16px rgba(72, 46, 26, .12),
    inset 0 0 34px rgba(255,255,255,.1);
  padding: 34px 24px 38px;
}
.diary-scroll::before,
.diary-scroll::after {
  content: '';
  position: absolute;
  left: -1px;
  right: -1px;
  height: 26px;
  border: 1px solid var(--scroll-line);
  background: linear-gradient(180deg, var(--scroll-edge-1) 0%, var(--scroll-edge-2) 52%, var(--scroll-edge-3) 100%);
  box-shadow: inset 0 2px 6px rgba(255,255,255,.22), 0 2px 6px rgba(48,32,18,.18);
}
.diary-scroll::before {
  top: -16px;
  border-radius: 18px 18px 10px 10px;
}
.diary-scroll::after {
  bottom: -16px;
  border-radius: 10px 10px 18px 18px;
}
.diary-scroll #diaryList {
  position: relative;
  z-index: 1;
}
.diary-year {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.45rem;
  font-weight: 600;
  text-align: center;
  margin: 0 0 10px;
  color: var(--scroll-ink);
}
.diary-entries { display: grid; gap: 6px; }
.diary-entry {
  border-bottom: 1px dashed var(--scroll-line);
  padding: 6px 0;
}
.diary-entry:last-child { border-bottom: 0; }
.diary-entry-link {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  text-decoration: none;
  color: var(--scroll-ink);
}
.diary-entry-date {
  font-size: .76rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--scroll-ink) 70%, transparent);
}
.diary-entry-title {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.04rem;
  line-height: 1.35;
}
.diary-entry-link:hover .diary-entry-title { color: var(--accent); }

.story-copy h2 a,
.story-date,
.story-excerpt,
.sub-nav a,
.site-name,
.footer-logo,
.lang-btn,
.theme-btn {
  transition: color .3s ease, border-color .3s ease, background-color .3s ease;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .about-intro { grid-template-columns: 1fr; }
  .about-image { min-height: 320px; max-width: 520px; }
  .about-profile { grid-template-columns: 1fr; }
  .about-photo { position: static; min-height: 360px; }
  .blog-subnav { top: 100px; }
  .blog-subnav-link { font-size: .72rem; }
  .articles-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .header-top { height: 60px; }
  .site-name { font-size: .95rem; }
  .hero { padding: 60px 0 52px; }
  .posts-section { padding: 48px 0; }
  .about-intro { padding: 36px 0 56px; gap: 28px; }
  .about-image { min-height: 260px; }
  .about-profile { padding: 42px 0 56px; }
  .blog-list-page { padding: 18px 20px 44px; max-width: 100vw; }
  .blog-subnav { margin-bottom: 16px; }
  .blog-subnav-link { font-size: .7rem; padding: 0 10px; }
  .articles-grid { grid-template-columns: 1fr; gap: 22px; }
  .diary-scroll { padding: 24px 14px 26px; }
  .diary-entry-link { grid-template-columns: 72px minmax(0, 1fr); gap: 10px; }
}


.kg-width-wide{width:100%;max-width:1100px;margin:2rem auto;}
.kg-width-full{width:100vw;max-width:100vw;margin:2rem calc(50% - 50vw);}
