:root {
    --paper: #dcdfd9;
    --body: #eceeea;
    --graphite: #2a2c2e;
    --graphite-hi: #3a3d40;
    --key: #cfd2cb;
    --key-edge: #b9bdb5;
    --ink: #1c1d1f;
    --ink-soft: #595d5f;
    --lcd: #c6cdbd;
    --lcd-ink: #232622;
    --amber: #e0a526;
    --amber-edge: #b98414;
    --error: #8c3b22;
    --sans: "Schibsted Grotesk", "Helvetica Neue", Helvetica, sans-serif;
    --mono: "Spline Sans Mono", ui-monospace, Menlo, monospace;
    --r-sm: 6px;
    --r-md: 14px;
    --r-lg: 22px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--sans);
    color: var(--ink);
    background:
        radial-gradient(1200px 600px at 85% -10%, rgba(255, 255, 255, .55), transparent 60%),
        repeating-linear-gradient(90deg, rgba(0, 0, 0, .018) 0 1px, transparent 1px 3px),
        var(--paper);
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
}

.shell {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 24px 64px;
}


/* navbar */

.top {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 0 20px;
    gap: 10px;
}

.tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: rgba(0, 0, 0, .07);
    border-radius: 999px;
}

.tabs a {
    padding: 8px 18px;
    border-radius: 999px;
    font-size: .92rem;
    font-weight: 500;
    color: var(--ink-soft);
    transition: background .2s, color .2s;
}

.tabs a:hover {
    color: var(--ink);
}

.tabs a[aria-current="page"] {
    background: var(--body);
    color: var(--ink);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
}


/* homepge */

.hero {
    padding: 56px 0 44px;
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
}

.hero h1 {
    margin: 0 0 20px;
    font-size: clamp(2.4rem, 6vw, 4rem);
    line-height: 1.02;
    letter-spacing: -.035em;
    font-weight: 700;
}

.stack {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.stack li {
    font-family: var(--mono);
    font-size: .88rem;
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--body);
    color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--key-edge), 0 1px 0 rgba(255, 255, 255, .7);
}

.choices {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 20px;
}

.choice {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
    padding: 28px;
    border-radius: var(--r-lg);
    min-height: 280px;
    transition: transform .2s ease;
}

.choice:hover {
    transform: translateY(-3px);
}

.choice h2 {
    margin: 0 0 6px;
    font-size: 1.5rem;
    letter-spacing: -.02em;
}

.choice p {
    margin: 0;
    font-size: .98rem;
    line-height: 1.5;
    max-width: 32ch;
}

.choice .go {
    font-weight: 600;
    font-size: .95rem;
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.choice .go::after {
    content: "";
    width: 18px;
    height: 2px;
    background: currentColor;
    transition: width .2s;
}

.choice:hover .go::after {
    width: 30px;
}

.choice.age {
    background: var(--body);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
}

.choice.age p {
    color: var(--ink-soft);
}

.peek-age {
    font-family: var(--mono);
    font-size: 2.6rem;
    letter-spacing: -.04em;
    line-height: 1;
    margin-bottom: 18px;
}

.peek-age small {
    font-size: .9rem;
    color: var(--ink-soft);
    letter-spacing: 0;
    margin: 0 14px 0 4px;
}

.choice.sci {
    background: var(--graphite);
    color: #f1f2ee;
}

.choice.sci p {
    color: #a9aca7;
}

.peek-keys {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    max-width: 280px;
    margin-bottom: 18px;
}

.peek-keys span {
    height: 22px;
    border-radius: 5px;
    background: var(--graphite-hi);
}

.peek-keys span:last-child {
    background: var(--amber);
}



/* same components ovr 3 pages */

.page-head {
    padding: 32px 0 24px;
}

.page-head h1 {
    margin: 0 0 6px;
    font-size: 2rem;
    letter-spacing: -.03em;
}

.page-head p {
    margin: 0;
    color: var(--ink-soft);
}

.device {
    background: var(--body);
    border-radius: 28px;
    padding: 22px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .8) inset,
        0 0 0 1px rgba(0, 0, 0, .07),
        0 24px 48px -24px rgba(30, 34, 30, .35);
}


/* age clac */

.age-title {
    text-align: center;
}

.age-device {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 22px;
    max-width: 880px;
    margin: 15px auto 0;
}

.fields {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 8px 6px;
}

