* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        sans-serif;
    background: #f7f7f7;
    color: #222;
    font-size: 12px;
}

a {
}

.container {
    min-width: 800px;
    margin: auto;
    padding: 0 20px;
}

.header {
    background: white;
    border-bottom: 1px solid #ddd;
}

.header-inner {
    height: 2.5em;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 17px;
    font-weight: 700;
    text-decoration: none;
}

nav {
    display: flex;
    gap: 25px;
    margin-left: auto;
}

nav a {
    text-decoration: none;
    color: #555;
}

.amazon-market-picker {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 18px;
    color: #666;
    font-size: 11px;
    font-weight: 600;
}

.amazon-market-picker select {
    height: 24px;
    border: 1px solid #bbb;
    border-radius: 4px;
    background: white;
    color: #333;
    font-size: 11px;
}

.page-header {
    display: flex;
    align-items: baseline;
    gap: 20px;
}

.page-header h1 {
    margin: 0;
    font-size: 2em;
}

.page-header p {
    color: #666;
    margin: 0;
}

@media (max-width: 600px) {
    .page-header {
        flex-direction: column;
        gap: 4px;
    }
}

.filters {
    background: white;
    border: 1px solid #ddd;
    padding: 6px;
    display: flex;
    gap: 10px;
    align-items: end;
    flex-wrap: wrap;
}

