/* workoutparse.mofiyinebo.com: a notebook to paste into, and the parser's reading on index cards. */
:root {
    --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
    --marker: rgba(242, 200, 76, 0.55);
    --code-key: #7a4b6b;
    --code-type: #2b6e69;
    --code-string: #93522a;
    --code-comment: #9d9386;
}

:root[data-theme='dark'] {
    --marker: rgba(217, 165, 75, 0.38);
    --code-key: #be92b1;
    --code-type: #6db5ae;
    --code-string: #d58d59;
    --code-comment: #81786c;
}

.room {
    margin: 0 auto;
    max-width: 1160px;
    padding: 3.5rem 1.25rem calc(4rem + env(safe-area-inset-bottom));
}

/* Intro ------------------------------------------------------------------------------------ */
.intro {
    margin-bottom: 2.75rem;
    max-width: 680px;
}

.intro .kicker {
    margin-bottom: 0.65rem;
}

.title {
    font-size: clamp(2.3rem, 7.5vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.02;
}

.title span {
    color: var(--accent);
}

.lede {
    color: var(--muted);
    font-size: 1.05rem;
    margin-top: 1rem;
}

.intro-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.4rem;
    margin-top: 1.5rem;
}

.install {
    align-items: center;
    background: var(--primary);
    border: 0;
    border-radius: 6px;
    box-shadow: 0 10px 18px -12px rgba(var(--shadow), 0.7);
    color: var(--on-primary);
    cursor: pointer;
    display: inline-flex;
    font-family: var(--mono);
    font-size: 0.86rem;
    gap: 0.7rem;
    padding: 0.85rem 1rem 0.85rem 1.1rem;
}

.install-prompt {
    opacity: 0.55;
}

.install-copy {
    border-left: 1px solid rgba(255, 255, 255, 0.25);
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding-left: 0.7rem;
}

:root[data-theme='dark'] .install-copy {
    border-left-color: rgba(0, 0, 0, 0.2);
}

.text-link,
.use a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: var(--rule);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 4px;
}

.text-link:hover,
.use a:hover {
    text-decoration-color: var(--accent);
}

/* The bench: the pad on the left, the reading on the right -------------------------------- */
.bench {
    align-items: start;
    display: grid;
    gap: 2rem;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
}

/* A notebook page: ruled lines, a red margin, the paste written on the lines. */
.pad {
    background-color: rgb(var(--sheet));
    background-image: linear-gradient(rgba(var(--sheet), 0.86), rgba(var(--sheet), 0.86)), var(--texture);
    background-size: 100% 100%, 520px auto;
    border-radius: 3px;
    box-shadow: 0 1px 1px rgba(var(--shadow), 0.06), 0 22px 40px -24px rgba(var(--shadow), 0.5);
    padding: 1.25rem 1.25rem 1rem;
    position: sticky;
    top: 5.5rem;
}

:root[data-theme='dark'] .pad {
    box-shadow: 0 0 0 1px rgba(243, 234, 219, 0.06), 0 22px 40px -24px rgba(0, 0, 0, 0.7);
}

