/* arpwal.com — shared styles for every page.
 * Monochrome zinc palette, JetBrains Mono and a faint 40px grid, matching codemany.com. */
:root {
    --background: #ffffff;
    --foreground: #09090b;
    --muted-foreground: #71717a;
    --border: #e4e4e7;
    --muted: #f4f4f5;
    --grid: #00000008;
    --primary: #18181b;
    --primary-foreground: #fafafa;
    --font: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

body {
    margin: 0;
    padding: 0;
    color: var(--foreground);
    font-family: var(--font);
    font-size: 13px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    background-color: var(--background);
    background-image:
        linear-gradient(90deg, var(--grid) 1px, #0000 1px),
        linear-gradient(var(--grid) 1px, #0000 1px);
    background-size: 40px 40px;
}

#contents {
    max-width: 880px;
    margin: 40px auto;
    padding: 24px 40px;
    background: color-mix(in srgb, var(--background) 88%, transparent);
    border: 1px solid var(--border);
    border-radius: 8px;
}

@media (max-width: 700px) {
    #contents { margin: 0; padding: 16px; border: 0; border-radius: 0; }
}

h2 { font-size: 20px; letter-spacing: -0.02em; margin: 8px 0 16px; }
h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; margin: 28px 0 10px;
     padding-bottom: 6px; border-bottom: 1px solid var(--border); }
h4 { font-size: 13px; }

a { color: var(--foreground); text-decoration: underline; text-decoration-color: var(--muted-foreground);
    text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--foreground); background: var(--muted); }
:focus-visible { outline: 2px solid var(--foreground); outline-offset: 3px; border-radius: 4px; }

code, .code {
    font: inherit; font-size: .95em; background: var(--muted);
    border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; overflow-wrap: anywhere;
}

ul li { margin-top: 4px; }

.muted { color: var(--muted-foreground); }
.error { color: var(--foreground); font-weight: 700; }
.error::before { content: "! "; }
.error:empty::before { content: none; }

/* Photos stay monochrome until hovered. */
img, .row-thumb { filter: grayscale(1); transition: filter .2s; }
img:hover, video:hover { filter: none; }
.avatar { width: 144px; float: right; border-radius: 8px; border: 1px solid var(--border); margin: 0 0 12px 16px; }

/* Buttons */
button, .btn {
    font: inherit; font-weight: 500; height: 32px; padding: 0 14px; cursor: pointer;
    border-radius: 6px; border: 1px solid var(--border); background: var(--background); color: var(--foreground);
    transition: background-color .15s, color .15s;
}
button:hover { background: var(--muted); }
button[type=submit], .btn-primary { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }
button[type=submit]:hover, .btn-primary:hover { background: #3f3f46; }
button:disabled { opacity: .6; cursor: progress; }

/* Forms (admin upload, apply to invest) */
form.admin label, .form-group label { display: block; margin-top: 12px; margin-bottom: 4px; font-weight: 700; }
input[type=text], input[type=password], input[type=email], input[type=number], select, textarea {
    width: 100%; max-width: 560px; padding: 8px; font: inherit; color: var(--foreground);
    background: var(--background); border: 1px solid var(--border); border-radius: 6px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--foreground); }
progress { width: 100%; max-width: 560px; accent-color: var(--foreground); }

/* Project lists (landing page + journey share this layout) */
ul.projects > li { margin-bottom: 28px; }
ul.projects > li > a:first-child { font-weight: 700; }
.press { font-size: 12px; color: var(--muted-foreground); }
.figure-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 220px)); gap: 14px; margin: 18px 0 10px; align-items: start; }
.figure-row.wide { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.figure-row.wide figure { max-width: 640px; }
.figure-row.wide img { max-height: 460px; }
.offline { display: block; margin-top: 2px; font-size: 11px; opacity: .75; }
.figure-row figure { margin: 0; min-width: 0; }
.figure-row img { display: block; width: 100%; height: auto; max-height: 340px; object-fit: contain; background: var(--muted);
    border-radius: 6px; border: 1px solid var(--border); }
.figure-row figcaption { font-size: 11px; color: var(--muted-foreground); margin-top: 4px; line-height: 1.4; }
@media (max-width: 700px) { .avatar { width: 96px; } }

/* Social logos under the name */
.socials { display: flex; gap: 10px; margin: -6px 0 10px; }
.socials a { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--border);
    border-radius: 6px; background: var(--background); }
.socials a:hover { background: var(--muted); }
.socials img { width: 16px; height: 16px; filter: none; }

/* Resume rows (single-page index); each row opens its project in the drawer */
ul.resume { list-style: none; padding: 0; margin: 8px 0 0; }
ul.resume > li { margin: 0; border-bottom: 1px dashed var(--border); }
ul.resume > li:last-child { border-bottom: 0; }
.row { display: block; padding: 10px 6px; color: var(--foreground); text-decoration: none; border-radius: 6px; }
.row:hover { background: var(--muted); }
.row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.row-title { font-weight: 700; font-size: 14px; letter-spacing: -0.01em; }
.row-title::after { content: " \2197"; font-weight: 400; color: var(--muted-foreground); font-size: 11px; }
.row-role { color: var(--muted-foreground); font-size: 12px; }
.row-head .when { color: var(--muted-foreground); font-size: 12px; white-space: nowrap; }
.row-fact { display: block; color: var(--muted-foreground); font-size: 11.5px; line-height: 1.55; margin-top: 3px; }
.row-head + .row-fact { margin-top: 6px; }
.row-fact:has(> b) { display: grid; grid-template-columns: 64px 1fr; align-items: baseline; }

