/* ==========================================================================
   Pages
   ========================================================================== */

/* --------------------------------------------------------------------------
   Home
   -------------------------------------------------------------------------- */

.home-wings {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
  margin-top: calc(-1 * var(--space-6) + var(--space-4));
  position: relative;
  z-index: 2;
}

.wing {
  display: grid;
  gap: 6px;
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  color: var(--text);
  text-decoration: none;
  transition: border-color var(--quick) var(--ease), transform 600ms var(--ease);
}

.wing:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.wing .label {
  color: var(--text-muted);
}

.wing strong {
  font-size: 18px;
  line-height: 26px;
}

.wing span:last-child {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 22px;
}

.wing__icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 6px;
  border-radius: 22%;
  color: var(--dusk-ink);
}

.wing__icon--teal {
  background: var(--atrium-teal);
}

.wing__icon--purple {
  background: var(--carpet-purple);
  color: var(--skylight);
}

.wing__icon--orange {
  background: var(--sunset-orange);
}

.wing__icon--lime {
  background: var(--signal-lime);
}

@media (max-width: 960px) {
  .home-wings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .home-wings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
    margin-top: var(--space-4);
  }

  .wing {
    padding: var(--space-3);
  }

  .wing span:last-child {
    display: none;
  }

  .wing__icon {
    width: 34px;
    height: 34px;
  }
}

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: var(--space-4);
}

.feature__lead .card__media {
  aspect-ratio: 16 / 10;
}

.feature__lead .card__title {
  font-size: 28px;
  line-height: 36px;
}

.feature__rest {
  display: grid;
  gap: var(--space-3);
  align-content: start;
}

.feature__rest .card {
  flex-direction: row;
}

.feature__rest .card__media {
  width: 38%;
  flex: none;
  aspect-ratio: auto;
}

.feature__rest .card__body {
  padding: var(--space-3);
}

.feature__rest .card__title {
  font-size: 17px;
  line-height: 24px;
}

@media (max-width: 860px) {
  .feature {
    grid-template-columns: minmax(0, 1fr);
  }
}

.thread-mini {
  list-style: none;
  margin: 0;
  padding: 0;
}

.thread-mini li {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.thread-mini li:last-child {
  border-bottom: 0;
}

.thread-mini a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.thread-mini a:hover {
  color: var(--accent);
}

.thread-mini .caption {
  display: block;
  margin-top: 2px;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--space-5);
}

@media (max-width: 960px) {
  .two-col {
    grid-template-columns: minmax(0, 1fr);
  }
}

.credo {
  padding: var(--space-6) 0;
  text-align: center;
}

.credo p {
  max-width: 720px;
  margin: var(--space-3) auto 0;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Directory
   -------------------------------------------------------------------------- */

.site-card {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-4);
}

.site-card__icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 22%;
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  color: var(--accent);
}

.site-card__body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.site-card__body .card__title {
  font-size: 18px;
  line-height: 26px;
}

.site-card__host {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.site-card .production {
  margin-top: 2px;
}

.production {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Blog
   -------------------------------------------------------------------------- */

.post-head {
  padding: var(--space-5) 0 var(--space-4);
}

.post-head .kicker {
  margin-bottom: var(--space-3);
}

.post-title {
  font-size: clamp(32px, 4.6vw, 52px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.post-head .lede {
  margin: var(--space-3) 0 0;
  font-size: 20px;
  line-height: 30px;
  color: var(--text-muted);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: var(--space-4);
  color: var(--text-muted);
  font-size: 14px;
}

.post-cover {
  margin: 0 0 var(--space-5);
}

.post-cover img {
  width: 100%;
  border-radius: var(--radius-lg);
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.post-cover figcaption {
  margin-top: 8px;
}

.post-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: var(--space-5);
}

.comments {
  margin-top: var(--space-6);
}

.comment {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  padding: var(--space-3) 0;
  border-top: 1px solid var(--line);
}

.comment--hidden {
  opacity: 0.55;
}

.comment__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-bottom: 4px;
}

.comment__head a {
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.comment__tools {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: 13px;
}

.comment__tools a,
.comment__tools button {
  color: var(--text-muted);
  font-weight: 600;
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.comment__tools a:hover,
.comment__tools button:hover {
  color: var(--text);
}

/* --------------------------------------------------------------------------
   Forums
   -------------------------------------------------------------------------- */

.forum-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-3);
}

.forum-stats div {
  display: grid;
}

.forum-stats strong {
  font-size: 22px;
  line-height: 28px;
  font-weight: 800;
}

.forum-stats span {
  font-size: 13px;
  color: var(--text-muted);
}

.forum-section + .forum-section {
  margin-top: var(--space-5);
}

.forum-section > h2 {
  margin-bottom: var(--space-3);
  color: var(--text-muted);
}

.category-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  overflow: hidden;
}

.category-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px minmax(0, 260px);
  gap: var(--space-3);
  align-items: center;
  padding: 18px 20px 18px 24px;
  border-bottom: 1px solid var(--line);
}

.category-row:last-child {
  border-bottom: 0;
}

.category-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--atrium-teal);
}

