/* ==========================================
   HOMEPAGE — highlighter bio + one tangle, project tabs underneath
   ========================================== */

/* ---------- Hero ---------- */

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 48px;
    align-items: center;
    max-width: 1320px;
    margin: 0 auto;
    padding: 40px 40px 56px;
}

.bio {
    font-family: 'EB Garamond', serif;
    font-size: clamp(1.45rem, 2.05vw, 2.05rem);
    line-height: 1.75;
    color: var(--ink);
    margin: 0;
}

.mark {
    position: relative;
    display: inline-block;
    white-space: nowrap;
    cursor: default;
    z-index: 0;
}

.mark svg {
    position: absolute;
    left: -3%;
    top: 78%;
    width: 106%;
    height: 34%;
    z-index: -1;
    overflow: visible;
    transition: opacity .25s;
}

.mark path { fill: none; stroke-linecap: round; stroke-linejoin: round; }

.bio.focus .mark:not(.on) svg { opacity: 0.12; }

.bio-links a {
    color: inherit;
    text-decoration: none;
}

.bio-links a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }

/* tangle + the quiet clock underneath it */
.tangle-wrap { display: flex; flex-direction: column; align-items: center; }

.tangle { width: 100%; max-width: 520px; }
.tangle svg { display: block; width: 100%; height: auto; overflow: visible; }
.tangle path { fill: none; stroke-linecap: round; stroke-linejoin: round; pointer-events: visibleStroke; }

.clock {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-top: 6px;
    font-family: 'Inter Tight', sans-serif;
    font-size: 0.78rem;
    color: var(--soft);
}

.clock-year {
    font-family: 'EB Garamond', serif;
    font-size: 1.15rem;
    color: var(--ink);
    font-variant-numeric: lining-nums tabular-nums;
    min-width: 2.6em;
    text-align: right;
}

.replay {
    background: none;
    border: none;
    color: var(--soft);
    font: inherit;
    cursor: pointer;
    padding: 0;
    opacity: 0;
    transition: opacity .4s, color .2s;
}

.replay:hover { color: var(--ink); }
.done .replay { opacity: 1; }

/* ---------- Project area under the hero: full width, no sidebar ---------- */

.layout.home-layout { display: block; min-height: 0; }

.layout.home-layout .main-content {
    width: 100%;
    margin: 0 auto;
    max-width: 1320px;
    min-height: 0;
    padding: 12px 40px 80px;
    background: transparent;
    background-image: none;
}

.layout.home-layout .controls { padding-top: 28px; }

/* tabs: quiet text tabs instead of boxed buttons */
.layout.home-layout .filter-btn {
    border: none !important;
    background: none !important;
    color: var(--soft) !important;
    font-family: 'Inter Tight', sans-serif;
    font-size: 0.95rem !important;
    padding: 4px 0 !important;
    margin-right: 20px;
    border-radius: 0;
    position: relative;
}

.layout.home-layout .filter-btn.active { color: var(--ink) !important; }

.layout.home-layout .filter-btn.active::after {
    content: '';
    position: absolute;
    left: -3px;
    right: -3px;
    bottom: -6px;
    height: 9px;
    background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20100%2012%22%20preserveAspectRatio%3D%22none%22%3E%3Cpath%20d%3D%22M1%207%20L6%203%20L11%209%20L16%202%20L22%209%20L27%203%20L33%2010%20L38%202%20L44%209%20L49%203%20L55%2010%20L60%202%20L66%209%20L71%203%20L77%209%20L82%202%20L88%2010%20L93%203%20L99%208%22%20fill%3D%22none%22%20stroke%3D%22%231F2BFF%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20vector-effect%3D%22non-scaling-stroke%22/%3E%3Cpath%20d%3D%22M2%205%20L8%2010%20L13%203%20L19%209%20L24%202%20L30%209%20L35%204%20L41%2010%20L46%202%20L52%209%20L57%203%20L63%2010%20L68%203%20L74%209%20L79%203%20L85%209%20L90%204%20L98%206%22%20fill%3D%22none%22%20stroke%3D%22%231F2BFF%22%20stroke-opacity%3D%22.6%22%20stroke-width%3D%221.4%22%20stroke-linecap%3D%22round%22%20vector-effect%3D%22non-scaling-stroke%22/%3E%3C/svg%3E") no-repeat center / 100% 100%;
    animation: tab-scribble .45s cubic-bezier(.3,.6,.3,1) both;
}

