/* =========================================
   Lumeve Design System • Full CSS
   Scope: #design-system.lumeve-ds
   ========================================= */

/* Tokens scoped to this section */
#design-system.lumeve-ds {
    /* layout */
    --rail-max: 1160px;
    --pad: clamp(12px, 3vw, 36px);

    /* type scale, compact */
    --h1: clamp(26px, 4.5vw, 38px);
    --h2: clamp(20px, 3.2vw, 28px);
    --h3: clamp(16px, 2.2vw, 20px);
    --body: clamp(14px, 1.8vw, 16px);

    /* spacing */
    --space-1: 6px;
    --space-2: 10px;
    --space-3: 14px;
    --space-4: 18px;
    --space-5: 22px;
    --space-6: 28px;

    /* colors */
    --ink-900: #1f1f1f;
    --ink-700: #2b3147;
    --ink-600: #5a6273;
    --ink-400: #8a91a1;

    --blue: #165c7d;
    --blue-100: #dce7ec;
    --blue-400: #6f9aae;
    --gold: #f2b134;
    --gold-300: #f7d085;
    --red: #b0332a;
    --sage: #aeb7ad;
    --off: #f9f8f6;
    --white: #ffffff;

    /* visuals */
    --radius: 14px;
    --radius-sm: 12px;
    --shadow: 0 10px 24px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.06);
    --hairline: 1px solid rgba(0, 0, 0, 0.08);

    /* font card target width */
    --font-card-max: 400px;
    color: var(--ink-900);
}

/* Rail and section spacing */
#design-system.lumeve-ds .section {
    max-width: var(--rail-max);
    margin: 0 auto;
    padding: clamp(20px, 5vw, 44px) var(--pad);
}

/* Intro */
#design-system.lumeve-ds .heading {
    font-size: var(--h1);
    line-height: 1.2;
    margin: 0 0 var(--space-2);
    letter-spacing: -0.01em;
}
#design-system.lumeve-ds .lede {
    margin-top: var(--space-2);
}
#design-system.lumeve-ds .subhead {
    font-size: var(--h2);
    line-height: 1.25;
    margin: 0 0 var(--space-2);
    color: var(--ink-700);
    font-weight: 600;
}
#design-system.lumeve-ds .body {
    font-size: var(--body);
    line-height: 1.65;
    color: var(--ink-600);
    margin: 0;
}

/* Typeface helpers */
#design-system.lumeve-ds .serif {
    font-family: "EB Garamond", Georgia, serif;
    font-weight: 500;
}
#design-system.lumeve-ds .sans {
    font-family: "IBM Plex Sans", system-ui, -apple-system, Segoe UI, Roboto,
        sans-serif;
}

/* Font pairs */
#design-system.lumeve-ds .font-pairs .font-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, var(--font-card-max)));
    justify-content: center;
    gap: 16px;
}
#design-system.lumeve-ds .font-card {
    display: grid;
    grid-template-rows: auto 1fr;
    background: var(--white);
    border: var(--hairline);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    max-width: var(--font-card-max);
    margin-inline: auto;

    /* animation */
    opacity: 0;
    transform: scale(0.92) translateY(20px);
    animation: fadeScaleUp 0.8s ease forwards;
}
#design-system.lumeve-ds .font-card img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    /* images remain static */
}
#design-system.lumeve-ds .font-card figcaption {
    padding: 12px 14px 14px;
}
#design-system.lumeve-ds .font-name {
    font-size: 18px;
    line-height: 1.25;
    margin: 0 0 2px;
      font-weight: 900;
}
#design-system.lumeve-ds .weights {
    margin: 0;
    font-size: 13px;
    line-height: 1.35;
    color: var(--ink-400);
}

/* Heritage aside (Rooted in Persian Heritage) */
#design-system.lumeve-ds .heritage {
    margin-top: clamp(20px, 4.5vw, 36px);
    background: linear-gradient(
      180deg,
      #ffffff 0%,
      #f9f9f9 60%,
      #fefefe 100%
    );
    border-left: 10px solid var(--blue);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    isolation: isolate;
    transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
}
#design-system.lumeve-ds .heritage-inner {
    padding: clamp(14px, 3vw, 22px);
    position: relative;
    transition: transform .35s ease;
}
#design-system.lumeve-ds .heritage-title {
    font-size: var(--h3);
    margin: 0 0 var(--space-2);
    color: var(--ink-700);
    font-weight: 700;
    position: relative;
    display: inline-block;
    padding-bottom: 6px;
}
#design-system.lumeve-ds .heritage-title::after {
    content: "";
    position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
    background: linear-gradient(90deg, var(--blue) 0%, #398FBA 60%, var(--gold) 100%);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform .6s cubic-bezier(.22,.75,.12,1);
}
#design-system.lumeve-ds .heritage-copy {
    margin: 0;
    font-size: var(--body);
    line-height: 1.65;
    color: var(--ink-600);
    background: linear-gradient(to right, rgba(242,177,52,.12), rgba(242,177,52,0) 60%);
    background-size: 0% 60%;
    background-repeat: no-repeat;
    background-position: 0 80%;
    transition: background-size .8s ease;
}

