/* =========================================================
   HOME — KULTKOD V9
   ========================================================= */


/* =========================================================
   HERO
   ========================================================= */

.hero {
  padding: 56px 0 36px;
}

.hero__title {
  margin: 0 0 16px;

  font-family: var(--serif);
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 500;

  letter-spacing: -0.02em;
  line-height: 1.05;
}

.hero__lead {
  margin: 0;
  max-width: 680px;

  font-size: 19px;
  line-height: 1.55;
}


/* =========================================================
   HERO TOOLTIPS
   ========================================================= */

.areas {
  position: relative;
  display: inline;
}

.areas__trigger {
  appearance: none;

  margin: 0;
  padding: 0;

  border: 0;
  border-bottom: 1px dashed var(--muted2);
  border-radius: 0;

  background: transparent;
  color: inherit;

  font: inherit;
  line-height: inherit;

  cursor: pointer;
}

.areas__trigger:hover,
.areas__trigger:focus-visible {
  border-bottom-color: var(--text);
}

.areas__tooltip {
  position: absolute;

  left: -7px;
  top: calc(100% + 7px);
  z-index: 20;

  display: flex;
  flex-direction: column;
  align-items: flex-start;

  min-width: 180px;

  padding: 10px 12px;

  background: var(--bg);
  border: 1px solid var(--line);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition:
    opacity 150ms ease,
    visibility 150ms ease;
}

.areas__tooltip > span {
  display: block;
  white-space: nowrap;

  font-size: 14px;
  line-height: 1.6;
}

.areas__tooltip a {
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.areas__tooltip a:hover {
  border-color: var(--text);
}

.areas:hover .areas__tooltip,
.areas:focus-within .areas__tooltip {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}


/* =========================================================
   HERO LINKS
   ========================================================= */

.hero__links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;

  gap: 6px;

  margin-top: 24px;

  font-size: 14px;
}

.hero__links a {
  color: var(--muted);

  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.hero__links a:hover {
  color: var(--text);
  border-color: var(--text);
}


/* =========================================================
   NOW
   ========================================================= */

.now {
  margin-top: 28px;
  max-width: 600px;
}

.now__label {
  display: block;
  margin-bottom: 7px;

  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;

  color: var(--muted2);
}

.now__text {
  margin: 0;

  font-size: 13px;
  line-height: 1.55;

  color: var(--muted);
}


/* =========================================================
   SECTIONS
   ========================================================= */

.section {
  padding: 36px 0 20px;
  scroll-margin-top: 90px;
}

.section-header {
  padding-bottom: 12px;
  margin-bottom: 28px;

  border-bottom: 1px solid var(--line);

  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;

  color: var(--muted2);
}


/* =========================================================
   INVENTORY GRID
   ========================================================= */

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));

  gap: 32px 12px;
}


/* =========================================================
   PROJECT CARDS
   ========================================================= */

.project-card {
  display: flex;
  flex-direction: column;

  min-width: 0;
}

.project-card__visual {
  position: relative;

  width: 100%;
  aspect-ratio: 1;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 10px;

  background: var(--bg);
  border: 1px solid var(--line);

  overflow: hidden;

  transition: border-color 150ms ease;

  text-decoration: none;
  color: inherit;

}

/* Единое выделение всей карточки */

.project-card:not(.project-card--disabled):hover
.project-card__visual,

.project-card:not(.project-card--disabled):focus-within
.project-card__visual {
  border-color: var(--text);
}

.project-card__main {
  display: block;
  margin-top: 10px;

  text-decoration: none;
  color: inherit;
}

.project-card__title {
  margin: 0;

  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;

  line-height: 1.25;
}

.project-card__desc {
  margin: 6px 0 8px;

  font-size: 11.5px;
  line-height: 1.45;

  color: var(--muted);
}

.project-card__main:hover .project-card__title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.project-card__links {
  margin-top: auto;

  font-size: 11.5px;
}

