/* Homepage only. The writing pages keep styles.css.
   One column, one typeface, one toy. The accent colour is set by the
   temperature slider (home.js): cool at 0, hot at 2. */

:root {
    --bg:    #FCFCFA;
    --ink:   #1B1B1B;
    --muted: #6A6A66;
    --faint: #E6E5E0;
    --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    --mono:  ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}
[data-theme="dark"] {
    --bg:    #141414;
    --ink:   #E9E7E2;
    --muted: #9A9893;
    --faint: #2C2C2A;
}

/* accent before JS takes over (home.js blends it with the temperature) */
:root { --accent: #6A44C8; }
[data-theme="dark"] { --accent: #B39BFF; }

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--serif);
    font-size: 19px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background 300ms;
}

a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 0.2em;
    transition: color 150ms, text-decoration-color 400ms;
}
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--accent); color: var(--bg); }

.page {
    max-width: 42rem;
    margin: 0 auto;
    padding: clamp(3rem, 10vh, 6.5rem) 20px 4rem;
}

/* ---------- intro ---------- */
.intro {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.face {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    object-fit: cover;
    flex: none;
}
h1 {
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

/* ---------- the temperature toy ---------- */
.temp {
    display: none;                    /* needs JS */
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    margin-top: 2.2rem;
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--muted);
}
.js .temp { display: flex; }

.temp output {
    min-width: 2.9em;
    font-variant-numeric: tabular-nums;
    color: var(--accent);
    font-weight: 600;
    transition: color 400ms;
}
.t-note { font-style: italic; }
.copy {
    font: inherit;
    font-style: normal;
    color: var(--accent);
    background: none;
    border: 0;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 9rem;
    height: 22px;
    background: transparent;
    cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, #2F5BD3, #6A44C8 33%, #B7337F 66%, #DB3B1C);
}
input[type="range"]::-moz-range-track {
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, #2F5BD3, #6A44C8 33%, #B7337F 66%, #DB3B1C);
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    margin-top: -6px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--accent);
    transition: border-color 400ms;
}
input[type="range"]::-moz-range-thumb {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--accent);
}

.bio {
    margin-top: 0.9rem;
    transition: opacity 160ms;
}
.bio.swap { opacity: 0; }
.bio p + p { margin-top: 0.9em; }

/* at 2.0 the bio is sampled garbage: show it as tokens, click to resample */
.bio.hot-on { cursor: pointer; }
.bio .hot { color: color-mix(in srgb, var(--accent) 78%, var(--ink)); }

.interests {
    margin-top: 1.3rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--muted);
}

.links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.1rem 0.9rem;
    margin-top: 0.2rem;
    font-size: 0.92rem;
}

/* ---------- lists ---------- */
section { margin-top: 3.6rem; }

h2 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.9rem;
    color: var(--muted);
}

.list { list-style: none; }
.list li + li { margin-top: 0.95rem; }
.list li[hidden] { display: none; }
.list .meta {
    display: block;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--muted);
}
.list .title { text-decoration-color: var(--faint); }
.list .title:hover { text-decoration-color: var(--accent); }
.list .flag { font-style: italic; color: var(--accent); transition: color 400ms; }

.news li {
    display: grid;
    grid-template-columns: 4.6rem 1fr;
    gap: 0.8rem;
    font-size: 0.97rem;
    line-height: 1.5;
}
.news .when { font-size: 0.85rem; color: var(--muted); padding-top: 0.1rem; }

.writing li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}
.writing li + li { margin-top: 0.45rem; }
.writing .when { flex: none; font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.more {
    margin-top: 0.8rem;
    font: inherit;
    font-size: 0.9rem;
    color: var(--muted);
    background: none;
    border: 0;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: var(--faint);
    text-underline-offset: 0.2em;
}
.more:hover { color: var(--accent); }

/* ---------- footer ---------- */
.foot {
    display: flex;
    justify-content: space-between;
    margin-top: 4.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--faint);
    font-size: 0.85rem;
    color: var(--muted);
}
.theme {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: var(--faint);
    text-underline-offset: 0.2em;
}
.theme:hover { color: var(--accent); }

@media (max-width: 520px) {
    body { font-size: 18px; }
    .news li { grid-template-columns: 1fr; gap: 0; }
    .writing li { flex-direction: column; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