/* Colors header */
#design-system.lumeve-ds .colors > .heading {
    margin-top: var(--space-6);
    margin-bottom: var(--space-2);
}

/* Swatch grid */
#design-system.lumeve-ds .colors .swatches {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(2, auto);
    grid-auto-columns: minmax(170px, 1fr);
    gap: clamp(12px, 2.4vw, 20px);
    margin-top: 16px;
}
#design-system.lumeve-ds .swatch {
    display: grid;
    grid-template-rows: auto auto;
    gap: 10px;
    padding: 14px;
    border-radius: var(--radius);
    background: var(--white);
    border: var(--hairline);
    box-shadow: var(--shadow);

    /* entrance animation */
    opacity: 0;
    transform: scale(0.92) translateY(20px);
    animation: fadeScaleUp .7s ease forwards;
}
#design-system.lumeve-ds .chip {
    width: 100%;
    aspect-ratio: 5 / 3;
    border-radius: var(--radius-sm);
    background: var(--chip, #ddd);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06),
        inset 0 0 0 5px rgba(255, 255, 255, 0.6);
}
#design-system.lumeve-ds .meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 14px;
    color: var(--ink-700);
}
#design-system.lumeve-ds .meta .name {
    font-weight: 600;
}
#design-system.lumeve-ds .meta .hex {
    font-variant-numeric: tabular-nums;
    font-size: 13px;
    color: var(--ink-400);
}

/* Responsive rules */
@media (max-width: 900px) {
    #design-system.lumeve-ds .colors .swatches {
        grid-auto-flow: row;
        grid-template-rows: none;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 680px) {
    #design-system.lumeve-ds .font-pairs .font-row {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 560px) {
    #design-system.lumeve-ds .colors .swatches {
        grid-template-columns: 1fr;
    }
    #design-system.lumeve-ds .swatch {
        padding: 12px;
    }
    #design-system.lumeve-ds .chip {
        aspect-ratio: 16 / 9;
    }
}

/* Spacing polish */
#design-system.lumeve-ds .intro .lede {
    gap: 10px;
}
#design-system.lumeve-ds .colors .swatches + * {
    margin-top: var(--space-6);
}

/* ===============================
   Animations
   =============================== */
