/* =========================================================
   TABLE OF CONTENTS
   ---------------------------------------------------------
   1. FONTS
   2. VARIABLES
   3. BASE
   4. LAYOUT
   5. COMPONENTS
   6. UTILITIES
   7. MEDIA QUERIES
   ========================================================= */

/* =========================================================
   1. FONTS
   ========================================================= */

@font-face {
  font-family: "EB Garamond";
  src:
    url("../fonts/EBGaramond/EBGaramond-Regular.woff2") format("woff2"),
    url("../fonts/EBGaramond/EBGaramond-Regular.woff") format("woff"),
    url("../fonts/EBGaramond/EBGaramond-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "EB Garamond";
  src:
    url("../fonts/EBGaramond/EBGaramond-Italic.woff2") format("woff2"),
    url("../fonts/EBGaramond/EBGaramond-Italic.woff") format("woff"),
    url("../fonts/EBGaramond/EBGaramond-Italic.ttf") format("truetype");
  font-weight: normal;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "EB Garamond";
  src:
    url("../fonts/EBGaramond/EBGaramond-Bold.woff2") format("woff2"),
    url("../fonts/EBGaramond/EBGaramond-Bold.woff") format("woff"),
    url("../fonts/EBGaramond/EBGaramond-Bold.ttf") format("truetype");
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "EB Garamond";
  src:
    url("../fonts/EBGaramond/EBGaramond-BoldItalic.woff2") format("woff2"),
    url("../fonts/EBGaramond/EBGaramond-BoldItalic.woff") format("woff"),
    url("../fonts/EBGaramond/EBGaramond-BoldItalic.ttf") format("truetype");
  font-weight: bold;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Cousine";
  src:
    url("../fonts/Cousine/Cousine-Regular.woff2") format("woff2"),
    url("../fonts/Cousine/Cousine-Regular.woff") format("woff"),
    url("../fonts/Cousine/Cousine-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Cousine";
  src:
    url("../fonts/Cousine/Cousine-Italic.woff2") format("woff2"),
    url("../fonts/Cousine/Cousine-Italic.woff") format("woff"),
    url("../fonts/Cousine/Cousine-Italic.ttf") format("truetype");
  font-weight: normal;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Cousine";
  src:
    url("../fonts/Cousine/Cousine-Bold.woff2") format("woff2"),
    url("../fonts/Cousine/Cousine-Bold.woff") format("woff"),
    url("../fonts/Cousine/Cousine-Bold.ttf") format("truetype");
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Cousine";
  src:
    url("../fonts/Cousine/Cousine-BoldItalic.woff2") format("woff2"),
    url("../fonts/Cousine/Cousine-BoldItalic.woff") format("woff"),
    url("../fonts/Cousine/Cousine-BoldItalic.ttf") format("truetype");
  font-weight: bold;
  font-style: italic;
  font-display: swap;
}

/* =========================================================
   2. VARIABLES
   ========================================================= */

:root {
  --bg: #171410;
  --bg-veil: rgba(23, 20, 16, .76); /* цвет тот же, что --bg, но с альфа-значением */
  --paper: #d6c6aa;
  --paper-dim: #a99b83;
  --ink: #211c17;
  --text: #d8ccb8;
  --muted: #938776;
  --rust: #8e5b3f;
  --line: rgba(210, 197, 173, .18);
  --serif: "EB Garamond", Georgia, serif;
  --mono: "Cousine", "Courier New", monospace;
  --sidebar-width: 14.44rem; /* было 260px; */
}

/* =========================================================
   3. BASE
   ========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  font-size: 112.5%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100lvh;
  min-height: 100dvh;

  display: flex;
  flex-direction: column;

  color: var(--text);
  background: var(--bg);
  font-family: var(--serif);
  line-height: 1.45;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(var(--bg-veil), var(--bg-veil)),
    url("../images/bg-texture.png") center / cover no-repeat var(--bg);
}

header, aside, nav, main, footer, article, section {
  display: block;
}

dl,
dt,
dd {
  margin: 0;
  padding: 0;
}

dl {
  margin: 1em 0;
}

dd {
  margin-left: 2.5em;
}

dd + dt {
  margin-top: 2em;
}

p  {
  margin: 1em 0;
}

h1 {
  margin: 0.67em 0;
  font-weight: bold;
  text-align: center;
}

h2 {
  margin: 0.83em 0;
}

/* h3 { margin: 1em 0; }
h4 { margin: 1.33em 0; }
h5 { margin: 1.67em 0; }
h6 { margin: 2.33em 0; } */

/* h1, h2,
h3, h4 {
  text-wrap: balance;
} */

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

/* ---------------- LISTS ---------------- */

ul, ol {
  margin: 0;
  padding: 0;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
}

/* ---------------- LINKS ---------------- */

a {
  color: var(--rust);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-thickness: from-font;
  text-decoration-color: color-mix(in srgb, var(--rust) 40%, transparent);
}

a:hover {
  text-decoration-color: var(--rust);
}

/* =========================================================
   4. LAYOUT
   ========================================================= */

/* ---------------- SIDEBAR ---------------- */

.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--sidebar-width);
  padding: 1.89rem 2.33rem 2.78rem 2.11rem;
  border-right: 1px solid rgba(215, 201, 176, .13);
  overflow-y: auto;
}

