/*  ----------------------------------------------------
    font face
    ----------------------------------------------------
*/    

@font-face {
    font-family: "NordeaSansLarge";
    src: url(../assets/fonts/NordeaSansLarge-300.woff2) format("woff2");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "NordeaSansLarge";
    src: url(../assets/fonts/NordeaSansLarge-300i.woff2) format("woff2");
    font-weight: 300;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: "NordeaSansLarge";
    src: url(../assets/fonts/NordeaSansLarge-400.woff2) format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "NordeaSansLarge";
    src: url(../assets/fonts/NordeaSansLarge-400i.woff2) format("woff2");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: "NordeaSansLarge";
    src: url(../assets/fonts/NordeaSansLarge-500.woff2) format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "NordeaSansLarge";
    src: url(../assets/fonts/NordeaSansLarge-500i.woff2) format("woff2");
    font-weight: 500;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: "NordeaSansLarge";
    src: url(../assets/fonts/NordeaSansLarge-700.woff2) format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "NordeaSansLarge";
    src: url(../assets/fonts/NordeaSansLarge-700i.woff2) format("woff2");
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: "NordeaSansLarge";
    src: url(../assets/fonts/NordeaSansLarge-900.woff2) format("woff2");
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "NordeaSansSmall";
    src: url(../assets/fonts/NordeaSansSmall-300.woff2) format("woff2");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "NordeaSansSmall";
    src: url(../assets/fonts/NordeaSansSmall-300i.woff2) format("woff2");
    font-weight: 300;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: "NordeaSansSmall";
    src: url(../assets/fonts/NordeaSansSmall-400.woff2) format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "NordeaSansSmall";
    src: url(../assets/fonts/NordeaSansSmall-400i.woff2) format("woff2");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: "NordeaSansSmall";
    src: url(../assets/fonts/NordeaSansSmall-500.woff2) format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "NordeaSansSmall";
    src: url(../assets/fonts/NordeaSansSmall-500i.woff2) format("woff2");
    font-weight: 500;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: "NordeaSansSmall";
    src: url(../assets/fonts/NordeaSansSmall-700.woff2) format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "NordeaSansSmall";
    src: url(../assets/fonts/NordeaSansSmall-700i.woff2) format("woff2");
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: "NordeaSansSmall";
    src: url(../assets/fonts/NordeaSansSmall-900.woff2) format("woff2");
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/*  ----------------------------------------------------
    Reset
    ----------------------------------------------------
*/    
*, ::after, ::before { box-sizing: border-box; }

* { position: relative; }
:where(svg, svg *) { position: static; }
:where(dialog) { position: fixed;}

:where(html) { block-size: 100%; overflow: hidden; }
:where(body) {
	min-block-size: 100%;
	margin: 0;
	font-family: sans-serif;
	text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
	-webkit-tap-highlight-color: transparent;
}

:where(a, button, label, select, [type="button"], summary) {
	cursor: pointer;
	font: inherit;
	color: inherit;
}
:where(button, a) * { pointer-events: none; }
:where(body, nav, header, main, footer, aside, article, section, img) {
	padding-block: 0.1px;
	display: block;
	isolation: isolate;
}


/*  ----------------------------------------------------
    Config
    ----------------------------------------------------
*/    
html {
    --min-scale-bound: 20rem;
    --max-scale-bound: 68rem;

    --pad: 1.5rem;
    --gap: 1.5rem;


    --color-none: transparent;
    --color-white: white;
    --color-black: #181818;
    --color-general-black: #000;
    --color-b1: #EAF4FF;
    --color-b2: #3399ff;
    --color-b3: #0000ff;
    --color-b4: #0000a0;
    --color-b5: #00005e;
    --color-b6: #EAF4FF;
    --color-bg1: #EAF4FF;
    --color-bg2: #d1dde7;
    --color-bg3: #dcedff;
    --color-p1: #fff3ee;
    --color-p2: #f5d3cc;
    --color-p3: #f5d3cc;
    --color-g1: #f4f2f1;
    --color-g2: #c9c7c7;
    --color-g3: #8b8a8d;
    --color-g4: #474748;
    --color-g5: #e6e4e3;
    --color-g6: #383838;
    --color-a1: #fc6161;
    --color-a2: #ffe183;
    --color-a3: #40bfa3;
    --color-a4: #c00404;
    --color-a5: #206052;

    --color-back: var(--color-bg1);
    --color-text: var(--color-b5);
}




/*  ----------------------------------------------------
    Typography
    ----------------------------------------------------
*/    
@property --☠️-vp-delta {
	syntax: "<length>";
	initial-value: 0px;
	inherits: true;
}

@property --☠️-fs-delta {
	syntax: "<length>";
	initial-value: 0px;
	inherits: true;
}

*, *::before, *::after {
    /* ☠️ = private */

    /* default values */
    --fs-def: inherit;		 
    --fs-min: inherit;
    --fs-max: inherit;

    /* viewport and font size delta */
    --☠️-vp-delta: calc(var(--max-scale-bound) - var(--min-scale-bound));  
    --☠️-fs-delta: calc(var(--fs-max) - var(--fs-min));	

    /* numeric delta values */
    --☠️-vp-num:   tan(atan2(var(--☠️-vp-delta), 1px));
    --☠️-fs-num:   tan(atan2(var(--☠️-fs-delta), 1px));	

    /* mid range values (components) */
    --☠️-divisor:  calc(var(--☠️-vp-num) / var(--☠️-fs-num));
    --☠️-vw-mid:  calc(100vw / var(--☠️-divisor));          
    --☠️-fs-mid:  calc(var(--fs-min) - (var(--min-scale-bound) / var(--☠️-divisor)));

    /* clamp value */
    --☠️-fs-clamp: clamp(var(--fs-min), var(--☠️-vw-mid) + var(--☠️-fs-mid),  var(--fs-max));

    /* property value */
    font-size: var(--fs, var(--☠️-fs-clamp, var(--fs-def, var(--fs-min, var(--fs-max)))));	
    font-weight: var(--fw, 400);
    line-height: var(--lh, 1.35);
}


body {
    background-color: var(--color-back);
    background-color: var(--color-none);
    color: var(--color-text);
    font-family: "NordeaSansSmall", "Arial", "Helvetica Neue", "Helvetica", sans-serif;




}
:is(h1,h2,h3,h4,h5,h6) {
    font-family: "NordeaSansLarge", "Arial", "Helvetica Neue", "Helvetica", sans-serif;
    --fw: 700;
}

h2 {
    --fs-min: 1.4rem;
    --fs-max: 1.8rem;
}




body {
    _display: grid;
    _place-content: center;
    _pointer-events: none;

}


fieldset {
    margin: 0;
    padding: 0;
    min-inline-size: 0;
    border: 0;
    border-radius: 0;
    
    padding: 1rem;
    max-inline-size: 40rem;
    min-inline-size: auto;
    margin-inline-end: auto;
    _margin-block-start: 5.5rem;


    _display: grid;
    _gap: 1.5rem;
    _grid-template-columns: 2fr 1fr;

    :is(h1,h2,h3) { grid-column: 1 / -1}
}
fieldset.center {
    margin-inline: auto;
}

.input label {
    display: flex;
    gap: 0.5em;
    _justify-content: space-between;
    align-items: baseline;
    --fs-min: 1.2rem;
    --fs-max: 2rem;

    /* nordea h3  */
    --fs-min: 1.375rem;
    --fs-max: 1.625rem;
}
.input button {
    appearance: none;
    background: none;
    border: 0;
    border-radius: 0;
    margin: 0;
    padding: 0;
    line-height: 0;
    align-self: center;
    cursor: pointer;


}
.input output {
    margin-inline-start: auto;
    justify-self: flex-end;
}


dialog[popover] {
    overflow: visible;
    position: fixed; /* important */
    inset: auto;     /* reset default */

    left: var(--popover-x, 0px);
    top: var(--popover-y, 0px);

    transform: translate(-50%, calc(-100% - 8px)); /* center horizontally, place above */

    white-space: normal;
    background-color: var(--color-b4);
    color: var(--color-white);
    __inline-size: 24ch;
    max-inline-size: 32ch;
    inline-size: 100%;
    padding-inline: 1.5rem;
    border: 0;
    border-radius: .5rem;
    text-wrap: pretty;

    --fs-min: 0.85rem;
    --fs-max: 1rem;
    --lh: 1.3;
}

/* triangle */

dialog[popover]::before {
    content: '';
    position: absolute;
    left: 50%;
    left: calc(50% + var(--arrow-offset-x, 0px));
    bottom: -8px; /* sits outside the box */
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--color-b4); /* triangle color */
}