.field label {
    display: block;
    font-size: .88rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.field input {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    border-radius: var(--r-md);
    border: 1px solid var(--key-edge);
    background: #f7f8f5;
    font-family: var(--mono);
    font-size: 1rem;
}

.field input:focus-visible {
    outline-offset: 1px;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    border: 0;
    border-radius: var(--r-md);
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    background: var(--graphite);
    color: #f4f4f0;
    transition: background .15s, transform .08s;
}

.btn:hover {
    background: var(--graphite-hi);
}

.btn:active {
    transform: translateY(1px);
}

.btn.quiet {
    background: transparent;
    color: var(--ink-soft);
    box-shadow: inset 0 0 0 1px var(--key-edge);
    padding: 0 20px;
}

.btn.quiet:hover {
    background: rgba(0, 0, 0, .05);
}

.btn-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-top: 4px;
}

.readout {
    background: var(--lcd);
    color: var(--lcd-ink);
    border-radius: var(--r-md);
    padding: 24px;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, .18);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    min-height: 200px;
}

.readout .label {
    font-size: .85rem;
    opacity: .7;
    margin: 0 0 6px;
}

.big-age {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
    font-family: var(--mono);
}

.big-age div {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.big-age b {
    font-weight: 500;
    font-size: clamp(2.4rem, 5vw, 3.4rem);
    letter-spacing: -.05em;
    line-height: 1;
}

.big-age span {
    font-size: .95rem;
    opacity: .7;
}

.big-age.empty {
    opacity: .35;
}

.error {
    margin: 0;
    font-size: 1rem;
    color: var(--error);
    font-weight: 500;
}



/* sci calc */

.calc-title {
    text-align: center;
}

[hidden] {
    display: none !important;
}

.sci-layout {
    display: grid;
    grid-template-columns: minmax(0, 500px) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
    margin: 15px auto 0;
}

.side {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.screen {
    background: var(--lcd);
    color: var(--lcd-ink);
    border-radius: var(--r-md);
    padding: 14px 20px 18px;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, .18);
    margin-bottom: 20px;
    font-family: var(--mono);
}

.screen:focus-within {
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, .18), 0 0 0 2px var(--ink);
}

.screen .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .75rem;
    min-height: 26px;
}

.mode {
    border: 0;
    border-radius: 999px;
    padding: 3px 12px;
    background: rgba(35, 38, 34, .12);
    color: inherit;
    font-family: var(--mono);
    font-size: .75rem;
    cursor: pointer;
}

.mode:hover {
    background: rgba(35, 38, 34, .22);
}

#memflag {
    opacity: .7;
}

.screen .expr {
    width: 100%;
    margin-top: 8px;
    padding: 4px 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: inherit;
    text-align: right;
    font-family: var(--mono);
    font-size: 1.05rem;
}

.screen .expr::placeholder {
    color: rgba(35, 38, 34, .45);
}

.screen .result {
    text-align: right;
    font-size: clamp(2.2rem, 8vw, 3rem);
    letter-spacing: -.05em;
    line-height: 1.15;
    overflow: hidden;
    white-space: nowrap;
}

.screen .result.err {
    font-family: var(--sans);
    font-size: 1rem;
    letter-spacing: 0;
    line-height: 1.4;
    white-space: normal;
    padding: 10px 0 4px;
    color: var(--error);
}

.keys {
    display: grid;
    gap: 10px;
}

.keys.mem {
    grid-template-columns: repeat(5, 1fr);
    margin-bottom: 10px;
}

.keys.fns {
    grid-template-columns: repeat(5, 1fr);
    margin-bottom: 18px;
}

.keys.pad {
    grid-template-columns: repeat(4, 1fr);
}

.key {
    height: 54px;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 500;
    background: var(--key);
    color: var(--ink);
    box-shadow: 0 2px 0 var(--key-edge), 0 0 0 1px rgba(0, 0, 0, .05) inset;
    transition: transform .06s, box-shadow .06s, background .15s;
}

.key:hover {
    background: #d8dbd4;
}

.key:active {
    transform: translateY(2px);
    box-shadow: 0 0 0 var(--key-edge);
}

.key.fn {
    background: transparent;
    box-shadow: inset 0 0 0 1px var(--key-edge);
    font-size: .92rem;
    color: var(--ink-soft);
}

.key.fn:hover {
    background: rgba(0, 0, 0, .05);
}

.key.small {
    height: 40px;
    font-size: .82rem;
}

select.key {
    appearance: none;
    -webkit-appearance: none;
    padding: 0 4px;
    text-align: center;
    text-align-last: center;
}

.key.num {
    background: var(--graphite);
    color: #f4f4f0;
    box-shadow: 0 2px 0 #121314;
}

.key.num:hover {
    background: var(--graphite-hi);
}

.key.num:active {
    box-shadow: 0 0 0 #121314;
}

.key.op {
    background: #bfc3bb;
    box-shadow: 0 2px 0 #a2a69e;
}

.key.op:hover {
    background: #c8ccc4;
}

.key.clear {
    background: #c9b9a8;
    box-shadow: 0 2px 0 #ab9a88;
}

