/* Hero */

.hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 100svh;
    padding-top: var(--header-h);
    overflow: hidden;
}

.hero-portrait {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.hero-inner {
    position: relative;
    z-index: 1;
    padding-block: clamp(2rem, 6vh, 4rem);
    pointer-events: none;
}

.hero-inner a {
    pointer-events: auto;
}

/* "whoami" arrives as flickering red digits and settles letter by letter. */
.hero-word {
    margin-top: 0.75rem;
    font-family: var(--mono);
    font-size: clamp(3.4rem, 9.6vw, 8.6rem);
    line-height: 1;
    letter-spacing: -0.02em;
    white-space: nowrap;
    user-select: none;
}

.hero-word .caret {
    color: var(--accent);
    animation: blink 1.1s steps(1) infinite;
}

.hero-word .ch {
    color: var(--accent);
}

.hero-word .ch.is-locked {
    color: var(--paper);
}

/* Hidden until terminal.js starts decoding; if that script never runs, it appears on its own. */
.js .hero-word .g {
    visibility: hidden;
    animation: show-text 0s 2.5s forwards;
}

.js .hero-word.is-typing .g {
    visibility: visible;
    animation: none;
}

@keyframes show-text {
    to {
        visibility: visible;
    }
}

.hero-out {
    max-width: 33rem;
    margin-top: clamp(1.25rem, 3.5vh, 2.25rem);
}

.js .hero-out {
    opacity: 0;
    animation: rise 0.9s var(--ease-out) 1.6s forwards;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.hero-name {
    font-family: var(--font-intro);
    font-weight: 700;
    font-size: clamp(2rem, 3.4vw, 3rem);
    line-height: 1.05;
    letter-spacing: -0.035em;
}

.hero-lede {
    margin-top: 0.7rem;
    font-family: var(--font-intro);
    font-size: clamp(1.05rem, 1.4vw, 1.25rem);
    line-height: 1.5;
    color: var(--fog);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.75rem;
}

/* decoder.exe: switch how the portrait is written, and read what the lens decodes. */
.decoder {
    position: absolute;
    right: var(--gutter);
    bottom: 22px;
    z-index: 2;
    width: 21rem;
}

.encoding {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    padding: 8px 10px 10px;
    border: 0;
    box-shadow: inset 1px 1px var(--stone), inset -1px -1px var(--face-hi), inset 2px 2px var(--face-hi), inset -2px -2px var(--stone);
}

.encoding legend {
    float: left;
    margin-right: 4px;
    padding: 0;
}

.encoding label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.encoding input {
    appearance: none;
    display: grid;
    place-items: center;
    width: 13px;
    height: 13px;
    margin: 0;
    border-radius: 50%;
    background: var(--face-hi);
    box-shadow: var(--sunken);
    cursor: pointer;
}

.encoding input:checked::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--ink);
}

.encoding input:focus-visible {
    outline: 1px dotted var(--ink);
    outline-offset: 2px;
}

/* Arabixel Basic is drawn on an 11px grid, so its digits sit at twice that. */
.encoding [lang="ar"] {
    font: 22px / 1 var(--font-ar);
}

.decoder-read {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding: 6px 8px;
    background: var(--ink);
    color: var(--fog);
    white-space: nowrap;
    overflow: hidden;
}

.decoder-read output {
    font-family: var(--mono);
    font-size: var(--mono-s);
    line-height: var(--ui-size);
    color: var(--teal);
    text-transform: uppercase;
}

@media (max-width: 899px) {
    .hero {
        display: block;
    }

    /* The canvas covers only the portrait's band, so the text below can grow freely. */
    .hero-portrait {
        bottom: auto;
        height: calc(var(--portrait-h, min(50svh, 117vw)) + 110px);
    }

    .hero-inner {
        padding-top: calc(var(--portrait-h, min(50svh, 117vw)) + 22px);
        padding-bottom: 1rem;
    }

    .hero-word {
        font-size: clamp(3rem, 17vw, 6.6rem);
    }

    .decoder {
        position: relative;
        right: auto;
        bottom: auto;
        width: auto;
        margin: 0 var(--gutter) 1.25rem;
    }
}

/* About */

.about-grid {
    display: grid;
    gap: 2.5rem;
    margin-top: 1.5rem;
}

