/* ============================================
   Rostyslav Daily: main stylesheet
   One file, no build step, no web fonts: the
   page is text first and loads at once.
   ============================================ */

/* --- Colours and type --- */
:root {
    --paper: #faf8f3;
    --surface: #ffffff;
    --ink: #17191d;
    --ink-soft: #4a4f57;
    --ink-faint: #7b8088;
    --rule: #e3dfd6;
    --accent: #b3261e;
    --link: #1d4ed8;
    --world: #b3261e;
    --us: #1f5fbf;
    --tech: #0f766e;
    --ai: #7c3aed;
    --robotics: #c2620a;
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --measure: 68ch;
    --wide: 1120px;
    --radius: 10px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --paper: #101216;
        --surface: #181b21;
        --ink: #eceef1;
        --ink-soft: #b9bec7;
        --ink-faint: #8a909a;
        --rule: #2a2e36;
        --accent: #ff7a70;
        --link: #8ab4ff;
        --world: #ff7a70;
        --us: #7fb0ff;
        --tech: #4fd1c5;
        --ai: #b79bff;
        --robotics: #ffa94d;
    }
}

/* --- Base --- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.55;
    text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; }
.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--surface); padding: 8px 12px; border-radius: 6px; z-index: 10; }

/* --- Masthead --- */
.masthead { border-bottom: 3px double var(--rule); padding: 22px 0 16px; text-align: center; }
.masthead .dateline {
    font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint);
}
.masthead .title {
    font-family: var(--serif); font-weight: 700; letter-spacing: -0.015em;
    font-size: clamp(38px, 7vw, 68px); line-height: 1.02; margin: 6px 0 6px;
}
.masthead .title a:hover { text-decoration: none; }
.masthead .tagline { color: var(--ink-soft); font-size: 15px; margin: 0; }

/* --- Navigation --- */
.nav { position: sticky; top: 0; z-index: 5; background: var(--paper); border-bottom: 1px solid var(--rule); }
.nav ul {
    list-style: none; margin: 0 auto; padding: 0 12px; max-width: var(--wide);
    display: flex; justify-content: center; gap: 2px; overflow-x: auto; scrollbar-width: none;
}
.nav ul::-webkit-scrollbar { display: none; }
.nav a {
    display: block; padding: 12px 14px; font-size: 14px; font-weight: 600; letter-spacing: 0.03em;
    white-space: nowrap; color: var(--ink-soft); border-bottom: 3px solid transparent;
}
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--tab, var(--accent)); }

/* --- Section colours --- */
.s-world { --tab: var(--world); }
.s-us { --tab: var(--us); }
.s-tech { --tab: var(--tech); }
.s-ai { --tab: var(--ai); }
.s-robotics { --tab: var(--robotics); }
.kicker {
    display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--tab, var(--accent));
}
.kicker:hover { text-decoration: none; opacity: 0.8; }

/* --- Home --- */
main { padding: 28px 0 56px; }
.edition { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.edition h2, .rail h2 {
    font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; margin: 0; color: var(--ink-soft);
}
.edition .count { font-size: 13px; color: var(--ink-faint); }

.lead {
    display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 28px; align-items: center;
    padding: 26px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
}
.lead h3 { font-family: var(--serif); font-size: clamp(28px, 4vw, 44px); line-height: 1.08; letter-spacing: -0.01em; margin: 10px 0 12px; }
.lead p.dek { font-size: 19px; color: var(--ink-soft); margin: 0 0 14px; }
.plate {
    aspect-ratio: 4 / 3; border-radius: var(--radius); position: relative; overflow: hidden;
    background:
        radial-gradient(120% 90% at 15% 10%, color-mix(in srgb, var(--tab, var(--accent)) 55%, transparent), transparent 60%),
        radial-gradient(100% 100% at 90% 95%, color-mix(in srgb, var(--tab, var(--accent)) 30%, transparent), transparent 55%),
        linear-gradient(135deg, color-mix(in srgb, var(--tab, var(--accent)) 16%, var(--surface)), var(--surface));
    border: 1px solid var(--rule);
}
.plate::after {
    content: attr(data-word); position: absolute; left: 18px; bottom: 10px;
    font-family: var(--serif); font-weight: 700; font-size: clamp(40px, 7vw, 84px); line-height: 1;
    color: color-mix(in srgb, var(--tab, var(--accent)) 60%, transparent); letter-spacing: -0.03em;
}

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 20px; }
.card {
    background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
    padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 8px;
    border-top: 3px solid var(--tab, var(--accent));
}
.card h3 { font-family: var(--serif); font-size: 22px; line-height: 1.18; margin: 0; letter-spacing: -0.005em; }
.card p { margin: 0; color: var(--ink-soft); font-size: 15.5px; }
.meta { font-size: 13px; color: var(--ink-faint); margin-top: auto; padding-top: 4px; }
.dot::before { content: "·"; margin: 0 6px; }

