/**
 * USP Grid — Amsterdam Hair Institute.
 * 12-column bento layout with mixed sizes, media-backed cards (image + MP4 loop),
 * follicle-dot grain and AHI palette (#001830 + #3e9c95).
 */

.dc-ug {
    --ug-bg:           #f6f9f8;
    --ug-accent:       #3e9c95;
    --ug-accent-dark:  #2e7f78;
    --ug-accent-soft:  rgba(62, 156, 149, 0.18);
    --ug-dark:         #001830;
    --ug-dark-soft:    #0a2a4a;
    --ug-card-bg:      #001830;
    --ug-text:         rgba(255, 255, 255, 0.78);
    --ug-border:       rgba(62, 156, 149, 0.18);
    --ug-radius:       22px;

    position: relative;
    background: var(--ug-bg);
    padding: 100px 24px 110px;
    overflow: hidden;
    font-family: 'DM Sans', 'Inter', system-ui, sans-serif;
    isolation: isolate;
}
.dc-ug *,
.dc-ug *::before,
.dc-ug *::after { box-sizing: border-box; }

/* Decorative follicle-dot grain + soft teal radial glow */
.dc-ug__grain {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.7;
    background-image:
        radial-gradient(ellipse at 18% 12%, rgba(62,156,149,.13) 0%, transparent 45%),
        radial-gradient(ellipse at 82% 88%, rgba(0,24,48,.05) 0%, transparent 55%),
        radial-gradient(circle at 20% 40%, rgba(62,156,149,.22) 1.2px, transparent 2px),
        radial-gradient(circle at 70% 30%, rgba(62,156,149,.18) 1px, transparent 2px),
        radial-gradient(circle at 45% 80%, rgba(62,156,149,.2) 1.4px, transparent 2px),
        radial-gradient(circle at 85% 60%, rgba(62,156,149,.16) 1px, transparent 2px);
    background-size: auto, auto, 560px 520px, 640px 580px, 720px 620px, 500px 480px;
    background-position: center, center, 0 0, 100px 60px, 240px 140px, 360px 80px;
}

.dc-ug__wrap {
    position: relative;
    z-index: 1;
    max-width: 1240px;
    margin: 0 auto;
}

/* ─── Header ─────────────────────────────── */
.dc-ug__header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.dc-ug__header .dc-eyebrow { margin-bottom: 14px; }
.dc-ug__title {
    font-family: "Times New Roman", Times, serif;
    font-size: clamp(30px, 4.2vw, 46px);
    line-height: 1.12;
    letter-spacing: -0.01em;
    color: var(--ug-dark);
    margin: 0 0 14px;
    font-weight: 700;
}
.dc-ug__desc {
    font-size: 16.5px;
    line-height: 1.65;
    color: var(--ug-text);
    margin: 0;
    max-width: 620px;
}

/* ─── Bento grid ─────────────────────────────── */
.dc-ug__grid--bento {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(220px, auto);
    grid-auto-flow: dense;
    gap: 18px;
}
/* Size variants */
.dc-ug__card--size-sm { grid-column: span 4; }
.dc-ug__card--size-md { grid-column: span 6; }
.dc-ug__card--size-lg { grid-column: span 8; }
.dc-ug__card--size-xl { grid-column: span 12; }
.dc-ug__card--tall    { grid-row: span 2; }

/* ─── Card base ─────────────────────────────── */
.dc-ug__card {
    --card-i: 0;
    position: relative;
    background: var(--ug-card-bg);
    border: 1px solid var(--ug-border);
    border-radius: var(--ug-radius);
    padding: 32px 30px 30px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    isolation: isolate;
    box-shadow: 0 4px 14px -6px rgba(0, 24, 48, 0.06);
    transition:
        transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.45s ease,
        border-color 0.35s ease;
}
.dc-ug__card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(62,156,149,0) 0%, rgba(62,156,149,.55) 50%, rgba(62,156,149,0) 100%);
    -webkit-mask:
        linear-gradient(#000, #000) content-box,
        linear-gradient(#000, #000);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
    z-index: 4;
}
.dc-ug__card:hover {
    transform: translateY(-6px);
    border-color: rgba(62, 156, 149, 0.25);
    box-shadow: 0 26px 50px -20px rgba(0, 24, 48, 0.22);
}
.dc-ug__card:hover::before { opacity: 1; }

/* ─── Plain (icon-only) card — dark navy background ─────────────────── */
.dc-ug__card--plain {
    background: linear-gradient(155deg, var(--ug-dark) 0%, var(--ug-dark-soft) 100%);
    border-color: rgba(62, 156, 149, 0.2);
    min-height: 260px;
    color: #ffffff;
}
.dc-ug__card--plain::after {
    content: "";
    position: absolute;
    right: -40px;
    top: -40px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(62,156,149,.32) 0%, transparent 70%);
    filter: blur(10px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.7;
    transition: opacity 0.4s ease, transform 0.5s ease;
}
.dc-ug__card--plain:hover::after {
    opacity: 1;
    transform: scale(1.1);
}

/* ─── Icon in glowing teal ring ─────────────────── */
.dc-ug__card-icon-wrap {
    position: relative;
    width: 68px;
    height: 68px;
    margin-bottom: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.dc-ug__card-icon-glow {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(62,156,149,.35) 0%, rgba(62,156,149,0) 70%);
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.45s ease, transform 0.6s ease;
    pointer-events: none;
}
.dc-ug__card:hover .dc-ug__card-icon-glow {
    opacity: 1;
    transform: scale(1.6);
}
.dc-ug__card-icon {
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: rgba(62, 156, 149, 0.18);
    color: #7fd4ce;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(62, 156, 149, 0.3);
    transition:
        background-color 0.35s ease,
        color 0.35s ease,
        border-color 0.35s ease,
        transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.dc-ug__card-icon svg { width: 30px; height: 30px; }
.dc-ug__card:hover .dc-ug__card-icon {
    background: var(--ug-accent);
    color: #ffffff;
    border-color: var(--ug-accent);
    transform: rotate(-6deg) scale(1.04);
}

/* Media-backed cards: icon sits in top-left with glass effect */
.dc-ug__card--has-media .dc-ug__card-icon-wrap {
    position: absolute;
    top: 18px;
    left: 18px;
    width: 52px;
    height: 52px;
    margin: 0;
}
.dc-ug__card--has-media .dc-ug__card-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
}
.dc-ug__card--has-media .dc-ug__card-icon svg { width: 24px; height: 24px; }
.dc-ug__card--has-media:hover .dc-ug__card-icon {
    background: var(--ug-accent);
    color: #ffffff;
    border-color: var(--ug-accent);
}

/* ─── Media layer ─────────────────────────────── */
.dc-ug__card-media {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    border-radius: inherit;
}
.dc-ug__card-media img,
.dc-ug__card-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.dc-ug__card--has-media:hover .dc-ug__card-media img,
.dc-ug__card--has-media:hover .dc-ug__card-media video { transform: scale(1.04); }

.dc-ug__card-media-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(0,24,48,0) 35%, rgba(0,24,48,.55) 75%, rgba(0,24,48,.85) 100%),
        linear-gradient(135deg, rgba(0,24,48,.25) 0%, transparent 60%);
    z-index: 1;
    transition: background 0.35s ease;
}
.dc-ug__card--has-media:hover .dc-ug__card-media-overlay {
    background:
        linear-gradient(180deg, rgba(0,24,48,.1) 20%, rgba(0,24,48,.65) 70%, rgba(0,24,48,.88) 100%),
        linear-gradient(135deg, rgba(62,156,149,.2) 0%, transparent 60%);
}