.key.eq {
    background: var(--amber);
    box-shadow: 0 2px 0 var(--amber-edge);
    color: #1c1608;
    font-weight: 600;
}

.key.eq:hover {
    background: #e8b13a;
}

.key.eq:active {
    box-shadow: 0 0 0 var(--amber-edge);
}

/* tools panel */
.tools {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.tool-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.field select,
.field textarea {
    width: 100%;
    padding: 0 16px;
    border-radius: var(--r-md);
    border: 1px solid var(--key-edge);
    background: #f7f8f5;
    font-size: 1rem;
}

.field select {
    height: 52px;
}

.field textarea {
    padding: 14px 16px;
    font-family: var(--mono);
    resize: vertical;
}

.pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.tool-out {
    background: var(--lcd);
    color: var(--lcd-ink);
    border-radius: var(--r-md);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, .18);
    overflow: hidden;
}

.tool-out:empty {
    display: none;
}

.tool-out div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 16px;
    font-family: var(--mono);
    font-size: .92rem;
}

.tool-out div+div {
    border-top: 1px solid rgba(35, 38, 34, .15);
}

.tool-out.err {
    padding: 12px 16px;
    color: var(--error);
    font-weight: 500;
}

/* history */
.history-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
}

.history h2 {
    margin: 0;
    font-size: 1rem;
    letter-spacing: -.01em;
}

.link-btn {
    border: 0;
    background: none;
    padding: 0;
    color: var(--ink-soft);
    font-size: .85rem;
    text-decoration: underline;
    cursor: pointer;
}

.history ol {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 220px;
    overflow: auto;
}

.history li button {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    text-align: left;
    font-family: var(--mono);
    font-size: .88rem;
    cursor: pointer;
}

.history li button:hover {
    background: rgba(0, 0, 0, .06);
}

.history-empty {
    margin: 0;
    font-size: .9rem;
    color: var(--ink-soft);
}

/* footer */


.site-foot {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 40px;
    margin-top: 72px;
    padding: 36px;
}


.foot-links {
    display: flex;
    flex-wrap: wrap;
    gap: 24px 56px;
}

.foot-col h3,
.foot-people h3,
.foot-code h3 {
    margin: 0 0 12px;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.foot-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 9px;
}

.foot-col a {
    font-size: .95rem;
}

.foot-col a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.foot-people {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-self: start;
}

.foot-code {
    max-width: 460px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--key-edge);
}

.foot-code-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

.foot-code-head h3 {
    margin: 0;
}

.foot-code-head span {
    font-size: .78rem;
    color: var(--ink-soft);
}

.lang-bar {
    display: flex;
    gap: 3px;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
}

.lang-bar span {
    display: block;
    min-width: 4px;
}

.lang-legend {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin: 14px 0 0;
    padding: 0;
    font-size: .88rem;
}

.lang-legend i {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 7px;
    border-radius: 50%;
}

.lang-legend b {
    margin-left: 2px;
    font-family: var(--mono);
    font-size: .8rem;
    font-weight: 500;
    color: var(--ink-soft);
}

.foot-code .deps-title {
    margin: 22px 0 10px;
}

.foot-code .stack {
    justify-content: flex-start;
    gap: 8px;
}

.foot-code .stack li {
    padding: 6px 12px;
    font-size: .82rem;
}

.stack li small {
    margin-left: 6px;
    font-size: .9em;
    color: var(--ink-soft);
}

.person {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: var(--r-md);
    box-shadow: inset 0 0 0 1px var(--key-edge);
    transition: transform .2s, background .2s;
}

.person:hover {
    transform: translateY(-2px);
    background: rgba(128, 128, 128, .09);
}

.person img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--key);
    flex: none;
}

.person b {
    display: block;
    font-size: .98rem;
}

.person small {
    font-family: var(--mono);
    font-size: .75rem;
    color: var(--ink-soft);
}





@media (max-width: 760px) {
    .shell {
        padding: 0 16px 48px;
    }

    .tabs {
        width: 100%;
    }

    .tabs a {
        flex: 1;
        text-align: center;
        padding: 9px 8px;
    }

    .hero {
        padding: 32px 0 28px;
    }

    .choices,
    .age-device {
        grid-template-columns: 1fr;
    }

    .choice {
        min-height: 220px;
        gap: 28px;
    }

    .device {
        padding: 16px;
        border-radius: 22px;
    }

    .keys {
        gap: 8px;
    }

    .key {
        height: 50px;
    }

    .sci-layout {
        grid-template-columns: 1fr;
    }

    .site-foot {
        grid-template-columns: 1fr;
        gap: 28px;
        padding: 24px;
        margin-top: 48px;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        transition: none !important;
    }

    html {
        scroll-behavior: auto;
    }
}