:root {
  /* Цвета */
  --color-primary: #f1b2ce;
  --color-secondary: #000028;
  --color-accent: #ff0070;
  --color-accent-alt: #db00ff;
  --color-decor: #ff0070;
  --color-section-title: #ff0070;
  --color-theme-button: #ff0070;
  --color-bg: #00042b;

  /* Шрифты и текст */
  --font-family: 'IBM Plex mono', 'Fira Code', 'Courier New', monospace;
  --font-size: 18px;
  --font-size-title: clamp(7.25rem, 7.0115rem + 1.0178vw, 7.5rem);
  --font-weight-normal: 400;
  --font-weight-bold: 700;
  --line-height: 1.3;

  /* Отступы / размеры */
  --spacing-padding: 10px;
  --corner-size: 25px;
  --corner-thickness: 1px;

  /* Изображения */
  --img-bg-cover: url(./images/cover-image-dark.png);
}

@media (width >= 768px) {

  :root {
    /* Отступы / размеры */
    --spacing-padding: 20px;

    /* Шрифты и текст */
    --font-size-title: clamp(7.5rem, 0.5625rem + 14.4531vw, 9.8125rem);
  }
}

@font-face {
  font-family: 'IBM Plex mono';
  src: local('IBM Plex Mono Regular'), local('IBMPlexMono-Regular'),
    url(./IBMPlexMono-Regular.woff) format('woff');
  font-weight: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex mono';
  src: local('IBM Plex Mono Bold'), local('IBMPlexMono-Bold'),
    url(./IBMPlexMono-Bold.woff) format('woff');
  font-weight: bold;
  font-display: swap;
}

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

