/* ========================================= */
/*  MACRO STUDIO — Product Page              */
/*  Builds on home.css design system         */
/* ========================================= */

/* ---------- Hero ---------- */
.ms-hero {
    position: relative;
    z-index: 2;
    padding-top: clamp(140px, 16vw, 190px);
    padding-bottom: clamp(50px, 7vw, 80px);
    text-align: center;
    overflow: hidden;
}

.ms-hero::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 38%;
    transform: translate(-50%, -50%);
    width: 90vw;
    max-width: 1100px;
    height: 700px;
    background: radial-gradient(ellipse at center,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.02) 35%,
        transparent 70%);
    pointer-events: none;
    z-index: -1;
}

.ms-hero-inner {
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ms-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 8px 16px;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    letter-spacing: 0.03em;
    color: var(--text-soft);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.02);
    box-shadow: 0 0 22px rgba(255, 255, 255, 0.06),
        inset 0 0 12px rgba(255, 255, 255, 0.03);
    margin-bottom: 28px;
    animation: badge-glow 3.6s ease-in-out infinite;
}

.ms-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

@keyframes badge-glow {
    0%, 100% { box-shadow: 0 0 22px rgba(255,255,255,0.06), inset 0 0 12px rgba(255,255,255,0.03); }
    50% { box-shadow: 0 0 34px rgba(255,255,255,0.14), inset 0 0 12px rgba(255,255,255,0.05); }
}

