* {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    min-height: 100vh;
    color: #f8f3ea;
    background:
        radial-gradient(circle at top left, rgba(214, 81, 32, 0.35), transparent 28%),
        radial-gradient(circle at bottom right, rgba(255, 191, 92, 0.18), transparent 26%),
        linear-gradient(135deg, #1e1613 0%, #2d2018 48%, #191512 100%);
    overflow-x: hidden;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

body::before {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.95), transparent 82%);
}

body::after {
    background: radial-gradient(circle at center, transparent 0 35%, rgba(0, 0, 0, 0.2) 78%, rgba(0, 0, 0, 0.48) 100%);
}

header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(20, 16, 14, 0.76);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    height: 92px;
    padding: 0 clamp(18px, 3vw, 40px);
}

header img {
    width: 78px;
    height: 78px;
    object-fit: contain;
}

main.hero {
    position: relative;
    min-height: calc(100vh - 92px);
    display: grid;
    align-items: center;
    padding: clamp(24px, 4vw, 56px);
    isolation: isolate;
}

nav {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: flex-end;
    z-index: 2;
}

a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: inherit;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.04);
    transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

a:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 189, 115, 0.6);
    background: rgba(255, 255, 255, 0.08);
}

.hero-copy {
    position: relative;
    z-index: 2;
    max-width: 560px;
    padding: clamp(24px, 4vw, 40px);
}

.eyebrow {
    margin-bottom: 14px;
    color: #ffcf8a;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.8rem;
    font-weight: 800;
}

.hero-copy h1 {
    font-size: clamp(2.5rem, 5vw, 5rem);
    line-height: 0.95;
    max-width: 10ch;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

.hero-copy p {
    margin-top: 18px;
    max-width: 52ch;
    color: rgba(248, 243, 234, 0.82);
    line-height: 1.6;
    font-size: 1rem;
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.25);
}

.hero-links {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 28px;
}

.hero-links a {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
}

.hero-links a:hover {
    background: rgba(255, 195, 108, 0.14);
}

.brand-wall {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.brand-tile {
    position: absolute;
    display: grid;
    place-items: center;
    width: clamp(110px, 14vw, 190px);
    aspect-ratio: 1;
    padding: 18px;
    border-radius: 26px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(14px);
    opacity: 0.94;
    animation-name: float;
    animation-duration: 8s;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-direction: alternate;
    will-change: transform;
    translate: 0 0;
}

.brand-tile img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: saturate(1.08) contrast(1.03);
}

.tile-1 {
    top: 8%;
    left: 6%;
    rotate: -10deg;
    animation-delay: 0s;
    animation-duration: 7.6s;
}

.tile-2 {
    top: 12%;
    right: 12%;
    width: clamp(120px, 15vw, 210px);
    rotate: 12deg;
    animation-delay: -2s;
    animation-duration: 8.4s;
}

.tile-3 {
    top: 28%;
    left: 28%;
    width: clamp(104px, 14vw, 176px);
    rotate: 10deg;
    animation-delay: -4s;
    animation-duration: 7.8s;
}

.tile-4 {
    top: 30%;
    right: 26%;
    width: clamp(116px, 15vw, 188px);
    rotate: -9deg;
    animation-delay: -1s;
    animation-duration: 8.8s;
}

.tile-5 {
    bottom: 12%;
    left: 12%;
    width: clamp(126px, 16vw, 206px);
    rotate: 9deg;
    animation-delay: -3s;
    animation-duration: 8.2s;
}

.tile-6 {
    bottom: 12%;
    right: 12%;
    width: clamp(126px, 16vw, 214px);
    rotate: -12deg;
    animation-delay: -5s;
    animation-duration: 8.6s;
}

.tile-7 {
    top: 48%;
    left: 44%;
    width: clamp(116px, 15vw, 188px);
    rotate: 6deg;
    animation-delay: -6s;
    animation-duration: 7.9s;
}

@keyframes float {
    0% {
        translate: 0 0;
    }

    50% {
        translate: 0 -14px;
    }

    100% {
        translate: 0 0;
    }
}

@media (max-width: 900px) {
    header {
        height: auto;
        padding-top: 14px;
        padding-bottom: 14px;
        align-items: flex-start;
        flex-direction: column;
    }

    nav {
        justify-content: flex-start;
    }

    main.hero {
        min-height: calc(100vh - 124px);
    }

    .tile-2,
    .tile-4,
    .tile-6 {
        opacity: 0.66;
    }
}

