html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: #f6f6f6;
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.material-symbols-outlined.filled {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Pizza slice clip-paths (8-slice system, clockwise from 12 o'clock) */
.pizza-slice-2 { clip-path: polygon(50% 50%, 50% 0%, 100% 0%, 100% 50%); }
.pizza-slice-7 { clip-path: polygon(50% 50%, 50% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 0%); }
.pizza-slice-4 { clip-path: polygon(50% 50%, 50% 0%, 100% 0%, 100% 100%, 50% 100%); }

.sticker-lift {
    transition: transform 0.2s ease-out;
}

.sticker-lift:hover {
    transform: translateY(-8px) rotate(-1deg);
}

/* Fake browser chrome for demo mockup */
.browser-mock {
    border-radius: 12px;
    box-shadow: 0 25px 60px rgba(175, 39, 0, 0.1);
    border: 2px solid rgba(175, 39, 0, 0.25);
}

.browser-mock-bar {
    border-radius: 12px 12px 0 0;
    background: #3d1a0a;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.browser-mock-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #5a3a2a;
}

.browser-mock-dot:nth-child(1) { background: #af2700; }
.browser-mock-dot:nth-child(2) { background: #fdd400; }
.browser-mock-dot:nth-child(3) { background: #1b8a2a; }

.browser-mock-url {
    flex: 1;
    background: #2a0f04;
    border-radius: 6px;
    padding: 5px 12px;
    color: #a08070;
    font-size: 12px;
    font-family: monospace;
    margin-left: 8px;
}

.browser-mock-body {
    background: #fffaf8;
    padding: 24px;
    border-radius: 0 0 12px 12px;
}

/* Demo product images */
.demo-product-img-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
}

.demo-product-img-wrapper .photo-credit-overlay {
    font-size: 0.55rem;
    padding: 2px 16px 2px 4px;
    white-space: nowrap;
}

.demo-product-img {
    width: 100%;
    height: 8rem;
    object-fit: cover;
    background: rgba(175, 39, 0, 0.05);
}

/* Tooltip that appears on hover in the demo */
.demo-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 2px solid #fdd400;
    border-radius: 12px;
    padding: 8px 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    white-space: normal;
    width: max-content;
    max-width: 280px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.demo-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #fdd400;
}

.demo-tooltip-icons {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: wrap;
}

.demo-tooltip-icons img {
    flex-shrink: 0;
    display: block;
}

.prizza-more {
    font-size: 10px;
    font-weight: 700;
    color: #5a5c5c;
    margin: 0 2px;
    white-space: nowrap;
}

.demo-tooltip .prizza-label {
    font-size: 11px;
    color: #5a5c5c;
    margin-left: 4px;
    white-space: nowrap;
}


.demo-price-wrapper {
    position: relative;
    display: inline-block;
}

.demo-price-wrapper:hover .demo-tooltip {
    opacity: 1;
}

.demo-price-highlight {
    background: #fdd40033;
    border-bottom: 2px dashed #af2700;
    cursor: pointer;
    padding: 0 2px;
    border-radius: 3px;
    transition: background 0.15s;
}

.demo-price-highlight:hover {
    background: #fdd40066;
}

/* CTA pizza icons */
.cta-pizza-icons {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    vertical-align: middle;
}

.cta-pizza-icons svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Extension popup trigger button in the fake browser bar */
.browser-mock-ext-btn {
    margin-left: 8px;
    padding: 4px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.browser-mock-ext-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.browser-mock-ext-btn[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.18);
}

.browser-mock-ext-btn[aria-expanded="true"] {
    animation: none;
    box-shadow: none;
}

/* Mock extension popup */
.browser-mock {
    position: relative;
}

.demo-popup {
    position: absolute;
    top: 44px;
    right: 8px;
    width: 280px;
    background: #f6f6f6;
    color: #2d2f2f;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.06);
    padding: 18px;
    z-index: 30;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transform-origin: top right;
    animation: demoPopupIn 0.18s ease-out;
}

.demo-popup[hidden] { display: none; }

.demo-popup::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 14px;
    width: 14px;
    height: 14px;
    background: #f6f6f6;
    transform: rotate(45deg);
    box-shadow: -1px -1px 0 rgba(0, 0, 0, 0.06);
}

@keyframes demoPopupIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.demo-popup-logo {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
}

.demo-popup-tagline {
    font-size: 12px;
    color: #5a5c5c;
    margin: 2px 0 12px;
}

.demo-popup-toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.demo-popup-toggle-row #demo-popup-status {
    font-size: 13px;
    font-weight: 500;
}

.demo-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.demo-switch input { opacity: 0; width: 0; height: 0; }
.demo-slider {
    position: absolute;
    inset: 0;
    background: #acadad;
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.2s;
}
.demo-slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}
.demo-switch input:checked + .demo-slider { background: #af2700; }
.demo-switch input:checked + .demo-slider::before { transform: translateX(20px); }

.demo-popup-section {
    margin-bottom: 12px;
}

.demo-popup-section > label {
    font-size: 12px;
    color: #5a5c5c;
    display: block;
    margin-bottom: 6px;
}

.demo-preset-row {
    display: flex;
    gap: 6px;
}

.demo-preset-btn {
    flex: 1;
    padding: 6px 0;
    font-size: 12px;
    font-family: inherit;
    font-weight: 600;
    color: #5a5c5c;
    background: #fff;
    border: 2px solid #acadad;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.demo-preset-btn:hover { border-color: #5a5c5c; }

.demo-preset-btn.selected {
    border-color: #af2700;
    color: #af2700;
    background: #fff5f3;
}

.demo-preset-row.disabled .demo-preset-btn {
    opacity: 0.35;
    pointer-events: none;
}

.demo-custom-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #5a5c5c;
    cursor: pointer;
}

.demo-custom-toggle input { accent-color: #af2700; }

.demo-custom-input {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
}

.demo-custom-input[hidden] { display: none; }

.demo-dollar {
    font-size: 13px;
    font-weight: 600;
}

.demo-custom-input input {
    width: 80px;
    font-size: 13px;
    padding: 4px 8px;
    border: 1px solid #acadad;
    border-radius: 8px;
    background: #fff;
    font-family: inherit;
}

.demo-custom-input input:focus {
    outline: 2px solid #af2700;
    outline-offset: -1px;
    border-color: transparent;
}

.demo-icon-options {
    display: flex;
    gap: 8px;
}

.demo-icon-option {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #acadad;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s;
    padding: 0;
}

.demo-icon-option:hover { border-color: #5a5c5c; }

.demo-icon-option.selected {
    border-color: #af2700;
    background: #fff5f3;
}

.demo-donate-link {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #1b8a2a;
    background: rgba(27, 138, 42, 0.08);
    border: 1px solid rgba(27, 138, 42, 0.25);
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.15s;
}

.demo-donate-link:hover { background: rgba(27, 138, 42, 0.15); }

/* When the extension is "off" in the popup, neutralize the demo highlights */
.browser-mock.demo-off .demo-price-highlight {
    background: transparent;
    border-bottom-color: transparent;
    cursor: default;
}

.browser-mock.demo-off .demo-price-wrapper:hover .demo-tooltip {
    opacity: 0;
}

@media (max-width: 480px) {
    .demo-popup {
        width: calc(100% - 16px);
        right: 8px;
    }
}

/* Pulse animation for the live demo — yellow so it pops against the red section */
@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(253, 212, 0, 0.6), 0 0 0 0 rgba(253, 212, 0, 0.35);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(253, 212, 0, 0), 0 0 0 16px rgba(253, 212, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(253, 212, 0, 0), 0 0 0 0 rgba(253, 212, 0, 0);
    }
}

.pulse {
    animation: pulse-ring 3s ease-out infinite;
    background: rgba(253, 212, 0, 0.12);
}

/* Counter animation */
@keyframes countUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.count-in {
    animation: countUp 0.4s ease-out forwards;
}

/* Photo attribution captions */
.photo-credit {
    position: relative;
    z-index: 10;
    text-align: right;
    font-size: 0.7rem;
    color: #767777;
    margin-top: 0.5rem;
}

.photo-credit a {
    color: #767777;
    text-decoration: underline;
    text-decoration-color: #acadad;
    text-underline-offset: 2px;
}

.photo-credit a:hover {
    color: #5a5c5c;
}

.photo-credit-overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    margin: 0;
    padding: 4px 24px 4px 8px;
    background: rgba(0, 0, 0, 0.4);
    color: rgba(255, 255, 255, 0.8);
    border-radius: 6px 0 0 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

*:hover > .photo-credit-overlay {
    opacity: 1;
}

.photo-credit-overlay a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration-color: rgba(255, 255, 255, 0.4);
}

.photo-credit-overlay a:hover {
    color: #fff;
}

/* Hero 3D Card Flip */

.hero-card-scene {
    perspective: 1000px;
}

.hero-card {
    position: relative;
    transform-style: preserve-3d;
    transform: rotate(3deg);
    transition: transform 0.7s ease-in-out;
}

.hero-card.no-transition {
    transition: none !important;
}

.hero-card.is-flipped {
    transform: rotate(3deg) rotateY(180deg);
}

.hero-card-front,
.hero-card-back {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.hero-card-front {
    position: relative;
    overflow: hidden;
}

.hero-card-back {
    position: absolute;
    inset: 0;
    transform: rotateY(180deg);
    overflow: hidden;
}

.hero-card-back img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Reusable component classes */

.section-title {
    font-size: 1.875rem;
    line-height: 2.25rem;
    font-weight: 900;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.faq-question {
    font-weight: 700;
    font-size: 1.125rem;
    line-height: 1.75rem;
    margin-bottom: 0.5rem;
}

.pill-link {
    background-color: #dbdddd;
    color: #2d2f2f;
    font-weight: 700;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    text-decoration: none;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.footer-link {
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #475569;
    font-weight: 500;
}

.footer-link:hover {
    color: #af2700;
    text-decoration: underline;
}

.attribution-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.attribution-title {
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 600;
    color: #2d2f2f;
}

.attribution-credit {
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #5a5c5c;
}

.attribution-thumb {
    width: 4rem;
    height: 4rem;
    border-radius: 2rem;
    object-fit: cover;
    flex-shrink: 0;
}

.product-card {
    border: 1px solid rgba(175, 39, 0, 0.1);
    border-radius: 2rem;
    padding: 1rem;
}

.product-name {
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #2d2f2f;
    margin-bottom: 0.25rem;
}

.product-desc {
    font-size: 0.75rem;
    line-height: 1rem;
    color: #5a5c5c;
    margin-bottom: 0.5rem;
}

.step-card {
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 3rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border-bottom-width: 8px;
    border-right-width: 8px;
    border-bottom-style: solid;
    border-right-style: solid;
}

.icon-circle {
    width: 4rem;
    height: 4rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

/* Anchor offset for fixed header */
[id="faq"], [id="privacy"], [id="terms"] {
    scroll-margin-top: 6rem;
}

/* ----- Pizzanomics page ----- */

.pizzanomics-price-picker {
    display: inline-block;
    text-align: left;
    background: #fff;
    border: 2px solid #fdd400;
    border-radius: 1.25rem;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 8px 24px rgba(175, 39, 0, 0.12);
    max-width: 100%;
}

.pizzanomics-price-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #2d2f2f;
    margin: 0 0 0.75rem;
    text-align: center;
}

/* Scale up the shared .demo-preset-row / .demo-preset-btn for hero context */
.pizzanomics-price-picker .demo-preset-row {
    gap: 8px;
    margin-bottom: 0.875rem;
}

.pizzanomics-price-picker .demo-preset-btn {
    padding: 10px 4px;
    font-size: 0.95rem;
    min-width: 56px;
}

.pizzanomics-price-picker-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.pizzanomics-price-picker .demo-custom-toggle {
    font-size: 0.85rem;
}

.pizzanomics-price-picker .demo-custom-input {
    margin-top: 0;
}

.pizzanomics-price-picker .demo-custom-input input {
    width: 90px;
    font-size: 0.95rem;
    padding: 6px 10px;
}

.pizzanomics-price-current {
    margin: 0.875rem 0 0;
    font-size: 0.85rem;
    color: #5a5c5c;
    font-weight: 500;
    text-align: center;
}

.pizzanomics-price-current strong {
    color: #1b8a2a;
    font-weight: 800;
}

.pizzanomics-tier-title {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: #2d2f2f;
    margin: 3.5rem 0 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #fdd400;
}

.pizzanomics-tier-title:first-child {
    margin-top: 0;
}

.pizzanomics-card {
    background: #fff;
    border: 1px solid rgba(175, 39, 0, 0.12);
    border-radius: 1.5rem;
    padding: 1.75rem 2rem;
    margin-bottom: 1.25rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pizzanomics-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(175, 39, 0, 0.10);
}

.pizzanomics-card.tier-2 {
    border-color: rgba(175, 39, 0, 0.18);
}

.pizzanomics-card.tier-3 {
    border-color: rgba(175, 39, 0, 0.30);
    background: linear-gradient(180deg, #fff 0%, #fffaf6 100%);
}

.pizzanomics-card.tier-4 {
    border: 2px solid #af2700;
    background: linear-gradient(180deg, #fff 0%, #fff0eb 100%);
    box-shadow: 0 8px 24px rgba(175, 39, 0, 0.10);
}

.pizzanomics-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.875rem;
}

.pizzanomics-name {
    font-size: 1.35rem;
    font-weight: 800;
    color: #2d2f2f;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.pizzanomics-price {
    font-size: 1.05rem;
    font-weight: 700;
    color: #5a5c5c;
    background: #f6f6f6;
    padding: 4px 12px;
    border-radius: 9999px;
    white-space: nowrap;
}

.tier-3 .pizzanomics-price,
.tier-4 .pizzanomics-price {
    background: #fff5f3;
    color: #af2700;
}

/* Counter Storm visualization — falling pizza sand grid with racing counter,
   progress bar, and ETA. The PixiJS canvas is inserted by JS into the viz
   container at runtime; the counter and bar overlays sit on top. */
.pizzanomics-storm-viz {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    margin: 0.875rem 0 1rem;
    background: #fafafa;
    border-radius: 0.875rem;
    overflow: hidden;
    border: 1px solid rgba(175, 39, 0, 0.10);
}

.pizzanomics-storm-viz canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.pizzanomics-storm-counter {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 14px;
    font-size: 1.5rem;
    font-weight: 900;
    color: #af2700;
    text-shadow: 0 2px 12px rgba(255, 250, 246, 0.95),
                 0 0 24px rgba(255, 250, 246, 0.95);
    pointer-events: none;
    z-index: 2;
    text-align: center;
    line-height: 1.1;
}

.pizzanomics-storm-counter > div {
    max-width: 100%;
    padding: 0 0.75rem;
}

.pizzanomics-storm-counter .label {
    display: block;
    font-size: 0.7rem;
    color: #5a5c5c;
    font-weight: 700;
    margin-top: 0.4rem;
    text-shadow: 0 1px 4px rgba(255, 250, 246, 0.95);
    letter-spacing: 0.02em;
}

.pizzanomics-storm-counter .label.eta {
    color: #af2700;
}

.pizzanomics-storm-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 6px;
    background: rgba(255, 255, 255, 0.55);
    border-top: 1px solid rgba(175, 39, 0, 0.18);
    z-index: 3;
    overflow: hidden;
}

.pizzanomics-storm-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #af2700, #d84a1a);
    box-shadow: 0 0 8px rgba(175, 39, 0, 0.6);
    transition: width 60ms linear;
}

@media (prefers-reduced-motion: reduce) {
    .pizzanomics-storm-viz {
        display: none;
    }
}

.pizzanomics-count {
    font-size: 1.15rem;
    color: #2d2f2f;
    margin-bottom: 0.5rem;
}

.pizzanomics-count strong {
    font-weight: 900;
    color: #1b8a2a;
}

.pizzanomics-count.count-big strong {
    font-size: 1.5rem;
    color: #af2700;
}

.pizzanomics-count.count-huge strong {
    font-size: 2rem;
    color: #af2700;
}

.pizzanomics-count.count-massive strong {
    font-size: 2.75rem;
    color: #af2700;
    text-shadow: 0 2px 0 rgba(175, 39, 0, 0.12);
}

.pizzanomics-snark {
    font-size: 0.95rem;
    color: #5a5c5c;
    line-height: 1.55;
    font-style: italic;
}

.pizzanomics-sources {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: #767777;
    line-height: 1.5;
}

.pizzanomics-sources a {
    color: #af2700;
    text-decoration: underline;
    text-decoration-color: rgba(175, 39, 0, 0.35);
    text-underline-offset: 2px;
}

.pizzanomics-sources a:hover {
    text-decoration-color: #af2700;
}

@media (max-width: 640px) {
    .pizzanomics-card {
        padding: 1.25rem 1.25rem;
    }
    .pizzanomics-name {
        font-size: 1.15rem;
    }
    .pizzanomics-count.count-huge strong {
        font-size: 1.6rem;
    }
    .pizzanomics-count.count-massive strong {
        font-size: 2rem;
    }
}