/* Project pages and the drawer that shows them */
.project .fact { font-style: italic; color: var(--muted-foreground); margin-top: -8px; }
.project ul.projects { list-style: none; padding-left: 0; }
dialog.drawer {
    margin: 0 0 0 auto; padding: 0; width: 60vw; max-width: none; height: 100dvh; max-height: none;
    border: 0; border-left: 1px solid var(--border); color: var(--foreground);
    background-color: var(--background);
    background-image: linear-gradient(90deg, var(--grid) 1px, #0000 1px), linear-gradient(var(--grid) 1px, #0000 1px);
    background-size: 40px 40px;
    transition: translate .25s ease, display .25s allow-discrete, overlay .25s allow-discrete;
    translate: 100% 0;
}
dialog.drawer[open] { translate: 0 0; }
@starting-style { dialog.drawer[open] { translate: 100% 0; } }
dialog.drawer::backdrop { background: #09090b59; }
.drawer-bar { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center;
    padding: 10px 24px; background: color-mix(in srgb, var(--background) 92%, transparent); border-bottom: 1px solid var(--border); }
.drawer-bar button { width: 32px; padding: 0; font-size: 18px; line-height: 1; }
.drawer-body { padding: 8px 40px 40px; }
.drawer-body[aria-busy="true"]::before { content: "Loading…"; color: var(--muted-foreground); display: block; padding: 24px 0; }
@media (max-width: 768px) {
    dialog.drawer { width: 100vw; border-left: 0; }
    .drawer-body { padding: 8px 16px 32px; }
}
@media (prefers-reduced-motion: reduce) { dialog.drawer { transition: none; } }

/* Likes: sticky site heart (bottom right) and a heart on every photo */
.site-like { position: fixed; right: 20px; bottom: 20px; z-index: 10; height: 40px; padding: 0 16px; border-radius: 999px;
    background: var(--background); box-shadow: 0 1px 2px #0000000d, 0 8px 24px -12px #0000001f; }
.site-like::after { content: attr(data-tip); position: absolute; right: 0; bottom: calc(100% + 8px); white-space: nowrap;
    padding: 6px 10px; border-radius: 6px; background: var(--primary); color: var(--primary-foreground); font-size: 12px;
    opacity: 0; translate: 0 4px; pointer-events: none; transition: opacity .15s, translate .15s; }
.site-like:hover::after, .site-like:focus-visible::after { opacity: 1; translate: 0 0; }
figure.likeable { position: relative; }
.photo-like { position: absolute; top: 8px; right: 8px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px;
    background: color-mix(in srgb, var(--background) 88%, transparent); }
[data-like][aria-pressed="true"] { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }
.like-error .like-count::after { content: " !"; }

/* Problem / impact rows */
.row-fact b { display: inline-block; min-width: 58px; color: var(--muted-foreground); font-weight: 700; font-size: 10px;
    text-transform: uppercase; letter-spacing: 0.06em; opacity: .8; }
dl.pis { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 12px 0 18px; padding: 12px 14px;
    border: 1px solid var(--border); border-radius: 8px; background: var(--muted); }
dl.pis dt { font-weight: 700; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-foreground); padding-top: 2px; }
dl.pis dd { color: var(--muted-foreground); font-size: 12px; }
dl.pis dd { margin: 0; }

/* University */
.school { margin: 8px 0 18px; }
.school-head { display: flex; justify-content: space-between; align-items: baseline; margin: 10px 0 2px; }
.school-head .when { color: var(--muted-foreground); font-size: 12px; }
.school ul.resume { margin-left: 12px; }

/* Investing: entry years, kept quiet */
.investments { color: var(--muted-foreground); font-size: 12px; line-height: 2; }
.investments .yr { opacity: .6; }

/* Videos: tiny thumbnails in project rows, natural-shape players in drawers */
.row-media { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; vertical-align: middle; }
.row-thumb { width: 22px; height: 22px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); background: var(--foreground); }
.row-media-label { font-size: 10px; color: var(--muted-foreground); margin-left: 2px; }
.project-videos h3 { margin-top: 8px; }
.video-grid { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.video-player { margin: 0; max-width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.video-player video { display: block; max-width: 100%; max-height: 62vh; width: auto; border-radius: 8px;
    background: #000; border: 1px solid var(--border); filter: none; }
.video-player figcaption { font-size: 12px; max-width: 320px; }
.video-player .like-btn { align-self: flex-start; }
.like-btn { border-radius: 999px; height: 28px; padding: 0 12px; }
.like-btn[aria-pressed="true"] { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }

/* Publication snippets: a short quoted excerpt, kept small */
.snippets { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 10px 0; }
.snippet { display: block; margin: 0; padding: 12px 14px; border: 1px solid var(--border); border-left: 2px solid var(--foreground);
    border-radius: 6px; background: var(--background); color: var(--foreground); text-decoration: none; }
a.snippet:hover { background: var(--muted); }
.snippet b { display: block; font-size: 12px; line-height: 1.4; }
.snippet p { margin: 6px 0; font-size: 12px; font-style: italic; color: var(--muted-foreground); line-height: 1.5; }
.snippet footer { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-foreground); }
main.project .snippet { margin: 0 0 16px; }

/* Embedded YouTube video (SigEntry) */
.yt { position: relative; width: 100%; max-width: 560px; aspect-ratio: 4 / 3; margin: 10px 0; border-radius: 8px; overflow: hidden;
    border: 1px solid var(--border); background: #000; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
