/* ==========================================================================
   Components: reusable pieces shared by several views
   ========================================================================== */

/* --- Navigation (left rail) ---------------------------------------------- */

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Group heading, e.g. [EXPLORE][+]; the small tag expands on group hover. */
.chip {
  display: inline-flex;
  align-items: stretch;
  height: 19px;
  cursor: pointer;
  width: fit-content;
}

.chip__label {
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  background-color: var(--rail-fg);
  color: var(--rail);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 1px;
  transition: border-radius 150ms ease;
}

.chip__tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0;
  opacity: 0;
  overflow: hidden;
  background-color: var(--rail-tag);
  color: var(--rail-fg);
  border-top-right-radius: 2px;
  border-bottom-right-radius: 2px;
  transition: width 160ms ease-out, opacity 160ms ease-out;
}

.nav-group:hover .chip__tag {
  width: 19px;
  opacity: 1;
}

/* Row with a pixel icon, label and dotted leader. Used for <button> and <a>. */
.nav-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 30px;
  margin: 0 -20px;
  padding: 0 20px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.72);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: color 140ms ease;
}

.nav-row:hover,
.nav-row.active {
  color: #ffffff;
}

.nav-row::before {
  content: "";
  position: absolute;
  inset: 0 0 0 12px;
  background: rgba(255, 255, 255, 0.06);
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
  opacity: 0;
  transition: opacity 140ms ease;
  pointer-events: none;
}

.nav-row:hover::before {
  opacity: 1;
}

.nav-row__tick {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 15px;
  background-color: #ffffff;
  opacity: 0;
  transition: opacity 140ms ease;
}

.nav-row.active .nav-row__tick {
  opacity: 1;
}

/* Icons are SVG masks painted with the row's text color. */
.nav-row__icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  background-color: currentColor;
  -webkit-mask-image: var(--icon);
  mask-image: var(--icon);
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.nav-row__icon--overview { --icon: url("../assets/icons/overview.svg"); }
.nav-row__icon--works    { --icon: url("../assets/icons/works.svg"); }
.nav-row__icon--stack    { --icon: url("../assets/icons/stack.svg"); }
.nav-row__icon--studio   { --icon: url("../assets/icons/studio.svg"); }
.nav-row__icon--telegram { --icon: url("../assets/icons/telegram.svg"); }
.nav-row__icon--github   { --icon: url("../assets/icons/github.svg"); }
.nav-row__icon--contact  { --icon: url("../assets/icons/contact.svg"); }

.nav-row__dots {
  flex: 1;
  height: 1px;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.22);
  transition: border-color 200ms ease;
}

.nav-row:hover .nav-row__dots,
.nav-row.active .nav-row__dots {
  border-bottom-color: rgba(255, 255, 255, 0.65);
}

/* --- Buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
}

.btn--primary {
  justify-content: center;
  padding: 0 14px;
  background-color: var(--brand);
  color: var(--stage);
  text-decoration: none;
  transition: transform 120ms ease, box-shadow 150ms ease;
}

.btn--primary:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 242, 0.22);
}

.btn--primary:active {
  transform: scale(0.98);
}

.btn--link {
  padding: 0 12px;
  background: transparent;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in srgb, var(--ink) 65%, transparent);
}

.btn--link:hover {
  text-decoration-color: var(--ink);
}

/* Sizes */
.btn--cta {
  height: 28px;
  font-size: 11px;
}

.btn--inline {
  padding: 0;
  height: 24px;
  font-size: 11px;
}

.btn--sm {
  height: 30px;
  font-size: 10px;
}

.btn--pen {
  height: 30px;
  padding: 0 6px;
  font-size: 11px;
}

.btn--xs {
  height: 26px;
  font-size: 10px;
}

.btn--xs.btn--primary {
  padding: 0 10px;
}

.btn--xs.btn--link {
  padding: 0 8px;
}

/* --- Art slab: framed image with a cobalt wash ---------------------------- */

.art-slab {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  border-bottom: 1px solid var(--ink);
  background-color: var(--navy);
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(2, 6, 33, 0.08);
}

.art-slab img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 480ms cubic-bezier(0.22, 1, 0.36, 1), filter 300ms ease;
}

.art-slab:hover img {
  transform: scale(1.04);
}

.art-slab__wash {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 242, 0.08) 0%, rgba(2, 6, 33, 0.32) 100%);
  pointer-events: none;
}

.art-slab--card {
  height: 185px;
}

.art-slab--preview {
  height: 188px;
}

.art-slab--fill {
  flex: 1;
  min-height: 0;
  margin-bottom: 12px;
}

.art-slab--focus-20 img {
  object-position: center 20%;
}

.art-slab--focus-26 img {
  object-position: center 26%;
}

/* --- Inverted panel and its rows ------------------------------------------ */

.panel-inverted {
  background-color: var(--panel-inverted);
  color: var(--panel-inverted-fg);
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  border-bottom: 1px solid var(--ink);
  padding: 20px;
}

.catalog-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 14px;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 13px;
}

.catalog-row::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid currentColor;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.catalog-row:hover::before,
.catalog-row.active::before {
  opacity: 1;
}

.catalog-row.active {
  background: rgba(255, 255, 255, 0.06);
}

.catalog-row__value {
  opacity: 0.75;
}

.catalog-row__stack {
  font-size: 12px;
  opacity: 0.48;
}

/* --- Small pieces --------------------------------------------------------- */

/* "#1", "#2" ... marker above a block of copy */
.index-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  opacity: 0.42;
}

.tag {
  border: 1px solid var(--hairline);
  padding: 4px 9px;
}

.lead {
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink-body);
}

/* --- Form controls -------------------------------------------------------- */

.field {
  width: 100%;
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
}

input.field {
  height: 38px;
  padding: 0 12px;
}

textarea.field {
  padding: 10px 12px;
  line-height: 1.5;
  resize: none;
}

input[type="range"].range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2px;
  background: var(--hairline);
  outline: none;
}

input[type="range"].range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 14px;
  background: var(--ink);
  cursor: pointer;
}
