:root {
    --ink: #17211b;
    --muted: #647067;
    --paper: #f8f6ef;
    --surface: #ffffff;
    --accent: #e15d3f;
    --accent-dark: #bd432a;
    --line: #deddd5;
    --success: #317a50;
    color: var(--ink);
    font-family:
        Inter, "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--paper);
}

a {
    color: inherit;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem max(1.5rem, calc((100vw - 1120px) / 2));
    border-bottom: 1px solid var(--line);
    background: rgba(248, 246, 239, 0.96);
}

.brand {
    display: block;
    flex: 0 0 auto;
    text-decoration: none;
}

.brand img {
    display: block;
    width: clamp(11rem, 18vw, 15rem);
    height: auto;
}

nav {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

nav a,
.link-button {
    font: inherit;
    text-decoration: none;
}

.badge {
    display: inline-grid;
    min-width: 1.5rem;
    height: 1.5rem;
    margin-left: 0.2rem;
    place-items: center;
    border-radius: 999px;
    background: var(--ink);
    color: white;
    font-size: 0.75rem;
}

.user-name {
    color: var(--muted);
}

.inline-form {
    display: inline;
}

.link-button {
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    text-decoration: underline;
}

.danger {
    color: #a32d24;
}

.container {
    width: min(1120px, calc(100% - 3rem));
    min-height: calc(100vh - 180px);
    margin: 0 auto;
    padding: 2.5rem 0 5rem;
}

.notice {
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    border: 1px solid #9bc6a8;
    border-radius: 0.5rem;
    background: #eaf6ed;
}

.error-notice {
    border-color: #d7a09b;
    background: #fff0ee;
    color: #8a251e;
}

.validation-summary-valid {
    display: none;
}

.hero {
    display: grid;
    min-height: 500px;
    margin-bottom: 3rem;
    padding: 3rem;
    place-items: center end;
    overflow: hidden;
    border: 1px solid #d8e8ea;
    border-radius: 1.25rem;
    background-image:
        linear-gradient(90deg, transparent 42%, rgba(255, 255, 255, 0.55) 58%, rgba(255, 255, 255, 0.98) 70%),
        url("../images/hero.png");
    background-position: center;
    background-size: cover;
    box-shadow: 0 1.25rem 3rem rgba(23, 33, 27, 0.08);
}

.hero-content {
    width: min(40%, 440px);
}

.hero-content>p:last-child {
    margin-bottom: 0;
}

.hero h1,
.page-heading h1,
.product-detail h1,
.auth-card h1,
.empty-state h1 {
    max-width: 800px;
    margin: 0.35rem 0 1rem;
    font-family: Georgia, "Yu Mincho", serif;
    font-size: clamp(2.2rem, 6vw, 4.8rem);
    line-height: 1.08;
}

.hero-content>p:last-child,
.description {
    max-width: 660px;
    color: var(--muted);
    font-size: 1.1rem;
    line-height: 1.8;
}

.hero h1 {
    max-width: none;
    font-size: clamp(2.2rem, 4vw, 3.2rem);
}

.agent-callout {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.5rem;
    align-items: center;
    margin: -1.5rem 0 3rem;
    padding: 2rem;
    border: 1px solid #d8b160;
    border-radius: 1rem;
    background: #fff8df;
}

.agent-callout-image {
    width: 5rem;
    height: 5rem;
    object-fit: contain;
}

.agent-callout h2 {
    margin: 0.35rem 0 0.75rem;
    font-size: clamp(1.5rem, 3vw, 2.1rem);
}

.agent-callout p:not(.eyebrow) {
    margin: 0 0 1.25rem;
    color: var(--muted);
    line-height: 1.7;
}

.catalog-disclaimer,
.fictional-product-note {
    padding: 0.85rem 1rem;
    border-left: 4px solid #d8b160;
    background: #fff8df;
    color: #665122;
    font-size: 0.9rem;
    line-height: 1.6;
}

.catalog-disclaimer {
    margin: -0.75rem 0 1.5rem;
}

.fictional-product-note {
    margin: 1.25rem 0 2rem;
}

code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.eyebrow {
    margin: 0;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.18em;
}

.section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.section-heading h2 {
    margin: 0;
    font-size: 1.7rem;
}

.section-heading span,
.category,
.fine-print {
    color: var(--muted);
    font-size: 0.85rem;
}

.product-search {
    display: grid;
    grid-template-columns: minmax(240px, 2fr) minmax(180px, 1fr) auto auto;
    gap: 1rem;
    align-items: end;
    margin-bottom: 2rem;
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--surface);
}