/* ─── Body ─────────────────────────────── */
.dc-ug__card-body {
    position: relative;
    z-index: 2;
}
.dc-ug__card-title {
    font-family: "Times New Roman", Times, serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    color: #ffffff;
    margin: 16px 0 10px;
    transition: color 0.3s ease;
}
.dc-ug__card-text {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 14.5px;
    line-height: 1.6;
    color: #FFFFFF;
    margin: 0;
}
.dc-ug__card--plain:hover .dc-ug__card-title { color: #7fd4ce; }

/* Media cards: larger title + slightly softer text */
.dc-ug__card--has-media .dc-ug__card-title { font-size: 26px; line-height: 1.15; margin: 0 0 8px; }
.dc-ug__card--has-media .dc-ug__card-text  { color: rgba(255,255,255,.82); font-size: 14px; }

/* Media card on a tall cell: bigger title */
.dc-ug__card--has-media.dc-ug__card--tall .dc-ug__card-title { font-size: 32px; }
.dc-ug__card--has-media.dc-ug__card--size-lg .dc-ug__card-title,
.dc-ug__card--has-media.dc-ug__card--size-xl .dc-ug__card-title { font-size: 30px; }

/* ─── Accent line ─────────────────────────────── */
.dc-ug__card-accent {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 42px;
    background: var(--ug-accent);
    border-radius: 0 3px 3px 0;
    transition: width 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2;
}
.dc-ug__card:hover .dc-ug__card-accent { width: 100%; }
.dc-ug__card--has-media .dc-ug__card-accent { height: 4px; }

/* Stagger reveal */
.dc-ug__card {
    animation: dc-ug-rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: calc(var(--card-i) * 0.06s);
}
@keyframes dc-ug-rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── CTA row ─────────────────────────────── */
.dc-ug__cta {
    display: flex;
    justify-content: center;
    margin-top: 56px;
}

/* ─── Responsive ─────────────────────────────── */
@media (max-width: 1024px) {
    .dc-ug { padding: 84px 22px 90px; }
    .dc-ug__grid--bento { grid-template-columns: repeat(6, 1fr); grid-auto-rows: minmax(200px, auto); }
    .dc-ug__card--size-sm { grid-column: span 3; }
    .dc-ug__card--size-md { grid-column: span 6; }
    .dc-ug__card--size-lg { grid-column: span 6; }
    .dc-ug__card--size-xl { grid-column: span 6; }
    .dc-ug__card--tall    { grid-row: span 1; }
}
@media (max-width: 680px) {
    .dc-ug { padding: 64px 18px 72px; }
    .dc-ug__header { margin-bottom: 40px; }
    .dc-ug__grid--bento { grid-template-columns: 1fr; grid-auto-rows: minmax(180px, auto); gap: 14px; }
    .dc-ug__card--size-sm,
    .dc-ug__card--size-md,
    .dc-ug__card--size-lg,
    .dc-ug__card--size-xl { grid-column: span 1; }
    .dc-ug__card { padding: 26px 24px; min-height: 220px; }
    .dc-ug__card--plain { min-height: 220px; }
    .dc-ug__card-icon-wrap { width: 60px; height: 60px; }
    .dc-ug__card-icon { width: 52px; height: 52px; }
    .dc-ug__card-icon svg { width: 26px; height: 26px; }
    .dc-ug__card--has-media .dc-ug__card-title { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    .dc-ug__card,
    .dc-ug__card-icon,
    .dc-ug__card-icon-glow,
    .dc-ug__card-media img,
    .dc-ug__card-media video { animation: none; transition: none; }
}
