:root {
    --purple: #4b0983;
    --purple-dark: #310f48;
    --green: #94c11f;
    --green-dark: #6c9c20;
    --yellow: #ffdd00;
    --white: #ffffff;
    --white-muted: rgba(255, 255, 255, 0.7);
    --white-faint: rgba(255, 255, 255, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: linear-gradient(180deg, var(--purple) 0%, var(--purple-dark) 100%);
    min-height: 100vh;
    color: var(--white);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.header-logo {
    display: block;
    margin: 0 auto 0.75rem;
    max-width: min(280px, 90vw);
    height: auto;
}

.logo {
    font-family: 'Fraunces', serif;
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 800;
    color: var(--green);
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1.1rem;
    color: var(--white);
    margin-bottom: 0.25rem;
}

.subtitle {
    color: var(--white-muted);
    font-size: 0.9rem;
}

/* Nav Tabs */
.nav-tabs {
    display: inline-flex;
    justify-content: center;
    margin-top: 1.75rem;
    padding: 0.35rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.nav-tab {
    position: relative;
    flex: 1 1 auto;
    border: none;
    background: transparent;
    color: var(--white-muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.75rem 1.75rem;
    border-radius: 999px;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.nav-tab:hover {
    transform: translateY(-1px);
    color: var(--white);
}

.nav-tab-active {
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    color: var(--purple-dark);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

/* Views */
.view-container {
    margin-top: 2rem;
}

.view {
    display: none;
}

.view-active {
    display: block;
}

/* Price Section */
.price-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.08) 100%);
    border-radius: 20px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    backdrop-filter: blur(10px);
}

.price-section-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--white-faint);
}

.price-section-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--white-muted);
    margin-bottom: 0.25rem;
}

.price-section-date {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--white-muted);
    margin-bottom: 0.75rem;
}

.price-section-average {
    font-family: 'Fraunces', serif;
    font-size: 3rem;
    font-weight: 700;
    color: var(--green);
    line-height: 1;
}

.price-section-divider {
    height: 1px;
    background: var(--white-faint);
    margin-bottom: 1rem;
}

.store-prices {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.store-price-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.25rem 1rem;
    border-radius: 12px;
    text-align: center;
    transition: all 0.2s ease;
    position: relative;
}

.store-price-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.store-price-item.cheapest {
    background: rgba(148, 193, 31, 0.12);
    border-color: rgba(148, 193, 31, 0.3);
    box-shadow: 0 0 0 1px rgba(148, 193, 31, 0.2);
}

.store-price-item.cheapest:hover {
    background: rgba(148, 193, 31, 0.16);
    border-color: rgba(148, 193, 31, 0.4);
}

.store-price-item.missing {
    background: rgba(255, 221, 0, 0.12);
    border-color: rgba(255, 221, 0, 0.3);
    box-shadow: 0 0 0 1px rgba(255, 221, 0, 0.2);
}

.store-price-item.missing:hover {
    background: rgba(255, 221, 0, 0.16);
    border-color: rgba(255, 221, 0, 0.4);
}

/* Yellow takes priority over green when both apply */
.store-price-item.missing.cheapest {
    background: rgba(255, 221, 0, 0.12);
    border-color: rgba(255, 221, 0, 0.3);
    box-shadow: 0 0 0 1px rgba(255, 221, 0, 0.2);
}

.store-price-item.missing.cheapest:hover {
    background: rgba(255, 221, 0, 0.16);
    border-color: rgba(255, 221, 0, 0.4);
}

.store-name {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--white-muted);
    margin-bottom: 0.5rem;
}

.store-price-item.cheapest .store-name {
    color: var(--green);
}

.store-price-item.missing .store-name {
    color: var(--yellow);
}

/* Yellow takes priority over green when both apply */
.store-price-item.missing.cheapest .store-name {
    color: var(--yellow);
}

.price {
    font-family: 'Fraunces', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.25rem;
}

.store-price-item.cheapest .price {
    color: var(--green);
}

.store-price-item.missing .price {
    color: var(--yellow);
}

/* Yellow takes priority over green when both apply */
.store-price-item.missing.cheapest .price {
    color: var(--yellow);
}

.cheapest-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--green);
    color: var(--purple-dark);
    font-size: 0.55rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Chart Section */
