/* Projects slide */

.slide--projects .blob {
  left: -120px;
  top: 180px;
  width: 760px;
  height: 640px;
  filter: blur(120px);
}

.sec-head {
  left: var(--pad-x);
  top: 132px;
  display: flex;
  align-items: baseline;
  gap: 18px;
}

.sec-title {
  font-family: var(--font-display);
  font-style: italic;
  font-stretch: 125%;
  font-weight: 900;
  font-size: var(--sec-title);
  letter-spacing: 0.01em;
  color: var(--name);
}

.sec-meta {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.meta-m {
  display: none;
}

/* Octagon tiles ---------------------------------------------------------- */

.oct-grid {
  display: contents;
}

.oct-wrap {
  position: absolute;
  left: calc(84px + var(--col) * 176px);
  top: calc(180px + var(--row) * 172px + var(--mid) * 86px);
  width: 160px;
  height: 160px;
}

.oct-wrap {
  --d: calc(0.12s + var(--i) * 0.07s);
}

.oct {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  transition: transform 0.25s ease;
}

.oct:hover {
  transform: scale(1.05);
}

.oct:active {
  transform: scale(0.97);
}

.oct-ring,
.oct-fill {
  position: absolute;
  clip-path: var(--octagon);
}

.oct-ring {
  inset: 0;
  background: var(--rule);
}

.oct-fill {
  inset: 1.5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--oct-fill);
}

.oct-fill::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 14px 14px;
}

.oct-fill > * {
  position: relative;
}

.oct-num {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.oct-init {
  font-family: var(--font-display);
  font-style: italic;
  font-stretch: 125%;
  font-weight: 900;
  font-size: 38px;
  line-height: 1;
  color: var(--name);
}

.oct-short {
  max-width: 110px;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.08em;
  line-height: 1.3;
  color: var(--muted);
}

.oct[aria-pressed="true"] .oct-ring {
  background: var(--accent);
}

.oct[aria-pressed="true"] .oct-fill {
  inset: 3px;
  background: var(--oct-fill-on);
}

.oct[aria-pressed="true"] .oct-num,
.oct[aria-pressed="true"] .oct-init {
  color: var(--accent);
}

.oct-path {
  left: 84px;
  top: 180px;
  width: 560px;
  height: 680px;
  pointer-events: none;
}

/* Details panel ---------------------------------------------------------- */

.panel {
  left: 696px;
  top: 150px;
  bottom: 100px;
  width: 648px;
  padding: 0 4px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 0.2em;
}

.panel-kicker {
  color: var(--accent);
}

.panel-count {
  color: var(--muted);
}

.panel-title {
  font-family: var(--font-display);
  font-style: italic;
  font-stretch: 125%;
  font-weight: 900;
  font-size: var(--proj-name);
  line-height: 0.95;
  letter-spacing: -0.01em;
  color: var(--name);
  text-shadow: 2px 0 0 var(--split), -2px 0 0 rgba(0, 200, 255, 0.5);
}

.panel-note {
  margin-top: 10px;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.panel-note:empty {
  display: none;
}

.p-meta {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.p-sites,
.p-cats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.p-sites {
  gap: 10px;
}

.p-cats {
  gap: 8px;
}

.site-chip,
.site-none {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  font-size: 12.5px;
  letter-spacing: 0.04em;
}

.site-chip {
  border: 1px solid var(--rule);
  color: var(--ink);
}

.site-chip:hover {
  border-color: var(--accent);
}

.site-chip svg {
  width: 14px;
  height: 14px;
}

.site-chip svg:last-child {
  width: 12px;
  height: 12px;
  stroke: var(--accent);
}

.site-none {
  border: 1px dashed var(--rule);
  color: var(--muted);
}

.cat-chip {
  padding: 7px 12px;
  background: var(--chip);
  border: 1px solid var(--rule);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--role-title);
}

.panel-rule {
  height: 1px;
  flex: none;
  background: var(--rule);
}

.p-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.p-tech {
  gap: 12px;
}

.p-summary p {
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--body);
}

.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Built with badges: octagon with the official logo */
.tech {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tech-size, 48px);
  height: var(--tech-size, 48px);
  cursor: default;
}

.tech-ring,
.tech-inner {
  position: absolute;
  clip-path: var(--octagon-sm);
}

.tech-ring {
  inset: 0;
  background: var(--rule);
  transition: background-color 0.2s ease;
}

.tech-inner {
  inset: 1px;
  background: var(--chip);
}

