/* Общие стили для всех страниц проекта quietmorning. */
:root {
  color-scheme: light;
  --paper: #FBF9F5;
  --ink: #2F3432;
  --sage: #7C9082;
  --sand: #D9C7AE;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}

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

ul,
ol {
  margin-block: 0;
}

p,
li,
a,
h1,
h2,
h3 {
  overflow-wrap: break-word;
}

p {
  margin-block: 0 1.25rem;
}

h1,
h2,
h3 {
  margin-block: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.025em;
}

h1 {
  max-width: 14ch;
  font-size: clamp(2.65rem, 6vw, 4.85rem);
  line-height: 1.05;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.15rem);
  line-height: 1.12;
}

h3 {
  font-size: clamp(1.3rem, 2vw, 1.55rem);
  line-height: 1.25;
}

a {
  color: var(--ink);
  text-decoration-color: var(--sage);
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 0.18em;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}

.container {
  width: min(calc(100% - 2rem), 70rem);
  margin-inline: auto;
}

.prose {
  max-width: 45rem;
}

.section {
  padding-block: clamp(4.5rem, 7vw, 6rem);
}

.section-tinted {
  background: rgb(217 199 174 / 28%);
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.75rem 1rem;
  transform: translateY(-180%);
  border: 1px solid var(--ink);
  border-radius: 0.75rem;
  background: var(--paper);
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  z-index: 20;
  border-bottom: 1px solid rgb(47 52 50 / 12%);
  background: var(--paper);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 5.5rem;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 0.7rem;
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1;
  text-decoration: none;
}

.brand img {
  flex: none;
}

.desktop-nav,
.nav-list {
  display: flex;
  align-items: center;
}

.nav-list,
.footer-nav {
  padding: 0;
  list-style: none;
}

.nav-list {
  gap: clamp(1rem, 3vw, 2.25rem);
}

.nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-size: 0.95rem;
  font-weight: 650;
  text-decoration: none;
}

.nav-list a:hover,
.nav-list a:focus-visible {
  text-decoration: underline;
  text-decoration-color: var(--sage);
  text-decoration-thickness: 0.14em;
  text-underline-offset: 0.35em;
}

.mobile-nav {
  display: none;
  position: relative;
}

.mobile-nav summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.75rem;
  min-height: 3rem;
  gap: 0.65rem;
  padding-inline: 0.8rem;
  border: 1px solid rgb(47 52 50 / 18%);
  border-radius: 0.75rem;
  background: var(--paper);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  list-style: none;
}

.mobile-nav summary::-webkit-details-marker {
  display: none;
}

.menu-icon,
.menu-icon::before,
.menu-icon::after,
.menu-icon > span {
  display: block;
  width: 1.15rem;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
}

.menu-icon {
  position: relative;
  background: transparent;
}

.menu-icon::before,
.menu-icon::after,
.menu-icon > span {
  position: absolute;
  left: 0;
  content: "";
}

.menu-icon::before {
  top: -0.32rem;
}

.menu-icon > span {
  top: 0;
}

.menu-icon::after {
  top: 0.32rem;
}

.mobile-nav[open] .menu-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.mobile-nav[open] .menu-icon > span {
  opacity: 0;
}

.mobile-nav[open] .menu-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

.mobile-nav-panel {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  z-index: 30;
  width: 17rem;
  max-width: calc(100vw - 2rem);
  padding: 0.65rem;
  border: 1px solid rgb(47 52 50 / 14%);
  border-radius: 1rem;
  background: var(--paper);
  box-shadow: 0 1.1rem 2.6rem rgb(47 52 50 / 12%);
}

.mobile-nav-panel .nav-list {
  align-items: stretch;
  flex-direction: column;
  gap: 0;
}

.mobile-nav-panel .nav-list a {
  display: flex;
  min-height: 3rem;
  padding-inline: 0.75rem;
  border-radius: 0.6rem;
}

.mobile-nav-panel .nav-list a:hover {
  background: rgb(217 199 174 / 35%);
}

.eyebrow,
.card-kicker,
.contact-label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  line-height: 1.35;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 2rem;
  height: 2px;
  background: var(--sage);
  content: "";
}

.hero {
  padding-block: clamp(4.5rem, 9vw, 7.5rem);
}

.hero-grid {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1.1fr) minmax(18rem, 0.9fr);
  gap: clamp(3rem, 7vw, 6.5rem);
}