.search-field {
    display: grid;
    gap: 0.4rem;
}

.search-field label {
    font-size: 0.85rem;
    font-weight: 700;
}

.search-field input,
.search-field select {
    width: 100%;
    min-height: 2.8rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 0.35rem;
    background: white;
    font: inherit;
}

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

.product-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--surface);
}

.empty-results {
    padding: 3rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--surface);
    text-align: center;
}

.state-illustration {
    display: block;
    width: 9rem;
    height: 9rem;
    margin: 0 auto 1rem;
    object-fit: contain;
}

.state-illustration.compact {
    width: 7rem;
    height: 7rem;
}

.state-illustration.cart-empty {
    width: 8rem;
    height: 8rem;
}

.pagination {
    justify-content: center;
    margin-top: 2rem;
}

.pagination span {
    color: var(--muted);
}

.product-visual {
    display: grid;
    min-height: 220px;
    place-items: center;
    background: #ebe7dc;
    font-size: 5rem;
    text-decoration: none;
}

.product-body {
    padding: 1.25rem;
}

.product-body h3 {
    margin: 0.35rem 0 0.75rem;
    font-size: 1.15rem;
}

.product-body h3 a {
    text-decoration: none;
}

.price {
    font-weight: 750;
}

.price.large {
    font-size: 1.6rem;
}

