:root {
    /* Logo navy uit tomstegeltoko.pdf / visitekaartjes; motieven blijven Delft-accent */
    --color-bg: #f3f0ea;
    --color-fg: #1a2330;
    --color-muted: #5c6b7c;
    --color-accent: #243c8c;
    --color-accent-deep: #1a2d6b;
    --color-motif: #10599d;
    --color-ceramic: #faf8f4;
    --color-line: #d5dde8;
    --font-display: "Cinzel", "Cormorant Garamond", Georgia, serif;
    --font-body: "Source Sans 3", system-ui, sans-serif;
}

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--color-bg);
    color: var(--color-fg);
}

::selection {
    background: rgba(16, 89, 157, 0.22);
    color: var(--color-fg);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border-radius: 0.25rem;
    padding: 0.5rem 0.9rem;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
}

.btn-primary {
    color: #fff;
    background-color: var(--color-accent);
    border-color: var(--color-accent-deep);
}

.btn-primary:hover {
    background-color: var(--color-accent-deep);
}

.btn-outline {
    color: var(--color-accent);
    background: transparent;
    border-color: var(--color-accent);
}

.btn-outline:hover {
    background: rgba(16, 89, 157, 0.08);
}

.form-message {
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.form-message.error {
    color: #b00020;
}

.admin-section {
    background: var(--color-ceramic);
    border: 1px solid var(--color-line);
    padding: 1rem;
    margin-bottom: 1.25rem;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.cart-table th,
.cart-table td {
    border-bottom: 1px solid var(--color-line);
    padding: 0.7rem;
    text-align: left;
}

.admin-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.admin-list li {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--color-line);
}

.docs-page {
    max-width: 46rem;
    background: var(--color-ceramic);
    border: 1px solid var(--color-line);
    padding: 1.25rem 1.5rem 2rem;
}

.docs-page pre {
    background: #fff;
    border: 1px solid var(--color-line);
    padding: 0.85rem;
    overflow-x: auto;
    font-size: 0.85rem;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    padding: 0.5rem 1rem;
    background: var(--color-accent);
    color: #fff;
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
}

/* Hero atmosphere */
.hero-plane {
    position: relative;
    min-height: min(100svh, 52rem);
    display: grid;
    align-items: end;
    overflow: hidden;
    background:
        linear-gradient(120deg, rgba(26, 35, 48, 0.78) 0%, rgba(36, 60, 140, 0.42) 48%, rgba(26, 35, 48, 0.22) 100%),
        url('/brand/tegeltje.webp') center / cover no-repeat;
}

.hero-plane::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url('/brand/Tegeltjes-01.svg');
    background-size: min(42vw, 28rem);
    background-repeat: no-repeat;
    background-position: right -4% bottom -8%;
    opacity: 0.18;
    pointer-events: none;
    animation: motif-drift 18s ease-in-out infinite alternate;
}

.hero-copy {
    position: relative;
    z-index: 1;
    padding: 5.5rem 0 4rem;
    color: #f7f4ee;
}

.hero-brand {
    margin: 0 0 1rem;
    animation: rise-in 0.9s ease both;
}

.hero-logo {
    display: block;
    width: min(100%, 28rem);
    height: auto;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.35));
}

.hero-headline {
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 3vw, 2rem);
    font-weight: 600;
    margin: 0 0 0.75rem;
    max-width: 22ch;
    animation: rise-in 0.9s ease 0.12s both;
}

.hero-support {
    max-width: 34rem;
    color: rgba(247, 244, 238, 0.88);
    line-height: 1.65;
    margin: 0 0 1.5rem;
    animation: rise-in 0.9s ease 0.22s both;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    animation: rise-in 0.9s ease 0.32s both;
}

@keyframes rise-in {
    from { opacity: 0; transform: translateY(1rem); }
    to { opacity: 1; transform: none; }
}

