/*###############################
###
###     style.css
###     FORMIC — A Living Canvas
###     BASED ON: HTML5, CSS3, Vanilla JavaScript, Canvas
###     AUTHOR: Benjamin Bennewitz
###
###
###       ██████╗  ▀█
###       ██╔══██╗ █▄
###       ██████╦╝
###       ██╔══██╗
###       ██████╦╝
###       ╚═════╝
###
#################################*/

/* ===========================================================================
   INHALTSVERZEICHNIS

   01   Design Tokens, Basis und Fokus
   02   Kopfzeile und Navigation
   03   Intro und Typografie
   04   Studio und Arbeitsfläche
   05   Papier, Canvas und Zeichenebenen
   06   Experimentpanel und Controls
   07   Footer
   08   Große Bildschirme
   09   Tablet-Layouts
   10   Mobile Layouts
   11   Credits und Quellenhinweise
   ========================================================================== */

/* ==========================================================================
   01   Design Tokens, Basis und Fokus
   ========================================================================== */

:root {
    font-family: Arial, Helvetica, sans-serif;
    color: #292b22;
    background: #eeeee7;
    font-synthesis: none;
    --line: #d1d2c8;
    --accent: #d5eb79;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
}

button,
input,
select {
    font: inherit;
}

button,
select {
    cursor: pointer;
}

