/* triss.dev — editorial monochrome */

:root {
    color-scheme: light dark;
    --bg: #fcfcfa;
    --ink: #141414;
    --muted: #6f6f68;
    --rule: #e4e4de;
    --accent: #07ffa9;
    --code-bg: #f1f1ec;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0d0d0d;
        --ink: #e9e9e3;
        --muted: #94948c;
        --rule: #262626;
        --code-bg: #1a1a1a;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Charter, "Bitstream Charter", "Iowan Old Style", Georgia, "Times New Roman", serif;
    font-size: 1.0625rem;
    line-height: 1.65;
}

::selection { background: var(--accent); color: #000; }

/* ---- Links ---- */
a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    /* constant overhang room so the hover swipe can bleed past the text without layout shift */
    padding: .18em .3em .1em;
    margin: 0 -.3em;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    /* hand-drawn marker swipe: static wobbly SVG stroke sits behind a page-bg-colored
       cover layer; the cover shrinks toward the right on hover, revealing the stroke
       in place left-to-right (a wipe, so the shape never moves or stretches). */
    background-image:
        linear-gradient(var(--bg), var(--bg)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 60' preserveAspectRatio='none'%3E%3Cpath d='M4 14 C 40 8 80 3 120 7 C 150 10 180 4 196 10 L 198 55 C 160 58 120 60 80 56 C 50 54 20 59 5 56 Z' fill='%2307ffa9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    /* both layers are a bottom-anchored 80% band — NEVER taller: the unpainted top
       strip is what keeps the opaque cover (cloned per line fragment) from chopping
       descenders of the line above on wrapped tight-leading links (feed titles).
       92% was tried and reintroduced the chopped "g"s. Stroke bottoms sit at
       y>=54/60 so the link's own descenders stay inside the swipe. */
    background-size: 100% 80%, 100% 80%;
    background-position: 100% 100%, 50% 100%;
    transition: background-size .25s ease-out, color .25s ease-out;
}
/* alternate stroke so neighbouring links don't get identical swipes */
a:nth-of-type(even) {
    background-image:
        linear-gradient(var(--bg), var(--bg)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 60' preserveAspectRatio='none'%3E%3Cpath d='M5 10 C 50 3 110 9 160 5 C 180 3 192 7 197 13 L 196 54 C 150 58 90 54 40 58 C 25 60 10 57 6 54 Z' fill='%2307ffa9'/%3E%3C/svg%3E");
}
a:hover {
    color: #000;
    text-decoration: none;
    background-size: 0% 80%, 100% 80%;
}

/* ---- Layout ---- */
.page {
    max-width: 44rem;
    width: 100%;
    margin: 0 auto;
    padding: 0 1.25rem 4rem;
}

/* Split layout (homepage): fixed portrait left, scrolling text right */
body.split {
    display: grid;
    grid-template-columns: clamp(300px, 42vw, 680px) minmax(0, 1fr);
    min-height: 100vh;
}
.portrait {
    margin: 0;
    position: sticky;
    top: 0;
    height: 100vh;
}
.portrait img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 58% 30%;
}

@media (max-width: 820px) {
    body.split { display: block; }
    .portrait { position: static; height: min(52vh, 26rem); }
}

/* ---- Header / nav ---- */
.site-header nav {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .35rem 1.5rem;
    padding: 1.1rem 0 .9rem;
    border-bottom: 1px solid var(--rule);
    margin-bottom: 2.75rem;
}
.wordmark {
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
    white-space: nowrap;
}
.site-nav { display: flex; flex-wrap: wrap; gap: .2rem 1.25rem; }
.site-nav a {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .16em;
    text-decoration: none;
    color: var(--muted);
    padding-bottom: 2px;
}
.site-nav a[aria-current="page"] {
    color: var(--ink);
    border-bottom: 2px solid var(--accent);
}
.site-nav a:hover { color: #000; }

/* ---- Typography ---- */
h1 {
    font-size: clamp(2rem, 5vw, 2.6rem);
    line-height: 1.12;
    letter-spacing: -.015em;
    margin: 0 0 .4em;
}
h2 {
    font-size: 1.3rem;
    line-height: 1.3;
    margin: 2.4em 0 .6em;
}
h2::before {
    content: "";
    display: block;
    width: 2rem;
    height: 3px;
    background: var(--accent);
    margin-bottom: .65rem;
}
h3 { font-size: 1.1rem; margin: 1.8em 0 .4em; }

.lede {
    font-style: italic;
    color: var(--muted);
    font-size: 1.1rem;
    margin-top: 0;
}

.meta { color: var(--muted); font-size: .9rem; }

/* ---- Content elements ---- */
img { max-width: 100%; height: auto; }

pre, code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .86em;
}
pre {
    background: var(--code-bg);
    border: 1px solid var(--rule);
    padding: 1em;
    overflow-x: auto;
    line-height: 1.5;
}
:not(pre) > code {
    background: var(--code-bg);
    padding: .1em .35em;
}

blockquote {
    margin: 1.5em 0;
    padding-left: 1.25em;
    border-left: 3px solid var(--accent);
    font-style: italic;
    color: var(--muted);
}

hr {
    border: none;
    border-top: 1px solid var(--rule);
    margin: 3em 0;
}

table { border-collapse: collapse; }
th, td { border: 1px solid var(--rule); padding: .3em .6em; }

ul, ol { padding-left: 1.4em; }
li { margin: .3em 0; }

cite { font-style: italic; }

/* ---- Thoughts feed (full-bleed two-column, Rigetti-style) ---- */
body.wide .page {
    max-width: none;
    padding-left: clamp(1.25rem, 3vw, 3.5rem);
    padding-right: clamp(1.25rem, 3vw, 3.5rem);
}
body.wide main > h1,
body.navwide main > h1 {
    text-align: center;
    font-size: clamp(2.6rem, 6vw, 4.5rem);
    margin: 4rem 0 .3em;
}
body.wide main > .lede,
body.navwide main > .lede {
    text-align: center;
    font-size: clamp(1.15rem, 1.6vw, 1.4rem);
    max-width: 46rem;
    margin: 0 auto 5.5rem;
}

/* Centered content column for wide pages */
.measure { max-width: 46rem; margin: 0 auto; }
.measure.center { text-align: center; }
.measure.center p { font-size: 1.15rem; line-height: 1.9; }

/* Full-width nav, narrow content (Reading, Contact) */
body.navwide .page {
    max-width: none;
    padding-left: clamp(1.25rem, 3vw, 3.5rem);
    padding-right: clamp(1.25rem, 3vw, 3.5rem);
}
body.navwide main,
body.navwide footer {
    max-width: 44rem;
    margin-left: auto;
    margin-right: auto;
}

body.reading main { max-width: none; }
.reading-list {
    max-width: 44rem;
    margin: 0 auto;
}
.reading-header {
    margin: 4rem calc(-1 * clamp(1.25rem, 3vw, 3.5rem)) 5.5rem;
    padding: clamp(2rem, 6vw, 4rem) clamp(1.25rem, 4vw, 3rem);
    background: linear-gradient(rgb(0 0 0 / .65), rgb(0 0 0 / .65)),
        url("/assets/img/books-optimised.png") center / cover;
    background-color: #141414;
    color: #fff;
    text-align: center;
}
.reading-header h1 {
    font-size: clamp(2.6rem, 6vw, 4.5rem);
    margin: 0 0 .3em;
}
.reading-header .lede {
    color: inherit;
    font-size: clamp(1.15rem, 1.6vw, 1.4rem);
    max-width: 44rem;
    margin: 0 auto;
}

/* ---- Work page ---- */
.projects-page {
    --work-columns: repeat(2, minmax(0, 1fr));
    --work-gap: clamp(2rem, 5vw, 5rem);
    max-width: 76rem;
    margin: 0 auto;
}
.work-intro {
    display: grid;
    grid-template-columns: var(--work-columns);
    align-items: end;
    gap: var(--work-gap);
    padding: clamp(2rem, 5vw, 4rem) 0 clamp(3rem, 6vw, 5rem);
    border-bottom: 1px solid var(--rule);
}
.work-kicker,
.section-index,
.venture-label {
    margin: 0 0 1rem;
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .72rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.work-intro h1 {
    max-width: 14ch;
    margin: 0;
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 400;
    letter-spacing: -.055em;
    line-height: .98;
}
.work-intro-copy {
    max-width: 24rem;
    margin: 0 0 .3rem;
    color: var(--muted);
    font-size: clamp(1.2rem, 2vw, 1.65rem);
    font-style: italic;
    line-height: 1.5;
}
.work-section {
    padding-top: clamp(3.5rem, 6vw, 5.5rem);
}
.section-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--ink);
}
.section-heading h2 {
    margin: 0 0 .25rem;
    font-size: clamp(2rem, 3vw, 2.75rem);
    font-weight: 400;
    letter-spacing: -.035em;
}
.section-heading h2::before { display: none; }
.section-heading div > p {
    margin: 0;
    color: var(--muted);
    font-size: .95rem;
}
.section-index { margin: 0; }
.ventures .section-heading { border-top: 0; }
.section-index span,
.venture-label span,
.venture-note span,
.venture-separator { color: var(--muted); }
.venture {
    display: grid;
    grid-template-columns: var(--work-columns);
    align-items: start;
    gap: var(--work-gap);
    margin: 0;
    padding: clamp(2.5rem, 5vw, 4rem) 0;
    border-top: 1px solid var(--rule);
}
.ventures .section-heading + .venture {
    margin-top: 2.5rem;
    padding-top: 0;
    border-top: 0;
}
.venture-image,
.project-image {
    min-width: 0;
    margin: 0;
}
.venture-image img,
.venture-image video,
.project-image img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1.55;
    object-fit: cover;
}
.venture-senbee .venture-image video {
    object-position: center 48%;
}
.venture-servicepoint .venture-image img {
    object-fit: contain;
    object-position: center;
}
.venture-label { margin-bottom: .8rem; }
.venture-copy h3,
.project-copy h3 {
    margin: 0 0 1rem;
    font-size: clamp(2.25rem, 4vw, 3.75rem);
    font-weight: 400;
    letter-spacing: -.045em;
    line-height: 1;
}
.venture-copy h3 a,
.project-copy h3 a {
    margin: 0;
    padding: 0;
    background-image: none;
    text-decoration: none;
}
.venture-copy h3 a:hover,
.project-copy h3 a:hover {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 2px;
    text-underline-offset: .12em;
}
.venture-copy > p:not(.venture-label, .venture-note, .venture-link),
.project-copy > p:not(.venture-label, .project-link) {
    max-width: 34em;
    font-size: clamp(1.05rem, 1.35vw, 1.25rem);
    line-height: 1.75;
}
.venture-note {
    margin: 1.5rem 0 .85rem;
    padding-top: .75rem;
    border-top: 1px solid var(--rule);
    color: var(--muted);
    font-size: .85rem;
}
.venture-link,
.project-link {
    margin: 0;
    font-size: .9rem;
}
.venture-separator { padding: 0 .35rem; }
.project-spotlight {
    display: grid;
    grid-template-columns: var(--work-columns);
    align-items: start;
    gap: var(--work-gap);
    margin: 2.5rem 0 0;
    padding-bottom: clamp(2.5rem, 5vw, 4rem);
}
.project-image img {
    object-fit: contain;
    object-position: center top;
}
.archive-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 var(--work-gap);
    margin: 2.5rem 0 0;
    padding: 0;
    list-style: none;
}
.archive-list li {
    margin: 0;
    padding: .8rem 0;
    border-top: 1px solid var(--rule);
    color: var(--muted);
    font-size: .86rem;
    line-height: 1.55;
}
.archive-list li a {
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
}
.archive-list li a:hover {
    text-decoration: underline;
    text-decoration-color: var(--accent);
}