@media (max-width: 640px) {
    .hero-copy h1 {
        max-width: none;
    }

    .brand-tile {
        width: 96px;
        padding: 14px;
        border-radius: 20px;
    }

    .tile-2,
    .tile-4,
    .tile-6,
    .tile-7 {
        display: none;
    }

    .tile-1 {
        top: 10%;
        left: 4%;
    }

    .tile-3 {
        top: 20%;
        right: 4%;
        left: auto;
    }

    .tile-5 {
        bottom: 10%;
        left: 6%;
    }
}

.login-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(9, 7, 6, 0.72);
    backdrop-filter: blur(12px);
}

.login-modal[hidden],
[hidden] {
    display: none !important;
}

.login-card {
    width: min(100%, 420px);
    padding: 28px;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(180deg, rgba(31, 23, 19, 0.98), rgba(18, 14, 12, 0.96));
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.login-card h2 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.login-kicker {
    color: #ffcf8a;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.78rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.login-card p {
    color: rgba(248, 243, 234, 0.82);
    line-height: 1.5;
    margin-bottom: 16px;
}

.login-card label {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 0.95rem;
    font-weight: 600;
}

.login-card input {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    color: #f8f3ea;
    padding: 12px 14px;
    outline: none;
}

.login-card input:focus {
    border-color: rgba(255, 189, 115, 0.7);
    box-shadow: 0 0 0 3px rgba(255, 189, 115, 0.14);
}

.login-hint {
    font-size: 0.88rem;
    margin-top: 6px;
}

.login-error {
    min-height: 1.2em;
    color: #ff8f8f;
    font-size: 0.92rem;
}

.login-card button {
    width: 100%;
    margin-top: 6px;
    border: 0;
    border-radius: 14px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #ffb35f, #ff7f3f);
    color: #1b120d;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
}

.login-card button:hover {
    transform: translateY(-1px);
}

/* L1 templates layout and button styles */
.l1-templates {
    min-height: calc(100vh - 92px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(20px, 4vw, 48px);
}

.templates-grid {
    width: min(1100px, 96%);
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    padding: clamp(18px, 3.5vw, 32px);
    border-radius: 18px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.45);
}

.template-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    align-items: stretch;
}

.template-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 20px;
    font-size: 1.05rem;
    font-weight: 800;
    color: #1b120d;
    background: linear-gradient(135deg, #ffb35f, #ff7f3f);
    border: none;
    border-radius: 14px;
    box-shadow: 0 18px 36px rgba(0,0,0,0.4);
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease;
    text-transform: none;
}

.template-btn:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 26px 48px rgba(0,0,0,0.48);
}

@media (max-width: 900px) {
    .template-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    .template-buttons {
        grid-template-columns: 1fr;
    }
    .template-btn {
        padding: 16px 18px;
        font-size: 1rem;
    }
}

/* Template pages styling */
.template-page {
    min-height: calc(100vh - 92px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(20px, 4vw, 48px);
}

.template-card {
    width: min(900px, 96%);
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    border: 1px solid rgba(255,255,255,0.04);
    padding: 28px;
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.45);
    display: grid;
    gap: 14px;
}

.template-card h1 {
    text-align: center;
    font-size: clamp(1.25rem, 2.6vw, 2rem);
    font-weight: 900;
    margin: 8px 0 6px 0;
    background: linear-gradient(90deg, #ffd19a, #ff8c5a);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 6px 18px rgba(0,0,0,0.45);
}

.template-card textarea {
    width: 100%;
    resize: vertical;
    min-height: 160px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(0,0,0,0.28);
    color: #f8f3ea;
    font-size: 0.98rem;
}

.template-form {
    display: grid;
    gap: 14px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.form-field {
    display: grid;
    gap: 8px;
}

.form-field span {
    font-size: 0.92rem;
    font-weight: 800;
    color: #ffd7a8;
    text-align: left;
}

.form-field input,
.form-field textarea,
.form-field select {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.28);
    color: #f8f3ea;
    padding: 12px 14px;
    font-size: 0.98rem;
    outline: none;
}

.form-field select {
    appearance: none;
    cursor: pointer;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
    border-color: rgba(255, 191, 92, 0.7);
    box-shadow: 0 0 0 3px rgba(255, 191, 92, 0.12);
}

.full-width {
    grid-column: 1 / -1;
}

.template-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.template-actions button,
.template-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 800;
    text-decoration: none;
    color: #1b120d;
    background: linear-gradient(135deg, #ffb35f, #ff7f3f);
    border: none;
    box-shadow: 0 12px 28px rgba(0,0,0,0.36);
}

.template-actions a { padding: 10px 12px; background: rgba(255,255,255,0.04); color: inherit; border: 1px solid rgba(255,255,255,0.06); }

@media (max-width: 640px) {
    .template-card { padding: 16px; }
    .template-card textarea { min-height: 120px; }
    .form-grid { grid-template-columns: 1fr; }
    .template-actions { flex-direction: column; }
}