.category-row--purple::before {
  background: #8a6bc4;
}

.category-row--orange::before {
  background: var(--sunset-orange);
}

.category-row--lime::before {
  background: var(--signal-lime);
}

.category-row:hover {
  background: var(--surface-hover);
}

.category-row h3 {
  font-size: 18px;
  line-height: 26px;
}

.category-row h3 a {
  color: var(--text);
  text-decoration: none;
}

.category-row h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.category-row p {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 22px;
}

.category-row__count {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 20px;
}

.category-row__count strong {
  color: var(--text);
}

.category-row__last {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
  font-size: 14px;
  line-height: 20px;
}

.category-row__last a {
  position: relative;
  z-index: 1;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.category-row__last > div {
  min-width: 0;
}

@media (max-width: 760px) {
  .category-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .category-row__count {
    display: none;
  }
}

.thread-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  overflow: hidden;
}

.thread-row {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 110px 190px;
  gap: var(--space-3);
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.thread-row:last-child {
  border-bottom: 0;
}

.thread-row:hover {
  background: var(--surface-hover);
}

.thread-row--pinned {
  background: color-mix(in srgb, var(--surface-raised) 88%, var(--accent));
}

.thread-row__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-weight: 600;
  line-height: 24px;
}

.thread-row__title a {
  color: var(--text);
  text-decoration: none;
}

.thread-row__title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.thread-row--unread .thread-row__title a {
  font-weight: 800;
}

.thread-row__title .icon {
  color: var(--text-muted);
}

.unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--signal-lime);
  flex: none;
}

[data-theme="skylight"] .unread-dot {
  background: var(--sunset-orange);
}

.thread-row__stats,
.thread-row__last {
  font-size: 13px;
  line-height: 20px;
  color: var(--text-muted);
}

.thread-row__stats strong,
.thread-row__last strong {
  color: var(--text);
}

@media (max-width: 760px) {
  .thread-row {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .thread-row .avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .thread-row__stats {
    display: none;
  }

  .thread-row__last {
    grid-column: 2;
  }
}

.thread-head {
  padding: var(--space-5) 0 var(--space-4);
}

.thread-head h1 {
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.2;
}

.thread-head .cluster {
  margin-top: var(--space-2);
}

.thread-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: var(--space-3);
}

.mod-tools {
  margin-top: var(--space-3);
}

.mod-tools summary {
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14px;
}

.mod-tools .cluster {
  margin-top: 10px;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
}

.mod-tools select {
  width: auto;
  min-height: 34px;
  padding-top: 4px;
  padding-bottom: 4px;
}

.post {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  overflow: hidden;
}

.post + .post {
  margin-top: var(--space-3);
}

.post:target {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.post--deleted {
  opacity: 0.6;
  border-style: dashed;
}

.post__author {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 6px;
  padding: var(--space-4) var(--space-3);
  border-right: 1px solid var(--line);
  background: var(--surface-sunken);
  text-align: center;
}

[data-theme="skylight"] .post__author {
  background: var(--surface);
}

.post__author a {
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.post__author .caption {
  font-weight: 400;
}

.post__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.post__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px var(--space-4);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-muted);
}

.post__meta a {
  color: var(--text-muted);
  text-decoration: none;
}

.post__body {
  padding: var(--space-4);
  flex: 1;
}

.post__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 8px var(--space-3);
  border-top: 1px solid var(--line);
}

.post__foot .edited {
  margin-right: auto;
  padding-left: 8px;
}

