/* sushree.space — single stylesheet.
   Sections: tokens · base · nav · typography · now/log · docs · me · footer · dark
   Loaded from base.html via {% static 'css/site.css' %}. */

/* ---------------------------------------------------------------- tokens -- */
:root {
    --paper:        #F5F1E8;
    --ink:          #1A1A1A;
    --ink-soft:     #555;
    --ink-faint:    #999;
    --accent:       #C9613D;
    --rule:         #D9D2C0;
    --serif:        "Newsreader", Georgia, "Times New Roman", serif;
    --mono:         "JetBrains Mono", "Fira Code", Consolas, monospace;
    --measure:      38rem;
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--serif);
    font-size: 1.125rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}
a:hover { color: var(--accent); }

.wrap {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 2.5rem 1.25rem 6rem;
}

/* Skip link — accessible, off-screen until focused. */
.skip-link {
    position: absolute;
    left: 0.75rem;
    top: -3rem;
    z-index: 100;
    background: var(--ink);
    color: var(--paper);
    padding: 0.5rem 0.85rem;
    border-radius: 6px;
    font-family: var(--mono);
    font-size: 0.8rem;
    text-decoration: none;
    transition: top 0.15s ease;
}
.skip-link:focus { top: 0.75rem; color: var(--paper); }

/* ------------------------------------------------------------------- nav -- */
nav.site-nav {
    font-family: var(--mono);
    font-size: 0.875rem;
    text-transform: lowercase;
    letter-spacing: 0.02em;
    margin-bottom: 2.75rem;
    display: flex;
    gap: 1rem 1.5rem;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
}
nav.site-nav a { text-decoration: none; }
nav.site-nav .wordmark {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
    text-transform: none;
}
nav.site-nav .wordmark .dot-sep { color: var(--accent); }
nav.site-nav .nav-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
nav.site-nav a.active {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
    color: var(--accent);
}

/* Optional one-line "what is this" tagline (home page fills the block). */
.tagline {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--ink-faint);
    margin: -1.5rem 0 2.5rem;
    line-height: 1.5;
}

/* Dark/light toggle button (lives at the right end of the nav). */
.theme-toggle {
    align-self: center;
    width: 34px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--rule);
    border-radius: 8px;
    background: transparent;
    color: var(--ink-soft);
    cursor: pointer;
    margin-left: 0.25rem;
    transition: border-color 0.15s, color 0.15s, transform 0.15s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.theme-toggle svg { width: 16px; height: 16px; display: block; }
/* Moon shown in light mode (click → go dark); sun shown in dark mode. */
:root:not(.dark) .theme-toggle .icon-sun { display: none; }
:root.dark .theme-toggle .icon-moon { display: none; }

/* ------------------------------------------------------------ typography -- */
h1, h2, h3 {
    font-family: var(--serif);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin: 0 0 0.5rem;
}
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: 1.5rem; margin-top: 2.5rem; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1rem; }

.meta {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--ink-faint);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

hr.rule {
    border: 0;
    border-top: 1px solid var(--rule);
    margin: 2.5rem 0;
}

/* --------------------------------------------------------------- now/log -- */
.now {
    border-left: 3px solid var(--accent);
    padding: 0.25rem 0 0.25rem 1.25rem;
    margin-bottom: 3rem;
}
.now .label {
    font-family: var(--mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 0.4rem;
}
.now .headline {
    font-size: 1.6rem;
    line-height: 1.3;
    font-weight: 600;
}
.now .updated {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--ink-faint);
    margin-top: 0.6rem;
}

.log-list { list-style: none; padding: 0; margin: 0; }
.log-item {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--rule);
}
.log-item:last-child { border-bottom: 0; }
.log-item .head {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
}
.tag {
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.15rem 0.5rem;
    border: 1px solid var(--rule);
    border-radius: 2px;
    color: var(--ink-soft);
}
.tag-ship  { color: var(--accent); border-color: var(--accent); }
.tag-learn { color: #2D5A3D; border-color: #2D5A3D; }
.tag-link  { color: #1F3D7A; border-color: #1F3D7A; }
.log-item time { font-family: var(--mono); font-size: 0.75rem; color: var(--ink-faint); }

.rel { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-faint); }
.edited { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-faint); font-style: italic; }

/* Topic tags attached to an entry (distinct from the kind badge above). */
.topics { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.55rem; }
.topic {
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.03em;
    padding: 0.1rem 0.45rem;
    border: 1px dashed var(--rule);
    border-radius: 999px;
    color: var(--ink-faint);
}