/* ---------------- MAIN ---------------- */

.main-content {
  position: relative;
  margin-left: var(--sidebar-width);
  padding: 2.67rem 2.78rem 4.44rem;
  flex: 1;
}

/* чат гпт предлагал
.main-content > * {
  max-width: 70ch;
} */

/* ---------------- FOOTER ---------------- */

.site-footer {
  text-align: center;
  margin-left: var(--sidebar-width);
  padding: 2rem 1rem;
  border-top: 1px solid rgba(215, 201, 176, .13);
}

/* =========================================================
   5. COMPONENTS
   ========================================================= */

/* ---------------- SKIP LINK ---------------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: #fff;
  color: #000;
}

.skip-link:focus {
  left: 0;
}

/* ---------------- MENU ---------------- */

.site-menu {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.site-menu li {
  margin: 0 0 0.39rem;
}

.site-menu a {
  display: inline-block;

  color: var(--muted);
  transition: color .15s ease;

  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: .025em;

  text-decoration: none;
}

.site-menu a::before {
  content: "— ";

  color: rgba(210, 197, 173, .28);
}

.site-menu a:hover {
  color: var(--paper);
}

.site-menu a:hover::before {
  color: var(--rust);
}

.site-menu a:focus-visible {
  outline: 1px solid var(--paper);
  outline-offset: 4px;
}

/* ---------------- FOOTER ---------------- */

.site-footer img {
  display: inline-block;
  vertical-align: middle;
}

/* ---------------- ALPHA INDEX ---------------- */

.alpha-index {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25rem .5rem;
  margin: 1.5rem 0;
  padding: .75rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.alpha-index a {
  display: inline-block;
  min-width: 1.75em;
  padding: .15em .3em;
  text-align: center;

  font-family: var(--mono);
  font-size: .85rem;
  color: var(--muted);
  text-decoration: none;

  transition: color .15s ease, background-color .15s ease;
}

.alpha-index a:hover {
  color: var(--paper);
  background: rgba(210, 197, 173, .08);
}

.alpha-index a:focus-visible {
  outline: 1px solid var(--paper);
  outline-offset: 2px;
}

.letter-section + .letter-section {
  margin-top: 2rem;
}

/* ---------------- LINKS PAGE ---------------- */

.link-me {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.cool-sites {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.buttons-grid {
  list-style: none;
  display:flex;
  flex-flow:row wrap;
  gap:5px;
  justify-content:center;
  line-height:31px
}

.buttons-grid li {
  margin: 0;
}

.buttons-grid li:hover {
  position: relative;
  top: 1px;
}

/* ---------------- DECORATIVE IMAGES ---------------- */

.decorative-image {
  position: absolute;
  z-index: -1;
  pointer-events: none;
}

#elephant-de-seve {
  width: 200px;
  height: auto;
  top: 375px;
  left: -125px;
  transform: rotate(4deg);
  opacity: .2;
}

#rouzaire-camembert {
  width: 185px;
  height: auto;
  top: 100px;
  right: clamp(80px, 10vw, 267px);
  transform: rotate(-14deg);
  opacity: .14;
}

/* #boethius {
  width: 170px;
  height: auto;
  top: 100px;
  left: 0;
  transform: rotate(-14deg);
  opacity: .17;
}

#glagolitsa {
  width: 165px;
  height: auto;
  top: 300px;
  right: 210px;
  transform: rotate(4deg);
  opacity: .17;
} */

/* ---------------- energy drink collection ---------------- */

.energy-drink-collection-note {
  margin: -1.5rem 0 0;
  text-align: center;
  font-size: .85rem;
  font-style: italic;
  color: var(--paper-dim);
}

.drink-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 200px));
  justify-content: center;
  gap: 3rem 2.5rem;
  margin: 3rem 0 0;
  padding: 0;
}