.hero-copy,
.hero-figure,
.topic-card,
.preview-card,
.entry-content,
.contact-card {
  min-width: 0;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 40rem;
  margin-top: 1.75rem;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.75;
}

.hero-copy .text-link {
  margin-top: 0.35rem;
}

.hero-figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgb(47 52 50 / 10%);
  border-radius: 1rem;
  background: var(--sand);
}

.hero-figure::after {
  position: absolute;
  inset: 1rem;
  border: 1px solid rgb(47 52 50 / 12%);
  border-radius: 0.7rem;
  content: "";
  pointer-events: none;
}

.hero-figure img {
  width: 100%;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 750;
}

.text-link span {
  font-size: 1.15em;
  line-height: 1;
}

.section-heading {
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section-heading h2 {
  margin-bottom: 1.25rem;
}

.section-heading > p:last-child {
  max-width: 42rem;
  margin-bottom: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2.2vw, 1.5rem);
}

.topic-card,
.preview-card {
  border: 1px solid rgb(47 52 50 / 10%);
  border-radius: 1rem;
  background: var(--paper);
}

.topic-card {
  padding: clamp(1.5rem, 3vw, 2.2rem);
}

.topic-card img {
  margin-bottom: 1.75rem;
}

.topic-card h3,
.preview-card h3 {
  margin-bottom: 0.85rem;
}

.topic-card p,
.preview-card p {
  margin-bottom: 0;
}

.habits-layout {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: clamp(3rem, 7vw, 6rem);
}

.habits-intro {
  margin-bottom: 0;
}

.habits-intro h2 {
  margin-bottom: 1.25rem;
}

.habit-list {
  padding: 0;
  counter-reset: habits;
  list-style: none;
}

.habit-list li {
  display: grid;
  align-items: start;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: 1.2rem;
  padding-block: 1.35rem;
  border-top: 1px solid rgb(47 52 50 / 14%);
  counter-increment: habits;
}

.habit-list li:last-child {
  border-bottom: 1px solid rgb(47 52 50 / 14%);
}

.habit-list li::before {
  display: grid;
  width: 2.6rem;
  height: 2.6rem;
  place-items: center;
  border-radius: 50%;
  background: var(--sand);
  content: counter(habits, decimal-leading-zero);
  font-family: var(--serif);
  font-size: 1rem;
}

.habit-list h3 {
  margin-bottom: 0.35rem;
  font-size: 1.25rem;
}

.habit-list p {
  margin-bottom: 0;
}

.preview-card {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  padding: clamp(1.5rem, 3vw, 2rem);
}

.preview-card .card-kicker {
  margin-bottom: 1.2rem;
}

.preview-card > p:not(.card-kicker) {
  margin-bottom: 1.5rem;
}

.preview-card .text-link {
  margin-top: auto;
}

.quote-section {
  padding-block: clamp(4.5rem, 8vw, 7rem);
}

.quote-section blockquote {
  max-width: 55rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 2.75rem) clamp(1.5rem, 5vw, 3.5rem);
  border-left: 0.35rem solid var(--sage);
  background: rgb(217 199 174 / 34%);
}

.quote-section p {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.65rem, 3vw, 2.5rem);
  line-height: 1.35;
}

.page-intro {
  padding-block: clamp(4.5rem, 8vw, 7rem);
}

.page-intro h1 {
  margin-bottom: 1.5rem;
}

.page-lede {
  max-width: 42rem;
  margin-bottom: 0;
  font-size: clamp(1.08rem, 1.8vw, 1.25rem);
  line-height: 1.75;
}

.journal-list {
  display: grid;
  max-width: 60rem;
  gap: 1.5rem;
}

.journal-entry {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: clamp(1.75rem, 5vw, 4rem);
  padding: clamp(1.5rem, 4vw, 3rem);
  scroll-margin-top: 2rem;
  border: 1px solid rgb(47 52 50 / 10%);
  border-radius: 1rem;
  background: var(--paper);
}

.journal-entry:target {
  border-color: var(--sage);
  outline: 3px solid rgb(124 144 130 / 28%);
  outline-offset: 4px;
}

.entry-meta {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 0.85rem;
  color: rgb(47 52 50 / 78%);
  font-size: 0.875rem;
  font-weight: 650;
}

.entry-number {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 400;
  line-height: 1;
}

.entry-content {
  max-width: 45rem;
}

