@font-face {
font-family: 'Huninn';
src: url('/fonts/Huninn-Regular.woff2') format('woff2');
font-weight: 400;
font-style: normal;
font-display: block;
}
@font-face {
font-family: 'Bpmf Huninn';
src: url('/fonts/BpmfHuninn-Regular.woff2') format('woff2');
font-weight: 400;
font-style: normal;
font-display: block;
}
:root {
    --bg: #0e0e0f;
    --surface: #1a1a1c;
    --surface2: #242427;
    --border: rgba(255,255,255,0.08);
    --border2: rgba(255,255,255,0.14);
    --text: #f0ede8;
    --text-muted: #888884;
    --text-dim: #555552;
    --accent: #e8d5a3;
    --accent2: #c9a96e;
    --accent-glow: rgba(232,213,163,0.15);
    --radius: 12px;
    --radius-sm: 8px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Huninn', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background texture */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
    radial-gradient(ellipse 60% 40% at 20% 10%, rgba(232,213,163,0.04) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 80% 80%, rgba(150,120,80,0.05) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 3rem 1.5rem 5rem;
}

h1 {
    font-family: 'Huninn', sans-serif;
    font-size: clamp(2.8rem, 8vw, 4.5rem);
    line-height: 0.95;
    letter-spacing: 0.02em;
    color: var(--text);
    margin-bottom: 1rem;
}


.subtitle {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 420px;
}

/* Card */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    margin-bottom: 1.25rem;
}

.card-label {
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 1rem;
}

/* Textarea */
textarea {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1rem;
    font-size: 17px;
    color: var(--text);
    resize: vertical;
    min-height: 90px;
    font-family: 'Huninn', sans-serif;
    transition: border-color 0.2s;
    outline: none;
}
textarea:focus { border-color: var(--border2); }
textarea::placeholder { color: var(--text-dim); }

/* Controls grid */
.controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
@media (max-width: 500px) { .controls { grid-template-columns: 1fr; } }

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

.ctrl-label {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

select {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: 'Huninn', sans-serif;
    font-size: 14px;
    height: 40px;
    padding: 0 12px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888884' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
select:focus { border-color: var(--border2); }

/* Slider row */
.slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 40px;
}

input[type=range] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 3px;
    background: var(--surface2);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    transition: transform 0.15s;
}
input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.2); }

.slider-val {
    font-size: 13px;
    color: var(--accent2);
    min-width: 38px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Color + weight row */
.inline-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

input[type=color] {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface2);
    padding: 3px;
    cursor: pointer;
    outline: none;
}

.toggle-group {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.toggle-group button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0 14px;
    height: 40px;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Huninn', sans-serif;
    transition: background 0.15s, color 0.15s;
}
.toggle-group button.active {
    background: var(--accent-glow);
    color: var(--accent);
}
.toggle-group button:first-child { border-right: 1px solid var(--border); }

/* Preview */
.preview-stage {
    background:
    repeating-conic-gradient(var(--surface2) 0% 25%, var(--bg) 0% 50%)
    0 0 / 20px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 1.5rem;
    position: relative;
    margin-bottom: 1.25rem;
}

.preview-stage::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    box-shadow: inset 0 0 30px rgba(0,0,0,0.3);
    pointer-events: none;
}

#preview-img {
    max-width: 100%;
    max-height: 300px;
    position: relative;
    z-index: 1;
}

canvas { display: none; }

/* Buttons */
.btn-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px;
    border-radius: var(--radius-sm);
    font-family: 'Huninn', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--accent);
    color: #1a1508;
    font-weight: 700;
    border-color: var(--accent);
}
.btn-primary:hover { background: #f0e0b0; }
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border2);
}
.btn-secondary:hover { color: var(--text); border-color: var(--border2); background: var(--surface2); }
.btn-secondary:active { transform: scale(0.97); }

.btn svg {
    width: 16px; height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: var(--surface2);
    border: 1px solid var(--border2);
    border-radius: 999px;
    padding: 10px 20px;
    font-size: 13px;
    color: var(--text);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s;
    white-space: nowrap;
    z-index: 100;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}


/* Footer */
footer {
    text-align: center;
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 4rem;
    letter-spacing: 0.05em;
}

/* Divider */
.divider {
    height: 1px;
    background: var(--border);
    margin: 1.25rem 0;
}