/* =========================================================
   Emiliano Carrizosa — simple bento
   One font, neutral greys, no accent colour. Dark by default,
   light automatically if the visitor's device prefers it.
   ========================================================= */

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

:root {
    color-scheme: dark light;

    --bg:      #161616;
    --tile:    #1D1D1D;
    --tile-hi: #252525;
    --line:    #2E2E2E;
    --text:    #F2F2F2;
    --dim:     #C6C6C6;
    --mute:    #9A9A9A;

    --radius:  22px;
    --gap:     12px;
    --pad:     clamp(20px, 3vw, 28px);
    --maxw:    920px;
    --gutter:  clamp(16px, 4vw, 40px);
    --sans:    'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

@media (prefers-color-scheme: light) {
    :root {
        --bg:      #F3F3F3;
        --tile:    #FFFFFF;
        --tile-hi: #F8F8F8;
        --line:    #E0E0E0;
        --text:    #161616;
        --dim:     #3F3F3F;
        --mute:    #5F5F5F;
    }
}

html { -webkit-font-smoothing: antialiased; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
    background: var(--bg); color: var(--text);
    font-family: var(--sans); font-size: 17px; line-height: 1.6;
    min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; border-radius: 8px; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip {
    position: absolute; left: 12px; top: -64px; z-index: 200;
    background: var(--text); color: var(--bg);
    padding: 10px 18px; border-radius: 10px; font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---- top bar (category pages) ---- */
.top { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--line); }
.top-in {
    max-width: var(--maxw); margin: 0 auto; padding: 8px var(--gutter);
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.back {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
    padding: 0 16px 0 12px; border-radius: 999px; text-decoration: none; font-weight: 500;
}
.back:hover { background: var(--tile); }
.top nav { display: flex; gap: 2px; }
.top nav a {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 13px;
    border-radius: 999px; color: var(--mute); text-decoration: none; font-size: 15px; font-weight: 500;
}
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--text); background: var(--tile); }

/* ---- page frame ---- */
.page { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: clamp(24px, 5vw, 56px) var(--gutter) 0; }
.page--home { --maxw: 860px; padding-top: clamp(24px, 6vw, 72px); }
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: clamp(2rem, 4.4vw, 2.9rem); font-weight: 500; line-height: 1.1; letter-spacing: -0.015em; }
.lead { color: var(--mute); max-width: 44em; margin-top: 8px; }

/* ---- grid + tiles ---- */
.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile {
    position: relative; min-width: 0; overflow: hidden;
    display: flex; flex-direction: column; gap: 10px;
    background: var(--tile); color: var(--text);
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: var(--pad); grid-column: 1 / -1;
    transition: background .2s, border-color .2s;
}
@media (min-width: 640px) {
    .grid { grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: minmax(150px, auto); }
    .tile { grid-column: span var(--c, 12); grid-row: span var(--r, 1); }
}
.c3 { --c: 3; } .c4 { --c: 4; } .c5 { --c: 5; } .c6 { --c: 6; } .c7 { --c: 7; } .c8 { --c: 8; } .c9 { --c: 9; } .c12 { --c: 12; }
.r2 { --r: 2; }
.t3 { --c: 6; }
@media (min-width: 900px) { .t3 { --c: 4; } }

.tile--link:hover { background: var(--tile-hi); border-color: color-mix(in srgb, var(--text) 35%, transparent); }
.tile:has(.preview--tall) .t-arrow { z-index: 2; background: var(--tile); color: var(--text); }
.tile--link:hover .t-arrow { background: var(--text); color: var(--tile); border-color: var(--text); }

.stretched { text-decoration: none; }
.stretched::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.stretched:focus-visible { outline: none; }
.stretched:focus-visible::after { outline: 3px solid var(--text); outline-offset: -3px; border-radius: var(--radius); }

.t-arrow {
    position: absolute; top: 18px; right: 18px; width: 36px; height: 36px;
    display: grid; place-items: center; border-radius: 50%;
    border: 1px solid var(--line); font-size: 16px; color: var(--mute);
    transition: background .2s, color .2s, border-color .2s;
}