@keyframes fadeScaleUp {
  0% { opacity: 0; transform: scale(0.92) translateY(20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes borderSweep {
  0%, 100% { background-position: left; opacity: .8; }
  50% { background-position: right; opacity: .2; }
}

/* Font cards stagger */
#design-system.lumeve-ds .font-card:nth-child(1) { animation-delay: 0.1s; }
#design-system.lumeve-ds .font-card:nth-child(2) { animation-delay: 0.25s; }
#design-system.lumeve-ds .font-card:nth-child(3) { animation-delay: 0.4s; }
#design-system.lumeve-ds .font-card:nth-child(4) { animation-delay: 0.55s; }
#design-system.lumeve-ds .font-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 12px 28px rgba(22,92,125,.25);
}

/* Swatch hover + stagger delays */
#design-system.lumeve-ds .colors .swatches .swatch:nth-child(1)  { animation-delay: .06s; }
#design-system.lumeve-ds .colors .swatches .swatch:nth-child(2)  { animation-delay: .12s; }
#design-system.lumeve-ds .colors .swatches .swatch:nth-child(3)  { animation-delay: .18s; }
#design-system.lumeve-ds .colors .swatches .swatch:nth-child(4)  { animation-delay: .24s; }
#design-system.lumeve-ds .colors .swatches .swatch:nth-child(5)  { animation-delay: .30s; }
#design-system.lumeve-ds .colors .swatches .swatch:nth-child(6)  { animation-delay: .36s; }
#design-system.lumeve-ds .colors .swatches .swatch:nth-child(7)  { animation-delay: .42s; }
#design-system.lumeve-ds .colors .swatches .swatch:nth-child(8)  { animation-delay: .48s; }
#design-system.lumeve-ds .colors .swatches .swatch:nth-child(9)  { animation-delay: .54s; }
#design-system.lumeve-ds .colors .swatches .swatch:nth-child(10) { animation-delay: .60s; }
#design-system.lumeve-ds .colors .swatches .swatch:nth-child(11) { animation-delay: .66s; }
#design-system.lumeve-ds .colors .swatches .swatch:nth-child(12) { animation-delay: .72s; }

#design-system.lumeve-ds .swatch:hover {
  transform: translateY(-6px) rotate(-1deg);
  box-shadow: 0 12px 28px rgba(22,92,125,.15);
}

/* Heritage card upgrades */
#design-system.lumeve-ds .heritage:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 60px rgba(0,0,0,.16), 0 10px 24px rgba(0,0,0,.12);
  border-color: #398FBA;
}
#design-system.lumeve-ds .heritage::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(57,143,186,0) 0%, rgba(57,143,186,.55) 6%, rgba(57,143,186,0) 12%) left/12px 100% no-repeat;
  pointer-events: none;
  animation: borderSweep 6s ease-in-out infinite;
}
#design-system.lumeve-ds .heritage:hover .heritage-title::after {
  transform: scaleX(1);
}
#design-system.lumeve-ds .heritage:hover .heritage-inner {
  transform: translateZ(10px);
}
#design-system.lumeve-ds .heritage:hover .heritage-copy {
  background-size: 100% 60%;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  #design-system.lumeve-ds .font-card,
  #design-system.lumeve-ds .heritage,
  #design-system.lumeve-ds .heritage::after,
  #design-system.lumeve-ds .heritage-title::after,
  #design-system.lumeve-ds .heritage-copy,
  #design-system.lumeve-ds .colors .swatches .swatch {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}


/* Arrows only visible in pause/scroll mode */
#lumeve-showcase .sc-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(0,0,0,0.4);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

#lumeve-showcase .sc-viewport.is-scroll ~ .sc-arrow {
  opacity: 1;
  pointer-events: auto;
}

#lumeve-showcase .sc-arrow.left { left: 12px; }
#lumeve-showcase .sc-arrow.right { right: 12px; }

/* hide arrows on small screens */
@media (max-width: 640px) {
  #lumeve-showcase .sc-arrow { display: none; }
}

@media (max-width: 560px) {
  #design-system.lumeve-ds .colors .swatches {
    grid-template-columns: 1fr;
    gap: 12px; /* reduce spacing */
  }

  #design-system.lumeve-ds .swatch {
    padding: 10px;
    max-width: 280px; /* limit card width */
    margin: 0 auto;   /* center card */
  }

  #design-system.lumeve-ds .chip {
    aspect-ratio: 4 / 3; /* less tall than 16:9 */
  }

  #design-system.lumeve-ds .meta {
    font-size: 12px; /* adjust text for smaller screens */
  }
}

@media (max-width: 560px) {
  #design-system.lumeve-ds .colors .swatches {
    grid-template-columns: repeat(2, 1fr); /* keep 2 columns */
    gap: 10px;
  }

  #design-system.lumeve-ds .swatch {
    padding: 10px;
  }

  #design-system.lumeve-ds .chip {
    aspect-ratio: 4 / 3; /* slightly shorter blocks */
  }

  #design-system.lumeve-ds .meta {
    font-size: 12px;
  }
}



@media (max-width: 560px) {
  /* Grid: keep 2 side by side */
  #design-system.lumeve-ds .colors .swatches,
  #design-system.lumeve-ds .font-pairs .font-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  /* Card sizing */
  #design-system.lumeve-ds .swatch,
  #design-system.lumeve-ds .font-card {
    max-width: 180px;   /* balanced width */
    margin: 0 auto;     /* center in column */
    padding: 10px;
  }

  /* Chip & previews */
  #design-system.lumeve-ds .chip {
    aspect-ratio: 4 / 3; /* not too tall */
  }

  /* Typography scaling */
  #design-system.lumeve-ds {
    --h1: 20px;
    --h2: 17px;
    --h3: 15px;
    --body: 14px;
  }

  #design-system.lumeve-ds .font-name {
    font-size: 15px;
  }
  #design-system.lumeve-ds .weights,
  #design-system.lumeve-ds .meta {
    font-size: 12px;
  }
}
