@import url("https://fonts.googleapis.com/css2?family=Damion&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;700;800;900&display=swap");

:root {
  --art-size: 520px;
  --arrow-dash: 1;
  --arrow-rot: 175deg;
  /*--arrow-left: 348px;
  --arrow-top: 46px;
  --arrow-w: 220px;*/
  --bd-bg: #fbf6e8;
  --bd-gold: #f2b400;
  --bd-ink: #1a1717;
  /*--bottle-h: 700px;
  --bottle-left: 104px;
  --bottle-top: -50px;*/
  /*--circle-h: 380px;
  --circle-left: 24px;
  --circle-top: 65px;
  --circle-w: 73.1%;*/
  /*--title-left: 227px;
  --title-top: 162px;*/

  --arrow-w: 41%;
  --arrow-left: 41%;
  --arrow-top: 49%;

  --title-left: 45.25%;
  --title-top: 38.5%;

  /*--circle-h: 281px;*/
  --circle-left: 7.75%;
  --circle-top: 21.5%;
  --circle-w: 67%;

  --bottle-left: 20%;
  --bottle-h: 100%;
  --bottle-top: 0;
}

dialog#label-generator-intro {
  background-color: var(--bd-bg);
  background-image: url("https://assets.codepen.io/142046/bg-texture-stripes.gif");
  background-repeat: repeat;
  border: 3px solid #FFF;
  border-radius: 40px;
  box-shadow: 0 4px 24px 0 rgba(0, 0, 0, 0.25);
  height: min(150px + var(--art-size), 90dvh);
  margin: auto;
  outline: none;
  overflow: hidden;
  padding: 0 4px;

  opacity: 0;
  translate: 0 25%;
  transition: opacity 0.35s ease-out, translate 0.35s ease-out, display 0.35s allow-discrete, overlay 0.35s allow-discrete; /* 1 */


  &::backdrop {
    background: rgba(234, 174, 40, 0);
    
    backdrop-filter: blur(4px);
    transition: background-color 0.35s ease-out, backdrop-filter 0.35s ease-out, overlay 0.35s allow-discrete; /* 1 */
  }

  &[open] {
    opacity: 1;
    translate: 0;

    @starting-style {
      opacity: 0;
      translate: 0 25%;
    }

    &::backdrop {
      background: rgba(234, 174, 40, 0.90);

      @starting-style {
        background: rgba(234, 174, 40, 0);
      }
    }

    body:has(&) {
      overflow: hidden;
    }
  }

  .bd-hero-inner {
    height: 100%;
    overflow: auto;
    scrollbar-width: thin;

    @media(width <= 980px) {
      display: flex;
      flex-direction: column;
    }
  }
}

