/* 42 — noir. Black & white, one brass accent, leather-and-stitch details. No build step (plain CSS, like Smarthomes). */

:root {
    --ink: #0b0b0c;
    --char: #121214;
    --hide: #18181b;          /* "leather" surface */
    --line: #2a2a2e;
    --smoke: #8d8a85;
    --ash: #b9b5ae;
    --ivory: #f4f1ea;
    --brass: #c9a66b;
    --oxblood: #8a2b2f;
    --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
    --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --r: 10px;
    --gutter: clamp(16px, 3vw, 36px);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    background: var(--ink);
    color: var(--ivory);
    font: 400 15px/1.5 var(--sans);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}
a { color: inherit; text-decoration-color: color-mix(in srgb, var(--brass) 60%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--brass); }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; }
::selection { background: var(--brass); color: var(--ink); }

.kicker, .panel-head h2, .sub, .fine, .unit, .nav a, .link, .state, .filters button, .hero-count, .colophon {
    font-family: var(--sans);
    text-transform: uppercase;
    letter-spacing: .18em;
    font-size: 10.5px;
    font-weight: 500;
}
.kicker { color: var(--smoke); margin: 0 0 10px; }
.muted { color: var(--smoke); }
.small { font-size: 13px; }
.error { color: #e3a1a1; }
.notice { color: var(--brass); }
.fine { color: var(--smoke); margin: 10px 0 0; letter-spacing: .12em; font-size: 9.5px; }

/* ── top bar ───────────────────────────────────────────── */
.bar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 24px;
    padding: 10px var(--gutter);
    background: color-mix(in srgb, var(--ink) 86%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.brand { display: flex; color: var(--ivory); }
.ring { display: block; }
.nav { display: flex; gap: 22px; }
.nav a { text-decoration: none; color: var(--smoke); padding: 6px 0; border-bottom: 1px solid transparent; }
.nav a.on { color: var(--ivory); border-bottom-color: var(--brass); }
.bar-end { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.bar-end form { margin: 0; }
.link { background: none; border: 0; padding: 4px 0; color: var(--smoke); cursor: pointer; }
.link:hover { color: var(--brass); }
.veil-toggle {
    display: grid; place-items: center; width: 42px; height: 32px;
    background: none; border: 1px solid var(--line); border-radius: 999px; color: var(--smoke); cursor: pointer;
    transition: color .2s, border-color .2s;
}
.veil-toggle:hover, .veiled .veil-toggle { color: var(--brass); border-color: color-mix(in srgb, var(--brass) 50%, var(--line)); }

/* ── today: photograph + board ─────────────────────────── */
.today {
    display: grid;
    grid-template-columns: minmax(320px, 38%) 1fr;
    min-height: calc(100vh - 59px);
}
.hero {
    position: sticky; top: 59px;
    height: calc(100vh - 59px);
    overflow: hidden;
    border-right: 1px solid var(--line);
    cursor: pointer;
    user-select: none;
}
.hero-frame { position: absolute; inset: 0; background: var(--char); }
.hero-img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; object-position: center 35%;
    filter: grayscale(1) contrast(1.06) brightness(.82);
    opacity: 0; transform: scale(1.04);
    transition: opacity 1.6s ease, transform 14s ease-out, filter .6s ease;
}
.hero-img.is-on { opacity: 1; transform: scale(1); }
.hero::after { /* vignette + bottom shade for the text */
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(0,0,0,.55) 100%),
        linear-gradient(to top, rgba(11,11,12,.92) 0%, rgba(11,11,12,.25) 38%, transparent 60%);
}
.hero-grain {
    position: absolute; inset: -50%; pointer-events: none; opacity: .09; mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    animation: grain 1.2s steps(4) infinite;
}
@keyframes grain { 0% { transform: translate(0,0) } 25% { transform: translate(-3%,2%) } 50% { transform: translate(2%,-3%) } 75% { transform: translate(-2%,-1%) } }
.hero-satin { /* what the blindfold shows */
    position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; pointer-events: none;
    background:
        repeating-linear-gradient(115deg, rgba(255,255,255,.035) 0 2px, transparent 2px 9px),
        linear-gradient(160deg, #19191c, #0d0d0f 60%, #141416);
    transition: opacity .5s ease;
}
.hero-satin span { font: italic 400 22px var(--serif); color: var(--smoke); letter-spacing: .08em; }
.veiled .hero-img { filter: grayscale(1) blur(30px) brightness(.4); }
.veiled .hero-satin { opacity: 1; }

.hero-text { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 64px; z-index: 2; }
.hero-text .kicker { color: var(--ash); }
.greeting {
    font: 400 clamp(38px, 4.6vw, 68px)/1.0 var(--serif);
    letter-spacing: -.01em;
}
.greeting em { font-style: italic; color: var(--brass); }
.hero-count {
    position: absolute; right: var(--gutter); bottom: 24px; z-index: 2; margin: 0; color: var(--ash);
}
.hero-count i { color: var(--brass); font-style: normal; padding: 0 4px; }

.board {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    padding: 24px var(--gutter) 40px;
    align-content: start;
}
.slot { min-width: 0; display: flex; flex-direction: column; animation: rise .7s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--n) * 90ms); }
.slot > * { flex: 1; }
.slot--weather, .slot--todos { grid-column: 1 / -1; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ── panels: dark hide, stitched edge, four rivets ────── */
.panel {
    position: relative;
    background:
        radial-gradient(140% 120% at 0% 0%, rgba(255,255,255,.025), transparent 60%),
        var(--hide);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 22px 24px 22px;
    min-height: 120px;
}
.panel .stitch {
    position: absolute; inset: 6px; pointer-events: none;
    border: 1px dashed rgba(244,241,234,.09);
    border-radius: calc(var(--r) - 4px);
}
.panel::after { /* rivets */
    content: ""; position: absolute; inset: 11px; pointer-events: none;
    --rv: radial-gradient(circle, #6b604f 0 1.4px, #2a2721 1.9px, transparent 2.4px);
    background: var(--rv) top left / 6px 6px no-repeat, var(--rv) top right / 6px 6px no-repeat,
                var(--rv) bottom left / 6px 6px no-repeat, var(--rv) bottom right / 6px 6px no-repeat;
}
.panel--loading { display: grid; place-items: center; color: var(--smoke); }
.panel-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; position: relative; z-index: 1; }
.panel-head h2 { color: var(--ash); }
.panel-head .unit { color: var(--smoke); letter-spacing: .12em; font-size: 9.5px; }
.panel-head .link { margin-left: auto; }
.numeral { font: italic 500 20px/1 var(--serif); color: var(--brass); min-width: 18px; }
.sub { color: var(--smoke); margin: 18px 0 10px; display: flex; gap: 8px; align-items: baseline; }
.sub span { color: var(--ash); }
.sub--overdue { color: #d9b37a; }
.panel > *:not(.stitch) { position: relative; z-index: 1; }

/* weather */
.places { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.place { padding: 0 22px; border-left: 1px solid var(--line); }
.place:first-child { padding-left: 0; border-left: 0; }
.place:last-child { padding-right: 0; }
.place-head { display: flex; justify-content: space-between; align-items: baseline; }
.place-head h3 { font: italic 500 22px var(--serif); }
.clock { font: 500 11px var(--sans); color: var(--smoke); letter-spacing: .1em; font-variant-numeric: tabular-nums; }
.place-now { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 2px; color: var(--ash); }
.temp { font: 400 64px/1 var(--serif); font-variant-numeric: lining-nums; color: var(--ivory); letter-spacing: -.02em; }
.temp sup { font-size: .45em; color: var(--brass); vertical-align: top; position: relative; top: .25em; margin-left: 2px; }
.place-line { color: var(--smoke); font-size: 12.5px; margin: 6px 0 14px; }
.days { list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px dashed rgba(244,241,234,.08); display: grid; gap: 6px; }
.days li { display: grid; grid-template-columns: 44px 24px 1fr auto auto; gap: 8px; align-items: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.days .day { color: var(--smoke); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.days .wx { color: var(--ash); }
.days .hi { text-align: right; }
.days .lo { color: var(--smoke); min-width: 30px; text-align: right; }
.days .rain { grid-column: 3; grid-row: 1; color: var(--smoke); font-size: 11px; }

/* silver */
.price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.price .cur { font: 400 30px var(--serif); color: var(--brass); }
.price .amount { font: 400 64px/1 var(--serif); font-variant-numeric: lining-nums; letter-spacing: -.02em; }
.change { margin-left: auto; font-size: 13px; color: var(--ash); font-variant-numeric: tabular-nums; }
.change.up { color: var(--ivory); }
.change.down { color: #c98d8d; }
.price-eur { margin: 2px 0 10px; color: var(--ash); font: italic 400 20px var(--serif); }
.spark { width: 100%; height: 56px; color: var(--brass); display: block; margin-top: 8px; opacity: .9; }

/* scenes: straps with a buckle */
.straps { display: flex; flex-wrap: wrap; gap: 10px; }
.strap {
    display: inline-flex; align-items: center; gap: 12px;
    padding: 10px 16px 10px 12px;
    background: linear-gradient(180deg, #1f1f23, #141416);
    border: 1px solid #34343a; border-radius: 6px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 1px 0 rgba(0,0,0,.6);
    color: var(--ivory); text-decoration: none; cursor: pointer;
    position: relative;
    transition: transform .12s ease, border-color .2s ease;
}
.strap::before { /* stitching along the strap */
    content: ""; position: absolute; inset: 3px 4px; border-top: 1px dashed rgba(244,241,234,.12); border-bottom: 1px dashed rgba(244,241,234,.12); pointer-events: none; border-radius: 3px;
}
.strap:hover { border-color: color-mix(in srgb, var(--brass) 60%, #34343a); color: var(--ivory); }
.strap:active { transform: scale(.97); }
.strap[data-busy] { opacity: .6; }
.buckle {
    width: 13px; height: 17px; border: 1.6px solid var(--brass); border-radius: 3px; position: relative; flex: none;
}
.buckle::after { content: ""; position: absolute; left: 50%; top: 2px; bottom: 2px; width: 1.4px; margin-left: -.7px; background: var(--brass); }
.strap.is-done .buckle { background: color-mix(in srgb, var(--brass) 35%, transparent); }
.strap.is-error { border-color: #6a3434; }
.strap-name { font: 500 12.5px var(--sans); letter-spacing: .04em; }
.strap--wide { padding: 14px 26px 14px 18px; }
.strap--wide .strap-name { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }

/* to-dos */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.filters button {
    display: inline-flex; align-items: center; gap: 8px;
    background: none; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px 6px 8px; color: var(--smoke); cursor: pointer;
    letter-spacing: .12em;
}
.filters button:first-child { padding-left: 12px; }
.filters button > span:last-child { color: var(--ash); }
.filters button.on { color: var(--ivory); border-color: color-mix(in srgb, var(--brass) 55%, var(--line)); }
.filters button.off { opacity: .5; }
.filters button.bad > span:last-child { color: #e3a1a1; }
.mark {
    display: inline-grid; place-items: center; flex: none;
    width: 22px; height: 22px; border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--brass) 70%, transparent);
    font: 600 8px var(--sans); letter-spacing: .06em; color: var(--brass);
}
.todos { list-style: none; margin: 0; padding: 0; }
.todo {
    display: grid; grid-template-columns: 22px 1fr auto; gap: 14px; align-items: center;
    padding: 9px 0; border-bottom: 1px solid rgba(244,241,234,.06);
}
.todo:last-child { border-bottom: 0; }
.todo-title { text-decoration: none; overflow-wrap: anywhere; }
.todo.is-high .todo-title::before { content: "◆ "; color: var(--brass); font-size: 10px; vertical-align: 2px; }
.todo-meta { display: flex; gap: 10px; color: var(--smoke); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.todo-meta span { letter-spacing: .08em; }

/* chain divider + colophon */
.chain {
    grid-column: 1 / -1; height: 12px; margin: 14px 0 0; opacity: .35;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='12'%3E%3Crect x='1' y='2.5' width='14' height='7' rx='3.5' fill='none' stroke='%23c9a66b' stroke-width='1.2'/%3E%3Cline x1='13' y1='6' x2='27' y2='6' stroke='%23c9a66b' stroke-width='1.2'/%3E%3C/svg%3E") repeat-x center;
}
.colophon { grid-column: 1 / -1; text-align: center; color: #5d5a55; margin: 6px 0 0; }

/* ── pages (connections) ───────────────────────────────── */
.page { max-width: 1100px; margin: 0 auto; padding: 36px var(--gutter) 60px; }
.page-head h1 { font: italic 400 52px/1 var(--serif); }
.lede { color: var(--ash); max-width: 60ch; }
.conns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 26px; }
.conn .panel-head { margin-bottom: 4px; align-items: center; }
.state { margin-left: auto; color: var(--smoke); }
.state.ok { color: var(--brass); }
.state.bad { color: #e3a1a1; }
.help { color: var(--ash); font-size: 13.5px; }
.token-form { display: flex; gap: 10px; margin-top: 12px; }
.token-form input {
    flex: 1; min-width: 0; background: var(--ink); color: var(--ivory); border: 1px solid var(--line); border-radius: 6px;
    padding: 10px 12px; font: 13px ui-monospace, SFMono-Regular, Menlo, monospace;
}
.token-form input:focus { outline: none; border-color: var(--brass); }
.conn-actions { display: flex; gap: 18px; margin-top: 12px; }

/* ── the door (sign in) ───────────────────────────────── */
.door {
    min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    padding: 40px var(--gutter);
    background: radial-gradient(60% 50% at 50% 40%, #17171a, var(--ink));
}
.door-mark { color: var(--ivory); margin-bottom: 22px; }
.door-title { font: 400 clamp(40px, 7vw, 76px)/1 var(--serif); margin-bottom: 34px; }
.door-title em { color: var(--brass); }
.door .chain { width: min(320px, 70vw); margin-top: 40px; }

/* ── small screens ─────────────────────────────────────── */
@media (max-width: 1100px) {
    .places { grid-template-columns: 1fr; }
    .place { padding: 16px 0; border-left: 0; border-top: 1px solid var(--line); }
    .place:first-child { padding-top: 0; border-top: 0; }
    .days { grid-template-columns: repeat(5, 1fr); gap: 4px; }
    .days li { grid-template-columns: 1fr; justify-items: center; gap: 2px; text-align: center; }
    .days .hi, .days .lo { text-align: center; }
    .days .rain { grid-column: auto; grid-row: auto; }
}
@media (max-width: 860px) {
    .today { grid-template-columns: 1fr; }
    .hero { position: relative; top: 0; height: 58vh; min-height: 360px; border-right: 0; border-bottom: 1px solid var(--line); }
    .board { grid-template-columns: 1fr; padding-top: 18px; }
    .conns { grid-template-columns: 1fr; }
    .nav { gap: 16px; }
    .bar { gap: 16px; }
}
@media (max-width: 480px) {
    .panel { padding: 18px 16px; }
    .temp, .price .amount { font-size: 54px; }
    .todo { grid-template-columns: 22px 1fr; }
    .todo-meta { grid-column: 2; }
    .nav a:not(.on) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .slot, .hero-grain { animation: none; }
    .hero-img { transition: opacity .3s; transform: none; }
}