@keyframes motif-drift {
    from { transform: translate3d(0, 0, 0) rotate(0deg); }
    to { transform: translate3d(-1.5%, -2%, 0) rotate(-2deg); }
}

@keyframes tile-flip {
    0%, 100% { transform: rotateY(0deg); }
    45% { transform: rotateY(0deg); }
    55% { transform: rotateY(180deg); }
    90% { transform: rotateY(180deg); }
}

.tile-flip {
    perspective: 900px;
}

.tile-flip-inner {
    position: relative;
    transform-style: preserve-3d;
    animation: tile-flip 8s ease-in-out infinite;
}

.tile-face {
    backface-visibility: hidden;
    border-radius: 0.25rem;
}

.tile-face-back {
    position: absolute;
    inset: 0;
    transform: rotateY(180deg);
}

.reveal {
    opacity: 0;
    transform: translateY(0.75rem);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* Designer (interaction surface) */
.designer-layout {
    display: grid;
    grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
    gap: 1.25rem;
}

.designer-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: var(--color-ceramic);
    border: 1px solid var(--color-line);
    padding: 1rem;
}

.designer-sidebar label,
.form-grid label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
}

.designer-sidebar input,
.designer-sidebar select,
.checkout-form input,
.form-grid input,
.form-grid textarea {
    border: 1px solid var(--color-line);
    border-radius: 0.25rem;
    padding: 0.45rem 0.55rem;
    background: #fff;
    color: var(--color-fg);
}

.tool-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.motif-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.motif-btn {
    text-align: left;
    border: 1px solid var(--color-line);
    background: #fff;
    border-radius: 0.25rem;
    padding: 0.45rem 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.motif-thumb {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    background: var(--color-ceramic);
    border: 1px solid var(--color-line);
    flex-shrink: 0;
}

.motif-group-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-muted);
    margin-top: 0.35rem;
}

.sidebar-block {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--color-line);
}

.sidebar-label {
    font-weight: 600;
    font-size: 0.9rem;
}

.stroke-presets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
}

.stroke-preset {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.35rem;
    border: 1px solid var(--color-line);
    border-radius: 0.25rem;
    background: #fff;
    cursor: pointer;
    font-size: 0.8rem;
}

.stroke-preset.is-active,
.btn.is-active-tool {
    border-color: var(--color-accent);
    background: rgba(16, 89, 157, 0.08);
    box-shadow: inset 0 0 0 1px var(--color-accent);
}

.stroke-sample {
    width: 70%;
    background: var(--color-accent);
    border-radius: 99px;
}

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

.stage-hint {
    text-align: center;
    margin-top: 0.75rem;
}

.designer-host.mode-draw .tile-designer-svg { cursor: crosshair; }
.designer-host.mode-text .tile-designer-svg { cursor: text; }
.designer-host.mode-erase .tile-designer-svg { cursor: pointer; }

.designer-stage {
    background:
        linear-gradient(45deg, #e4ebf2 25%, transparent 25%),
        linear-gradient(-45deg, #e4ebf2 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e4ebf2 75%),
        linear-gradient(-45deg, transparent 75%, #e4ebf2 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
    border: 1px solid var(--color-line);
    padding: 1rem;
    min-height: 560px;
}

.designer-host,
.tile-designer-svg {
    width: 100%;
    max-width: 640px;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    display: block;
    background: #fff;
    touch-action: none;
}

.full-span {
    grid-column: 1 / -1;
}

.validation-message {
    color: #b00020;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

#blazor-error-ui {
    background: #fff3cd;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.15);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

@media (max-width: 900px) {
    .designer-layout {
        grid-template-columns: 1fr;
    }
    .designer-stage {
        min-height: 420px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-brand,
    .hero-headline,
    .hero-support,
    .hero-cta,
    .hero-plane::before,
    .tile-flip-inner,
    .reveal {
        animation: none !important;
        transition: none !important;
        opacity: 1;
        transform: none;
    }
}