.about-bio {
    max-width: 30ch;
    font-size: clamp(1.6rem, 3.2vw, 2.8rem);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.025em;
    text-wrap: pretty;
}

/* facts.txt opens in Notepad. */
.notepad .well {
    margin-top: 3px;
    padding: 4px 14px;
}

.facts div {
    padding-block: 10px;
    border-bottom: 1px dashed rgba(18, 18, 18, 0.25);
}

.facts div:last-child {
    border-bottom: 0;
}

.facts dt {
    color: var(--stone-ink);
}

.facts dd {
    margin-top: 2px;
    font-size: var(--ui-size);
}

@media (min-width: 960px) {
    .about-grid {
        grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
        align-items: end;
        gap: 4rem;
    }
}

/* Awards */

.awards {
    margin-top: clamp(4.5rem, 9vw, 7rem);
}

.award-list {
    margin-top: 1.5rem;
    border-top: 1px solid var(--line);
}

.award {
    display: grid;
    gap: 1.5rem 3.5rem;
    align-items: center;
    padding-block: clamp(2rem, 4vw, 3rem);
    border-bottom: 1px solid var(--line);
}

.award .pix-wrap {
    max-width: 34rem;
}

.award-where {
    font: var(--ui-size) / 1.3 var(--ui);
    color: var(--fog);
}

.award-title {
    margin-top: 0.5rem;
    font-weight: 600;
    font-size: clamp(1.9rem, 3.6vw, 3.1rem);
    line-height: 1.05;
    letter-spacing: -0.035em;
}

.award-title .tag {
    vertical-align: 0.35em;
}

.award-note {
    max-width: 46ch;
    margin-top: 0.8rem;
    color: var(--fog);
}

.award-more {
    display: grid;
    gap: 0.4rem;
    margin-top: 1.75rem;
    font: var(--ui-size) / 1.4 var(--ui);
    color: var(--fog);
}

.award-more li::before {
    content: "+ ";
    color: var(--accent);
}

@media (min-width: 860px) {
    .award {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    }
}

/* What I build: four elements, each a tile from the periodic table of the work */

.build {
    background: var(--face);
    color: var(--ink);
}

.build-head {
    display: grid;
    gap: 1.25rem;
    margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.build-head p {
    max-width: 46ch;
    color: var(--stone-ink);
}

.cards {
    display: grid;
    gap: 14px;
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 31rem;
    padding: 18px 18px 16px;
    background: var(--paper);
    box-shadow: var(--raised);
    font: var(--ui-size) / 1.375 var(--ui);
}

.card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    min-height: 124px;
}

.element {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto 1fr auto;
    width: 118px;
    height: 118px;
    padding: 6px 8px 7px;
    border: 2px solid var(--ink);
    background: var(--tile, var(--paper));
    color: var(--tile-ink, var(--ink));
}

.el-num,
.el-mass {
    font-weight: 700;
}

.el-mass {
    text-align: right;
}

.el-sym {
    grid-column: 1 / -1;
    align-self: center;
    font-family: var(--font);
    font-weight: 800;
    font-size: 3.4rem;
    line-height: 1;
    letter-spacing: -0.04em;
}

.el-name {
    grid-column: 1 / -1;
    font: 700 var(--ui-size) / 1 var(--ui);
}

.el-accent { --tile: var(--accent); }
.el-violet { --tile: var(--field-violet); --tile-ink: var(--paper); }
.el-teal { --tile: var(--teal); }
.el-ink { --tile: var(--ink); --tile-ink: var(--paper); }

.card .sticker {
    margin: 2px 2px 0 0;
}

.card-kind {
    font-weight: 700;
}

.card-spec {
    display: grid;
    gap: 0.75rem;
}

.card-spec dt {
    color: var(--stone-ink);
}

.card-spec dd {
    font-family: var(--font);
    font-weight: 600;
    font-size: 1.05rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.card-viz {
    margin-top: auto;
    padding-top: 0.75rem;
}

.card-tools {
    padding-top: 0.6rem;
    border-top: 2px solid var(--ink);
    color: var(--stone-ink);
}

@media (min-width: 700px) {
    .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1240px) {
    .cards {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .build-head {
        grid-template-columns: 1fr minmax(0, 26rem);
        align-items: end;
    }
}