.chart-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.08) 100%);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    backdrop-filter: blur(10px);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.chart-title {
    font-family: 'Fraunces', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--white);
}

.inflation-stat {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 221, 0, 0.15);
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
}

.inflation-stat .value {
    font-family: 'Fraunces', serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--yellow);
}

.inflation-stat .label {
    font-size: 0.75rem;
    color: var(--white-muted);
}

.chart-container {
    position: relative;
    height: 320px;
}

.pulse-point {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.pulse-point::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(255, 221, 0, 0.6);
    animation: pulse 1.5s ease-out infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--white-faint);
}

/* About / History / Gifts / Contact */
.about-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.08) 100%);
    border-radius: 20px;
    padding: 2.5rem 2rem 3rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    backdrop-filter: blur(10px);
}

.about-title {
    font-family: 'Fraunces', serif;
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 800;
    color: var(--white);
    margin-bottom: 1rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
    position: relative;
    padding-bottom: 1rem;
}

.about-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--green), var(--green-dark));
    border-radius: 2px;
}

.about-lede {
    color: var(--white-muted);
    font-size: 1.05rem;
    line-height: 1.75;
    margin-bottom: 2.5rem;
    max-width: 85ch;
    letter-spacing: 0.01em;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

/* About Content Sections */
.about-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.about-subsection {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.18) 0%, rgba(0, 0, 0, 0.12) 100%);
    border-radius: 16px;
    padding: 2rem 2rem 2.25rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 
                0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out backwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.about-subsection:nth-child(1) { animation-delay: 0.1s; }
.about-subsection:nth-child(2) { animation-delay: 0.2s; }
.about-subsection:nth-child(3) { animation-delay: 0.3s; }
.about-subsection:nth-child(4) { animation-delay: 0.4s; }
.about-subsection:nth-child(5) { animation-delay: 0.5s; }
.about-subsection:nth-child(6) { animation-delay: 0.6s; }
.about-subsection:nth-child(7) { animation-delay: 0.7s; }

.about-subsection::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--green), var(--green-dark));
    opacity: 0.6;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.about-subsection:hover {
    transform: translateY(-2px);
    border-color: rgba(148, 193, 31, 0.3);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 
                0 0 0 1px rgba(148, 193, 31, 0.1) inset,
                0 0 20px rgba(148, 193, 31, 0.1);
}

.about-subsection:hover::before {
    transform: scaleX(1);
}

.about-subsection h3 {
    font-family: 'Fraunces', serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--green);
    margin-bottom: 1rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
    position: relative;
    padding-bottom: 0.75rem;
}

.about-subsection h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, var(--green), transparent);
    border-radius: 2px;
}

.history-image-text {
    display: flex;
    align-items: flex-start;
    gap: 1.75rem;
    margin-top: 0.5rem;
}

.history-image-wrap {
    margin: 0;
    flex-shrink: 0;
    line-height: 0;
}

.history-image {
    max-width: 200px;
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    border: none;
    outline: none;
    box-shadow: none;
    background: none;
    vertical-align: middle;
}

.history-image-body {
    flex: 1;
    min-width: 0;
}

.history-image-body p {
    margin-bottom: 1.25rem;
}

.history-image-body p:last-of-type {
    margin-bottom: 0;
}

.about-subsection p {
    font-size: 0.95rem;
    color: var(--white-muted);
    line-height: 1.75;
    margin-bottom: 1.25rem;
    letter-spacing: 0.01em;
}

.about-subsection p:last-of-type {
    margin-bottom: 0;
}

.about-subsection ul {
    margin: 1.25rem 0 1.5rem 0;
    padding: 0;
    list-style: none;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.about-subsection li {
    font-size: 0.95rem;
    color: var(--white-muted);
    line-height: 1.8;
    margin-bottom: 1rem;
    padding-left: 2rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    position: relative;
    transition: all 0.2s ease;
}

.about-subsection li::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0.9rem;
    width: 7px;
    height: 7px;
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(148, 193, 31, 0.6),
                0 0 20px rgba(148, 193, 31, 0.2);
    transition: all 0.3s ease;
}

.about-subsection li:hover {
    color: var(--white);
    transform: translateX(4px);
}

