/* ==========================================================
   Engraving Studio 63 — Stylesheet
   ========================================================== */

/* ── Widget wrapper ─────────────────────────────────────── */
.esg63-widget {
    position: relative;
    width: 100%;
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* ── Canvas stage ──────────────────────────────────────── */
.esg63-canvas-wrapper {
    position: relative;
    width: 100%;
    height: 600px;
    overflow: hidden;
    cursor: none;
    background: #130b04;
    border-radius: 4px;
}

.esg63-main-canvas,
.esg63-particle-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.esg63-main-canvas     { z-index: 1; }
.esg63-particle-canvas { z-index: 2; pointer-events: none; }

/* ── Pen cursor ─────────────────────────────────────────── */
.esg63-pen-cursor {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 10;
    will-change: transform;
}

.esg63-pen-tip {
    position: absolute;
    top: -5px;
    left: -5px;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, #ffffff 0%, #00d4ff 55%, transparent 100%);
    border-radius: 50%;
    animation: esg63-tip-pulse 0.9s ease-in-out infinite;
}

.esg63-pen-ring {
    position: absolute;
    top: -14px;
    left: -14px;
    width: 28px;
    height: 28px;
    border: 1.5px solid rgba(0, 212, 255, 0.45);
    border-radius: 50%;
    animation: esg63-ring-ripple 1.4s ease-out infinite;
}

@keyframes esg63-tip-pulse {
    0%, 100% { transform: scale(1);   opacity: 1;    }
    50%       { transform: scale(1.4); opacity: 0.75; }
}

@keyframes esg63-ring-ripple {
    0%   { transform: scale(0.6); opacity: 0.8; }
    100% { transform: scale(1.9); opacity: 0;   }
}

/* ── Overlay (info + nav) ───────────────────────────────── */
.esg63-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 5;
    padding: 20px 24px 18px;
    background: linear-gradient(transparent 0%, rgba(0,0,0,0.72) 100%);
    pointer-events: none;
}

.esg63-image-info {
    text-align: center;
    margin-bottom: 14px;
}

.esg63-title {
    margin: 0 0 5px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #e8c870;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-shadow: 0 0 14px rgba(232,200,112,0.55);
    line-height: 1.3;
}

.esg63-description {
    margin: 0;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.65);
    line-height: 1.55;
}

/* ── Navigation ─────────────────────────────────────────── */
.esg63-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    pointer-events: all;
}

.esg63-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.esg63-btn:hover {
    background: rgba(0,212,255,0.2);
    border-color: rgba(0,212,255,0.55);
    box-shadow: 0 0 12px rgba(0,212,255,0.35);
}

.esg63-progress-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.esg63-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.28);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.25s, transform 0.25s, box-shadow 0.25s;
}

.esg63-dot.active,
.esg63-dot:hover {
    background: #00d4ff;
    transform: scale(1.4);
    box-shadow: 0 0 10px rgba(0,212,255,0.6);
}

/* ── Gyroscope button ───────────────────────────────────── */
.esg63-gyro-wrapper {
    text-align: center;
    margin-top: 10px;
    pointer-events: all;
}

.esg63-gyro-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 18px;
    background: rgba(0,212,255,0.12);
    border: 1px solid rgba(0,212,255,0.38);
    border-radius: 20px;
    color: #00d4ff;
    font-size: 0.8rem;
    cursor: pointer;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background 0.2s;
}

.esg63-gyro-btn:hover {
    background: rgba(0,212,255,0.28);
}

/* ── Lightbox ───────────────────────────────────────────── */
.esg63-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.38s ease;
}

.esg63-lightbox.active {
    opacity: 1;
    pointer-events: all;
}

.esg63-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.esg63-lightbox-content {
    position: relative;
    z-index: 1;
    width: min(720px, 92vw);
    max-height: 92vh;
    overflow-y: auto;
    background: rgba(8,6,4,0.96);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 14px;
    padding: 36px 32px 28px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.7);
    transform: translateY(20px) scale(0.96);
    transition: transform 0.38s cubic-bezier(0.34,1.2,0.64,1);
}

.esg63-lightbox.active .esg63-lightbox-content {
    transform: translateY(0) scale(1);
}

