/* =========================================
   МОХ — Малые формы новой литературы
   Design: organic, moss-inspired, editorial
   ========================================= */

:root {
  --bg: #ffffff;
  --bg-deep: #f7f7f5;
  --text: #000000;
  --text-muted: #555555;
  --text-light: #888888;
  --accent: #94A996;
  --accent-light: #a8bba9;
  --accent-pale: #d0ddd1;
  --border: #e0e0e0;
  --white: #ffffff;
  --shadow: rgba(0, 0, 0, 0.06);

  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-body: 'Cormorant Garamond', 'Georgia', serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  --max-w: 1800px;
  --max-w-text: 900px;
  --gap: clamp(2rem, 5vw, 4rem);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  font-size: clamp(17px, 1.15vw, 20px);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

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

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

/* ---- Noise texture overlay (disabled — clean white) ---- */

/* =========================================
   Navigation
   ========================================= */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem var(--gap);
  background: transparent;
  transition: background 0.4s, box-shadow 0.4s, padding 0.4s;
}

.nav--scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--border);
  padding: 1.5rem var(--gap);
}

.nav__logo {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: #000000;
}

.nav__links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav__link {
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.3s;
  text-transform: lowercase;
}

.nav__link:hover {
  color: var(--accent);
}

/* =========================================
   Hero
   ========================================= */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding: 2rem var(--gap);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse at 20% 50%, rgba(74, 103, 65, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 30%, rgba(107, 140, 94, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(74, 103, 65, 0.04) 0%, transparent 40%);
}

.hero__inner {
  position: relative;
  z-index: 1;
  width: fit-content;
  text-align: center;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(5rem, 15vw, 12rem);
  font-weight: 300;
  letter-spacing: 0.2em;
  color: #000000;
  line-height: 1;
  margin-bottom: 0.5rem;
  animation: fadeUp 1.2s ease-out;
}

.hero__subtitle {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  letter-spacing: 0.1em;
  color: #000000;
  text-transform: lowercase;
  margin-bottom: 2rem;
  animation: fadeUp 1.2s ease-out 0.2s both;
  display: block;
  transform-origin: center center;
}

.hero__desc {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 400;
  color: #000000;
  font-style: italic;
  animation: fadeUp 1.2s ease-out 0.4s both;
  display: block;
  width: 100%;
  text-align: center;
}

.hero__scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 6rem;
  color: var(--text-light);
  animation: float 3s ease-in-out infinite;
  z-index: 1;
}

/* =========================================
   Sections
   ========================================= */

.section {
  padding: clamp(3rem, 8vw, 6rem) var(--gap);
}

.section__inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

/* =========================================
   Cards (text excerpts)
   ========================================= */

.texts__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5rem 3rem;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem;
  background: transparent;
  border: none;
  border-radius: 0;
  transition: transform 0.3s;
  animation: fadeUp 0.6s ease-out both;
}

.card:hover {
  transform: translateY(-5px);
}

.card__illustration {
  width: 100%;
  max-width: 400px;
  height: 320px;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.card__illustration img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: opacity 0.4s;
}

.card__excerpt {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  font-family: var(--font-body);
  font-size: 1.1rem;
  line-height: 1.6;
  color: #000000;
  text-align: center;
  opacity: 0;
  transition: opacity 0.4s;
  overflow: hidden;
}

.card:hover .card__illustration img {
  opacity: 0.08;
}

.card:hover .card__excerpt {
  opacity: 1;
}

.card--featured {
  /* no special treatment */
}

.card__meta {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  border-top: none;
  padding-top: 0;
}

.card__title {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 500;
  color: #000000;
}

.card__author {
  font-family: var(--font-body);
  font-size: 1.8rem;
  letter-spacing: 0;
  color: var(--text-muted);
  text-transform: none;
  font-weight: 400;
}

/* Featured section */
.featured .section__inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5rem 3rem;
}

/* CTA section */
.cta {
  text-align: center;
  padding: clamp(4rem, 10vw, 8rem) var(--gap);
  background: var(--bg-deep);
}

.cta__text {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.cta__link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  border-bottom: 1px solid var(--accent-pale);
  padding-bottom: 2px;
  transition: border-color 0.3s;
}

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

/* =========================================
   Article page
   ========================================= */

.article {
  max-width: var(--max-w-text);
  margin: 0 auto;
  padding: 8rem var(--gap) 4rem;
}

.article__header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.article__title-circle {
  position: relative;
  width: min(700px, 90vw);
  height: min(700px, 90vw);
  margin: 0 auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.article__title-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.article__title-overlay {
  position: relative;
  z-index: 1;
  width: 70%;
  height: 70%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  overflow: hidden;
}

.article__title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3.5vw, 2.6rem);
  font-weight: 400;
  line-height: 1.2;
  color: #000000;
  word-break: break-word;
}

.article__author {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0;
  color: #000000;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.article__bio {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--text-muted);
}

.article__social {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.article__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  opacity: 0.5;
  transition: opacity 0.3s;
}

.article__social-link:hover {
  opacity: 1;
}

.article__social-link img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Reader controls */
.reader-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: 30px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.reader-controls__btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-muted);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.reader-controls__btn:hover {
  color: #000;
  background: var(--bg-deep);
}