/* Status dots */
.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 0.45rem;
    position: relative;
    top: -1px;
}
.dot-ongoing { background: #22c55e; animation: pulse 1.6s ease-in-out infinite; }
.dot-paused  { background: #f59e0b; }
.dot-dropped { background: #dc2626; }
.dot-done    { background: #3b82f6; }

@keyframes pulse {
    0%, 100% { opacity: 1;   box-shadow: 0 0 0 0   rgba(34,197,94,0.55); }
    50%      { opacity: 0.55;box-shadow: 0 0 0 6px rgba(34,197,94,0);    }
}

/* Filter pills + search box above the feed. */
.log-controls { margin: 0.25rem 0 1.25rem; }
.filters { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.6rem; }
.filter {
    font-family: var(--mono); font-size: 0.75rem; text-transform: lowercase; letter-spacing: 0.02em;
    padding: 0.3rem 0.7rem; border: 1px solid var(--rule); border-radius: 999px;
    background: transparent; color: var(--ink-soft); cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.filter:hover { color: var(--ink); border-color: var(--ink-soft); }
.filter.is-active { color: var(--accent); border-color: var(--accent); background: rgba(201,97,61,0.08); }

.log-search {
    width: 100%;
    font-family: var(--mono);
    font-size: 0.8rem;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--rule);
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
}
.log-search::placeholder { color: var(--ink-faint); }
.log-search:focus { outline: none; border-color: var(--accent); }

.log-item.is-hidden { display: none; }
.log-empty { padding: 1.25rem 0; }

/* Flowy feed: stagger fade-in + bottom fade mask.
   The mask only applies when there are enough entries to scroll past —
   otherwise it fades the only/last line, which looks broken. The .fade
   class is added conditionally in home.html. */
.log-list.fade {
    -webkit-mask-image: linear-gradient(to bottom, black 88%, transparent 100%);
            mask-image: linear-gradient(to bottom, black 88%, transparent 100%);
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.log-item {
    animation: fadeUp 0.55s ease-out backwards;
}
.log-item:nth-child(1)  { animation-delay: 0.04s; }
.log-item:nth-child(2)  { animation-delay: 0.10s; }
.log-item:nth-child(3)  { animation-delay: 0.16s; }
.log-item:nth-child(4)  { animation-delay: 0.22s; }
.log-item:nth-child(5)  { animation-delay: 0.28s; }
.log-item:nth-child(6)  { animation-delay: 0.34s; }
.log-item:nth-child(7)  { animation-delay: 0.40s; }
.log-item:nth-child(n+8){ animation-delay: 0.46s; }

@media (prefers-reduced-motion: reduce) {
    .log-item, .dot-ongoing { animation: none !important; }
}

/* ------------------------------------------------------------------ docs -- */
.doc-list { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.doc-item { padding: 1.15rem 0; border-bottom: 1px solid var(--rule); }
.doc-item:last-child { border-bottom: 0; }
.doc-item h3 { margin: 0 0 0.25rem; }
.doc-item h3 a { text-decoration: none; }
.doc-item h3 a:hover { text-decoration: underline; }

.doc-summary { margin: 0 0 0.4rem; color: var(--ink-soft); font-size: 1rem; }
.doc-meta { font-family: var(--mono); font-size: 0.75rem; color: var(--ink-faint); margin: 0 0 0.4rem; }
.doc-empty { color: var(--ink-soft); font-size: 1rem; }

/* Rendered Markdown body. */
.doc-body { margin-top: 1.75rem; }
.doc-body p { margin: 0 0 1.15rem; }
.doc-body h2 { font-size: 1.35rem; margin-top: 2.25rem; }
.doc-body h3 { font-size: 1.1rem; margin-top: 1.75rem; }
.doc-body ul, .doc-body ol { margin: 0 0 1.15rem; padding-left: 1.4rem; }
.doc-body li { margin-bottom: 0.35rem; }
.doc-body img { max-width: 100%; height: auto; border-radius: 8px; }
.doc-body hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }
.doc-body blockquote {
    margin: 1.5rem 0;
    padding-left: 1rem;
    border-left: 3px solid var(--rule);
    color: var(--ink-soft);
}
.doc-body code {
    font-family: var(--mono);
    font-size: 0.85em;
    background: rgba(0,0,0,0.05);
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
}
.doc-body pre {
    background: rgba(0,0,0,0.05);
    border: 1px solid var(--rule);
    border-radius: 8px;
    padding: 0.9rem 1rem;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.5;
}
.doc-body pre code { background: none; padding: 0; font-size: inherit; }
.doc-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 1.25rem;
    font-size: 0.9rem;
}
.doc-body th, .doc-body td {
    border-bottom: 1px solid var(--rule);
    padding: 0.45rem 0.6rem;
    text-align: left;
}
.doc-body th { font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); }

/* Attachments: files and links hanging off a doc. */
.attachments { margin-top: 2.75rem; }
.attachments h2 { font-size: 1.2rem; }
.attach-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.attach-item {
    display: flex;
    gap: 0.7rem;
    align-items: baseline;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--rule);
}
.attach-item:last-child { border-bottom: 0; }
.attach-main { flex: 1 1 auto; min-width: 0; }
.attach-main a { word-break: break-word; }
.attach-kind {
    flex: 0 0 auto;
    font-family: var(--mono);
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.15rem 0.45rem;
    border: 1px solid var(--rule);
    border-radius: 3px;
    color: var(--ink-soft);
}
.kind-pdf      { color: #B03A2E; border-color: #B03A2E; }
.kind-doc      { color: #1F3D7A; border-color: #1F3D7A; }
.kind-sheet    { color: #2D5A3D; border-color: #2D5A3D; }
.kind-csv      { color: #2D5A3D; border-color: #2D5A3D; }
.kind-slides   { color: #C9613D; border-color: #C9613D; }
.kind-markdown { color: var(--ink-soft); }
.kind-link     { color: var(--accent); border-color: var(--accent); }
.attach-size { font-family: var(--mono); font-size: 0.68rem; color: var(--ink-faint); margin-left: 0.5rem; }
.attach-desc { margin: 0.25rem 0 0; font-size: 0.9rem; color: var(--ink-soft); }

/* Inline previews for embeddable attachments. */
.embed { margin: 2rem 0 0; }
.embed-frame {
    width: 100%;
    height: 70vh;
    min-height: 320px;
    border: 1px solid var(--rule);
    border-radius: 8px;
    background: var(--paper);
}
.embed figcaption {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--ink-faint);
    margin-top: 0.45rem;
}

/* -------------------------------------------------------------------- me -- */
.me-hero { display: flex; gap: 1.5rem; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; }
.me-avatar {
    flex: 0 0 auto; width: 84px; height: 84px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--serif); font-weight: 600; font-size: 2rem; color: var(--paper);
    background: var(--accent); box-shadow: 0 6px 18px -10px rgba(201,97,61,0.6);
}
.me-hero h1 { margin: 0; }
.me-hero .me-tag {
    font-family: var(--mono); font-size: 0.8rem; color: var(--ink-faint);
    text-transform: uppercase; letter-spacing: 0.08em; margin-top: 0.35rem;
}

.me-threads { display: grid; gap: 0.7rem; grid-template-columns: 1fr; margin: 1.75rem 0; }
@media (min-width: 560px) { .me-threads { grid-template-columns: 1fr 1fr; } }
.me-thread { border: 1px solid var(--rule); border-radius: 12px; padding: 1rem 1.1rem; background: rgba(255,255,255,0.4); }
.me-thread h3 { margin: 0 0 0.3rem; font-size: 1.05rem; display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.me-thread .count { font-family: var(--mono); font-size: 0.7rem; color: var(--ink-faint); font-weight: 400; }
.me-thread > p { margin: 0; font-size: 0.95rem; line-height: 1.5; color: var(--ink-soft); }

/* Live evidence under each thread: the newest tagged log entries. */
.thread-recent { list-style: none; margin: 0.75rem 0 0; padding: 0.7rem 0 0; border-top: 1px dashed var(--rule); }
.thread-recent li { font-size: 0.85rem; line-height: 1.45; color: var(--ink-soft); margin-bottom: 0.45rem; display: flex; gap: 0.45rem; align-items: baseline; }
.thread-recent li:last-child { margin-bottom: 0; }
.thread-recent .when { font-family: var(--mono); font-size: 0.68rem; color: var(--ink-faint); }

.me-links { display: flex; gap: 0.6rem; margin: 1.75rem 0; flex-wrap: wrap; }
.me-links a {
    width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--rule); border-radius: 10px; color: var(--ink); text-decoration: none;
    background: rgba(255,255,255,0.4); transition: border-color 0.15s, color 0.15s, transform 0.15s;
}
.me-links a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.me-links svg { width: 20px; height: 20px; }

/* ---------------------------------------------------------------- footer -- */
footer {
    margin-top: 5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--rule);
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--ink-faint);
    line-height: 1.7;
}
footer a { color: var(--ink-faint); }
footer a:hover { color: var(--accent); }

/* ------------------------------------------------------------------ dark -- */
/* Warm dark mode — toggled by the .dark class on <html> (set before paint by
   the inline head script, from localStorage or the OS setting, so there is no
   flash). Same editorial palette, inverted. */
:root.dark {
    --paper:     #1b1714;
    --ink:       #ece6d8;
    --ink-soft:  #b3a995;
    --ink-faint: #8a8170;
    --accent:    #E08A5A;
    --rule:      #3a332b;
}
:root.dark .tag-learn { color: #7FB58A; border-color: #7FB58A; }
:root.dark .tag-link  { color: #8FB0E6; border-color: #8FB0E6; }
:root.dark .me-thread,
:root.dark .me-links a { background: rgba(255,255,255,0.04); }
:root.dark .doc-body code,
:root.dark .doc-body pre { background: rgba(255,255,255,0.06); }
:root.dark .kind-pdf    { color: #E8837A; border-color: #E8837A; }
:root.dark .kind-doc    { color: #8FB0E6; border-color: #8FB0E6; }
:root.dark .kind-sheet,
:root.dark .kind-csv    { color: #7FB58A; border-color: #7FB58A; }
