:root {
    color-scheme: dark;
    --background: #000;
    --text: #eceff1;
    --muted: #74808b;
    --tweet: #0b1015;
    --tweet-line: #242d35;
    --tweet-hover: #111820;
    --blue: #1d9bf0;
    --focus: #d7d7d7;
    --media-bg: #070b0f;
    --selection: #d8d8d8;
    --selection-text: #080808;
}

[data-theme="light"] {
    color-scheme: light;
    --background: #edf0f1;
    --text: #161a1d;
    --muted: #657078;
    --tweet: #fafbfb;
    --tweet-line: #ccd3d7;
    --tweet-hover: #eef2f3;
    --blue: #126fa8;
    --focus: #202428;
    --media-bg: #e2e7e9;
    --selection: #29333a;
    --selection-text: #f5f7f8;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    overflow-x: clip;
    background: var(--background);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    margin: 0;
    overflow-x: clip;
    background: transparent;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

body::before {
    position: fixed;
    z-index: -1;
    inset: -3%;
    background-image: url("/images/bathymetry.svg");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    content: "";
    opacity: 0.34;
    pointer-events: none;
    -webkit-mask-image: radial-gradient(ellipse 38% 68% at 50% 38%, transparent 20%, rgba(0, 0, 0, 0.28) 58%, #000 100%);
    mask-image: radial-gradient(ellipse 38% 68% at 50% 38%, transparent 20%, rgba(0, 0, 0, 0.28) 58%, #000 100%);
    transition: opacity 200ms ease;
}

[data-theme="light"] body::before {
    opacity: 0.2;
}

.has-js body {
    opacity: 0;
    transform: translateY(7px);
    transition: opacity 240ms ease, transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.has-js.is-ready body {
    opacity: 1;
    transform: translateY(0);
}

.has-js.is-leaving body {
    opacity: 0;
    transform: translateY(-5px);
    transition-duration: 170ms;
    transition-timing-function: ease;
}

a {
    color: inherit;
}

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

::selection {
    background: var(--selection);
    color: var(--selection-text);
}

.page {
    display: grid;
    grid-template-columns: minmax(0, 460px);
    gap: 28px;
    width: min(100% - 32px, 460px);
    margin: 0 auto;
    padding: 36px 0 72px;
}

p {
    margin: 0;
}

.site-mark {
    position: static;
    display: flex;
    height: auto;
    align-self: start;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    justify-content: flex-start;
}

.site-name {
    color: var(--text);
    font-size: clamp(30px, 9vw, 42px);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 1;
    text-decoration: none;
    text-orientation: mixed;
    transition: opacity 150ms ease;
    transform: none;
    white-space: nowrap;
    writing-mode: horizontal-tb;
}

.site-name:hover {
    opacity: 0.72;
}

.site-location {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1;
}

.site-location svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.site-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.pill {
    display: inline-flex;
    min-height: 34px;
    padding: 0 14px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--tweet-line);
    border-radius: 999px;
    background: var(--tweet);
    color: var(--text);
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 650;
    text-decoration: none;
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.pill:hover {
    border-color: var(--muted);
    background: var(--tweet-hover);
}

.theme-toggle {
    display: grid;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.theme-toggle:hover {
    background: var(--tweet-hover);
    color: var(--text);
}

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

.theme-toggle:active {
    transform: scale(0.94);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 1.7;
}

.archive {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding-top: 0;
}

.tweet-timeline {
    position: relative;
    display: grid;
    flex: 1;
    grid-template-columns: minmax(0, 460px);
    align-items: start;
    gap: 22px;
    padding-left: 36px;
}

.timeline-path {
    position: absolute;
    z-index: 0;
    top: 0;
    left: 0;
    width: 100%;
    overflow: visible;
    pointer-events: none;
}

.timeline-path path {
    fill: none;
    stroke: var(--tweet-line);
    stroke-dasharray: 1 8;
    stroke-linecap: round;
    stroke-width: 1.5;
}

.tweet {
    position: relative;
    z-index: 1;
    width: 100%;
    min-width: 0;
    overflow: visible;
    border: 1px solid var(--tweet-line);
    border-radius: 14px;
    background: var(--tweet);
}

.timeline-logo {
    position: absolute;
    z-index: 3;
    top: 12px;
    left: -36px;
    display: grid;
    width: 26px;
    height: 26px;
    padding: 3px;
    place-items: center;
    border: 1px solid var(--tweet-line);
    border-radius: 8px;
    background: var(--background);
    transition: border-color 150ms ease, transform 150ms ease;
}

.timeline-logo:hover {
    border-color: var(--muted);
    transform: scale(1.06);
}

.timeline-logo img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 4px;
}

.tweet-main {
    display: block;
    padding: 16px 16px 0;
    color: inherit;
    text-decoration: none;
}

.tweet-head {
    display: flex;
    align-items: center;
    gap: 9px;
}

.tweet-avatar {
    display: block;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border-radius: 50%;
    object-fit: cover;
}

.tweet-person {
    min-width: 0;
    line-height: 1.25;
}

.tweet-name-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tweet-name {
    overflow: hidden;
    font-size: 14px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.verified {
    display: block;
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    color: var(--blue);
}

.tweet-handle {
    overflow: hidden;
    color: var(--muted);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.x-mark {
    width: 19px;
    height: 19px;
    margin-left: auto;
    flex: 0 0 auto;
    color: var(--text);
}

.tweet-text {
    margin-top: 14px;
    color: var(--text);
    font-size: 15px;
    letter-spacing: -0.01em;
    line-height: 1.43;
    white-space: pre-wrap;
}

.tweet[data-long="true"] .tweet-text {
    font-size: 14px;
    line-height: 1.43;
}

.tweet-text a {
    color: var(--blue);
    text-decoration: none;
}

.tweet-text a:hover {
    text-decoration: underline;
}

.tweet-media {
    display: block;
    margin: 13px 16px 0;
    overflow: hidden;
    border: 1px solid var(--tweet-line);
    border-radius: 10px;
    background: var(--media-bg);
}

.tweet-media img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1200 / 630;
    object-fit: cover;
}

.tweet-time {
    display: block;
    padding: 11px 16px 10px;
    border-bottom: 1px solid var(--tweet-line);
    color: var(--muted);
    font-size: 12px;
    text-decoration: none;
}

.tweet-time:hover {
    color: var(--text);
}

.tweet-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 2px 6px;
}

.tweet-action {
    display: flex;
    min-width: 0;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    text-decoration: none;
    transition: color 150ms ease, background 150ms ease;
}

.tweet-action:hover {
    background: var(--tweet-hover);
    color: var(--blue);
}

.tweet-action svg {
    width: 17px;
    height: 17px;
}

.noscript {
    color: var(--muted);
    font-size: 13px;
}

.subscribe-page {
    width: min(100% - 32px, 460px);
    margin: 0 auto;
    padding: 36px 0 72px;
}

.subscribe-back {
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.035em;
    text-decoration: none;
}

.subscribe-back:hover {
    opacity: 0.72;
}

.subscribe-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.subscribe-card {
    margin-top: 56px;
}

.subscribe-card h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.035em;
}

.subscribe-card > p {
    max-width: 34ch;
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.subscribe-form {
    margin-top: 28px;
}

.subscribe-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.subscribe-row {
    display: flex;
    gap: 8px;
}

.subscribe-row input {
    min-width: 0;
    height: 42px;
    flex: 1;
    padding: 0 14px;
    border: 1px solid var(--tweet-line);
    border-radius: 999px;
    outline: none;
    background: var(--tweet);
    color: var(--text);
    font: inherit;
}

.subscribe-row input::placeholder {
    color: var(--muted);
}

.subscribe-row input:focus {
    border-color: var(--muted);
}

.subscribe-row button {
    height: 42px;
    padding: 0 17px;
    border: 1px solid var(--text);
    border-radius: 999px;
    background: var(--text);
    color: var(--background);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
}

.subscribe-row button:hover {
    border-color: #cdd1d4;
    background: #cdd1d4;
}

.form-status {
    min-height: 20px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 420px) {
    .page {
        width: min(100% - 24px, 460px);
    }

    .subscribe-row {
        align-items: stretch;
        flex-direction: column;
    }

    .tweet-timeline {
        padding-left: 30px;
    }

    .timeline-logo {
        left: -30px;
        width: 24px;
        height: 24px;
    }

}

@media (max-width: 600px) {
    body::before {
        opacity: 0.22;
        -webkit-mask-image: linear-gradient(to right, #000, rgba(0, 0, 0, 0.25) 34%, rgba(0, 0, 0, 0.25) 66%, #000);
        mask-image: linear-gradient(to right, #000, rgba(0, 0, 0, 0.25) 34%, rgba(0, 0, 0, 0.25) 66%, #000);
    }

    [data-theme="light"] body::before {
        opacity: 0.13;
    }
}

@media (prefers-reduced-motion: reduce) {
    .has-js body,
    .has-js.is-ready body,
    .has-js.is-leaving body {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