/* =========================
   HERO WRAP + GRID
========================= */
.bd-hero {
  color: var(--bd-ink);
  outline: none;
  /*overflow: hidden;*/
  padding: 140px 0 0;
  
  small { font-size: 11px; }
  a:link, a:visited { color: #111; }
}

.bd-hero-inner {
  align-items: center;
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr 1.2fr;
  margin: 0 auto;
  max-width: 1100px;
  outline: none;
  /*padding: 0 24px;*/
  padding: 42px 38px;

  @media(width > 980px) {
    padding: 72px 68px;
  }
}

/* =========================
   LEFT ART
========================= */
.bd-hero-left {
  display: flex;
  justify-content: center;

  @media(width > 980px) {
    overflow: hidden;
    /* here */
    overflow: visible;
    width: 440px;
  }

  @media(width <= 980px) {
    max-width: 800px;
    width: 100%;
  }
}

.bd-hero-art {
  height: var(--art-size);
  position: relative;
  width: var(--art-size);

  @media(width <= 980px) {
    aspect-ratio: 1;
    height: auto;
    translate: 4dvw;
    width: 100%;
  }
}

/* Circle */
.bd-circle {
  aspect-ratio: 1;
  background: var(--bd-gold);
  border-radius: 999px;
  /*height: var(--circle-h);*/
  left: var(--circle-left);
  opacity: 0;
  position: absolute;
  top: var(--circle-top);
  transform: scale(0.75);
  transform-origin: center;
  width: var(--circle-w);
  z-index: 1;

  /*height: 281px;
  width: 281px;
  top: 20.5%;
  left: 50px;*/
}

/* Bottle */
.bd-bottle {
  height: var(--bottle-h);
  left: var(--bottle-left);
  opacity: 0;
  position: absolute;
  top: var(--bottle-top);
  transform: translateY(760px);
  width: auto;
  z-index: 2;

  /*left: 20%;
  top: 0;
  max-height: 100%;*/
}

/* =========================
   TITLE (ARC)
========================= */
/* Title */
.bd-circle-title {
  left: var(--title-left);
  opacity: 0;
  position: absolute;
  top: var(--title-top);
  transform: rotate(-14deg) translateX(-10px) translateY(6px);
  transform-origin: left center;
  width: 96%;
  z-index: 4;
}

.bd-title-arc {
  display: block;
  font-size: .75rem;
  overflow: visible;
  width: 100%;

  @media(width > 768px) {
    font-size: 1rem;
  }
}

.bd-title-top {
  fill: rgba(26, 23, 23, 0.92);
  font-family: "Montserrat", Arial, sans-serif;
  font-size: 1.125em;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.bd-title-bottom {
  fill: rgba(26, 23, 23, 0.92);
  font-family: "Damion", cursive;
  font-size: 2.75em;
  letter-spacing: -0.01em;
}

/* =========================
   ARROW (RIGHT -> LEFT DRAW)
========================= */
/* Arrow */
.bd-arrow {
  left: var(--arrow-left);
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: var(--arrow-top);
  /*transform: translateX(-22px) translateY(10px) rotate(var(--arrow-rot));
  transform-origin: 40px 199px;*/
  width: var(--arrow-w);
  z-index: 3;

  @media(width <= 980px) {
    display: none;
  }

  /*width: 34%;
  left: 36%;
  top: 47%;*/
}

.bd-arrow svg {
  color: var(--bd-ink);
  height: auto;
  overflow: visible;
  width: 100%;

  /*transform: translateX(-22px) translateY(10px) rotate(var(--arrow-rot));
  transform-origin: 40px 199px;*/
}

.bd-arrow-stroke {
  fill: none;
  stroke: currentColor;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 5;
}



/* Shadow */
.bd-shadow {
  background: radial-gradient(ellipse at center, rgba(132, 94, 6, 0.2), transparent 62%);
  color: rgba(245, 182, 26, 0.22);
  filter: blur(2px);
  height: 6.15%;
  left: 4.6%;
  position: absolute;
  top: 80.5%;
  width: 80%;
}

/* =========================
   RIGHT COPY
========================= */
.bd-hero-right {
  text-align: center;
}

.bd-hero-title {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.bd-hero-subtitle {
  border-bottom: 2px solid var(--bd-gold);
  padding-bottom: 12px;
  font-size: 19px;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 12px 0 0 0;
}

.bd-hero-callout {
  display: inline-block;
  font-size: 18px;
  font-weight: 300;
  line-height: 1.5;
  margin-top: 18px;
  padding-bottom: 4px;
}

.bd-actions {
  margin-top: 18px;

  .bd-btn {
    background: #f5b61a;
    border: 2px solid #000;
    box-shadow: 4px 4px 0 #000;
    color: #1a1717;
    cursor: pointer;
    display: inline-block;
    font-family: inherit;
    font-size: 14px;
    font-weight: bold;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    text-transform: uppercase;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  }

  .bd-btn:hover {
    background: #f5b61a;
    box-shadow: 6px 6px 0 #000;
    color: #1a1717;
    transform: translate(-1px, -1px);
  }

  .bd-btn:focus-visible {
    outline: 3px solid rgba(242, 180, 0, 0.45);
    outline-offset: 3px;
  }
}



/* =========================
   EXAMPLES STRIP
========================= */
.bd-examples {
  /*height: 132px;*/
  height: 0;
  margin-top: 32px;
  position: relative;

  padding-bottom: 25.6%;
}

.bd-example {
  border: 6px solid #fff;
  border-radius: 4px;
  box-shadow: 0 7px 12px rgba(0, 0, 0, 0.12);
  height: 116px;
  left: 50%;
  opacity: 0;
  position: absolute;
  top: 0;
  transform: translateX(-50%) translateY(16px) scale(0.98);
  transform-origin: center;
  width: auto;
  will-change: transform, opacity;

  width: 35%;
  height: auto;
}

/* Stacking order */
/* Stacking order */
.bd-example--left {
  z-index: 1;
}

.bd-example--mid {
  z-index: 2;
}

.bd-example--right {
  z-index: 3;
}

/* Initial “stacked under the middle” positions */
.bd-example--left,
.bd-example--right {
  transform: translateX(-50%) translateY(22px) rotate(0deg) scale(0.98);
}

/* =========================
   EXAMPLES ANIMATION
   Plays after the hero sequence
========================= */
.bd-loaded .bd-example--mid {
  animation: bdExampleMidIn 520ms cubic-bezier(0.2, 0.9, 0.2, 1) 2400ms forwards;
}

.bd-loaded .bd-example--left {
  animation: bdExampleLeftOut 780ms cubic-bezier(0.2, 0.9, 0.2, 1) 2700ms forwards;
}

.bd-loaded .bd-example--right {
  animation: bdExampleRightOut 780ms cubic-bezier(0.2, 0.9, 0.2, 1) 2700ms forwards;
}

@keyframes bdExampleMidIn {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(18px) scale(0.96);
  }
  65% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1.03);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@keyframes bdExampleLeftOut {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(22px) rotate(0deg) scale(0.98);
  }
  10% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translateX(calc(-50% - 77.5%)) translateY(-10px) rotate(-6deg) scale(1);
  }
}