.post__foot .button--ghost {
  min-height: 32px;
  padding: 4px 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.post__foot .button--ghost:hover {
  color: var(--text);
}

@media (max-width: 760px) {
  .post {
    grid-template-columns: minmax(0, 1fr);
  }

  .post__author {
    grid-auto-flow: column;
    justify-content: start;
    justify-items: start;
    align-items: center;
    padding: 12px var(--space-3);
    border-right: 0;
    border-bottom: 1px solid var(--line);
    text-align: left;
  }

  .post__author .avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .post__author .hide-mobile {
    display: none;
  }

  .post__body {
    padding: var(--space-3);
  }

  .post__meta {
    padding: 8px var(--space-3);
  }
}

.reply-box {
  margin-top: var(--space-5);
}

/* --------------------------------------------------------------------------
   Shop
   -------------------------------------------------------------------------- */

.product-card .card__media {
  aspect-ratio: 1 / 1;
}

.product-card .card__media--empty {
  display: grid;
  place-items: center;
  color: var(--text-muted);
  background:
    linear-gradient(to bottom, transparent 62%, var(--floor) 62%),
    var(--sky);
}

.price {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 800;
  font-size: 18px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.price s {
  font-weight: 400;
  font-size: 15px;
  color: var(--text-muted);
}

.price--large {
  font-size: 30px;
  line-height: 36px;
}

.product-card .card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 1fr);
  gap: var(--space-5);
  align-items: start;
  padding-top: var(--space-4);
}

@media (max-width: 900px) {
  .product-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.gallery__main {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-raised);
  border: 1px solid var(--line);
}

.gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery__thumbs {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.gallery__thumbs button {
  width: 72px;
  height: 72px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: none;
  cursor: pointer;
}

.gallery__thumbs button[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.gallery__thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.buy-panel {
  position: sticky;
  top: calc(var(--header-h) + 16px);
}

.buy-panel h1 {
  font-size: clamp(28px, 3.4vw, 38px);
  line-height: 1.2;
}

.buy-panel .tagline {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 28px;
}

.buy-panel .price {
  margin-top: var(--space-3);
}

.buy-panel form {
  margin-top: var(--space-4);
}

.trust {
  display: grid;
  gap: 8px;
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  color: var(--text-muted);
}

.trust li {
  display: flex;
  gap: 8px;
  align-items: center;
}

.order-steps {
  display: flex;
  list-style: none;
  margin: var(--space-4) 0;
  padding: 0;
  gap: 0;
}

.order-steps li {
  flex: 1;
  position: relative;
  padding-top: 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.order-steps li::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--line);
}

.order-steps li::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--line-strong);
}

.order-steps li[data-done]::before {
  background: var(--accent);
}

.order-steps li[data-done]::after {
  background: var(--accent);
  border-color: var(--accent);
}

.order-steps li[data-current] {
  color: var(--text);
}

.order-steps li[data-current]::after {
  background: var(--signal-lime);
  border-color: var(--signal-lime);
}

[data-theme="skylight"] .order-steps li[data-current]::after {
  background: var(--sunset-orange);
  border-color: var(--sunset-orange);
}

.summary-table td {
  padding: 8px 0;
}

.summary-table td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.summary-table tr.total td {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-weight: 800;
  font-size: 18px;
}

/* --------------------------------------------------------------------------
   Profiles and account settings
   -------------------------------------------------------------------------- */

.profile-head {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  flex-wrap: wrap;
  padding: var(--space-5) 0 var(--space-4);
}

.profile-head h1 {
  font-size: clamp(26px, 3.6vw, 40px);
  line-height: 1.15;
}

.profile-head .cluster {
  margin-top: 8px;
}

.online {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.online::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--atrium-teal);
}

.settings-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
  padding: var(--space-5) 0;
}

.settings-nav {
  display: grid;
  gap: 2px;
  position: sticky;
  top: calc(var(--header-h) + 16px);
}

.settings-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 600;
  text-decoration: none;
}

.settings-nav a:hover {
  color: var(--text);
  background: var(--surface-raised);
}

.settings-nav a[aria-current="page"] {
  color: var(--text);
  background: var(--surface-raised);
  box-shadow: inset 2px 0 0 var(--accent);
}

@media (max-width: 760px) {
  .settings-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-3);
  }

  .settings-nav {
    position: static;
    display: flex;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
  }

  .settings-nav a {
    white-space: nowrap;
  }
}

/* --------------------------------------------------------------------------
   Errors
   -------------------------------------------------------------------------- */

.error-page {
  --floor-h: 34%;
  min-height: 70vh;
  display: grid;
  place-items: center;
  padding: var(--space-6) 0 calc(var(--space-6) + 10vh);
  text-align: center;
}

.error-page .plate {
  padding: var(--space-5);
  width: min(560px, calc(100vw - 32px));
}

.error-page h1 {
  margin-top: 12px;
}

.error-page p {
  margin: var(--space-3) auto 0;
  color: var(--text-muted);
}

.error-page .cluster {
  justify-content: center;
  margin-top: var(--space-4);
}