/* ---- type ---- */
.t-title { font-size: 1.3rem; font-weight: 500; line-height: 1.2; letter-spacing: -0.005em; padding-right: 46px; }
.t-title--lg { font-size: clamp(1.5rem, 2.4vw, 1.8rem); }
.label { font-size: 14.5px; color: var(--mute); }
.t-text { color: var(--dim); font-size: 16px; line-height: 1.65; }
.t-text + .t-text { margin-top: 2px; }
.t-sub { color: var(--mute); font-size: 15.5px; margin-top: -4px; }
.t-note { font-size: 14.5px; color: var(--mute); }
.t-foot { margin-top: auto; padding-top: 6px; }
.tagline { color: var(--mute); font-size: 14.5px; }

.ticks { list-style: none; display: grid; gap: 9px; }
.ticks li { position: relative; padding-left: 18px; color: var(--dim); font-size: 15.5px; line-height: 1.55; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 0.7em; width: 8px; height: 2px; background: var(--mute); }

.pills { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.pills li { padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 15px; color: var(--dim); }

.rows { list-style: none; }
.rows li { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 15.5px; }
.rows li:first-child { border-top: 1px solid var(--line); }
.rows .v { color: var(--mute); font-size: 14px; text-align: right; }

.btn {
    display: inline-flex; align-items: center; gap: 10px; align-self: flex-start;
    min-height: 46px; padding: 0 22px; border-radius: 999px;
    border: 1px solid var(--mute); border: 1px solid color-mix(in srgb, var(--text) 40%, transparent);
    color: var(--text); font-weight: 500; font-size: 15.5px; text-decoration: none;
    position: relative; z-index: 2; transition: background .2s, color .2s;
}
.btn:hover { background: var(--text); color: var(--bg); }

/* ---- preview image inside a tile ---- */
.preview {
    position: relative; margin-top: auto; min-height: 170px; flex: 1 1 auto;
    border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--tile-hi);
}
.preview img {
    position: absolute; inset: 0; width: 100%; height: 100%; display: block;
    object-fit: cover; object-position: right top; transform: scale(1.12); transform-origin: right top;
}
.preview--tall { min-height: 220px; flex: 0 0 auto; margin-top: 0; }

/* ---- home page ---- */
.hero-h1 { font-size: clamp(2rem, 4.6vw, 2.9rem); font-weight: 500; line-height: 1.05; letter-spacing: -0.02em; }
.hero-sub { color: var(--mute); font-size: clamp(1.05rem, 1.8vw, 1.25rem); }
.tile--intro { justify-content: center; gap: 12px; }
.tile--intro .t-text { max-width: 30em; }
.tile--portrait { padding: 0; min-height: 190px; }
.tile--portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; display: block; }
.avatar { display: none; }
.tile--icon { align-items: flex-start; justify-content: space-between; }
.tile--icon svg { width: 30px; height: 30px; }
.cat-count { margin-top: auto; color: var(--mute); font-size: 14.5px; }

/* ---- footer ---- */
.foot {
    max-width: var(--maxw); width: 100%; margin: clamp(36px, 6vw, 64px) auto 0;
    padding: 22px var(--gutter) 40px; position: relative;
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px;
    font-size: 14.5px; color: var(--mute);
}
.page--home + .foot { --maxw: 860px; }
.foot::before { content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); border-top: 1px solid var(--line); }
.foot span { padding: 8px 0; display: inline-block; }
.foot a { text-decoration: none; padding: 8px 0; display: inline-block; }
.foot a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }

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

@media (max-width: 639px) {
    .top nav { display: none; }
    .tile--portrait { display: none; }
    .avatar { display: block; width: 72px; height: 72px; border-radius: 50%; object-fit: cover; object-position: 50% 18%; border: 1px solid var(--line); }
    .tile { min-height: 0; }
    .preview { min-height: 150px; }
}