.pad-head {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.pad-label {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.examples {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.example {
    background: transparent;
    border: 1.5px solid var(--rule);
    border-radius: 999px;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.35rem 0.8rem;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.example:hover {
    border-color: var(--accent);
    color: var(--primary);
}

.example[aria-pressed='true'] {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--on-primary);
}

.pad-text {
    --line: 1.75rem;
    background:
        linear-gradient(90deg, transparent 2.6rem, var(--margin-line) 2.6rem, var(--margin-line) calc(2.6rem + 1.5px), transparent calc(2.6rem + 1.5px)),
        repeating-linear-gradient(transparent 0 calc(var(--line) - 1px), var(--ruled) calc(var(--line) - 1px) var(--line));
    background-attachment: local;
    border: 0;
    color: var(--ink);
    display: block;
    font-family: var(--mono);
    font-size: 0.86rem;
    line-height: var(--line);
    min-height: calc(var(--line) * 16);
    outline: none;
    padding: 0 0.5rem 0 3.2rem;
    resize: vertical;
    white-space: pre;
    width: 100%;
}

.pad-text::placeholder {
    color: var(--faint);
}

.pad-text:focus-visible {
    box-shadow: inset 0 0 0 2px var(--rule);
}

.options {
    border-top: 1px solid var(--rule);
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.76rem;
    font-weight: 600;
    gap: 0.6rem 1.2rem;
    margin-top: 0.9rem;
    padding-top: 0.85rem;
}

.options label {
    align-items: center;
    display: inline-flex;
    gap: 0.45rem;
}

.options select {
    background: transparent;
    border: 1.5px solid var(--rule);
    border-radius: 5px;
    color: var(--primary);
    font: inherit;
    font-weight: 700;
    padding: 0.2rem 0.35rem;
}

/* The reading ------------------------------------------------------------------------------ */
.readout-head {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.summary {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.views {
    border: 1.5px solid var(--rule);
    border-radius: 999px;
    display: inline-flex;
    flex: none;
    padding: 2px;
}

.view {
    background: transparent;
    border: 0;
    border-radius: 999px;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 0.3rem 0.85rem;
}

.view[aria-selected='true'] {
    background: var(--primary);
    color: var(--on-primary);
}

.sheets {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sheets[hidden],
.json[hidden],
.legend[hidden] {
    display: none;
}

/* A day: an index card with a heading, then a ruled line per exercise. */
.day {
    background-color: rgb(var(--sheet));
    background-image: linear-gradient(rgba(var(--sheet), 0.86), rgba(var(--sheet), 0.86)), var(--texture);
    background-size: 100% 100%, 520px auto;
    border-radius: 3px;
    box-shadow: 0 1px 1px rgba(var(--shadow), 0.06), 0 18px 34px -22px rgba(var(--shadow), 0.5);
    padding: 1.2rem 1.4rem 0.6rem;
    transform: rotate(var(--turn, 0deg));
}

:root[data-theme='dark'] .day {
    box-shadow: 0 0 0 1px rgba(243, 234, 219, 0.06), 0 18px 34px -22px rgba(0, 0, 0, 0.7);
}

.day-name {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    padding-bottom: 0.4rem;
    position: relative;
}

.day-name::after {
    background: var(--primary);
    bottom: 0;
    content: '';
    height: 3px;
    left: 0;
    position: absolute;
    width: 2.2rem;
}

.ex-list {
    list-style: none;
    margin-top: 0.35rem;
}

.ex {
    align-items: flex-start;
    border-bottom: 1px solid var(--ruled);
    display: flex;
    gap: 0.7rem;
    padding: 0.75rem 0;
}

.ex:last-child {
    border-bottom: 0;
}

/* Superset letter, inked like a rubber stamp. */
.ex-group {
    align-items: center;
    border: 2px solid var(--blue);
    border-radius: 50%;
    color: var(--blue);
    display: inline-flex;
    flex: none;
    font-size: 0.72rem;
    font-weight: 800;
    height: 1.55rem;
    justify-content: center;
    margin-top: 0.05rem;
    transform: rotate(-8deg);
    width: 1.55rem;
}

.ex-main {
    flex: 1;
    min-width: 0;
}

.ex-head {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 1rem;
    justify-content: space-between;
}

.ex-name {
    font-size: 0.98rem;
    font-weight: 700;
}

.ex-dose {
    font-size: 0.95rem;
    font-weight: 800;
    white-space: nowrap;
}

.ex-times {
    color: var(--faint);
    font-weight: 600;
}

.ex-meta {
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.8rem;
    font-weight: 600;
    gap: 0.15rem 0.9rem;
    margin-top: 0.2rem;
}

.ex-faint {
    color: var(--faint);
}

.ex-typed,
.ex-note {
    color: var(--faint);
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: 0.2rem;
}

.ex-note::before {
    content: 'note: ';
}

.ex-check {
    color: var(--red);
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.ex-check b {
    font-weight: 800;
}

/* The highlighter: streaky at the ends, sunk into the paper. */
mark.filled {
    background: linear-gradient(100deg, transparent 0.15em, var(--marker) 0.3em, var(--marker) calc(100% - 0.3em), transparent calc(100% - 0.12em));
    border-radius: 0.2em 0.35em 0.25em 0.3em;
    color: inherit;
    margin: 0 -0.15em;
    padding: 0 0.25em;
}

.aside {
    border: 1.5px dashed var(--rule);
    border-radius: 4px;
    color: var(--muted);
    font-size: 0.85rem;
    padding: 1rem 1.2rem;
}

.aside h4 {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.aside h4 + ul {
    margin: 0.35rem 0 0.9rem;
}

.aside ul {
    list-style: none;
}

.aside li + li {
    margin-top: 0.3rem;
}

.aside code {
    color: var(--ink);
    font-family: var(--mono);
    font-size: 0.8rem;
}

.empty {
    color: var(--faint);
    font-size: 0.9rem;
    padding: 2rem 0;
    text-align: center;
}

.legend {
    color: var(--faint);
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: 1.25rem;
}

/* JSON, on a code page */
.json {
    position: relative;
}

.json pre,
.code {
    background-color: rgb(var(--sheet));
    border-radius: 4px;
    box-shadow: inset 0 0 0 1px var(--rule);
    color: var(--ink);
    font-family: var(--mono);
    font-size: 0.78rem;
    line-height: 1.6;
    max-height: 640px;
    overflow: auto;
    padding: 1rem 1.2rem;
}

.json-copy {
    background: var(--primary);
    border: 0;
    border-radius: 4px;
    color: var(--on-primary);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.3rem 0.65rem;
    position: absolute;
    right: 0.75rem;
    top: 0.75rem;
}

/* In your app ------------------------------------------------------------------------------ */
.use {
    margin-top: 4.5rem;
    max-width: 720px;
}

.heading {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    padding-bottom: 0.55rem;
    position: relative;
}

.heading::after {
    background: var(--primary);
    bottom: 0;
    content: '';
    height: 3px;
    left: 0;
    position: absolute;
    width: 2.6rem;
}

.use-lede {
    color: var(--muted);
    margin: 1rem 0 1.25rem;
}

.code {
    max-height: none;
}

.tok-key {
    color: var(--code-key);
}

.tok-type {
    color: var(--code-type);
}

.tok-string {
    color: var(--code-string);
}

.tok-comment {
    color: var(--code-comment);
}

.use-foot {
    color: var(--faint);
    font-size: 0.85rem;
    margin-top: 1.25rem;
}

/* A little printed slip for "copied". */
.note {
    background: var(--primary);
    border-radius: 4px;
    bottom: calc(1.5rem + env(safe-area-inset-bottom));
    box-shadow: 0 12px 24px -12px rgba(var(--shadow), 0.7);
    color: var(--on-primary);
    font-size: 0.85rem;
    font-weight: 700;
    left: 50%;
    opacity: 0;
    padding: 0.7rem 1.1rem;
    pointer-events: none;
    position: fixed;
    transform: translate(-50%, 12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 20;
}

.note.is-shown {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (max-width: 880px) {
    .bench {
        grid-template-columns: minmax(0, 1fr);
    }

    .pad {
        position: static;
    }

    .pad-text {
        min-height: calc(var(--line) * 10);
    }
}

@media (max-width: 560px) {
    .room {
        padding-top: 2.25rem;
    }

    .install {
        font-size: 0.8rem;
    }

    .day {
        padding: 1.1rem 1.1rem 0.5rem;
    }
}