.about-subsection li:hover::before {
    transform: scale(1.4);
    box-shadow: 0 0 15px rgba(148, 193, 31, 0.9),
                0 0 25px rgba(148, 193, 31, 0.4);
}

.about-subsection li:last-child {
    margin-bottom: 0;
}

.about-subsection strong {
    color: var(--white);
    font-weight: 600;
    background: linear-gradient(135deg, rgba(148, 193, 31, 0.15), rgba(148, 193, 31, 0.05));
    padding: 0.15em 0.3em;
    border-radius: 4px;
    letter-spacing: 0.01em;
}

.about-subsection em {
    color: var(--yellow);
    font-style: italic;
    font-weight: 500;
    text-shadow: 0 0 10px rgba(255, 221, 0, 0.3);
}

.about-subsection a {
    color: var(--yellow);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    padding: 0.1em 0.2em;
    border-radius: 4px;
}

.about-subsection a:hover {
    background: rgba(255, 221, 0, 0.15);
    text-shadow: 0 0 10px rgba(255, 221, 0, 0.5);
}

/* Contact form */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.5rem;
}

.contact-form-feedback {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.contact-form-feedback[hidden] {
    display: none;
}

.contact-form-feedback--success {
    background: rgba(148, 193, 31, 0.15);
    border: 1px solid rgba(148, 193, 31, 0.4);
    color: var(--green);
}

.contact-form-feedback--error {
    background: rgba(255, 100, 100, 0.12);
    border: 1px solid rgba(255, 100, 100, 0.35);
    color: #ffb3b3;
}

.contact-form label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--white-muted);
    margin-bottom: -0.25rem;
}

.contact-form input,
.contact-form textarea {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    color: var(--white);
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--white-muted);
    opacity: 0.8;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 2px rgba(148, 193, 31, 0.2);
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-form button {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--purple-dark);
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    border: none;
    border-radius: 999px;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 0.5rem;
}

.contact-form button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(148, 193, 31, 0.4);
}

.contact-form button:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

.about-note {
    margin-top: 1.5rem;
    padding: 1.25rem 1.5rem;
    background: rgba(255, 221, 0, 0.08);
    border-left: 3px solid var(--yellow);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--white-muted);
    line-height: 1.7;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.about-note strong {
    color: var(--yellow);
    background: transparent;
    padding: 0;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-family: 'Fraunces', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--white);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--white-muted);
    margin-top: 0.2rem;
}

/* Footer */
footer {
    text-align: center;
    padding-top: 1.5rem;
    color: var(--white-muted);
    font-size: 0.75rem;
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    color: var(--white-muted);
}

.loading::after {
    content: '';
    width: 18px;
    height: 18px;
    border: 2px solid var(--white-faint);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 1.5rem 1rem;
    }

    .store-prices {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .price-section-average {
        font-size: 2.5rem;
    }

    .chart-container {
        height: 260px;
    }

    .nav-tabs {
        width: 100%;
        justify-content: space-between;
    }

    .nav-tab {
        flex: 1;
        padding-inline: 0.9rem;
        font-size: 0.8rem;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .about-section {
        padding: 2rem 0.75rem 2.5rem;
    }

    .about-content {
        gap: 1.5rem;
    }

    .about-subsection {
        padding: 1.5rem 1rem 1.75rem;
    }

    .about-subsection h3 {
        font-size: 1.15rem;
        margin-bottom: 0.875rem;
    }

    .about-subsection h3::after {
        width: 30px;
    }

    .history-image-text {
        flex-direction: column;
        gap: 1.25rem;
    }

    .history-image-wrap {
        order: 0;
        text-align: center;
        align-self: center;
        width: 100%;
    }

    .history-image {
        max-width: 80%;
        width: 80%;
        margin-inline: auto;
    }

    .history-image-body {
        order: 1;
    }

    .about-subsection p,
    .about-subsection li {
        font-size: 0.9rem;
        line-height: 1.7;
    }

    .about-subsection ul {
        padding: 1rem 1.25rem;
    }

    .about-subsection li {
        padding-left: 1.75rem;
        font-size: 0.9rem;
    }

    .about-subsection li::before {
        left: 0.375rem;
        top: 0.85rem;
    }

    .about-lede {
        font-size: 0.95rem;
        margin-bottom: 2rem;
    }

    .about-title::after {
        width: 40px;
    }
}