@keyframes bdExampleRightOut {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(22px) rotate(0deg) scale(0.98);
  }
  10% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translateX(calc(-50% + 77.5%)) translateY(-12px) rotate(6deg) scale(1);
  }
}

/* =========================
   RESPONSIVE TUNING
========================= */
@media (max-width: 980px) {
  .bd-examples {
    margin-top: 28px;
  }

  .bd-loaded { 
    .bd-example--left,
    .bd-example--right,
    .bd-example--mid {
      animation-delay: 500ms;
    }
  }

  @keyframes bdExampleLeftOut {
    0% {
      opacity: 0;
      transform: translateX(-50%) translateY(22px) rotate(0deg) scale(0.98);
    }
    10% { opacity: 1; }
    100% {
      opacity: 1;
      transform: translateX(calc(-50% - 118px)) translateY(-8px) rotate(-6deg) scale(1);
    }
  }

  @keyframes bdExampleRightOut {
    0% {
      opacity: 0;
      transform: translateX(-50%) translateY(22px) rotate(0deg) scale(0.98);
    }
    10% { opacity: 1; }
    100% {
      opacity: 1;
      transform: translateX(calc(-50% + 118px)) translateY(-6px) rotate(6deg) scale(1);
    }
  }
}

@media (max-width: 560px) {
  .bd-examples {
    margin-top: 26px;
  }

  /*.bd-example--left,
  .bd-example--right {
    display: none;
  }*/
}

@media (prefers-reduced-motion: reduce) {
  .bd-example {
    opacity: 1 !important;
    transform: translateX(-50%) translateY(0) rotate(0deg) scale(1) !important;
  }

  .bd-example--left,
  .bd-example--right {
    display: none;
  }
}





/* =========================
   STEPS LIST
========================= */

.bd-steps {
  list-style: none;
  margin: 22px auto 0;
  max-width: 560px;
  padding: 0;
  text-align: left;
}

.bd-step {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: 28px 1fr;
  margin-top: 16px;
}

.bd-step-num {
  align-items: center;
  background: var(--bd-gold);
  border-radius: 999px;
  color: var(--bd-ink);
  display: inline-flex;
  font-size: 15px;
  font-weight: 700;
  height: 32px;
  justify-content: center;
  line-height: 1;
  margin-top: 2px;
  width: 32px;
}

.bd-step-text {
  font-size: 16px;
  line-height: 1.45;
  margin: 0;
}

.bd-step-note {
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-top: 6px;
  opacity: 0.75;
}


/* =========================
   INTRO ANIMATION SEQUENCE
========================= */
.bd-loaded .bd-circle {
  animation: bdCircleGrow 820ms cubic-bezier(0.2, 0.9, 0.2, 1.1) 80ms forwards;
  opacity: 1;
}

.bd-loaded .bd-bottle {
  animation: bdBottleRise 900ms cubic-bezier(0.2, 0.85, 0.2, 1) 220ms forwards;
  opacity: 1;
}

