@import url('boska.css');

:root {
  --bg: #f8f7f2;
  --bg-soft: #f2f0e8;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.9);

  --text: #24312b;
  --text-muted: #5f6f68;
  --text-faint: #8b9891;
  --line: rgba(36, 49, 43, 0.10);

  --accent: #6f8f72;
  --accent-deep: #4f6d57;
  --accent-pale: #dfe8dd;

  --shadow-soft: 0 12px 40px rgba(80, 96, 82, 0.08);
  --shadow-card: 0 20px 60px rgba(80, 96, 82, 0.10);

  --radius-sm: 18px;
  --radius-md: 28px;
  --radius-lg: 38px;

  --container: 1200px;
  --header-height: 92px;

  --parallax-depth: 0.1;

  --site-bg-depth: 0.22;
  --site-bg-opacity-back: 0.10;
  --site-bg-opacity-mid: 0.16;
  --site-bg-opacity-front: 0.12;
}

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

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  position: relative;
  font-family: 'General Sans', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background: var(--bg);
  color: var(--text);
}

.site-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.site-bg__gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(223, 232, 221, 0.85), transparent 30%),
    radial-gradient(circle at 85% 20%, rgba(223, 232, 221, 0.35), transparent 28%),
    linear-gradient(180deg, #f8f7f2 0%, #f4f2ea 100%);
}

.site-bg__layer {
  position: absolute;
  inset: -10%;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  will-change: transform;
}

.site-bg__layer--back {
  opacity: var(--site-bg-opacity-back);
  filter: blur(2px);
  background-image: url("../img/leaves/hero/leaves-back.svg");
  transform: translateY(calc(var(--scroll, 0) * -0.18px * var(--site-bg-depth)));
}

.site-bg__layer--mid {
  opacity: var(--site-bg-opacity-mid);
  background-image: url("../img/leaves/hero/leaves-mid.svg");
  transform: translateY(calc(var(--scroll, 0) * -0.10px * var(--site-bg-depth)));
}

.site-bg__layer--front {
  opacity: var(--site-bg-opacity-front);
  background-image: url("../img/leaves/hero/leaves-front.svg");
  transform: translateY(calc(var(--scroll, 0) * -0.05px * var(--site-bg-depth)));
}

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

a {
  color: inherit;
}

h1,
h2,
h3,
.hero-title,
.section-title {
  margin: 0;
  font-family: 'Boska', serif;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.section-actions {
  margin-top: 28px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.section-actions .btn {
  align-self: flex-start;
}

p {
  margin: 0;
}

.container {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
}

main#content {
  overflow: clip;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 1000;
  padding: 10px 14px;
  background: var(--text);
  color: #fff;
  border-radius: 999px;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 12px;
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 18px 0;
  background: rgba(248, 247, 242, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(36, 49, 43, 0.06);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 56px;
}

.site-header__cta {
  white-space: nowrap;
}

.site-nav a {
  position: relative;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
  transform: scaleX(1);
}
/*
.site-logo {
  color: var(--text);
  text-decoration: none;
  font-family: 'Boska', serif;
  font-size: 32px;
  line-height: 1;
  white-space: nowrap;
}
*/
.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

.site-logo__mark {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.site-logo__wordmark {
  font-family: 'Boska', serif;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.03em;
}

.site-logo__image {
  display: block;
  width: auto;
  height: 48px;
  max-width: 100%;
}

@media (max-width: 640px) {
  .site-logo__image {
    height: 40px;
  }
}

.site-nav {
  display: flex;
  gap: 26px;
  align-items: center;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 15px;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
}

.hero {
  position: relative;
  min-height: calc(100svh - var(--header-height));
  overflow: hidden;
  background: linear-gradient(
    180deg,
    rgba(248, 247, 242, 0.30) 0%,
    rgba(248, 247, 242, 0.12) 100%
  );
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 160px;
  background: linear-gradient(to bottom, rgba(248, 247, 242, 0), rgba(248, 247, 242, 0.72));
  z-index: 1;
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  min-height: calc(100svh - var(--header-height));
  padding-top: 96px;
  padding-bottom: 96px;
}

.hero__content {
  max-width: 760px;
  width: 100%;
}

.eyebrow {
  margin-bottom: 18px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hero-title {
  font-size: clamp(50px, 7.4vw, 104px);
  line-height: 0.92;
  color: var(--text);
  max-width: 20ch;
  text-align: left;
  margin-inline: 0;
  margin-bottom: 24px;
}

.hero-text {
  max-width: 620px;
  font-size: 20px;
  line-height: 1.75;
  color: var(--text-muted);
  font-weight: 300;
  margin-bottom: 36px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 14px 22px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.22s ease;
  font-size: 15px;
  font-weight: 500;
}

.btn-primary {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 10px 30px rgba(111, 143, 114, 0.18);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--accent-deep);
  transform: translateY(-1px);
}

.btn-secondary {
  color: var(--text);
  background: var(--surface-strong);
  border-color: var(--line);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: #fff;
}

.soft-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
  padding: 28px;
}

.section {
  position: relative;
  padding: 96px 0;
}

.section--soft {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.54),
    rgba(255, 255, 255, 0.36)
  );
  backdrop-filter: blur(6px);
}