.rail { margin-top: 40px; }
.rail-head { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 2px solid var(--tab, var(--accent)); padding-bottom: 8px; margin-bottom: 4px; }
.rail-head h2 { color: var(--tab, var(--accent)); font-size: 14px; }
.rail-head a { font-size: 13px; color: var(--ink-faint); }
.row { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.row time { font-size: 13px; color: var(--ink-faint); padding-top: 4px; }
.row h3 { font-family: var(--serif); font-size: 21px; line-height: 1.2; margin: 0 0 4px; }
.row p { margin: 0; color: var(--ink-soft); font-size: 15.5px; }

.empty {
    text-align: center; padding: 64px 20px; background: var(--surface);
    border: 1px dashed var(--rule); border-radius: var(--radius); color: var(--ink-soft);
}
.empty h3 { font-family: var(--serif); font-size: 28px; margin: 0 0 8px; color: var(--ink); }

/* --- Section and archive pages --- */
.page-head { margin-bottom: 18px; }
.page-head h1 { font-family: var(--serif); font-size: clamp(34px, 5vw, 52px); line-height: 1.05; margin: 4px 0 6px; letter-spacing: -0.01em; }
.page-head p { margin: 0; color: var(--ink-soft); }
.day { margin: 30px 0 0; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }

/* --- Story --- */
.story { max-width: var(--measure); margin: 0 auto; }
.story h1 { font-family: var(--serif); font-size: clamp(32px, 5.2vw, 50px); line-height: 1.07; letter-spacing: -0.012em; margin: 10px 0 14px; }
.story .dek { font-size: 21px; line-height: 1.4; color: var(--ink-soft); margin: 0 0 18px; }
.byline { font-size: 14px; color: var(--ink-faint); padding: 12px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-bottom: 24px; }
.byline strong { color: var(--ink-soft); font-weight: 600; }
.story .body p { font-family: var(--serif); font-size: 20px; line-height: 1.62; margin: 0 0 1.05em; }
.story .body p:first-child::first-letter {
    float: left; font-size: 3.3em; line-height: 0.86; padding: 6px 8px 0 0; font-weight: 700; color: var(--tab, var(--accent));
}
.box { background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--tab, var(--accent)); border-radius: var(--radius); padding: 18px 20px; margin: 26px 0; }
.box h2 { font-size: 13px; letter-spacing: 0.13em; text-transform: uppercase; margin: 0 0 8px; color: var(--tab, var(--accent)); }
.box ul { margin: 0; padding-left: 20px; }
.box li { margin: 6px 0; }
.box p { margin: 0; }
.sources { margin-top: 30px; }
.sources h2 { font-size: 13px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 8px; }
.sources ol { margin: 0; padding-left: 22px; }
.sources li { margin: 8px 0; font-size: 15.5px; }
.sources a { color: var(--link); }
.sources .outlet { color: var(--ink-faint); }
.note { font-size: 14px; color: var(--ink-faint); border-top: 1px solid var(--rule); margin-top: 30px; padding-top: 14px; }
.note a { color: var(--link); }
.more { max-width: var(--measure); margin: 44px auto 0; }

/* --- Social and About --- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 22px; }
.social {
    display: flex; flex-direction: column; gap: 6px; padding: 20px; background: var(--surface);
    border: 1px solid var(--rule); border-radius: var(--radius); transition: transform 0.15s ease, border-color 0.15s ease;
}
a.social:hover { transform: translateY(-2px); border-color: var(--ink-faint); text-decoration: none; }
.social .name { font-family: var(--serif); font-size: 22px; font-weight: 700; }
.social .text { color: var(--ink-soft); font-size: 15px; }
.social .state { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); margin-top: 6px; }
.social.live .state { color: var(--tech); }
.prose { max-width: var(--measure); }
.prose h2 { font-family: var(--serif); font-size: 26px; margin: 32px 0 8px; }
.prose p, .prose li { font-size: 18px; color: var(--ink-soft); }
.prose a { color: var(--link); }

/* --- Footer --- */
footer { border-top: 3px double var(--rule); padding: 28px 0 40px; color: var(--ink-faint); font-size: 14px; }
footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
footer h4 { font-family: var(--serif); font-size: 18px; color: var(--ink); margin: 0 0 8px; }
footer ul { list-style: none; margin: 0; padding: 0; }
footer li { margin: 5px 0; }
footer .fine { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--rule); }

/* --- Small screens --- */
@media (max-width: 860px) {
    .lead { grid-template-columns: 1fr; padding: 20px; }
    .plate { aspect-ratio: 16 / 7; order: -1; }
    .grid { grid-template-columns: 1fr; }
    .nav ul { justify-content: flex-start; }
    footer .cols { grid-template-columns: 1fr; }
    .row { grid-template-columns: 1fr; gap: 2px; }
    .story .body p { font-size: 19px; }
}
@media (min-width: 861px) and (max-width: 1040px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media print { .nav, footer, .more { display: none; } body { background: #fff; } }