.bd-loaded .bd-circle-title {
  animation: bdTitleIn 520ms ease 1030ms forwards;
}

/* Intro */
.bd-loaded .bd-arrow {
  animation: arrowSlideIn 520ms ease 980ms forwards;
  opacity: 1;
}

/* Tail draws first, and because the whole arrow is rotated 180deg,
   it visually draws RIGHT -> LEFT (toward the label). */
.bd-loaded .bd-arrow-body {
  animation: arrowDraw 820ms cubic-bezier(0.19, 1.03, 0.22, 1) 1100ms forwards;
  animation-fill-mode: both;
}

/* Head draws last so it does not appear before the tail arrives */
.bd-loaded .bd-arrow-head {
  animation: arrowDraw 260ms cubic-bezier(0.19, 1.03, 0.22, 1) 1850ms forwards;
  animation-fill-mode: both;
}

@keyframes arrowSlideIn {
  0% { transform: translateX(-22px) translateY(10px) rotate(var(--arrow-rot)); }
  100% { transform: translateX(0) translateY(0) rotate(var(--arrow-rot)); }
}

@keyframes arrowDraw {
  0% { opacity: 0;stroke-dashoffset: 1; }
  1% { opacity: 1; }
  100% { stroke-dashoffset: 0; }
}


@keyframes bdCircleGrow {
  0% { transform: scale(0.75); }
  55% { transform: scale(1.08); }
  78% { transform: scale(0.99); }
  100% { transform: scale(1); }
}

@keyframes bdBottleRise {
  0% { transform: translateY(760px); }
  70% { transform: translateY(-44px); }
  /*100% { transform: translateY(-36px); }*/
  100% { transform: translateY(0); }
}

@keyframes bdTitleIn {
  0% { opacity: 0; transform: rotate(-14deg) translateX(-10px) translateY(6px); }
  100% { opacity: 1; transform: rotate(-14deg) translateX(0) translateY(0); }
}



/* =========================
   RESPONSIVE
========================= */
/*@media (max-width: 980px) {
  .bd-hero-inner {
    grid-template-columns: 1fr;
  }
}*/

/*@media (max-width: 560px) {
  :root {
    --art-size: 420px;
    --bottle-h: 560px;
    --bottle-left: 60px;
    --circle-h: 300px;
    --circle-left: 25px;
    --circle-top: 85px;
    --circle-w: 300px;
    --title-left: 215px;
    --title-top: 92px;
    --arrow-left: 120px;
    --arrow-top: 150px;
    --arrow-w: 210px;
  }

  .bd-hero-title {
    font-size: 34px;
  }
}*/

/* =========================
   REDUCED MOTION
========================= */
@media (prefers-reduced-motion: reduce) {
  .bd-circle,
  .bd-bottle,
  .bd-arrow,
  .bd-circle-title {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .bd-arrow-stroke {
    stroke-dashoffset: 0 !important;
  }
}


/* =========================
   STEPS RESPONSIVE TWEAKS
========================= */

/* Slightly roomier / more readable on desktop */
@media (min-width: 981px) {
  .bd-steps {
    max-width: 600px;
  }

  .bd-step-text {
    font-size: 14px;
    line-height: 1.5;
  }
}

/* Tablet + down: let the list breathe and center within the column */
@media (max-width: 980px) {
  .bd-steps {
    margin-left: auto;
    margin-right: auto;
    max-width: 640px;
  }
}

@media (max-width: 560px) {
  .bd-steps {
    margin-top: 18px;
    padding: 0 6px;
  }

  .bd-step {
    gap: 12px;
    grid-template-columns: 30px 1fr;
    margin-top: 14px;
  }

  .bd-step-num {
    font-size: 12px;
    height: 24px;
    width: 24px;
  }

  .bd-step-text {
    font-size: 13px;
    line-height: 1.5;
  }

  .bd-step-note {
    font-size: 11px;
  }
}

@media (max-width: 380px) {
  .bd-step {
    grid-template-columns: 28px 1fr;
    gap: 10px;
  }

  .bd-step-text {
    font-size: 12.5px;
  }
}

@media (max-width: 980px) {

  .bd-hero-inner {
    grid-template-columns: 1fr;
  }

  .bd-hero-right {
    order: -1;
    text-align: center;
    margin-bottom: 32px;
  }
}