.reader-controls__size {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 2rem;
  text-align: center;
}

.reader-controls__sep {
  width: 1px;
  height: 1.2rem;
  background: var(--border);
  margin: 0 0.3rem;
}

.reader-controls__font {
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 1rem;
  color: var(--text-muted);
  transition: color 0.2s, border-color 0.2s;
}

.reader-controls__font[data-font="serif"] {
  font-family: 'Cormorant Garamond', Georgia, serif;
}

.reader-controls__font[data-font="sans"] {
  font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
}

.reader-controls__font--mono {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
}

.reader-controls__font--active {
  color: #000;
  border-color: var(--accent);
}

.article__body {
  font-family: var(--font-mono);
  font-size: clamp(1.3rem, 1.6vw, 1.45rem);
  line-height: 1.85;
  color: var(--text);
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.article__body p,
.article__body br + br {
  margin-bottom: 1em;
}

/* More stories */
.article__more {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 3px solid var(--accent);
}

.article__more-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem 2rem;
  max-width: var(--max-w);
  margin: 0 auto;
}

.article__more .card__illustration {
  max-width: 180px;
  height: 150px;
}

.article__more .card__title {
  font-size: 2rem;
}

.article__more .card__author {
  font-size: 1.2rem;
}

/* =========================================
   Pages (popast, 404)
   ========================================= */

.page {
  max-width: var(--max-w-text);
  margin: 0 auto;
  padding: 8rem var(--gap) 4rem;
}

.page__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  margin-bottom: 2rem;
}

.page--404 {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  max-width: 100%;
}

.page--404 .page__inner {
  max-width: var(--max-w-text);
  margin: 0 auto;
}

.page--404 .page__title {
  font-size: clamp(4rem, 10vw, 8rem);
  color: var(--accent-pale);
  font-weight: 300;
}

/* Popast */
.popast__section {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.popast__section:last-child {
  border-bottom: none;
}

.popast__heading {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 400;
  margin-bottom: 1.5rem;
  color: #000000;
}

.popast__section p {
  margin-bottom: 1rem;
  font-size: 1.15rem;
  line-height: 1.7;
}

.popast__section ol {
  padding-left: 1.5rem;
  font-size: 1.15rem;
}

.popast__section ol li {
  margin-bottom: 1rem;
  line-height: 1.7;
}

.popast__section a {
  color: var(--accent);
  border-bottom: 1px solid var(--accent-pale);
}

.popast__cta {
  text-align: center;
}

.popast__cta .btn {
  width: 100%;
  font-size: 1.5rem;
  padding: 1.2rem 2rem;
  border-radius: 8px;
  color: #ffffff;
}

/* =========================================
   Search overlay
   ========================================= */

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 20vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.search-overlay--open {
  opacity: 1;
  pointer-events: all;
}

.search-overlay__close {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.3s;
  line-height: 1;
}

.search-overlay__close:hover { color: var(--text); }

.search-overlay__inner {
  width: 90%;
  max-width: 600px;
}

.search-overlay__input {
  width: 100%;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  background: none;
  border: none;
  border-bottom: 2px solid var(--border);
  padding: 0.5rem 0;
  color: var(--text);
  outline: none;
  transition: border-color 0.3s;
}

.search-overlay__input:focus {
  border-color: var(--accent);
}

.search-overlay__input::placeholder {
  color: var(--text-light);
  font-style: italic;
}

.search-overlay__results {
  margin-top: 2rem;
}

.search-result {
  display: block;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  transition: padding-left 0.3s;
}

.search-result:hover {
  padding-left: 0.5rem;
}

.search-result__title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--accent);
}

.search-result__author {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* =========================================
   Button
   ========================================= */

.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.8rem 2rem;
  background: var(--accent);
  color: #ffffff;
  border: 1px solid var(--accent);
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
  text-decoration: none;
}

.btn:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: transparent;
}

/* =========================================
   Footer
   ========================================= */

.footer {
  padding: 2rem var(--gap);
  background: var(--accent);
}

.footer__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer__copy {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: #ffffff;
}

.footer__social {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.footer__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  opacity: 0.8;
  transition: opacity 0.3s;
  filter: brightness(0) invert(1);
}

.footer__social-link:hover {
  opacity: 1;
}

.footer__social-link img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* =========================================
   Texts empty state
   ========================================= */

.texts__empty {
  text-align: center;
  padding: 4rem 2rem;
  font-style: italic;
  color: var(--text-muted);
}

/* =========================================
   Animations
   ========================================= */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* =========================================
   Responsive
   ========================================= */

@media (max-width: 960px) {
  .texts__grid,
  .featured .section__inner {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem 2rem;
  }
}

@media (max-width: 768px) {
  .nav__links { gap: 1.2rem; }

  .texts__grid,
  .featured .section__inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .article__more-grid {
    grid-template-columns: 1fr;
  }

  .footer__inner {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero__title {
    letter-spacing: 0.12em;
  }

  .nav__logo {
    font-size: 2.5rem;
  }

  .nav__links {
    gap: 0.8rem;
  }

  .nav__link {
    font-size: 0.85rem;
  }
}