.tech:hover .tech-ring,
.tech:focus-visible .tech-ring {
  background: var(--accent);
}

.tech-ico {
  position: relative;
  width: 22px;
  height: 22px;
  transition: transform 0.2s ease;
}

.tech:hover .tech-ico {
  transform: scale(1.12);
}

/* Pager, pinned to the bottom, does not move with the panel -------------- */

.pager {
  left: 700px;
  bottom: 40px;
  width: 390px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.step-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 48px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink);
}

.step-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.step-btn svg {
  width: 18px;
  height: 18px;
}

.pager-count {
  min-width: 58px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.pager-count b {
  font-weight: 400;
  color: var(--nav-active);
}

.pager-segs {
  display: flex;
  flex: 1;
  gap: 5px;
}

.pager-segs i {
  flex: 1;
  height: 3px;
  background: var(--rule);
  transition: background-color 0.3s ease;
}

.pager-segs i.is-past {
  background: rgba(30, 111, 255, 0.45);
}

.pager-segs i.is-on {
  background: var(--accent);
}

/* Phone and tablet ------------------------------------------------------- */

@media (max-width: 1023.98px) {
  .slide--projects .blob {
    left: -120px;
    top: 120px;
    width: var(--blob-w, 360px);
    height: var(--blob-w, 360px);
    filter: blur(100px);
  }

  .sec-head {
    left: var(--pad-x);
    right: var(--pad-x);
    top: var(--content-top);
    justify-content: space-between;
  }

  .sec-meta {
    font-size: 10.5px;
    letter-spacing: 0.18em;
  }

  .meta-d {
    display: none;
  }

  .meta-m {
    display: inline;
  }

  .oct-wrap {
    left: calc((100% - (7 * var(--oct-step) + var(--oct-size))) / 2 + var(--i) * var(--oct-step));
    top: calc(var(--oct-top) + var(--alt) * var(--oct-row));
    width: var(--oct-size);
    height: var(--oct-size);
  }

  .oct-wrap {
    --d: calc(0.1s + var(--i) * 0.05s);
  }

  .oct-fill {
    gap: 4px;
  }

  .oct-init {
    font-size: var(--oct-init);
  }

  .oct-num {
    font-size: 9.5px;
    letter-spacing: 0.16em;
  }

  .oct-short,
  .oct-path {
    display: none;
  }

  .panel {
    --panel-bottom: calc(
      var(--tab-bottom) + var(--menu-base) * 1.5 + 2 * (var(--menu-base) + var(--menu-gap)) + 10px +
        env(safe-area-inset-bottom, 0px)
    );
    left: var(--pad-x);
    right: var(--pad-x);
    top: var(--panel-top);
    bottom: var(--panel-bottom);
    width: auto;
    padding: 0;
    gap: var(--panel-gap);
  }

  .panel-top,
  .panel-rule,
  .p-block .label {
    display: none;
  }

  .panel-note {
    margin-top: 6px;
    font-size: 10.5px;
  }

  .p-meta {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }

  .p-sites,
  .p-cats {
    display: contents;
  }

  .site-chip,
  .site-none {
    min-height: 44px;
    padding: 0 12px;
    font-size: 12px;
  }

  .cat-chip {
    padding: 6px 10px;
    font-size: 10px;
    letter-spacing: 0.14em;
  }

  .p-summary p {
    font-size: var(--sum-fs);
    line-height: 1.6;
  }

  .p-tech {
    padding-top: 4px;
    padding-bottom: 6px;
  }

  .tech-list {
    gap: 8px;
  }

  .tech-ico {
    width: calc(var(--tech-size) * 0.5);
    height: calc(var(--tech-size) * 0.5);
  }

  .pager {
    --pager-left: calc(var(--pad-x) + var(--menu-base) * 1.5 + 16px);
    left: var(--pager-left);
    right: var(--pad-x);
    bottom: var(--pager-bottom);
    width: auto;
    gap: 10px;
  }

  .pager-count {
    order: 1;
    min-width: 52px;
    text-align: left;
    font-size: 11px;
    letter-spacing: 0.12em;
  }

  .pager-segs {
    order: 2;
    gap: 4px;
  }

  .step-btn {
    width: 44px;
    height: 44px;
  }

  .step-btn--prev {
    order: 3;
  }

  .step-btn--next {
    order: 4;
  }

  .pager-count,
  .step-btn {
    flex: none;
  }
}

/* Phone shows initials only. Tablet keeps the number. */
@media (max-width: 599.98px) {
  .oct-num {
    display: none;
  }
}