.soft-card {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
  padding: 28px;
}

.section-head {
  margin-bottom: 28px;
  max-width: 760px;
}

.section-title {
  font-size: clamp(34px, 5vw, 64px);
  line-height: 0.98;
  margin-bottom: 18px;
}

.section-text {
  font-size: 18px;
  line-height: 1.75;
  color: var(--text-muted);
  max-width: 60ch;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
}

.content-grid > * {
  grid-column: span 4;
}

.parallax-layer {
  position: absolute;
  inset: -15%;
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 115%;
  will-change: transform;
}

.layer-back {
  opacity: 0.14;
  filter: blur(2px);
  background-image: url("../img/leaves/hero/leaves-back.svg");
  transform: translateY(calc(var(--scroll, 0) * 0.10px));
}

.layer-mid {
  opacity: 0.24;
  background-image: url("../img/leaves/hero/leaves-mid.svg");
  transform: translateY(calc(var(--scroll, 0) * -0.00px));
}

.layer-front {
  opacity: 0.34;
  background-image: url("../img/leaves/hero/leaves-front.svg");
  transform: translateY(calc(var(--scroll, 0) * -0.20px));
}

.site-footer {
  padding: 40px 0 56px;
  border-top: 1px solid rgba(36, 49, 43, 0.06);
  color: var(--text-muted);
}

@media (max-width: 1100px) {
  .content-grid > * {
    grid-column: span 6;
  }
}

@media (max-width: 900px), (prefers-reduced-motion: reduce) {
  .parallax-layer {
    transform: none !important;
    inset: 0;
    background-size: contain;
    background-position: top center;
  }

  .hero__inner {
    min-height: auto;
    padding-top: 110px;
    padding-bottom: 56px;
    align-items: flex-start;
  }

  .hero-title {
    font-size: clamp(36px, 9vw, 56px);
    line-height: 0.96;
    max-width: 11ch;
    margin-inline: 0;
  }

  .hero-text {
    font-size: 17px;
    line-height: 1.65;
  }

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

  .content-grid > * {
    grid-column: 1 / -1;
  }
}


@media (max-width: 640px) {
  .hero__inner {
    padding-top: 88px;
    padding-bottom: 48px;
  }

  .hero__content {
    max-width: 100%;
  }

  .hero-title {
    font-size: clamp(32px, 8.8vw, 44px);
    line-height: 1;
    max-width: 100%;
    margin-inline: 0;
    text-wrap: balance;
  }

  .container {
    width: min(100% - 24px, var(--container));
  }

  .site-header {
    padding: 14px 0;
  }

  .site-logo {
    font-size: 28px;
  }

  .site-nav {
    display: none;
  }

  .section {
    padding: 72px 0;
  }

  .section-title {
    font-size: clamp(30px, 9vw, 44px);
  }

  .soft-card {
    padding: 22px;
    border-radius: 24px;
  }

  .btn {
    width: 100%;
  }
}

.diary-grid {
  align-items: stretch;
}

