/* Editorial field. Tokens measured from a public reference, drawn here as original CSS. */

:root {
    --paper: #faf8f2;
    --ink: #22251e;
    --ink-2: #4c5243;
    --ink-3: #6a7060;
    --line: #ddd9cb;
    --line-soft: #eae7dc;
    --red: #b8431f;
    --night: 0;
    --serif: "Fraunces", Georgia, "Times New Roman", serif;
    --sans: "Geist", ui-sans-serif, system-ui, sans-serif;
    --mono: ui-monospace, "SF Mono", "Cascadia Code", monospace;
    --gutter: clamp(1.5rem, 4.5vw, 4rem);
    --mast-pad: clamp(1.1rem, 2.4vw, 1.9rem);
    color-scheme: light;
}

html.dark {
    --paper: #14181c;
    --ink: #eceae2;
    --ink-2: #b9bcb2;
    --ink-3: #8b9188;
    --line: #2e343a;
    --line-soft: #23282d;
    --red: #ef7a52;
    --night: 1;
    color-scheme: dark;
}

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

html {
    font-size: 16px;
}

body {
    margin: 0;
    min-height: 100dvh;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-weight: 400;
    line-height: 1.6;
    text-rendering: optimizeLegibility;
}

.skip {
    position: absolute;
    left: var(--gutter);
    top: 0.75rem;
    z-index: 5;
    transform: translateY(-160%);
    background: var(--ink);
    color: var(--paper);
    padding: 0.4rem 0.7rem;
    border-radius: 0.375rem;
    text-decoration: none;
}

.skip:focus {
    transform: none;
}

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

a {
    color: inherit;
}

/* Mast */

.mast {
    position: fixed;
    z-index: 3;
    inset-inline: 0;
    inset-block-start: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: var(--mast-pad) var(--gutter);
    pointer-events: none;
}

.mast a,
.mast button {
    pointer-events: auto;
}

.mark {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    color: var(--ink);
    text-decoration: none;
}