@keyframes tab-scribble { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

.layout.home-layout .filter-btn[data-filter="writing"].active::after { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20100%2012%22%20preserveAspectRatio%3D%22none%22%3E%3Cpath%20d%3D%22M1%207%20L6%203%20L11%209%20L16%202%20L22%209%20L27%203%20L33%2010%20L38%202%20L44%209%20L49%203%20L55%2010%20L60%202%20L66%209%20L71%203%20L77%209%20L82%202%20L88%2010%20L93%203%20L99%208%22%20fill%3D%22none%22%20stroke%3D%22%2300D936%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20vector-effect%3D%22non-scaling-stroke%22/%3E%3Cpath%20d%3D%22M2%205%20L8%2010%20L13%203%20L19%209%20L24%202%20L30%209%20L35%204%20L41%2010%20L46%202%20L52%209%20L57%203%20L63%2010%20L68%203%20L74%209%20L79%203%20L85%209%20L90%204%20L98%206%22%20fill%3D%22none%22%20stroke%3D%22%2300D936%22%20stroke-opacity%3D%22.6%22%20stroke-width%3D%221.4%22%20stroke-linecap%3D%22round%22%20vector-effect%3D%22non-scaling-stroke%22/%3E%3C/svg%3E"); }
.layout.home-layout .filter-btn[data-filter="press"].active::after { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20100%2012%22%20preserveAspectRatio%3D%22none%22%3E%3Cpath%20d%3D%22M1%207%20L6%203%20L11%209%20L16%202%20L22%209%20L27%203%20L33%2010%20L38%202%20L44%209%20L49%203%20L55%2010%20L60%202%20L66%209%20L71%203%20L77%209%20L82%202%20L88%2010%20L93%203%20L99%208%22%20fill%3D%22none%22%20stroke%3D%22%23FF4FC1%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20vector-effect%3D%22non-scaling-stroke%22/%3E%3Cpath%20d%3D%22M2%205%20L8%2010%20L13%203%20L19%209%20L24%202%20L30%209%20L35%204%20L41%2010%20L46%202%20L52%209%20L57%203%20L63%2010%20L68%203%20L74%209%20L79%203%20L85%209%20L90%204%20L98%206%22%20fill%3D%22none%22%20stroke%3D%22%23FF4FC1%22%20stroke-opacity%3D%22.6%22%20stroke-width%3D%221.4%22%20stroke-linecap%3D%22round%22%20vector-effect%3D%22non-scaling-stroke%22/%3E%3C/svg%3E"); }

/* project cards: small coloured dot by category */
.layout.home-layout .masonry-type,
.layout.home-layout .col-type { color: var(--soft) !important; }

.layout.home-layout .writing-group-title { color: var(--soft) !important; }

.layout.home-layout .col-title-link,
.layout.home-layout .masonry-title-link { color: var(--writing) !important; }

@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; gap: 8px; padding: 18px 20px 36px; }
    .bio { font-size: 1.4rem; }
    .tangle { max-width: 360px; }
    .layout.home-layout .main-content { padding: 0 0 56px; }
    .layout.home-layout .controls { padding: 20px 24px 6px; }
}

/* ---------- Text reveal: words rise in, line two waits a beat ---------- */
.bio-line { display: inline; }
#line2::before { content: ''; display: block; height: 0.9em; }

.js-reveal .w {
    display: inline-block;
    opacity: 0;
    transform: translateY(0.45em);
    filter: blur(5px);
    transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1), filter .7s ease;
}

.js-reveal .w.in { opacity: 1; transform: none; filter: none; }

/* project cards and rows rise in as they scroll into view */
.rise { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.rise.in { opacity: 1; transform: none; }

/* no green scroll tracker */
#scrollProgress, .scroll-progress { display: none !important; }

@media (prefers-reduced-motion: reduce) {
    .js-reveal .w, .rise { opacity: 1 !important; transform: none !important; filter: none !important; transition: none !important; }
}

/* ---------- Links in the bio: a quiet dotted underline, solid on hover ---------- */
.bio-links a {
    text-decoration: underline dotted;
    text-decoration-color: rgba(0, 0, 0, 0.35);
    text-decoration-thickness: 1px;
    text-underline-offset: 5px;
}
.bio-links a:hover { text-decoration: underline solid; text-decoration-color: var(--ink); }

/* ---------- Messier underlines ---------- */
.mark { cursor: pointer; }
.mark > svg { left: 0 !important; top: 76% !important; width: 100% !important; height: 42% !important; }

/* ---------- Crayon asterisks ---------- */
.star {
    /* takes no space in the line, so punctuation sits right after the word */
    display: inline-block;
    position: relative;
    width: 0;
    height: 0;
    cursor: pointer;
}
.star svg { position: absolute; left: 0; bottom: 0.5em; width: 0.72em; height: 0.72em; overflow: visible; display: block; }
.star path, .note-star path, .note-links path { fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Margin notes ---------- */
.hero { position: relative; }
.more { display: none !important; }

.notes {
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(50% + 40px);
    width: 300px;
    pointer-events: none;
    z-index: 3;
}

.note {
    position: absolute;
    left: 0;
    width: 100%;
    font-family: 'Inter Tight', sans-serif;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--ink);
    padding: 4px 6px 6px 0;
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity .35s, transform .35s;
    pointer-events: none;
}
.note.open { opacity: 1; transform: none; pointer-events: auto; }
.note a { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
.note-star { display: inline-block; width: 14px; height: 14px; margin-right: 7px; vertical-align: -2px; }
.note-star svg { width: 100%; height: 100%; overflow: visible; }

.note-links { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 2; }

/* the knot steps back while notes are open */
.tangle { transition: opacity .4s; }
.notes-open .tangle { opacity: 0.25; }

@media (max-width: 900px) {
    .notes { position: static; width: auto; }
    .note { position: static; display: none; transform: none; padding: 0; margin: 2px 0 12px; }
    .note.open { display: block; }
    .notes-open .tangle { opacity: 1; }
}

/* phones: tabs and cards share the 20px edge with the name and bio */
@media (max-width: 900px) {
    .layout.home-layout .controls { padding-left: 20px !important; padding-right: 20px !important; }
    .masonry-grid.view-container.active { padding-left: 20px !important; padding-right: 20px !important; }
    #listBody .grid-row, .writing-view .writing-group-title { padding-left: 20px !important; padding-right: 20px !important; }
}