.project-card__links a {
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.project-card__links a:hover {
  border-color: var(--text);
}

.project-card__links .dot {
  margin: 0 3px;
}


/* =========================================================
   INACTIVE PROJECTS
   ========================================================= */

.project-card--disabled .project-card__visual {
  border-style: dashed;
  background: transparent;
}

.project-card--disabled .project-card__visual > * {
  opacity: 0.35;
}

.project-card--disabled .project-card__title,
.project-card--disabled .project-card__desc {
  color: #aaa9a3;
}


/* =========================================================
   COLLABORATION SLOT
   ========================================================= */

.inventory-slot__link {
  position: relative;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  aspect-ratio: 1;

  border: 1px dashed #e2e2dc;

  color: #d2d2cc;
  text-decoration: none;
}

.inventory-slot__plus {
  font-family: var(--mono);
  font-size: 20px;
}

.inventory-slot__hint {
  position: absolute;

  left: 50%;
  bottom: 16px;

  width: 90%;

  transform: translateX(-50%);

  font-size: 10px;
  line-height: 1.35;

  text-align: center;
  color: var(--muted);

  opacity: 0;
  visibility: hidden;

  transition: opacity 150ms ease;
}

.inventory-slot__link:hover,
.inventory-slot__link:focus-visible {
  border-color: #aaa9a3;
  color: var(--muted);
}

.inventory-slot__link:hover .inventory-slot__hint,
.inventory-slot__link:focus-visible .inventory-slot__hint {
  opacity: 1;
  visibility: visible;
}


/* =========================================================
   TEXT DYNAMICS PREVIEW
   ========================================================= */

.td-preview {
  position: relative;

  width: 100%;
  height: 100%;

  font-family: Georgia, serif;
  font-style: italic;
}

.td-preview__text {
  position: absolute;

  inset: 8px 2px 24px;

  display: flex;
  align-items: center;

  font-size: 12px;
  line-height: 1.35;
}

.td-preview__state {
  position: absolute;

  left: 0;
  top: 50%;

  width: 100%;
  margin: 0;

  transform: translateY(-50%);

  transition:
    opacity 220ms ease,
    transform 260ms ease;
}

.td-preview__state--before {
  opacity: 1;
}

.td-preview__state--after {
  opacity: 0;
  transform: translateY(-45%);
}

.td-preview__removed {
  color: #989893;
  text-decoration: line-through;
}

.td-preview__added {
  padding: 0 2px;

  background: #d8f1dc;
  color: #173c20;
}

.project-card:hover .td-preview__state--before,
.project-card:focus-within .td-preview__state--before {
  opacity: 0;
  transform: translateY(-55%);
}

.project-card:hover .td-preview__state--after,
.project-card:focus-within .td-preview__state--after {
  opacity: 1;
  transform: translateY(-50%);
}


/* YEARS */

.td-preview__year {
  position: absolute;

  left: 2px;
  bottom: 4px;

  font-family: var(--sans);
  font-size: 9px;
  font-style: normal;

  color: var(--muted2);
}

.td-preview__year-before,
.td-preview__year-after {
  display: block;
  transition: opacity 180ms ease;
}

.td-preview__year-after {
  position: absolute;
  left: 0;
  top: 0;

  opacity: 0;
}

.project-card:hover .td-preview__year-before,
.project-card:focus-within .td-preview__year-before {
  opacity: 0;
}

.project-card:hover .td-preview__year-after,
.project-card:focus-within .td-preview__year-after {
  opacity: 1;
}


/* =========================================================
   ACROSTICS PREVIEW
   ========================================================= */

.acro-preview {
  width: 100%;
  height: 100%;

  display: flex;
  align-items: center;

  overflow: hidden;
}

.acro-preview__text {
  margin: 0;

  font-family: Georgia, serif;
  font-size: 9px;
  line-height: 1.45;

  color: #777770;
}

.acro-preview__word {
  transition: color 180ms ease;
}

.acro-preview__first {
  transition: color 180ms ease;
}

.project-card:hover .acro-preview__word,
.project-card:focus-within .acro-preview__word {
  color: #cececa;
}

.project-card:hover .acro-preview__first,
.project-card:focus-within .acro-preview__first {
  color: #b83a32;
  font-weight: 700;
}


/* =========================================================
   DEMO ICONS
   ========================================================= */

.demo-icon {
  font-family: var(--mono);
  font-size: 18px;

  color: var(--muted2);
}


/* =========================================================
   COLLECTIONS
   ========================================================= */

.collection-card__link {
  display: flex;
  flex-direction: column;
  align-items: center;

  text-decoration: none;
  text-align: center;
}

.collection-card__visual {
  width: 100%;
  aspect-ratio: 1;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 1px solid var(--line);

  transition: border-color 150ms ease;
}

.collection-card:hover .collection-card__visual,
.collection-card:focus-within .collection-card__visual {
  border-color: var(--text);
}

.collection-box {
  position: relative;

  width: 56px;
  height: 46px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 1.5px solid var(--muted);

  transition: border-color 150ms ease;
}

.collection-box::before {
  content: "";

  position: absolute;

  top: 10px;
  left: 0;
  right: 0;

  border-top: 1.5px solid var(--muted);
}

.collection-box__glyph {
  position: relative;

  padding: 0 4px;

  background: var(--bg);

  font-family: var(--mono);
  font-size: 13px;

  color: var(--muted);
}

.collection-card:hover .collection-box,
.collection-card:focus-within .collection-box {
  border-color: var(--text);
}

.collection-card:hover .collection-box::before,
.collection-card:focus-within .collection-box::before {
  border-color: var(--text);
}

.collection-card:hover .collection-box__glyph,
.collection-card:focus-within .collection-box__glyph {
  color: var(--text);
}

.collection-card__title {
  margin-top: 10px;

  font-size: 12px;
  font-weight: 500;

  line-height: 1.3;
}

.collection-card__count {
  margin-top: 4px;

  font-family: var(--mono);
  font-size: 10px;

  color: var(--muted2);
}

.collection-card:hover .collection-card__title {
  text-decoration: underline;
}


/* =========================================================
   DIARIES
   ========================================================= */

.diaries-list {
  display: flex;
  flex-direction: column;

  gap: 10px;
}

.diary-row {
  display: flex;
  align-items: baseline;

  gap: 20px;
  padding: 2px 0;

  text-decoration: none;
}

.diary-row__date {
  min-width: 90px;

  font-family: var(--mono);
  font-size: 12px;

  color: var(--muted2);
}

.diary-row__title {
  font-size: 14px;
}

.diary-row:hover .diary-row__title {
  text-decoration: underline;
}


/* =========================================================
   CONTACT
   ========================================================= */

.contact {
  padding-bottom: 20px;
}

.contact__title {
  margin: 0 0 14px;

  font-family: var(--serif);
  font-size: 34px;
  font-weight: 500;
}

.contact__desc {
  max-width: 650px;
  margin: 0;

  font-size: 17px;
}

.contact__links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;

  margin-top: 20px;
  font-size: 15px;
}

.channel-note {
  margin-top: 24px;

  color: var(--muted2);
  font-size: 14px;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 650px) {

  .inventory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 14px;
  }

}

@media (max-width: 380px) {

  .inventory-grid {
    gap: 24px 10px;
  }

  .project-card__title {
    font-size: 14px;
  }

  .project-card__desc {
    font-size: 11px;
  }

  .td-preview__text {
    font-size: 11px;
  }

  .acro-preview__text {
    font-size: 8px;
  }

  .diary-row {
    flex-direction: column;
    gap: 2px;
  }

}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

  .td-preview__state,
  .td-preview__year-before,
  .td-preview__year-after,
  .acro-preview__word,
  .acro-preview__first {
    transition: none;
  }

}