.ms-hero-title {
    font-size: clamp(2.1rem, 5vw, 3.7rem);
    font-weight: 700;
    line-height: 1.06;
    letter-spacing: -0.038em;
    background: linear-gradient(180deg, #ffffff 0%, #9a9a9a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    max-width: 14ch;
}

.ms-hero-sub {
    margin-top: 24px;
    max-width: 620px;
    color: var(--text-muted);
    font-size: 1.06rem;
    line-height: 1.65;
}

.ms-hero-actions {
    margin-top: 36px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
}

/* Code editor window (Lua sandbox mockup) */
.ms-editor-wrap {
    position: relative;
    margin-top: clamp(48px, 7vw, 72px);
    width: 100%;
    max-width: 920px;
}

.ms-editor {
    text-align: left;
    position: relative;
    z-index: 2;
}

.ms-editor .terminal-body {
    min-height: 280px;
    font-size: 0.86rem;
    padding: 24px 26px 28px;
}

.ms-editor-wrap::after {
    content: "";
    position: absolute;
    left: 10%;
    right: 10%;
    bottom: -34px;
    height: 60px;
    background: radial-gradient(ellipse at center,
        rgba(255, 255, 255, 0.10) 0%, transparent 70%);
    filter: blur(18px);
    z-index: 1;
    pointer-events: none;
}

.editor-gutter {
    display: inline-block;
    width: 26px;
    color: var(--text-faint);
    user-select: none;
}

.lua-kw { color: #c678dd; }
.lua-fn { color: #61afef; }
.lua-str { color: #98c379; }
.lua-com { color: #5c6370; font-style: italic; }
.lua-local { color: #e06c75; }
.lua-op { color: #d19a66; }

/* ---------- Bento grid ---------- */
.bento {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.bento-card {
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 26px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 200px;
    transition: border-color 0.3s var(--ease), background 0.3s var(--ease),
        transform 0.3s var(--ease);
    position: relative;
    overflow: hidden;
}

.bento-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-elev-3);
    transform: translateY(-3px);
}

.bento-card.large {
    grid-column: span 2;
}

.bento-card .bc-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.bento-card h3 {
    font-size: 1.12rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
}

.bento-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Accent: red panic card */
.bento-card.accent-red {
    border-color: rgba(248, 113, 113, 0.22);
}
.bento-card.accent-red:hover {
    border-color: rgba(248, 113, 113, 0.5);
    box-shadow: 0 0 30px rgba(248, 113, 113, 0.08);
}
.bento-card.accent-red .bc-icon {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.25);
}
.bento-card.accent-red h3 { color: #fff; }

/* Icon chip */
.bc-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    background: var(--bg-elev-1);
    display: grid;
    place-items: center;
    color: var(--text-soft);
}
.bc-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.bc-icon ion-icon { font-size: 20px; }

/* CPU chart */
.cpu-chart {
    margin-top: 8px;
    width: 100%;
    height: 120px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: linear-gradient(180deg, #0a0a0a, #060606);
    position: relative;
    overflow: hidden;
}

.cpu-chart svg {
    width: 100%;
    height: 100%;
    display: block;
}

.cpu-grid line {
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 1;
}

.cpu-line {
    fill: none;
    stroke: #4ade80;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 4px rgba(74, 222, 128, 0.5));
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: chart-draw 2.4s var(--ease) 0.3s forwards;
}

@keyframes chart-draw {
    to { stroke-dashoffset: 0; }
}

.cpu-dot {
    fill: #4ade80;
    filter: drop-shadow(0 0 6px rgba(74, 222, 128, 0.9));
}

.cpu-dot-html {
    position: absolute;
    left: 0;
    bottom: 18px;
    width: 7px;
    height: 7px;
    margin-left: -3.5px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.9), 0 0 4px rgba(74, 222, 128, 1);
    animation: dot-travel 4s linear infinite;
    z-index: 2;
}

@keyframes dot-travel {
    0% { left: 0%; }
    100% { left: 100%; }
}

.cpu-label {
    position: absolute;
    top: 12px;
    left: 14px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
}
.cpu-label b {
    color: #4ade80;
    font-weight: 600;
}

.cpu-meta {
    position: absolute;
    bottom: 10px;
    right: 14px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-faint);
}

/* Lua snippet block inside bento */
.lua-snippet {
    margin-top: auto;
    background: #060606;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 14px 16px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.7;
    color: #d6d6d6;
    overflow-x: auto;
    white-space: pre;
}

.lua-snippet .ln {
    display: inline-block;
    width: 20px;
    color: var(--text-faint);
    user-select: none;
}

/* ---------- Developer Experience ---------- */
.devexp {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: clamp(36px, 6vw, 72px);
    align-items: center;
}

.devexp-text h2 {
    font-size: clamp(1.7rem, 3.4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.12;
}

.devexp-text p {
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 1.04rem;
    line-height: 1.7;
    max-width: 480px;
}

.devexp-points {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.devexp-point {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    color: var(--text-muted);
    font-size: 0.94rem;
}

.devexp-point ion-icon {
    color: #4ade80;
    font-size: 1.15rem;
    margin-top: 1px;
    flex-shrink: 0;
}

/* Terminal with copy button */
.terminal-copy {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: transparent;
    transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.terminal-copy:hover {
    color: var(--text);
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.04);
}

.terminal-copy.copied {
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.4);
}

.terminal-copy ion-icon { font-size: 0.95rem; }

.bash-cmd { color: #d6d6d6; }
.bash-prompt { color: #4ade80; user-select: none; }
.bash-arg { color: #61afef; }
.bash-flag { color: #d19a66; }
.bash-url { color: #98c379; }
.bash-path { color: #e5c07b; }

/* ---------- Pricing ---------- */
.pricing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 820px;
}

.price-card {
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    transition: border-color 0.3s var(--ease);
}

.price-card.featured {
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08),
        0 0 40px rgba(255, 255, 255, 0.05);
    position: relative;
    animation: featured-pulse 4s ease-in-out infinite;
}

@keyframes featured-pulse {
    0%, 100% {
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08),
            0 0 40px rgba(255, 255, 255, 0.05);
    }
    50% {
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14),
            0 0 60px rgba(255, 255, 255, 0.10);
    }
}

.price-card.featured::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,255,255,0.5), transparent 40%, transparent 60%, rgba(255,255,255,0.25));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* "Available now" badge on the featured card */
.price-featured-badge {
    position: absolute;
    top: -12px;
    left: 28px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 13px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #4ade80;
    background: #0a0a0a;
    border: 1px solid rgba(74, 222, 128, 0.35);
    border-radius: var(--r-pill);
    box-shadow: 0 0 18px rgba(74, 222, 128, 0.15);
    z-index: 3;
}

.pf-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.9);
    animation: blink 2s ease-in-out infinite;
}

/* Premium CTA — shine sweep on hover */
.btn-premium {
    position: relative;
    overflow: hidden;
    padding: 14px 22px;
    font-size: 0.96rem;
    font-weight: 600;
}

.btn-premium::after {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(100deg,
        transparent 0%,
        rgba(0, 0, 0, 0.18) 50%,
        transparent 100%);
    transform: skewX(-18deg);
    transition: left 0.6s var(--ease);
    pointer-events: none;
}

.btn-premium:hover::after {
    left: 130%;
}

/* Secure checkout note */
.price-secure-note {
    margin-top: -4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-faint);
}

.price-secure-note ion-icon {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.price-tier {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.price-card.featured .price-tier { color: var(--text); }

.price-amount {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.price-amount .num {
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
}

.price-amount .per {
    color: var(--text-muted);
    font-size: 1rem;
}

.price-desc {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

.price-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 4px 0 8px;
}

.price-feature {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.92rem;
    color: var(--text-soft);
}

.price-feature ion-icon {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.price-card.featured .price-feature ion-icon { color: #fff; }

.price-card .btn { margin-top: auto; width: 100%; }

/* ---------- FAQ ---------- */
.faq {
    margin-top: clamp(40px, 6vw, 64px);
    max-width: 760px;
}

.faq-item {
    border-bottom: 1px solid var(--border);
}

.faq-q {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 4px;
    text-align: left;
    font-size: 1.04rem;
    font-weight: 500;
    color: var(--text);
    transition: color 0.2s var(--ease);
}

.faq-q ion-icon {
    font-size: 1.3rem;
    color: var(--text-muted);
    transition: transform 0.3s var(--ease), color 0.2s var(--ease);
    flex-shrink: 0;
}

.faq-item.open .faq-q ion-icon {
    transform: rotate(45deg);
    color: var(--text);
}

.faq-a {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s var(--ease);
}

.faq-a-inner {
    padding: 0 4px 22px;
    color: var(--text-muted);
    font-size: 0.96rem;
    line-height: 1.7;
}

/* ---------- Screenshots ---------- */
.shot-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    align-items: center;
}

.shot-tabs {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shot-tab {
    text-align: left;
    padding: 18px 20px;
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text-muted);
    transition: border-color 0.25s var(--ease), color 0.25s var(--ease),
        background 0.25s var(--ease), transform 0.25s var(--ease);
}

.shot-tab:hover {
    color: var(--text);
    border-color: var(--border-hover);
    transform: translateX(3px);
}

.shot-tab.active {
    color: var(--text);
    border-color: var(--border-hover);
    background: var(--bg-elev-3);
}

.shot-tab h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 5px;
}

.shot-tab p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.45;
    margin: 0;
}

.shot-frame {
    background: #0a0a0a;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    min-height: 320px;
    position: relative;
}

.shot-stage {
    position: relative;
    aspect-ratio: 16 / 10;
    background: #050505;
}

.shot-stage img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s var(--ease);
    pointer-events: none;
}

.shot-stage img.active {
    opacity: 1;
    position: relative;
    pointer-events: auto;
}

.shot-titlebar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    background: #0c0c0c;
}

.shot-titlebar .dots {
    display: flex;
    gap: 7px;
}

.shot-titlebar .dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2a2a2a;
}

.shot-titlebar .title {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--text-faint);
    margin: 0 auto;
    padding-right: 40px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .bento { grid-template-columns: repeat(2, 1fr); }
    .bento-card.large { grid-column: span 2; }
    .devexp { grid-template-columns: 1fr; }
    .pricing-grid { grid-template-columns: 1fr; }
    .shot-layout { grid-template-columns: 1fr; }
    .shot-tabs { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
    .shot-tab { min-width: 200px; }
}

@media (max-width: 560px) {
    .bento { grid-template-columns: 1fr; }
    .bento-card.large { grid-column: span 1; }
    .ms-hero-actions .btn { flex: 1 1 auto; }
    .price-card { padding: 26px 22px; }
}