body {
  min-inline-size: 375px;
  max-inline-size: 1440px;
  margin: 0 auto;
  font-family: var(
    --font-family,
    'IBM Plex mono',
    'Fira Code',
    'Courier New',
    monospace
  );
  font-size: var(--fonts-size, 18px);
  line-height: var(--line-height, 1.3);
  color: var(--color-primary, #f1b2ce);
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

picture {
  margin: 0;
  padding: 0;
}

img {
  display: block;
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
     object-fit: cover;
  -o-object-position: center;
     object-position: center;
}

button,
a {
  color: currentColor;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

.link {
  text-decoration: none;
  text-shadow: 2px 2px 0 var(--color-accent, #282828);
}

.link:hover {
  -webkit-box-shadow: 0 1px currentColor;
          box-shadow: 0 1px currentColor;
}

.link:focus {
  outline: none;
}

.link:focus-visible {
  outline: 1px solid currentColor;
}

.title {
  color: var(--color-accent-alt, #db00ff);
  font-weight: var(--font-weight-bold, 700);
  font-size: var(
    --font-size-title,
    clamp(7.25rem, 7.0115rem + 1.0178vw, 7.5rem)
  );
  line-height: 0.83;
}

.title--decor {
  color: var(--color-secondary, #000028);
  background-color: var(--color-accent, #ff0070);
}

.decorated-zone {
  position: relative;
  display: -ms-grid;
  display: grid;
  place-items: center;
  padding: var(--spacing-padding, 10px);
  block-size: 100vh;
  min-block-size: 668px;
}

/* Общие стили уголков */

.decorated-zone::before,
.decorated-zone::after {
  content: "";
  position: absolute;
  inline-size: var(--corner-size, 25px);
  block-size: var(--corner-size, 25px);
  border: var(--corner-thickness, 1px) solid transparent;
}

/* Цвет и позиция */

.decorated-zone::before {
  border-block-end-color: var(--color-decor, #ff0070);
  border-inline-start-color: var(--color-decor, #ff0070);
  inset-block-end: var(--spacing-padding, 10px);
  inset-inline-start: var(--spacing-padding, 10px);
}

.decorated-zone::after {
  border-block-start-color: var(--color-decor, #ff0070);
  border-inline-end-color: var(--color-decor, #ff0070);
  inset-block-start: var(--spacing-padding, 10px);
  inset-inline-end: var(--spacing-padding, 10px);
}

:root.theme-dark {
  /* Цвета */
  --color-primary: #f1b2ce;
  --color-secondary: #000028;
  --color-accent: #ff0070;
  --color-accent-alt: #db00ff;
  --color-decor: #ff0070;
  --color-section-title: #ff0070;
  --color-theme-button: #ff0070;
  --color-bg: #00042b;

  /* Изображения */
  --img-bg-cover: url(./images/cover-image-dark.png);
}

/* REC для тёмной темы */

.theme-dark .header__rec {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
}

:root.theme-light {
  /* Цвета */
  --color-primary: #353430;
  --color-secondary: #353430;
  --color-accent: #ff8dcb;
  --color-accent-alt: #ffc2e6;
  --color-decor: #353430;
  --color-section-title: #353430;
  --color-theme-button: #353430;
  --color-bg: #ffeef6;

  /* Изображения */
  --img-bg-cover: url(./images/cover-image-light.png);
}

/* REC для светлой темы */

.theme-light .header__rec {
  display: none;
}

@media (prefers-color-scheme: light) {

  :root {
    /* Цвета */
    --color-primary: #353430;
    --color-secondary: #353430;
    --color-accent: #ff8dcb;
    --color-accent-alt: #ffc2e6;
    --color-decor: #353430;
    --color-section-title: #353430;
    --color-theme-button: #353430;
    --color-bg: #ffeef6;

    /* Изображения */
    --img-bg-cover: url(./images/cover-image-light.png);
  }

  /* REC для автоматической светлой темы */

  .header__rec {
    display: none;
  }
}

.card {
  display: -ms-grid;
  display: grid;
  gap: 10px;
}

.card-list {
  display: -ms-grid;
  display: grid;
  gap: 20px;
}

.gallery {
  gap: 10px;
}

@media (width >= 768px) {

  .section.gallery {
    -ms-grid-columns: 1fr 20px 1fr 20px 1fr;
    grid-template-columns: repeat(3, 1fr);
    -ms-grid-rows: auto 20px auto 20px auto 20px auto;
        grid-template-areas:
      'title  title  title'
      'sunset sunset ice-cream'
      'tape   books  ice-cream'
      'tape   street street';
    gap: 20px;
  }
}

.header {
  -ms-grid-rows: 1fr -webkit-min-content 1fr;
  -ms-grid-rows: 1fr min-content 1fr;
  grid-template-rows: 1fr -webkit-min-content 1fr;
  grid-template-rows: 1fr min-content 1fr;
}

@media (width >= 768px) {

  .header {
    -ms-grid-columns: (1fr)[2];
    grid-template-columns: repeat(2, 1fr);
        grid-template-areas:
      'theme-menu theme-menu'
      'title      title'
      '.          subtitle';
  }
}

.main {
  display: -ms-grid;
  display: grid;
  gap: 50px;
}

@media (width >= 768px) {

  .main {
    gap: 80px;
  }
}

.page {
  display: -ms-grid;
  display: grid;
  gap: 40px;
  background-color: var(--color-bg, #00042b);
  background-image: var(--img-bg-cover, url(./images/cover-image-dark.png));
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
}

@media (width >= 768px) {

  .page {
    gap: 60px;
  }
}

.section {
  display: -ms-grid;
  display: grid;
  gap: 20px;
  padding: 0 var(--spacing-padding, 10px);
}

@media (width >= 768px) {

  .section {
    -ms-grid-columns: 1fr 2fr;
    grid-template-columns: 1fr 2fr;
        grid-template-areas: 'title card-list';
  }
}

@media (width >= 1024px) {

  .section {
    -ms-grid-columns: (1fr)[3];
    grid-template-columns: repeat(3, 1fr);
        grid-template-areas: 'title card-list card-list';
  }
}

.card__title {
  font-size: inherit;
}

.footer__title {
  text-shadow: 2px 2px 0 var(--color-accent, #ff0070);
}

.gallery__picture {
  max-inline-size: 100vw;
}

@media (width >= 768px) {

  .gallery__picture--sunset {
    grid-area: sunset;
  }

  .gallery__picture--ice-cream {
    grid-area: ice-cream;
  }

  .gallery__picture--tape {
    grid-area: tape;
  }

  .gallery__picture--books {
    grid-area: books;
  }

  .gallery__picture--street {
    grid-area: street;
  }
}

.header__rec {
  position: absolute;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: justify;
      -ms-flex-pack: justify;
          justify-content: space-between;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  gap: 10px;
  color: var(--color-accent, #ff0070);
  inset-block-start: var(--spacing-padding, 10px);
  inset-inline-end: calc(var(--spacing-padding, 10px) + 9px);
}

.header__rec::after {
  content: '';
  border-radius: 50%;
  -webkit-box-shadow: 0 0 4px 2px currentColor;
          box-shadow: 0 0 4px 2px currentColor;
  background-color: currentColor;
  inline-size: 9px;
  block-size: 9px;
}

.header__subtitle {
  font-weight: var(--font-weight-bold, 700);
}

@media (width >= 768px) {

  .header__subtitle {
    grid-area: subtitle;
  }
}

.header__theme-menu {
  -ms-grid-column-align: end;
      justify-self: end;
}

@media (width >= 768px) {

  .header__theme-menu {
    grid-area: theme-menu;
  }
}

@media (width >= 1024px) {

  .header__theme-menu {
    -ms-grid-column-align: center;
        justify-self: center;
    -ms-flex-item-align: start;
        -ms-grid-row-align: start;
        align-self: start;
  }
}

.header__theme-menu-button {
  position: relative;
  border: none;
  padding: 0 12px;
  color: var(--color-decor, #ff0070);
  text-transform: lowercase;
  background-color: transparent;
  cursor: pointer;
}

.header__theme-menu-button:hover::before {
  content: '';
  position: absolute;
  inset: 0;
  outline: 1px solid currentColor;
  outline-offset: 1px;
  opacity: 0.4;
}

.header__theme-menu-button:focus {
  outline: none;
}

.header__theme-menu-button:focus-visible {
  -webkit-box-shadow: 0 1px currentColor;
          box-shadow: 0 1px currentColor;
}

.header__theme-menu-list {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  gap: 10px;
}

@media (width >= 1024px) {

  .header__theme-menu-list {
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
        -ms-flex-direction: row;
            flex-direction: row;
  }
}

.header__title {
  -ms-grid-column-align: start;
      justify-self: start;
  text-shadow: 4px 4px 0 var(--color-accent, #ff0070);
}


@media (width >= 768px) {

  .header__title {
    grid-area: title;
    -webkit-transform: translateX(-20px);
        -ms-transform: translateX(-20px);
            transform: translateX(-20px);
  }
}

@media (width >= 768px) {

  .section--stacked {
        grid-template-areas:
      'title     .'
      'card-list card-list';
  }

  .section--stacked > .header__title {
    -ms-grid-row: 1;
    -ms-grid-column: 1;
    -ms-grid-column-span: 1;
  }
}

@media (width >= 1024px) {

  .section--stacked {
        grid-template-areas:
      'title     .         .'
      'card-list card-list card-list';
  }

  .section--stacked .card-list {
    -ms-grid-columns: (1fr)[3];
    grid-template-columns: repeat(3, 1fr);
  }

  .section--stacked > .header__title {
    -ms-grid-row: 1;
    -ms-grid-column: 1;
    -ms-grid-column-span: 1;
  }
}

@media (width >= 768px) {

  .section__card-list {
    grid-area: card-list;
  }
}

.section__title {
  color: var(--color-section-title, #ff0070);
  font-size: inherit;
}

@media (width >= 768px) {

  .section__title {
    grid-area: title;
  }
}

@media (width >= 768px) {

  .gallery__picture--sunset {
    -ms-grid-row: 3;
    -ms-grid-column: 1;
    -ms-grid-column-span: 3;
  }

  .gallery__picture--ice-cream {
    -ms-grid-row: 3;
    -ms-grid-row-span: 3;
    -ms-grid-column: 5;
  }

  .gallery__picture--tape {
    -ms-grid-row: 5;
    -ms-grid-row-span: 3;
    -ms-grid-column: 1;
  }

  .gallery__picture--books {
    -ms-grid-row: 5;
    -ms-grid-column: 3;
  }

  .gallery__picture--street {
    -ms-grid-row: 7;
    -ms-grid-column: 3;
    -ms-grid-column-span: 3;
  }

  .header__subtitle {
    -ms-grid-row: 3;
    -ms-grid-column: 2;
  }

  .header__theme-menu {
    -ms-grid-row: 1;
    -ms-grid-column: 1;
    -ms-grid-column-span: 2;
  }

  .header__title {
    -ms-grid-row: 1;
    -ms-grid-column: 1;
    -ms-grid-column-span: 5;
  }

  .header > .header__title {
    -ms-grid-row: 2;
    -ms-grid-column: 1;
    -ms-grid-column-span: 2;
  }

  .section > .header__title {
    -ms-grid-row: 1;
    -ms-grid-column: 1;
    -ms-grid-column-span: 1;
  }

  .section__card-list {
    -ms-grid-row: 1;
    -ms-grid-column: 2;
  }

  .section--stacked > .section__card-list {
    -ms-grid-row: 2;
    -ms-grid-column: 1;
    -ms-grid-column-span: 2;
  }

  .section__title {
    -ms-grid-row: 1;
    -ms-grid-column: 1;
    -ms-grid-column-span: 5;
  }

  .header > .section__title {
    -ms-grid-row: 2;
    -ms-grid-column: 1;
    -ms-grid-column-span: 2;
  }

  .section > .section__title {
    -ms-grid-row: 1;
    -ms-grid-column: 1;
    -ms-grid-column-span: 1;
  }

  .section--stacked > .section__title {
    -ms-grid-row: 1;
    -ms-grid-column: 1;
    -ms-grid-column-span: 1;
  }
}

@media (width >= 1024px) {

  .section > .header__title {
    -ms-grid-row: 1;
    -ms-grid-column: 1;
    -ms-grid-column-span: 1;
  }

  .section > .section__card-list {
    -ms-grid-row: 1;
    -ms-grid-column: 2;
    -ms-grid-column-span: 2;
  }

  .section--stacked > .section__card-list {
    -ms-grid-row: 2;
    -ms-grid-column: 1;
    -ms-grid-column-span: 3;
  }

  .section > .section__title {
    -ms-grid-row: 1;
    -ms-grid-column: 1;
    -ms-grid-column-span: 1;
  }

  .section--stacked > .section__title {
    -ms-grid-row: 1;
    -ms-grid-column: 1;
    -ms-grid-column-span: 1;
  }
}

.card__title--main {
  margin-bottom: 10px;
}

.card__title--normal {
  font-weight: var(--font-weight-normal, 400);
}

.header__theme-menu-button--active {
  outline: 1px solid currentColor;
  pointer-events: none;
}