.sale-price {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.sale-price .price {
    margin: 0;
    color: #b42318;
}

.sale-price del,
.sale-period {
    color: var(--muted);
    font-size: 0.9rem;
}

.sale-badge {
    padding: 0.2rem 0.45rem;
    border-radius: 0.25rem;
    background: #b42318;
    color: white;
    font-size: 0.8rem;
    font-weight: 750;
}

.daily-sale {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    border: 1px solid #f3c7c2;
    border-radius: 0.75rem;
    background: #fff7f6;
}

.daily-sale .section-heading {
    align-items: flex-end;
    margin-top: 0;
}

.daily-sale .section-heading h2 {
    margin: 0.2rem 0 0;
}

.daily-sale-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.daily-sale-card {
    display: grid;
    grid-template-columns: 5rem minmax(0, 1fr);
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 0.6rem;
    background: var(--surface);
}

.daily-sale-visual {
    display: grid;
    width: 5rem;
    height: 5rem;
    place-items: center;
    border-radius: 0.5rem;
    background: #ebe7dc;
    font-size: 2.5rem;
    text-decoration: none;
}

.daily-sale-card h3 {
    margin: 0.25rem 0 0.65rem;
    font-size: 1rem;
}

.daily-sale-card h3 a {
    text-decoration: none;
}

.daily-sale-card .sale-price {
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.detail-sale-price {
    margin-bottom: 1.25rem;
}

.detail-sale-price .sale-period {
    flex-basis: 100%;
    margin: 0;
}

.button {
    display: inline-flex;
    min-height: 2.8rem;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.1rem;
    border: 1px solid transparent;
    border-radius: 0.35rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

.button.primary {
    background: var(--accent);
    color: white;
}

.button.primary:hover {
    background: var(--accent-dark);
}

.button.secondary {
    border-color: var(--line);
    background: white;
}

.full-width {
    width: 100%;
}

.breadcrumb {
    justify-content: flex-start;
    margin-bottom: 2rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.product-detail {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.detail-visual {
    min-height: 480px;
    border-radius: 1rem;
    font-size: 9rem;
}

.product-detail h1 {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
}

.purchase-form {
    display: grid;
    grid-template-columns: 5rem 6rem minmax(max-content, 1fr);
    gap: 0.75rem;
    align-items: center;
    margin-top: 2rem;
}

.purchase-form .button {
    width: 300px;
}

input[type="number"] {
    width: 5rem;
    padding: 0.65rem;
    border: 1px solid var(--line);
    border-radius: 0.3rem;
    font: inherit;
}

.field-validation-error {
    grid-column: 1 / -1;
    color: #a32d24;
}

.page-heading {
    margin-bottom: 2rem;
}

.page-heading h1 {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
}

.cart-layout,
.checkout-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 2rem;
    align-items: start;
}

.cart-lines,
.panel,
.order-summary {
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--surface);
}

.cart-line {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 1rem;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 1px solid var(--line);
}

.cart-line:last-child {
    border: 0;
}

.cart-line h2 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
}

.cart-line p {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.quantity-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.quantity-form label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.order-summary,
.panel {
    padding: 1.5rem;
}

.order-summary h2,
.panel h2 {
    margin-top: 0;
}

.order-summary>div {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
}

.summary-total,
.checkout-total {
    margin: 0.5rem 0 1rem;
    border-top: 1px solid var(--line);
    font-size: 1.2rem;
}

.empty-state,
.auth-card {
    max-width: 600px;
    margin: 3rem auto;
    padding: 3rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: var(--surface);
    text-align: center;
}

.empty-state>span {
    font-size: 3rem;
}

.empty-state h1,
.empty-state h2,
.auth-card h1 {
    font-size: 2rem;
}

.auth-card p {
    margin-bottom: 2rem;
    color: var(--muted);
    line-height: 1.7;
}

.auth-card ul {
    width: fit-content;
    margin: 0 auto 2rem;
    text-align: left;
}

.auth-form {
    display: grid;
    gap: 1.5rem;
    text-align: left;
}

.form-field {
    display: grid;
    gap: 0.5rem;
}

.form-field label {
    font-weight: 700;
}

.field-hint {
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.form-field input {
    width: 100%;
    min-height: 2.8rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 0.35rem;
    font: inherit;
}

.form-field input:focus {
    border-color: var(--accent);
    outline: 2px solid color-mix(in srgb, var(--accent) 25%, transparent);
    outline-offset: 1px;
}

.auth-switch {
    display: grid;
    gap: 0.35rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
}

.auth-switch a {
    color: var(--ink);
    font-weight: 700;
}

.button-row {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.success-state>span {
    display: inline-grid;
    width: 5rem;
    height: 5rem;
    margin-bottom: 1rem;
    place-items: center;
    border-radius: 50%;
    background: var(--success);
    color: white;
}

.definition-list>div {
    display: grid;
    grid-template-columns: 7rem 1fr;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--line);
}

.definition-list dt {
    color: var(--muted);
}

.definition-list dd {
    margin: 0;
}

.checkout-lines {
    padding: 0;
    list-style: none;
}

.checkout-lines li,
.checkout-total {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
}

.order-history {
    display: grid;
    gap: 1.5rem;
}

.pending-purchases {
    margin-top: 2rem;
}

footer {
    padding: 1.5rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    text-align: center;
}

@media (max-width: 760px) {
    .hero {
        min-height: 620px;
        padding: 1rem;
        place-items: end stretch;
        background-image:
            linear-gradient(180deg, transparent 28%, rgba(255, 255, 255, 0.18) 43%, rgba(255, 255, 255, 0.98) 66%),
            url("../images/penguin-shopping.png");
        background-position: 28% center;
    }

    .hero-content {
        width: 100%;
        padding: 1.25rem;
    }

    .hero h1 {
        font-size: clamp(2.2rem, 10vw, 3.2rem);
    }

    .site-header {
        align-items: flex-start;
        gap: 1rem;
    }

    .brand img {
        width: 10rem;
    }

    .site-header nav {
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 0.75rem;
    }

    .user-name {
        display: none;
    }

    .container {
        width: min(100% - 2rem, 1120px);
    }

    .product-grid,
    .daily-sale-grid,
    .agent-callout,
    .product-search,
    .product-detail,
    .cart-layout,
    .checkout-layout {
        grid-template-columns: 1fr;
    }

    .agent-callout-image {
        width: 4rem;
        height: 4rem;
    }

    .product-search .button {
        width: 100%;
    }

    .product-detail {
        gap: 2rem;
    }

    .detail-visual {
        min-height: 280px;
    }

    .cart-line {
        grid-template-columns: 1fr auto;
    }

    .quantity-form {
        grid-column: 1 / -1;
    }

    .purchase-form {
        grid-template-columns: 4rem 5rem;
    }

    .purchase-form .button {
        grid-column: 1 / -1;
    }
}