.entry-content h2 {
  margin-bottom: 1.5rem;
  font-size: clamp(1.85rem, 4vw, 2.75rem);
}

.entry-content ul {
  margin: -0.25rem 0 1.4rem;
  padding-left: 1.3rem;
}

.entry-content li {
  margin-bottom: 0.35rem;
  padding-left: 0.4rem;
}

.soft-close {
  margin-top: 1.75rem;
  margin-bottom: 0;
  padding-left: 1.1rem;
  border-left: 3px solid var(--sage);
  font-family: var(--serif);
  font-size: 1.15rem;
}

.contacts-hero {
  display: grid;
  align-items: end;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.55fr);
  gap: clamp(3rem, 8vw, 7rem);
}

.contact-card {
  margin: 0;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid rgb(47 52 50 / 10%);
  border-radius: 1rem;
  background: var(--sand);
  font-style: normal;
}

.contact-card a {
  display: inline-block;
  max-width: 100%;
  margin-bottom: 1rem;
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.contact-card p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

.content-stack {
  display: grid;
  max-width: 60rem;
}

.content-section {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  padding-block: clamp(2.5rem, 5vw, 4rem);
  border-top: 1px solid rgb(47 52 50 / 14%);
}

.content-section:last-child {
  border-bottom: 1px solid rgb(47 52 50 / 14%);
}

.content-section h2 {
  margin-bottom: 1.5rem;
}

.section-index {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.4rem;
}

.important-section .prose {
  padding: clamp(1.25rem, 3vw, 2rem);
  border-left: 0.3rem solid var(--sage);
  background: var(--paper);
}

.site-footer {
  padding-block: clamp(3.5rem, 7vw, 5rem) 2rem;
  background: var(--ink);
  color: var(--paper);
}

.site-footer a,
.site-footer .brand {
  color: var(--paper);
  text-decoration-color: var(--sand);
}

.site-footer :focus-visible {
  outline-color: var(--paper);
}

.footer-top {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 2rem;
  padding-bottom: 2.25rem;
}

.footer-brand {
  justify-self: start;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

.footer-nav a {
  font-size: 0.9rem;
  font-weight: 650;
}

.footer-email {
  justify-self: end;
  max-width: 100%;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.footer-disclaimer {
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr);
  gap: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgb(251 249 245 / 22%);
  color: rgb(251 249 245 / 78%);
  font-size: 0.875rem;
  line-height: 1.65;
}

.footer-disclaimer p {
  margin: 0;
}

.disclaimer-label {
  color: var(--paper);
  font-weight: 750;
}

.copyright {
  margin: 2rem 0 0;
  color: rgb(251 249 245 / 72%);
  font-size: 0.82rem;
}

@media (max-width: 56rem) {
  .hero-grid,
  .habits-layout,
  .contacts-hero {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    max-width: 48rem;
  }

  .hero-figure {
    width: min(100%, 34rem);
    margin-inline: auto;
  }

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

  .topic-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-top {
    align-items: start;
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-nav {
    justify-content: flex-start;
  }
}

@media (max-width: 47.99rem) {
  .desktop-nav {
    display: none;
  }

  .mobile-nav {
    display: block;
  }

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

  .journal-entry {
    grid-template-columns: 1fr;
    gap: 1.4rem;
  }

  .entry-meta {
    align-items: baseline;
    flex-direction: row;
    justify-content: space-between;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgb(47 52 50 / 10%);
  }

  .content-section {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .footer-disclaimer {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

@media (max-width: 36rem) {
  .container {
    width: min(calc(100% - 1.5rem), 70rem);
  }

  .header-inner {
    min-height: 4.75rem;
    gap: 0.75rem;
  }

  .brand {
    gap: 0.5rem;
    font-size: 1.08rem;
  }

  .brand img {
    width: 2.25rem;
    height: 2.25rem;
  }

  .mobile-nav summary {
    min-width: 3rem;
    padding-inline: 0.7rem;
  }

  .mobile-nav summary > span:first-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .hero-grid {
    gap: 2.5rem;
  }

  .habit-list li {
    grid-template-columns: 2.6rem minmax(0, 1fr);
    gap: 0.85rem;
  }

  .habit-list li::before {
    width: 2.3rem;
    height: 2.3rem;
    font-size: 0.9rem;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .footer-brand,
  .footer-email {
    justify-self: start;
  }

  .footer-nav {
    gap: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