/* Scrollbar styling */
.esg63-lightbox-content::-webkit-scrollbar { width: 4px; }
.esg63-lightbox-content::-webkit-scrollbar-track { background: rgba(255,255,255,0.04); }
.esg63-lightbox-content::-webkit-scrollbar-thumb { background: rgba(0,212,255,0.4); border-radius: 2px; }

.esg63-lightbox-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.18s;
    padding: 0;
}

.esg63-lightbox-close:hover { color: #fff; }

/* Image wrapper */
.esg63-lightbox-img-wrap {
    position: relative;
    text-align: center;
    margin-bottom: 22px;
}

.esg63-lightbox-img {
    max-width: 100%;
    max-height: 55vh;
    object-fit: contain;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
    transition: opacity 0.15s, filter 0.15s;
}

.esg63-lightbox-glow {
    position: absolute;
    inset: -12px;
    border-radius: 14px;
    pointer-events: none;
    animation: esg63-glow-pulse 2.2s ease-in-out infinite;
}

@keyframes esg63-glow-pulse {
    0%, 100% { opacity: 0.55; }
    50%       { opacity: 1;    }
}

/* Info */
.esg63-lightbox-info {
    text-align: center;
    margin-bottom: 24px;
}

.esg63-lightbox-title {
    margin: 0 0 8px;
    font-size: 1.35rem;
    font-weight: 700;
    color: #e8c870;
    text-shadow: 0 0 22px rgba(232,200,112,0.4);
    letter-spacing: 0.05em;
}

.esg63-lightbox-desc {
    margin: 0;
    font-size: 0.88rem;
    color: rgba(255,255,255,0.62);
    line-height: 1.65;
}

/* Rewind slider */
.esg63-rewind-wrap {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 18px;
}

.esg63-rewind-label {
    display: block;
    text-align: center;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.45);
    letter-spacing: 0.04em;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.esg63-rewind-slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 3px;
    background: linear-gradient(to right, #00d4ff var(--val, 100%), rgba(255,255,255,0.15) var(--val, 100%));
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.esg63-rewind-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00d4ff;
    box-shadow: 0 0 10px rgba(0,212,255,0.65), 0 0 0 3px rgba(0,212,255,0.18);
    cursor: pointer;
    transition: box-shadow 0.15s;
}

.esg63-rewind-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 0 16px rgba(0,212,255,0.85), 0 0 0 5px rgba(0,212,255,0.22);
}

.esg63-rewind-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00d4ff;
    border: none;
    box-shadow: 0 0 10px rgba(0,212,255,0.65);
    cursor: pointer;
}

.esg63-rewind-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.3);
}

/* ── Pen color variants (data-pen-type) ─────────────────── */
.esg63-widget[data-pen="steel"] .esg63-pen-tip {
    background: radial-gradient(circle, #fff0a0 0%, #ffaa00 55%, transparent 100%);
}
.esg63-widget[data-pen="steel"] .esg63-pen-ring {
    border-color: rgba(255,170,0,0.45);
}
.esg63-widget[data-pen="wood"] .esg63-pen-tip {
    background: radial-gradient(circle, #ffe0a0 0%, #c06010 55%, transparent 100%);
}
.esg63-widget[data-pen="wood"] .esg63-pen-ring {
    border-color: rgba(192,96,16,0.45);
}
.esg63-widget[data-pen="steel"] .esg63-dot.active { background: #ffaa00; box-shadow: 0 0 10px rgba(255,170,0,0.6); }
.esg63-widget[data-pen="wood"]  .esg63-dot.active { background: #c06010; box-shadow: 0 0 10px rgba(192,96,16,0.6); }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
    .esg63-canvas-wrapper {
        height: 420px;
        cursor: auto;
    }
    .esg63-pen-cursor { display: none; }
    .esg63-title      { font-size: 0.95rem; }

    .esg63-lightbox-content {
        padding: 28px 18px 22px;
        border-radius: 10px;
    }
    .esg63-lightbox-title { font-size: 1.1rem; }
}

@media (max-width: 480px) {
    .esg63-canvas-wrapper { height: 300px; }
    .esg63-overlay        { padding: 14px 16px 12px; }
}
