.coffee-templates-page {
  --coffee: #b76528;
  --coffee-dark: #7f3f17;
  --coffee-soft: #fff0dc;
}

html[data-theme="dark"] .coffee-templates-page {
  --coffee: #f0a867;
  --coffee-dark: #ffc68f;
  --coffee-soft: #3b281a;
}

.language-link {
  min-width: 42px;
  border: 1px solid var(--line);
  color: var(--accent-dark);
}

.coffee-hero {
  padding-bottom: 72px;
}

.button-coffee {
  border-color: color-mix(in srgb, var(--coffee) 30%, var(--line));
  color: var(--coffee-dark);
  background: var(--coffee-soft);
  box-shadow: 0 12px 26px rgba(127, 63, 23, 0.12);
}

.button-coffee:hover {
  box-shadow: 0 16px 30px rgba(127, 63, 23, 0.18);
}

.coffee-hero-visual {
  position: relative;
  min-height: 520px;
  isolation: isolate;
}

.coffee-glow {
  position: absolute;
  inset: 4% -4% 2%;
  z-index: -1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 58% 43%, rgba(55, 168, 212, 0.28), transparent 43%),
    radial-gradient(circle at 25% 74%, rgba(183, 101, 40, 0.2), transparent 31%);
  filter: blur(18px);
}

.coffee-document {
  position: absolute;
  display: flex;
  width: min(320px, 66%);
  min-height: 405px;
  flex-direction: column;
  padding: 35px 29px;
  border: 1px solid #dbe3ed;
  border-radius: 8px;
  color: #536277;
  background: #fff;
  box-shadow: 0 32px 68px rgba(28, 45, 78, 0.2);
}

.coffee-document-back {
  top: 24px;
  right: 12px;
  transform: rotate(8deg);
}

.coffee-document-front {
  top: 52px;
  left: 18px;
  z-index: 2;
  transform: rotate(-5deg);
}

.coffee-doc-kicker {
  display: block;
  margin-bottom: 30px;
  padding: 11px 12px;
  border-radius: 5px;
  color: #fff;
  background: linear-gradient(90deg, #157aa9, #36a7d4);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.11em;
}

.coffee-document i {
  display: block;
  height: 8px;
  margin: 0 0 14px;
  border-radius: 4px;
  background: #e6ebf2;
}

.coffee-document i:nth-of-type(1) { width: 78%; }
.coffee-document i:nth-of-type(2) { width: 58%; }
.coffee-document i:nth-of-type(3) { width: 100%; }
.coffee-document i:nth-of-type(4) { width: 70%; }

.coffee-document b {
  display: block;
  height: 102px;
  margin: 15px 0 22px;
  border: 1px solid #dfe7f0;
  border-radius: 4px;
  background:
    linear-gradient(#ecf2f8 1px, transparent 1px) 0 33% / 100% 33%,
    linear-gradient(90deg, transparent 67%, #ecf2f8 67%, #ecf2f8 calc(67% + 1px), transparent calc(67% + 1px));
}

.coffee-cup {
  position: absolute;
  z-index: 5;
  right: 3px;
  bottom: 18px;
  display: grid;
  width: 130px;
  height: 112px;
  place-items: center;
  border: 1px solid #e0c09e;
  border-radius: 18px 18px 46px 46px;
  color: #fff;
  background: linear-gradient(145deg, #c87a3e, #8b471d);
  box-shadow: 0 24px 44px rgba(91, 43, 14, 0.28);
}

.coffee-cup::after {
  position: absolute;
  right: -36px;
  top: 21px;
  width: 48px;
  height: 50px;
  border: 12px solid #a85c27;
  border-left: 0;
  border-radius: 0 36px 36px 0;
  content: "";
}

.coffee-cup-fill {
  font-size: 42px;
  filter: grayscale(0.15);
}

.coffee-steam {
  position: absolute;
  top: -52px;
  width: 18px;
  height: 58px;
  border-left: 3px solid color-mix(in srgb, var(--coffee) 45%, transparent);
  border-radius: 50%;
  transform: rotate(9deg);
}

.steam-one { left: 42px; }
.steam-two { left: 76px; top: -66px; transform: rotate(-9deg); }

.coffee-chip {
  z-index: 7;
  bottom: 3px;
  left: 7px;
}

.coffee-chip::before {
  content: "☕";
  color: var(--coffee-dark);
  background: var(--coffee-soft);
}

.coffee-template-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 920px;
}

.coffee-template-card {
  min-height: 360px;
}

.badge-coffee {
  color: var(--coffee-dark);
  background: var(--coffee-soft);
}

.coffee-account-note {
  margin-top: 24px;
  padding: 16px 18px;
  border-left: 4px solid var(--coffee);
  border-radius: 4px 13px 13px 4px;
  color: var(--muted);
  background: var(--coffee-soft);
  font-size: 13px;
}

.coffee-account-note strong {
  color: var(--coffee-dark);
}

.coffee-access-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: clamp(34px, 7vw, 80px);
}

.coffee-access-panel h2 {
  margin: 10px 0 14px;
  font-size: clamp(32px, 4.6vw, 52px);
  line-height: 1.07;
  letter-spacing: -0.045em;
}

.coffee-access-panel > div:first-child > p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

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

.coffee-clarity-grid article {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.coffee-clarity-grid article:first-child {
  border-color: color-mix(in srgb, var(--coffee) 38%, var(--line));
  background:
    linear-gradient(150deg, color-mix(in srgb, var(--coffee-soft) 70%, transparent), transparent 67%),
    var(--surface);
}

.coffee-clarity-grid article > span {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 13px;
  color: var(--coffee-dark);
  background: var(--coffee-soft);
  font-size: 21px;
}

.coffee-clarity-grid article:last-child > span {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.coffee-clarity-grid h3 {
  margin: 19px 0 8px;
  font-size: 19px;
}

.coffee-clarity-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 980px) {
  .coffee-hero-visual {
    width: min(610px, 100%);
    margin-inline: auto;
  }

  .coffee-access-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .nav-actions .language-link {
    display: inline-flex;
  }

  .coffee-hero-visual {
    min-height: 480px;
  }

  .coffee-template-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .nav-actions .language-link {
    min-width: 38px;
    min-height: 40px;
    padding-inline: 8px;
  }

  .coffee-hero-visual {
    min-height: 408px;
  }

  .coffee-document {
    width: 70%;
    min-height: 330px;
    padding: 26px 21px;
  }

  .coffee-document-back {
    right: 7px;
  }

  .coffee-document-front {
    top: 44px;
    left: 4px;
  }

  .coffee-doc-kicker {
    margin-bottom: 22px;
    font-size: 9px;
  }

  .coffee-document b {
    height: 78px;
    margin-block: 10px 16px;
  }

  .coffee-cup {
    right: 18px;
    bottom: 6px;
    width: 94px;
    height: 82px;
  }

  .coffee-cup::after {
    right: -26px;
    width: 35px;
    height: 38px;
    border-width: 9px;
    border-left: 0;
  }

  .coffee-cup-fill {
    font-size: 30px;
  }

  .coffee-chip {
    left: 0;
    font-size: 11px;
  }

  .coffee-clarity-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .coffee-document,
  .coffee-cup,
  .coffee-steam {
    animation: none;
  }
}