button {
    color: inherit;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible {
    outline: 3px solid #667c27;
    outline-offset: 4px;
}

/* ==========================================================================
   02   Kopfzeile und Navigation
   ========================================================================== */

header {
    height: 112px;
    margin: 0 4%;
    display: flex;
    align-items: center;
    gap: 40px;
    border-bottom: 1px solid var(--line);
}

.brand {
    font-weight: 900;
    letter-spacing: -4px;
    font-size: 46px;
    color: inherit;
    text-decoration: none;
}

.brand span {
    font-size: 14px;
    vertical-align: top;
    letter-spacing: 0;
    display: inline-block;
    margin: 6px;
}

.edition,
.eyebrow,
.panel-heading,
legend,
.canvas-top,
.scale-mark,
footer,
.note {
    font-family: monospace;
    font-size: 10px;
    letter-spacing: 1px;
    line-height: 1.6;
}

.edition {
    margin-left: auto;
}

.quiet {
    border: 0;
    background: transparent;
    font-size: 11px;
    padding: 8px 0;
    text-align: left;
}

.quiet:hover {
    text-decoration: underline;
}

/* ==========================================================================
   03   Intro und Typografie
   ========================================================================== */

main {
    margin: 0 4%;
}

.intro {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 42px 0 36px;
}

.eyebrow {
    margin: 0 0 16px;
}

h1 {
    font-size: clamp(44px, 5.3vw, 82px);
    line-height: .99;
    letter-spacing: -4px;
    font-weight: 500;
    margin: 0;
}

.intro-copy {
    font-size: 14px;
    line-height: 1.7;
    margin: 0 30px 3px 20px;
    color: #64665a;
}

/* ==========================================================================
   04   Studio und Arbeitsfläche
   ========================================================================== */

.studio {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    border: 1px solid var(--line);
}

.workbench {
    min-width: 0;
    background: #dedfd5;
    display: flex;
    flex-direction: column;
}

.canvas-top,
.canvas-bottom {
    padding: 16px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.canvas-top {
    border-bottom: 1px solid #caccbf;
    color: #666a59;
}

.canvas-top b {
    font-weight: 400;
}

i {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #8a8d7e;
    border-radius: 50%;
    margin-right: 6px;
}

i.running {
    background: #526a22;
    box-shadow: 0 0 0 4px #c3ce9e;
}

/* ==========================================================================
   05   Papier, Canvas und Zeichenebenen
   ========================================================================== */

.paper-area {
    position: relative;
    min-height: 650px;
    padding: 34px 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    background-image: radial-gradient(#a7aa9c55 .6px, transparent .6px);
    background-size: 9px 9px;
}

.paper {
    position: relative;
    background: #faf8f0;
    box-shadow: 0 7px 24px #33352218;
    width: 100%;
    max-width: 430px;
    aspect-ratio: 210/297;
    touch-action: manipulation;
    cursor: crosshair;
}

canvas {
    position: absolute;
    width: 100%;
    height: 100%;
    inset: 0;
}

#hint {
    position: absolute;
    bottom: 28px;
    width: 100%;
    text-align: center;
    color: #aaa99b;
    font: italic 12px Georgia;
    pointer-events: none;
}

.scale-mark {
    position: absolute;
    left: 14px;
    bottom: 20px;
    writing-mode: vertical-rl;
    color: #757966;
}

.canvas-bottom {
    font-size: 11px;
    border-top: 1px solid #caccbf;
    color: #626653;
}

/* ==========================================================================
   06   Experimentpanel und Controls
   ========================================================================== */

aside {
    background: #f5f5ee;
    padding: 22px;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    padding-bottom: 15px;
}

.specimen {
    padding: 14px 0 22px;
    text-align: center;
}

.specimen svg {
    width: 165px;
    height: 95px;
}

.specimen h2 {
    font: italic 24px Georgia;
    margin: 0 0 5px;
}

.specimen p {
    font-size: 10px;
    color: #727568;
    margin: 0;
}

fieldset {
    border: 0;
    border-top: 1px solid var(--line);
    padding: 16px 0 18px;
    margin: 0;
}

legend {
    padding: 0 7px 0 0;
    color: #777b69;
    font-size: 9px;
}

.line-color {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    margin-bottom: 20px;
}

.smoothness-hint {
    display: flex;
    justify-content: space-between;
    font: 10px monospace;
    color: #65695d;
    margin: 0;
}

input[type=color] {
    appearance: none;
    border: 1px solid #c5c7ba;
    background: none;
    width: 29px;
    height: 29px;
    padding: 3px;
    cursor: pointer;
}

input[type=color]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type=color]::-webkit-color-swatch {
    border: 0;
}

.range-label {
    display: grid;
    grid-template-columns: 1fr auto;
    font-size: 11px;
    gap: 6px;
    margin-bottom: 13px;
}

input[type=range] {
    width: 100%;
    grid-column: 1/-1;
    height: 3px;
    accent-color: #4b5831;
    margin: 4px 0;
}

output {
    color: #6b705f;
    font-family: monospace;
}

.select-row {
    display: flex;
    gap: 8px;
}

select {
    min-width: 0;
    border: 1px solid var(--line);
    background: #efefe6;
    border-radius: 0;
    padding: 9px;
    font-size: 11px;
}

.select-row select {
    width: 50%;
}

.export-size {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    margin-top: 10px;
}

.export-size select {
    padding: 5px;
}

.export {
    width: 100%;
    border: 1px solid #aeb3a0;
    background: transparent;
    font-size: 11px;
    padding: 12px;
    margin-top: 12px;
}

.export:hover {
    background: #e8eadf;
}

.play {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 17px 14px;
    border: 0;
    background: var(--accent);
    font-weight: bold;
    font-size: 12px;
}

.play:hover {
    background: #c7e45f;
}

.note {
    letter-spacing: 0;
    font-size: 9px;
    color: #7e8273;
    margin: 14px 0 0;
}

/* ==========================================================================
   07   Footer
   ========================================================================== */

footer {
    display: flex;
    justify-content: space-between;
    padding: 26px 0;
    font-size: 9px;
    color: #7a7d6e;
}

/* ==========================================================================
   08   Große Bildschirme
   ========================================================================== */

@media (min-width:1600px) {

    main,
    header {
        max-width: 1480px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ==========================================================================
   09   Tablet-Layouts
   ========================================================================== */

@media (max-width:850px) {
    .studio {
        grid-template-columns: minmax(0, 1fr) 260px;
    }

    aside {
        padding: 16px;
    }

    .paper-area {
        padding: 25px;
        min-height: 500px;
    }

    .intro-copy {
        margin-right: 0;
        font-size: 12px;
    }

    h1 {
        letter-spacing: -2px;
    }
}

/* ==========================================================================
   10   Mobile Layouts
   ========================================================================== */

@media (max-width:620px) {
    header {
        height: 82px;
        gap: 12px;
    }

    .brand {
        font-size: 35px;
        letter-spacing: -3px;
    }

    .edition {
        font-size: 7px;
    }

    .intro {
        padding: 28px 0;
        display: block;
    }

    .intro-copy {
        margin: 20px 0 0;
    }

    .intro-copy br {
        display: none;
    }

    .studio {
        grid-template-columns: 1fr;
    }

    .paper-area {
        min-height: 480px;
        padding: 25px 38px;
    }

    .paper {
        max-width: 350px;
    }

    .canvas-top {
        font-size: 8px;
        padding: 13px;
    }

    .canvas-bottom {
        padding: 12px;
    }

    aside {
        border-top: 1px solid var(--line);
        padding: 22px;
    }

    .specimen {
        display: flex;
        align-items: center;
        text-align: left;
        justify-content: center;
        gap: 20px;
    }

    .specimen svg {
        width: 120px;
    }

    footer {
        gap: 15px;
        flex-wrap: wrap;
    }

    footer span:nth-child(2) {
        display: none;
    }

    h1 {
        font-size: 54px;
    }
}

/* ==========================================================================
   11   Credits und Quellenhinweise
   ========================================================================== */

.credits {
    border-top: 1px solid var(--line);
    padding: 18px 0 28px;
    font-size: 12px;
    line-height: 1.7;
    color: #636855;
}

.credits summary {
    cursor: pointer;
    width: fit-content;
}

.credits p {
    max-width: 720px;
}

.credits a {
    color: #445c23;
    text-underline-offset: 3px;
}

.credits .credit-note {
    font-size: 11px;
    color: #6d7262;
}