dialog button {
    position: absolute;
    inset-inline-end: .5em;
    inset-block-start: .5em;
    padding: .75rem;
    margin: 0;
    border: 0;
    border-radius: 0;
    svg {
        width:  .75rem;
        height: .75rem;
    }
}

dialog button::before {
    content: '';
    display: block;
    position: absolute;
    inset: -1rem;
    
}

.result {
    background-color: var(--color-bg1) ;
    padding: 1.5rem;
    border-radius: .5rem;
}
.result label {
    display: grid;
    display: flex;
    gap: .5em;
    justify-content: space-between;
    align-items: center;
    __align-items: baseline;

    output { 
        font-size: 125% ;
        text-align: end;
    }
}

label {
    --fs-min:  1rem;
    --fs-max:  1.5rem;
    --fw: 500;
    white-space: nowrap;
    output { font-size: 125% ;}
}

output {
    __min-inline-size: 5em;
    text-align: end;
}

/* ---------------------------------
    Range Slider
--------------------------------- */
input[type=range] {
    --thumb-width: 4rem;
    --thumb-height: 1.75rem;
    --track-height: 4px;
    
    inline-size: 100%;
    appearance: none;
    background: var(--color-none);
    _z-index: 1;

    block-size: calc(var(--thumb-height) * 2);
    margin-block-start: -0.5em;

    &::-webkit-slider-thumb {
        cursor: pointer;
        appearance: none;
        width: var(--thumb-width);
        height: var(--thumb-height);
        border: 0;
        color: transparent;
        border-radius: 4rem;
        background-color: var(--color-b5);
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 25 15'%3E%3Cpath fill='%23fff' stroke='%23fff' stroke-width='.28' d='M15.93.38a.7.7 0 0 1 1-.06l7.12 6.3c.32.3.32.8 0 1.08l-7.13 6.31a.7.7 0 0 1-1-.06.7.7 0 0 1 .07-1l6.53-5.79-6.53-5.77a.7.7 0 0 1-.06-1ZM8.5 13.95a.7.7 0 0 1-1 .06L.39 7.71a.72.72 0 0 1 0-1.08L7.5.32a.7.7 0 0 1 1 .06c.25.3.22.75-.07 1L1.91 7.18l6.53 5.77c.3.26.32.71.07 1Z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
        background-size: auto 40%;
        transform: translateY( calc((-50% + var(--track-height) / 2)) );
    }

    /* as above */
    &::-moz-range-thumb {
        cursor: pointer;
        appearance: none;
        width: var(--thumb-width);
        height: var(--thumb-height);
        border: 0;
        color: transparent;
        border-radius: 4rem;
        background-color: var(--color-b5);
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 25 15'%3E%3Cpath fill='%23fff' stroke='%23fff' stroke-width='.28' d='M15.93.38a.7.7 0 0 1 1-.06l7.12 6.3c.32.3.32.8 0 1.08l-7.13 6.31a.7.7 0 0 1-1-.06.7.7 0 0 1 .07-1l6.53-5.79-6.53-5.77a.7.7 0 0 1-.06-1ZM8.5 13.95a.7.7 0 0 1-1 .06L.39 7.71a.72.72 0 0 1 0-1.08L7.5.32a.7.7 0 0 1 1 .06c.25.3.22.75-.07 1L1.91 7.18l6.53 5.77c.3.26.32.71.07 1Z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
        background-size: auto 40%;
        /* not needed in firefox
        transform: translateY( calc((-50% + var(--track-height) / 2)) );
         */
    }


    &::-webkit-slider-runnable-track {
        background-color: var(--color-a3);
        border-radius: 100vmax;
        height: var(--track-height);
    }
    	
    &::-moz-range-track {
        background-color: var(--color-a3);
        border-radius: 100vmax;
        height: var(--track-height);
    }    
}



button, input {
    pointer-events: auto;
} 



.input p {
    margin-block-start: 0;
}