.filter {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter label {
    font-size: 13px;
    font-weight: 600;
}

.filter input,
.filter select {
    min-width: 170px;
    height: 2em;
    padding: 0 10px;
    border: 1px solid #bbb;
    background: white;
}

.filters button {
    height: 2em;
    padding: 0 22px;
    border: 0;
    background: #222;
    color: white;
    cursor: pointer;
}

.results-info {
    padding: 8px 0 8px;
    color: #666;
    font-weight: 800;
}

.table-wrapper {
    background: white;
    border: 1px solid #ddd;
    overflow-x: auto;
}

.products {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.products th {
    background: #f2f2f2;
    text-align: left;
    padding-right: 1em;
    padding-top: 0.4em;
    padding-bottom: 0.4em;
    border-bottom: 0px solid #ddd;
    white-space: nowrap;
}

th[data-sort] {
    cursor: pointer;
}

th[data-sort]:hover {
    text-decoration: underline;
}

.products td {
    padding: 2px 1px;
    border-bottom: 0px solid #eee;
    vertical-align: middle;
}

.products tbody tr:hover {
    background: #fafafa;
}

.product-cell {
    min-width: 360px;
    display: flex;
    gap: 12px;
}

.product-image {
    width: 65px;
    height: 65px;
    object-fit: contain;
    background: white;
}

.product-title {
    font-weight: 600;
    text-decoration: none;
    line-height: 1.4;
}

.product-title:hover {
    text-decoration: underline;
}

.brand {
    margin-top: 4px;
    color: #777;
    font-size: 13px;
}

.price {
    white-space: nowrap;
}

.price small {
    display: block;
    color: #888;
    font-size: 11px;
}

.price-per-gb, .price-per-tb {
    font-weight: 700;
    white-space: nowrap;
}

.amazon-link {
    color: #06c;
    text-decoration: none;
    white-space: nowrap;
}

.empty {
    text-align: center;
    padding: 50px !important;
    color: #888;
}

.product-page {
    padding: 35px 0;
}

.product-main {
    background: white;
    border: 1px solid #ddd;
    padding: 30px;
    display: flex;
    gap: 40px;
}

.product-image-large {
    width: 350px;
    height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image-large img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-info {
    flex: 1;
}

.product-info h1 {
    font-size: 27px;
    line-height: 1.35;
}

.asin {
    color: #777;
    font-size: 13px;
}

.price-box {
    margin: 25px 0;
}

.current-price {
    font-size: 34px;
    font-weight: 700;
}

.per-gb, .per-tb {
    margin-top: 5px;
    color: #555;
}

.product-meta {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.product-meta div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.buy-button {
    display: inline-block;
    padding: 12px 25px;
    background: #222;
    color: white;
    text-decoration: none;
}

section {
    margin-top: 35px;
}

section h2 {
    font-size: 21px;
}

.chart-container {
    background: white;
    border: 1px solid #ddd;
    padding: 20px;
    height: 350px;
}

.specs {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid #ddd;
}

.specs th,
.specs td {
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.specs th {
    width: 30%;
    background: #f7f7f7;
}

footer {
    margin-top: 60px;
    padding: 30px 0;
    border-top: 1px solid #ddd;
    color: #888;
}

footer .container {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.generated-at {
    white-space: nowrap;
}

@media (max-width: 700px) {

    .product-main {
        flex-direction: column;
    }

    .product-image-large {
        width: 100%;
    }

    nav {
        display: none;
    }

}

/* Memory-specific columns keep the disk table unchanged. */
.memory-products th,
.memory-products td {
    padding: 6px 10px;
}
.memory-products td:not(:last-child) {
    white-space: nowrap;
}
.interface-cell span,
.interface-cell small {
    display: block;
}
.interface-cell small {
    margin-top: 2px;
    color: #666;
    font-size: 11px;
}
.cpu-layout span,
.cpu-layout small {
    display: block;
}
.cpu-layout small {
    margin-top: 2px;
    color: #666;
    font-size: 11px;
}
.npu-yes {
    color: #176b3a;
    font-weight: 700;
}
.memory-sort {
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.memory-products th[aria-sort="ascending"] button::after { content: " ↑"; }
.memory-products th[aria-sort="descending"] button::after { content: " ↓"; }

/* Home */
.home-page {
    background:
        radial-gradient(circle at 12% 8%, rgba(255, 213, 195, 0.55), transparent 27%),
        radial-gradient(circle at 88% 22%, rgba(198, 224, 255, 0.55), transparent 25%),
        #f7f5f0;
}

.home-page .container {
    min-width: 0;
    width: 100%;
    max-width: 1180px;
}

.home-page .header {
    border-bottom-color: rgba(34, 34, 34, 0.1);
    background: rgba(255, 255, 255, 0.76);
    backdrop-filter: blur(14px);
}

.home-page .header-inner {
    height: 64px;
}

.home-page .logo {
    color: #171717;
    letter-spacing: -0.4px;
}

.home-page nav a {
    color: #4b4b4b;
    font-size: 13px;
    font-weight: 600;
}

.home-page nav a:hover {
    color: #111;
}

.home-hero {
    max-width: 790px;
    margin: 0;
    padding: 78px 0 46px;
}

.home-hero__eyebrow,
.hardware-card__eyebrow {
    margin: 0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.home-hero__eyebrow {
    color: #706d68;
}

.home-hero h1 {
    margin: 14px 0 20px;
    color: #171717;
    font-size: clamp(44px, 6.2vw, 78px);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.home-hero h1 span {
    color: #77736d;
}

.home-hero__intro {
    max-width: 620px;
    margin: 0;
    color: #595650;
    font-size: 17px;
    line-height: 1.6;
}

.hardware-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin: 0;
}

.hardware-card {
    --card-accent: #e86d4c;
    --card-art: #ffe4d9;
    position: relative;
    display: flex;
    min-width: 0;
    aspect-ratio: 1 / 1.08;
    flex-direction: column;
    overflow: hidden;
    padding: 18px;
    border: 1px solid rgba(24, 24, 24, 0.11);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 9px 24px rgba(30, 27, 24, 0.055);
    color: #1f1f1f;
    text-decoration: none;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.hardware-card:hover,
.hardware-card:focus-visible {
    transform: translateY(-5px);
    border-color: color-mix(in srgb, var(--card-accent) 55%, #222 10%);
    box-shadow: 0 18px 36px rgba(30, 27, 24, 0.12);
}

.hardware-card:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--card-accent) 45%, white);
    outline-offset: 3px;
}

.hardware-card--violet { --card-accent: #7d5bd6; --card-art: #eae1ff; }
.hardware-card--blue { --card-accent: #3978d4; --card-art: #dcecff; }
.hardware-card--mint { --card-accent: #218a76; --card-art: #d9f3eb; }

.hardware-card__art {
    display: grid;
    min-height: 0;
    flex: 1 1 auto;
    place-items: center;
    overflow: hidden;
    border-radius: 15px;
    background:
        radial-gradient(circle at 76% 24%, rgba(255, 255, 255, 0.9) 0 4px, transparent 5px),
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.7) 0 6px, transparent 7px),
        var(--card-art);
}

.hardware-card__art img {
    width: min(82%, 170px);
    height: min(82%, 170px);
    object-fit: contain;
    transition: transform 180ms ease;
}

.hardware-card:hover .hardware-card__art img {
    transform: rotate(-2deg) scale(1.045);
}

.hardware-card__copy {
    padding: 17px 2px 0;
}

.hardware-card__eyebrow {
    color: var(--card-accent);
}

.hardware-card h2 {
    margin: 5px 0 7px;
    font-size: 24px;
    line-height: 1.1;
    letter-spacing: -0.035em;
}

.hardware-card__description {
    min-height: 48px;
    margin: 0;
    color: #66625d;
    font-size: 12px;
    line-height: 1.45;
}

.hardware-card__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding: 12px 2px 1px;
    border-top: 1px solid rgba(24, 24, 24, 0.09);
    color: #34312e;
    font-size: 12px;
    font-weight: 750;
}

.hardware-card__link span {
    color: var(--card-accent);
    font-size: 18px;
}

.home-note {
    margin: 28px 0 0;
    color: #77736d;
    font-size: 13px;
    text-align: center;
}

.home-page footer {
    margin-top: 70px;
    border-top-color: rgba(34, 34, 34, 0.1);
}

@media (max-width: 900px) {
    .hardware-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hardware-card {
        aspect-ratio: 1.08 / 1;
    }
}

@media (max-width: 600px) {
    .home-page .header-inner { height: 58px; }
    .home-hero { padding: 56px 0 34px; }
    .home-hero h1 { font-size: clamp(42px, 13vw, 58px); }
    .home-hero__intro { font-size: 15px; }
    .hardware-grid { grid-template-columns: 1fr; }
    .hardware-card { aspect-ratio: auto; min-height: 390px; }
}

@media (prefers-reduced-motion: reduce) {
    .hardware-card,
    .hardware-card__art img { transition: none; }
}
