/* ============================================================
   dgaitsgo — data visualization portfolio
   Tokens match dgaitsgo.com
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font: inherit; color: inherit; border: none; background: none; }

:root {
  --bg:          #0a0a0a;
  --surface:     #111111;
  --surface-2:   #1a1a1a;
  --border:      #222222;
  --border-2:    #333333;
  --text:        #e4e1dc;
  --text-muted:  #8a8a8a;
  --text-faint:  #555555;
  --accent:      #c8964a;
  --accent-dim:  rgba(200, 150, 74, 0.10);
  --accent-dim2: rgba(200, 150, 74, 0.18);
  --radius:      8px;
  --max-w:       1240px;
  --sans:        'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:        'JetBrains Mono', ui-monospace, Menlo, monospace;
  --ease:        cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent-dim2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .container { padding: 0 40px; } }

.mono { font-family: var(--mono); }

/* ---- Top bar ---- */
.bar { border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; background: rgba(10, 10, 10, 0.88); backdrop-filter: blur(10px); }
.bar-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }
.logo { font-weight: 800; letter-spacing: -0.02em; font-size: 18px; }
.logo .dot { color: var(--accent); }
.logo small { font: 500 12px var(--mono); color: var(--text-muted); margin-left: 10px; letter-spacing: 0; }
.bar nav { display: flex; gap: 20px; font-size: 14px; color: var(--text-muted); }
.bar nav a:hover { color: var(--text); }
@media (max-width: 480px) { .logo small { display: none; } .bar nav { gap: 14px; font-size: 13px; } }

/* ---- Panel ---- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#panel { padding-top: 26px; }
@media (max-width: 600px) { #panel { padding-top: 6px; } }

/* ---- Filters ---- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 26px; }
.chip {
  font: 500 12px var(--mono); padding: 6px 12px; border-radius: 99px; border: 1px solid var(--border-2);
  color: var(--text-muted); transition: all .15s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--text-faint); }
.chip[aria-pressed="true"] { color: var(--bg); background: var(--text); border-color: var(--text); }
.chip .n { opacity: .55; margin-left: 4px; }

/* ---- Grid ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 28px 24px; padding-bottom: 64px; }
.card { display: flex; flex-direction: column; gap: 12px; }
.card .thumb {
  aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden; background: var(--surface-2);
  border: 1px solid var(--border); position: relative;
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease), filter .3s; }
.card:hover .thumb img { transform: scale(1.03); }
.card .badge {
  position: absolute; top: 10px; left: 10px; font: 500 11px var(--mono); padding: 3px 8px; border-radius: 99px;
  background: rgba(10, 10, 10, .78); color: var(--text); backdrop-filter: blur(6px);
}
.card .meta { display: flex; justify-content: space-between; gap: 12px; font: 500 12px var(--mono); color: var(--text-faint); }
.card .meta .k { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card h3 { font-size: 18px; line-height: 1.25; letter-spacing: -0.015em; font-weight: 600; margin-top: -4px; }
.card:hover h3 { color: var(--accent); }
.card p { font-size: 14px; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font: 500 11px var(--mono); color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border); padding: 2px 7px; border-radius: 4px; }
.empty { color: var(--text-muted); padding: 40px 0; }

footer { border-top: 1px solid var(--border); padding: 28px 0 40px; color: var(--text-faint); font-size: 13px; }
footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer a:hover { color: var(--text); }

/* ============================================================
   Work page
   ============================================================ */
.work-head { padding: 40px 0 24px; }
.crumbs { font: 500 12px var(--mono); color: var(--text-muted); display: flex; gap: 10px; align-items: center; margin-bottom: 22px; }
.crumbs a:hover { color: var(--text); }
.work-head h1 { font-size: clamp(30px, 5vw, 52px); line-height: 1.05; letter-spacing: -0.03em; font-weight: 700; max-width: 22ch; }
.work-head .kicker { font: 500 13px var(--mono); color: var(--text-muted); margin-top: 14px; }

.stage { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.stage-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--border); font: 500 12px var(--mono); color: var(--text-muted); }
.stage-bar .path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-bar a { color: var(--text); white-space: nowrap; }
.stage-bar a:hover { color: var(--accent); }
.stage iframe { display: block; width: 100%; height: min(78vh, 860px); border: 0; background: #fff; }
.stage img { width: 100%; background: #fff; }
.stage .load { display: grid; place-items: center; height: min(78vh, 860px); }
.stage .load button { font: 500 14px var(--mono); padding: 12px 20px; border: 1px solid var(--border-2); border-radius: 99px; color: var(--text); }
.stage .load button:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 700px) { .stage iframe, .stage .load { height: 70vh; } }

.work-body { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 48px; padding: 36px 0 20px; }
.work-body .text p { color: #c9c6c1; font-size: 17px; line-height: 1.7; margin-bottom: 16px; max-width: 66ch; }
.work-body .text p.lead { color: var(--text); font-size: 19px; }
.work-body .note { font-size: 13px; color: var(--text-muted); border-left: 2px solid var(--border-2); padding-left: 12px; margin-top: 8px; }
.facts dt { font: 500 11px var(--mono); color: var(--text-faint); text-transform: uppercase; letter-spacing: .08em; margin-top: 18px; }
.facts dt:first-child { margin-top: 0; }
.facts dd { margin-top: 6px; font-size: 14px; }
.facts dd a { color: var(--accent); }
.facts dd a:hover { text-decoration: underline; }
.facts dd li + li { margin-top: 4px; }
@media (max-width: 860px) { .work-body { grid-template-columns: 1fr; gap: 28px; } }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; align-items: start; padding: 8px 0 24px; }
.gallery figure { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #fff; }
.gallery figcaption { background: var(--surface); color: var(--text-muted); font: 500 12px var(--mono); padding: 8px 12px; }

/* Pager */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; border-top: 1px solid var(--border); padding: 28px 0 56px; margin-top: 40px; }
.pager a { display: block; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); }
.pager a:hover { border-color: var(--border-2); background: var(--surface); }
.pager small { display: block; font: 500 11px var(--mono); color: var(--text-faint); margin-bottom: 4px; }
.pager .next { text-align: right; }
.pager span { font-weight: 600; }