.mark__glyph {
    width: 1.35rem;
    height: 1.35rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mast__end {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.mast__pages,
.elsewhere {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.mast__pages a {
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    padding: 0.45rem 0.55rem;
    border-radius: 0.375rem;
}

.mast__pages a:hover,
.mast__pages a[aria-current="page"] {
    background: color-mix(in srgb, var(--ink) 8%, transparent);
}

.icon-button {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 0.375rem;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    text-decoration: none;
}

.icon-button svg {
    width: 0.95rem;
    height: 0.95rem;
}

.icon-button:hover {
    background: color-mix(in srgb, var(--ink) 6%, transparent);
}

[data-theme-toggle] .moon {
    display: none;
}

html.dark [data-theme-toggle] .sun {
    display: none;
}

html.dark [data-theme-toggle] .moon {
    display: block;
}

/* Home clearing */

.sky,
.stage,
.track {
    display: none;
}

body.is-home {
    overflow: hidden;
}

body.is-home .sky {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, #ffffff 0%, transparent 60%),
        linear-gradient(180deg, #e4edf1 0%, #f3f1ea 38%, #faf8f2 68%);
}

html.dark body.is-home .sky {
    background:
        radial-gradient(ellipse 70% 40% at 50% 0%, #243038 0%, transparent 62%),
        linear-gradient(180deg, #1a2026 0%, #14181c 58%, #101418 100%);
}

body.is-home .stage {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: grab;
}

body.is-turning,
body.is-turning .stage {
    cursor: grabbing;
}

body.is-home .track {
    display: grid;
    position: fixed;
    z-index: 4;
    left: 50%;
    bottom: 1.15rem;
    transform: translateX(-50%);
    width: min(34rem, calc(100% - 2 * var(--gutter)));
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.2rem 0.75rem;
    padding: 0.45rem 0.85rem 0.55rem;
    border-radius: 0.85rem;
    background: color-mix(in srgb, var(--paper) 82%, transparent);
    color: var(--ink-3);
    font-size: 0.75rem;
    pointer-events: none;
}

.track__bar {
    grid-column: 1 / -1;
    position: relative;
    height: 1.35rem;
    pointer-events: auto;
    cursor: ew-resize;
}

.track__bar::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: color-mix(in srgb, var(--ink) 28%, transparent);
}

.track__mark {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: var(--red);
    transform: translate(-50%, -50%);
}

.track__name {
    grid-column: 1 / -1;
    margin: 0.15rem 0 0;
    text-align: center;
    color: var(--ink-2);
    font-family: var(--serif);
    font-size: 1rem;
    letter-spacing: -0.02em;
}

.track__hint,
.track__keys {
    margin: 0;
}

.track__keys {
    display: flex;
    gap: 0.35rem;
}

.track__keys .icon-button,
.track__bar {
    pointer-events: auto;
}

.hero,
.hero__go {
    pointer-events: none;
}

.hero a,
.hero button,
.hero__word {
    pointer-events: auto;
}

.hero {
    position: relative;
    z-index: 2;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 22vh var(--gutter) 38vh;
}

.hero__word {
    margin: 0;
    max-width: none;
    position: relative;
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(1.7rem, 6.2vw, 4.8rem);
    letter-spacing: -0.028em;
    line-height: 1;
    white-space: nowrap;
    cursor: default;
}

.hero__row,
.word {
    white-space: nowrap;
}

.hero__row {
    display: inline;
}

.hero__word .ch {
    font-kerning: none;
    font-variant-ligatures: none;
}

.hero__word .no {
    color: var(--red);
    font-style: italic;
    font-weight: 400;
    font-size: 0.62em;
}

.hero__word .ch.is-on {
    animation: letter-in 0.34s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes letter-in {
    from {
        opacity: 0;
        transform: translateY(0.22em);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.caret {
    position: absolute;
    left: 0;
    top: 0;
    width: 2px;
    height: 0.82em;
    background: var(--red);
    opacity: 0;
    pointer-events: none;
}

.caret--on {
    opacity: 1;
    animation: caret 0.88s step-end infinite;
}

@keyframes caret {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .caret,
    .hero__word .ch.is-on {
        animation: none;
    }
}

.hero__blurb {
    max-width: 26rem;
    margin: 1.4rem 0 0;
    color: var(--ink-2);
    font-size: clamp(0.95rem, 1.05vw, 1.0625rem);
    line-height: 1.6;
    text-wrap: pretty;
}

.hero__go {
    margin-top: 1.25rem;
}

.seam {
    display: inline-flex;
    align-items: center;
    gap: 1.35rem;
    padding: 0.72rem 0.9rem 0.72rem 1.05rem;
    border-radius: 0.45rem;
    background: var(--ink);
    color: var(--paper);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.seam:hover {
    background: color-mix(in srgb, var(--ink) 88%, var(--paper));
}

.seam__icon {
    display: grid;
    place-items: center;
    width: 1.4rem;
}

/* Interior pages */

.page {
    width: min(46rem, 100%);
    margin-inline: auto;
    padding: calc(var(--mast-pad) * 2 + 4.5rem) 0 5rem;
}

@media (max-width: 860px) {
    .page {
        padding-inline: var(--gutter);
    }
}

.page--prose {
    width: min(40rem, 100%);
}

.kicker {
    margin: 0 0 0.85rem;
    color: var(--ink-3);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.page h1,
.lost h1 {
    margin: 0;
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2.25rem, 6vw, 3.5rem);
    letter-spacing: -0.02em;
    line-height: 1.05;
    text-wrap: balance;
}

.page__count,
.lede {
    margin: 1.15rem 0 0;
    color: var(--ink-2);
    font-size: 1.0625rem;
    line-height: 1.55;
}

.year {
    display: grid;
    grid-template-columns: 7.5rem minmax(0, 1fr);
    gap: 1.5rem 2rem;
    margin-top: 3.25rem;
}

.year__label {
    margin: 0.15rem 0 0;
    font-family: var(--serif);
    font-weight: 400;
    font-size: 1.75rem;
    letter-spacing: -0.03em;
    line-height: 1;
}

.year__count {
    margin: 0.35rem 0 0;
    color: var(--ink-3);
    font-size: 0.8125rem;
}

.entries {
    list-style: none;
    margin: 0;
    padding: 0;
}

.entry {
    display: block;
    padding: 1.15rem 0 1.2rem;
    border-top: 1px solid var(--line-soft);
    text-decoration: none;
}

.entries li:last-child .entry {
    border-bottom: 1px solid var(--line-soft);
}

.entry__title {
    display: block;
    font-size: 1.02rem;
    font-weight: 500;
    letter-spacing: -0.015em;
    line-height: 1.35;
}

.entry:hover .entry__title {
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.entry__lede {
    display: block;
    margin-top: 0.35rem;
    color: var(--ink-2);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.entry__meta {
    display: block;
    margin-top: 0.55rem;
    color: var(--ink-3);
    font-size: 0.8125rem;
}

.empty {
    margin-top: 2rem;
    color: var(--ink-3);
}

/* Article */

.post-kicker {
    margin-bottom: 1.25rem;
}

.post-title {
    font-size: clamp(2.4rem, 6vw, 4rem);
}

.post-meta {
    margin: 1.35rem 0 0;
    color: var(--ink-3);
    font-size: 0.875rem;
}

.post-content {
    margin-top: 2.75rem;
    font-size: 1.0625rem;
    line-height: 1.7;
}

.post-content > *:first-child {
    margin-top: 0;
}

.post-content h2,
.post-content h3,
.post-content h4 {
    font-family: var(--serif);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin: 2.2rem 0 0.7rem;
}

.post-content h2 {
    font-size: 1.7rem;
}

.post-content h3 {
    font-size: 1.3rem;
}

.post-content p,
.post-content ul,
.post-content ol,
.post-content blockquote,
.post-content pre,
.post-content table {
    margin: 0.9rem 0;
}

.post-content a {
    color: inherit;
    text-underline-offset: 0.16em;
}

.post-content blockquote {
    margin-left: 0;
    padding-left: 1rem;
    border-left: 2px solid var(--line);
    color: var(--ink-2);
}

.post-content code {
    font-family: var(--mono);
    font-size: 0.88em;
}

.post-content :not(pre) > code {
    padding: 0.1em 0.3em;
    border-radius: 0.25rem;
    background: color-mix(in srgb, var(--ink) 7%, transparent);
}

.post-content pre {
    padding: 1rem 1.1rem;
    overflow: auto;
    border-radius: 0.5rem;
    background: #1c211c;
    color: #eceae2;
}

.post-content pre code {
    background: transparent;
    color: inherit;
}

.post-content img {
    max-width: 100%;
    height: auto;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.post-content th,
.post-content td {
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.post-back {
    display: inline-block;
    margin-top: 3rem;
    color: var(--ink-2);
    font-size: 0.875rem;
    text-underline-offset: 0.18em;
}

/* Projects and about */

.stack {
    display: flex;
    flex-direction: column;
}

.work {
    display: block;
    padding: 1.25rem 0;
    border-top: 1px solid var(--line-soft);
    text-decoration: none;
}

.stack .work:last-child {
    border-bottom: 1px solid var(--line-soft);
}

.work__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: -0.015em;
}

.work:hover .work__title {
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.work__text {
    margin: 0.4rem 0 0;
    color: var(--ink-2);
    font-size: 0.95rem;
}

.work__tags {
    margin: 0.55rem 0 0;
    color: var(--ink-3);
    font-size: 0.8125rem;
}

.about-copy p {
    margin: 0 0 1rem;
    color: var(--ink-2);
    font-size: 1.05rem;
    line-height: 1.7;
}

.skills {
    margin-top: 2.5rem;
    padding-top: 0.25rem;
}

.skills h2 {
    margin: 0 0 1rem;
    font-family: var(--serif);
    font-weight: 500;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

.skill-row {
    display: grid;
    grid-template-columns: 9.5rem minmax(0, 1fr);
    gap: 1rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--line-soft);
    font-size: 0.9375rem;
}

.skill-row dt {
    margin: 0;
    color: var(--ink-3);
}

.skill-row dd {
    margin: 0;
}

/* Forms */

.composer {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    margin-top: 2rem;
}

.composer label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.8125rem;
    color: var(--ink-3);
}

.composer input,
.composer textarea {
    width: 100%;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 0.375rem;
    background: transparent;
    color: var(--ink);
    font: inherit;
}

.composer textarea {
    min-height: 16rem;
    resize: vertical;
}

.composer__actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.button,
button.seam {
    font: inherit;
    cursor: pointer;
    border: 0;
}

.ghost {
    color: var(--ink-2);
    font-size: 0.875rem;
}

.lost {
    min-height: 100dvh;
    display: grid;
    align-content: center;
    width: min(36rem, 100%);
    margin-inline: auto;
    padding: 6rem 0;
}

.lost p {
    color: var(--ink-2);
}

@media (max-width: 720px) {
    .mast__pages a {
        padding-inline: 0.35rem;
    }

    .hero {
        padding-top: 18vh;
    }

    .year,
    .skill-row {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .year__label {
        font-size: 1.35rem;
    }
}

@media (max-width: 520px) {
    .mast {
        align-items: flex-start;
    }

    .mast__end {
        flex-wrap: wrap;
        justify-content: flex-end;
        max-width: calc(100% - 2.5rem);
    }
}