.drink {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.drink img {
  transition:
    transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
    filter 0.4s ease;
}

.drink img:hover {
  transform: rotate(2deg) scale(1.015);
  filter: drop-shadow(0 0 12px rgba(214, 198, 170, 0.35));
}

.drink h2 {
  margin: 1.25rem 0 .3rem;
  font-size: 1.05rem;
  font-weight: normal;
}

.drink-meta {
  margin: 0;
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--muted);
}

.drink-note {
  margin: .6rem 0 0;
  font-size: .9rem;
  font-style: italic;
  color: var(--paper-dim);
}

/* =========================================================
   6. UTILITIES
   ========================================================= */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.text-big {
  font-size: 1.4rem;
}

.text-normal {
  font-size: 1rem;
}

.text-small {
  font-size: 0.8rem;
}

.crisp-edges {
  image-rendering: crisp-edges;
}

/* =========================================================
   7. MEDIA QUERIES
   ========================================================= */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  ::before,
  ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =========================================================
   АДАПТИВ — для узких экранов
   ========================================================= */

/* планшет и уже */
@media (max-width: 900px) {
  .sidebar {
    position: static;         /* перестаёт быть фиксированным */
    width: 100%;              /* на всю ширину */
    padding: 1.5rem 1.5rem 1rem;
    border-right: none;
    border-bottom: 1px solid rgba(215, 201, 176, .13);
    text-align: center;       /* логотип и меню по центру */
  }

  .sidebar img {
    margin: 0 auto;           /* центрируем логотип */
  }

  .site-menu {
    border-top: none;
    padding-top: .5rem;
  }

  .site-menu ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 1rem;
  }

  .site-menu li {
    margin: 0;
  }

  .main-content {
    margin-left: 0;           /* убираем отступ слева */
    padding: 2rem 1.5rem 3rem;
  }

  .site-footer {
    margin-left: 0;
  }
}

/* телефон */
@media (max-width: 600px) {
  html {
    font-size: 100%;          /* было 112.5% — на телефоне крупно */
  }

  .sidebar {
    padding: 1rem 1rem .75rem;
  }

  .sidebar img {
    width: 130px;             /* логотип поменьше */
    height: auto;
  }

  .site-menu a {
    font-size: .8rem;
  }

  .main-content {
    padding: 1.5rem 1rem 2.5rem;
  }

  .text-big {
    font-size: 1.2rem;
  }

  /* декоративные картинки уезжают за экран — скрываем */
  .decorative-image {
    display: none;
  }
}