/* Homepage card: MyTaste */

/* ---------- MyTaste feature ---------- */
/* MyTaste is black and white with one colour: the hue that slowly turns
   through its "MY" mark. The card keeps that, and follows the page scheme
   the way mytaste.cc follows the operating system. */
@property --mytaste-spin {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

.mytaste-feature {
  --mytaste-hue: calc(var(--mytaste-hue-start) + var(--mytaste-spin));

  position: relative;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(2.5rem, 5vw, 5rem);
  min-height: clamp(30rem, 46vw, 37rem);
  margin-top: clamp(3rem, 6vw, 5rem);
  padding: clamp(2.25rem, 5vw, 5rem);
  overflow: hidden;
  border: 1px solid var(--mytaste-hairline);
  border-radius: clamp(12px, 1.5vw, 18px);
  background:
    radial-gradient(circle at 78% 42%, oklch(0.72 0.16 var(--mytaste-hue) / var(--mytaste-glow)), transparent 44%),
    linear-gradient(135deg, var(--mytaste-surface), var(--mytaste-surface-deep));
  color: var(--mytaste-ink);
  isolation: isolate;
  animation: mytaste-spin 36s linear infinite;
}

@keyframes mytaste-spin {
  to { --mytaste-spin: 360; }
}

/* the slanted bands that hang behind mytaste.cc */
.mytaste-feature::before {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  z-index: -1;
  width: 58%;
  background: repeating-linear-gradient(
    90deg,
    var(--mytaste-band) 0 3.4rem,
    transparent 3.4rem 4.2rem
  );
  opacity: var(--mytaste-band-opacity);
  clip-path: polygon(0 3.5rem, 100% 0, 100% 100%, 0 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 45%);
  mask-image: linear-gradient(90deg, transparent, #000 45%);
}

.mytaste-copy {
  position: relative;
  z-index: 5;
  align-self: center;
  max-width: 34rem;
}

.mytaste-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: clamp(1.6rem, 3vw, 2.4rem);
  color: var(--mytaste-ink-soft);
}

.mytaste-title {
  display: block;
  width: clamp(8.5rem, 13vw, 11rem);
  line-height: 0;
}

.mytaste-mark {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.mytaste-glow { opacity: var(--mytaste-mark-glow); }
.mytaste-script { fill: currentColor; overflow: visible; }
.mytaste-stop-top { stop-color: oklch(0.77 0.13 var(--mytaste-hue)); }
.mytaste-stop-bottom { stop-color: oklch(0.65 0.19 var(--mytaste-hue)); }

.mytaste-lede {
  margin: clamp(1.7rem, 3vw, 2.4rem) 0 1.2rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.6vw, 2.15rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.mytaste-feature .product-desc {
  max-width: 31rem;
  color: var(--mytaste-ink-soft);
  line-height: 1.75;
}

.mytaste-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.mytaste-feature .btn-solid {
  background: var(--mytaste-ink);
  color: var(--mytaste-surface);
}

.mytaste-feature .btn-solid:hover {
  background: oklch(var(--mytaste-accent-l) 0.17 var(--mytaste-hue));
  color: var(--mytaste-on-accent);
}

.mytaste-github-link { color: var(--mytaste-ink-soft); }
.mytaste-feature .btn-text:hover { color: var(--mytaste-ink); }

.mytaste-action-icon {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
}

/* ---------- vignette: a collection as a poster wall ---------- */
.mytaste-vignette {
  position: relative;
  z-index: 5;
  display: grid;
  place-items: center;
  align-self: stretch;
  min-height: 25rem;
}

.mytaste-wall {
  width: min(100%, 34rem);
  padding: 1rem 1rem 1.15rem;
  border: 1px solid var(--mytaste-hairline);
  border-radius: 12px;
  background: var(--mytaste-window);
  box-shadow: 0 34px 70px -30px var(--mytaste-shadow);
  rotate: -1.5deg;
  backdrop-filter: blur(14px);
}

.mytaste-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
  overflow: hidden;
}

.mytaste-tabs span {
  flex: none;
  padding: 0.32rem 0.7rem;
  border: 1px solid var(--mytaste-hairline);
  border-radius: 999px;
  color: var(--mytaste-ink-soft);
  white-space: nowrap;
}

.mytaste-tabs .is-on {
  border-color: transparent;
  background: var(--mytaste-ink);
  color: var(--mytaste-surface);
}

.mytaste-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

/* each poster is a hue; --o offsets it from the turning brand hue */
.mytaste-poster {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 6px;
  background:
    linear-gradient(180deg, transparent 48%, rgba(0, 0, 0, 0.55)),
    linear-gradient(160deg,
      oklch(0.8 0.11 calc(var(--mytaste-hue) + var(--o))),
      oklch(0.5 0.16 calc(var(--mytaste-hue) + var(--o) + 40)));
}

.mytaste-poster::before {
  content: "";
  position: absolute;
  left: 0.45rem;
  right: 35%;
  bottom: 0.55rem;
  height: 0.28rem;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.78);
}

/* service marks in the poster corner */
.mytaste-poster b {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  display: flex;
  gap: 0.2rem;
}

.mytaste-poster b i {
  width: 0.5rem;
  height: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
}

.mytaste-poster b i.mytaste-local {
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.9);
}

/* the one you are about to watch */
.mytaste-poster-on {
  outline: 2px solid var(--mytaste-ink);
  outline-offset: 2px;
}

.mytaste-poster-on::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-block: 0.5rem solid transparent;
  border-left: 0.8rem solid rgba(255, 255, 255, 0.92);
  translate: -35% -60%;
}

@media (prefers-reduced-motion: reduce) {
  .mytaste-feature { animation: none; }
}

@media (min-width: 861px) and (max-height: 850px) {
  .mytaste-feature {
    min-height: calc(100svh - var(--nav-height) - 3.5rem);
    padding-block: clamp(2.25rem, 6vh, 3rem);
  }

  .mytaste-meta { margin-bottom: clamp(1.1rem, 3vh, 1.75rem); }
  .mytaste-lede { margin-top: clamp(1.2rem, 3.5vh, 1.7rem); }
}

@media (max-width: 860px) {
  .mytaste-feature { grid-template-columns: 1fr; gap: 2rem; min-height: auto; }
  .mytaste-feature::before { width: 100%; }
  .mytaste-copy { max-width: 38rem; }
  .mytaste-vignette { min-height: auto; }
}

@media (max-width: 520px) {
  .mytaste-feature {
    gap: 1.5rem;
    padding: 1.75rem 1.15rem 1.5rem;
    border-radius: 12px;
  }
  .mytaste-actions { justify-content: center; }
  .mytaste-wall { padding: 0.75rem; rotate: 0deg; }
  .mytaste-grid { gap: 0.45rem; }
  .mytaste-tabs span:nth-child(n + 4) { display: none; }
}

.mytaste-feature .product-desc code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--mytaste-ink);
}