@media (max-width: 760px) {
    .projects-page { --work-columns: minmax(0, 1fr); }
    .work-intro {
        gap: 1.5rem;
    }
    .work-intro h1 { font-size: clamp(3.2rem, 12vw, 5.5rem); }
    .work-intro-copy { max-width: 32rem; }
    .section-heading {
        gap: .75rem;
    }
    .venture,
    .project-spotlight {
        gap: 1.5rem;
    }
    .venture-copy h3,
    .project-copy h3 { font-size: clamp(2.25rem, 8vw, 3.5rem); }
}
@media (max-width: 520px) {
    .archive-list { grid-template-columns: 1fr; }
}

/* Blog posts: wider column, larger body text */
body.post main,
body.post footer {
    max-width: 52rem;
}
body.post article {
    font-size: 1.1875rem;
}

/* Photo strip (Contact) */
.photo-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .75rem;
    margin: 0 0 3rem;
}
.photo-strip img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    filter: grayscale(1);
    border: 1px solid var(--rule);
}
.photo-strip img:last-child { object-position: 58% 30%; }

@media (max-width: 700px) {
    .photo-strip { grid-template-columns: repeat(2, 1fr); }
}

.feed-entry {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 5fr);
    gap: clamp(2rem, 4vw, 4rem);
    align-items: start;
    margin: 0 0 7rem;
}
.feed-image { grid-column: 1; }
.feed-body { grid-column: 2; }
.feed-entry h2 {
    font-size: clamp(2.5rem, 5.2vw, 5.5rem);
    line-height: 1.1;
    font-weight: 500;
    margin: .25em 0 .4em;
}
.feed-entry h2::before { display: none; }
.feed-entry h2 a { text-decoration: none; }
.feed-entry h2 a:hover { color: #000; }
.feed-entry .meta {
    margin: 0;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .14em;
}
.draft-badge {
    display: inline-block;
    margin-left: .4em;
    padding: .05em .4em;
    background: var(--accent);
    color: #000;
    font-size: .8em;
    font-weight: 700;
    letter-spacing: .08em;
    vertical-align: .08em;
}
.feed-body > p:not(.meta) {
    font-size: clamp(1.1rem, 1.6vw, 1.4rem);
    line-height: 1.75;
    max-width: 46em;
}
.feed-image { display: block; }
.feed-image:hover { background: none; }
.feed-image img,
.feed-image video {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}
body.blog .feed-image { overflow: hidden; }
body.blog .feed-image img {
    filter: grayscale(1);
    transition: filter .45s ease, transform .6s ease;
}
body.blog .feed-entry:is(:hover, :focus-within) .feed-image img {
    filter: grayscale(0);
    transform: scale(1.04);
}
@media (prefers-reduced-motion: reduce) {
    body.blog .feed-image img { transition: none; }
    body.blog .feed-entry:is(:hover, :focus-within) .feed-image img {
        transform: none;
    }
}
/* Info card: cropped visual with logo, meta rows, and links below */
.feed-image.card {
    border: 1px solid var(--rule);
    border-radius: .5rem;
    overflow: hidden;
}
.card-media {
    display: block;
    padding: 0;
    margin: 0;
    background: none;
}
.card-media:hover { background: none; }
.card-media img,
.card-media video {
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: top;
}
.card-body { padding: 1rem 1.1rem 1.1rem; }
.card-head {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: 0 0 .9rem;
}
.card-body .card-logo {
    width: 1.6rem;
    height: 1.6rem;
    aspect-ratio: auto;
    object-fit: contain;
    flex: none;
}
.card-logo-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #000;
    border-radius: .35rem;
    font-size: .95rem;
    font-weight: 600;
}
.card-name {
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: .02em;
}
.card-meta { margin: 0 0 .9rem; }
.card-meta > div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: .45rem 0;
    border-top: 1px solid var(--rule);
}
.card-meta dt {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--muted);
}
.card-meta dd {
    margin: 0;
    font-size: .85rem;
    text-align: right;
}
.card-links {
    margin: 0;
    font-size: .85rem;
    border-top: 1px solid var(--rule);
    padding-top: .75rem;
}
.readmore {
    font-size: clamp(1rem, 1.3vw, 1.2rem);
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
    border-bottom: none;
}

@media (max-width: 700px) {
    .feed-entry { display: block; }
    .feed-image { margin-bottom: 1.25rem; }
    .feed-image img,
    .feed-image video { aspect-ratio: auto; max-height: 20rem; }
}

/* ---- Post navigation ---- */
.post-nav {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    margin-top: 3rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--rule);
}
.post-nav p {
    margin: 0;
    max-width: 45%;
}
.post-nav .post-nav-next {
    margin-left: auto;
    text-align: right;
}

/* ---- Footer ---- */
footer {
    margin-top: 4.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--rule);
    font-size: .85rem;
    color: var(--muted);
}