.diary-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.diary-meta {
  margin-bottom: 12px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.diary-card__title {
  margin-bottom: 14px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.05;
}

.diary-card__title a {
  text-decoration: none;
  color: var(--text);
}

.diary-card__title a:hover,
.diary-card__title a:focus-visible {
  color: var(--accent-deep);
}

.diary-card__text {
  margin-bottom: 24px;
}

.diary-card__footer {
  margin-top: auto;
}

.diary-empty {
  max-width: 760px;
}

.diary-empty h2 {
  margin-bottom: 14px;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1;
}

.post-layout {
  max-width: 860px;
}

.post-title {
  margin-bottom: 18px;
}

.post-excerpt {
  max-width: 52rem;
  margin-bottom: 28px;
  font-size: 20px;
  line-height: 1.7;
  color: var(--text-muted);
}

.post-cover {
  margin: 0 0 32px;
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.post-cover img {
  width: 100%;
  height: auto;
  display: block;
}

.post-body {
  max-width: 720px;
  font-size: 18px;
  line-height: 1.85;
  color: var(--text);
}

.post-body p {
  margin-bottom: 1.2em;
}

.post-body h2,
.post-body h3 {
  margin-top: 2em;
  margin-bottom: 0.6em;
}

.post-footer {
  margin-top: 40px;
}

@media (max-width: 640px) {
  .diary-card__title {
    font-size: 28px;
  }

  .diary-meta {
    font-size: 12px;
  }

  .post-excerpt {
    font-size: 18px;
  }

  .post-body {
    font-size: 17px;
    line-height: 1.75;
  }
}

/* =========================
   Form styles
   Добавить в конец site.css
   ========================= */

.form-row {
  display: flex;
  flex-direction: column;
}

.form-row label {
  margin-bottom: 10px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.form-input,
.form-select,
.form-textarea,
.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  padding: 14px 16px;
  font: inherit;
  line-height: 1.5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
  appearance: none;
}

.form-select {
  padding-right: 44px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 22px) calc(50% - 2px),
    calc(100% - 16px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.form-textarea,
.form-row textarea {
  min-height: 160px;
  resize: vertical;
}

.form-input::placeholder,
.form-textarea::placeholder,
.form-row input::placeholder,
.form-row textarea::placeholder {
  color: var(--text-faint);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover,
.form-row input:hover,
.form-row select:hover,
.form-row textarea:hover {
  border-color: rgba(79, 109, 87, 0.22);
  background: rgba(255, 255, 255, 0.9);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow:
    0 0 0 4px rgba(111, 143, 114, 0.12),
    0 10px 24px rgba(80, 96, 82, 0.08);
}

.form-errors {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(150, 66, 25, 0.08);
  border: 1px solid rgba(150, 66, 25, 0.16);
}

.form-errors p {
  margin: 0;
}

.form-row ul.errorlist {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.form-row ul.errorlist li {
  color: #964219;
  font-size: 15px;
  line-height: 1.5;
}

.form-row .helptext {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-faint);
}

.form-row input[type="checkbox"] {
  width: auto;
}

.form-row + .form-row {
  margin-top: 2px;
}

@media (max-width: 640px) {
  .form-input,
  .form-select,
  .form-textarea,
  .form-row input,
  .form-row select,
  .form-row textarea {
    padding: 13px 14px;
    border-radius: 16px;
    font-size: 16px;
  }

  .form-row label {
    font-size: 14px;
  }

  .form-row .helptext {
    font-size: 13px;
  }
}

/* =========================
   Wagtail styles 
   for entries
   ========================= */

.entry-figure {
    margin: 2rem 0;
}

.entry-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 1rem;
}

.entry-figcaption {
    margin-top: 0.75rem;
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.entry-stream p {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

/* =========================
   Django messages
   Добавить в конец site.css
   ========================= */

.messages {
  margin-top: 20px;
  margin-bottom: 0;
}

.message {
  padding: 16px 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
  font-size: 15px;
  line-height: 1.6;
}

.message + .message {
  margin-top: 12px;
}

.message.success {
  background: rgba(223, 232, 221, 0.72);
  border-color: rgba(111, 143, 114, 0.22);
  color: var(--accent-deep);
  box-shadow: 0 12px 30px rgba(111, 143, 114, 0.10);
}

.message.error,
.message.warning,
.message.info {
  background: rgba(255, 255, 255, 0.86);
}

@media (max-width: 640px) {
  .messages {
    margin-top: 16px;
  }

  .message {
    padding: 14px 16px;
    border-radius: 16px;
    font-size: 14px;
  }
}

/*=====================================*/

.mobile-menu-toggle {
  display: none;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}

.mobile-menu-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
}

.mobile-menu {
  display: none;
}

.mobile-menu.is-open {
  display: block;
}

.mobile-menu__inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
  padding-bottom: 18px;
}

.mobile-menu__inner a {
  display: block;
  padding: 12px 0;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid rgba(36, 49, 43, 0.06);
}

.mobile-menu__inner a:last-child {
  border-bottom: none;
}

@media (max-width: 900px) {
  .site-header__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }

  .site-header__cta {
    display: none;
  }

  .mobile-menu-toggle {
    display: inline-flex;
    flex-shrink: 0;
  }

  .site-nav {
    display: none;
  }

  .mobile-menu {
    border-top: 1px solid rgba(36, 49, 43, 0.06);
    background: rgba(248, 247, 242, 0.9);
    backdrop-filter: blur(14px);
  }

  .hero__inner {
    min-height: auto;
    padding-top: 110px;
    padding-bottom: 56px;
    align-items: flex-start;
  }

  .hero__content {
    max-width: 100%;
  }

  .hero-title {
    max-width: 100%;
    margin-inline: 0;
    font-size: clamp(36px, 9vw, 56px);
    line-height: 1.02;
  }

  .hero-text {
    max-width: 100%;
    font-size: 17px;
    line-height: 1.7;
  }

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

  .hero__actions .btn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 24px, var(--container));
  }

  .site-header {
    padding: 14px 0;
  }

  .site-logo {
    font-size: 24px;
  }

  .mobile-menu-toggle {
    width: 42px;
    height: 42px;
  }

  .mobile-menu__inner {
    padding-top: 6px;
    padding-bottom: 14px;
  }

  .mobile-menu__inner a {
    padding: 11px 0;
    font-size: 15px;
  }

  .hero__inner {
    padding-top: 88px;
    padding-bottom: 48px;
  }

  .hero-title {
    font-size: clamp(31px, 10.5vw, 42px);
    line-height: 1.06;
    letter-spacing: -0.03em;
  }

  .section {
    padding: 72px 0;
  }

  .section-title {
    font-size: clamp(30px, 9vw, 44px);
  }

  .soft-card {
    padding: 22px;
    border-radius: 24px;
  }

  .btn {
    width: 100%;
  }
}