/* zoltanberki.com — Bento: an Apple-keynote grid of glass tiles that spring
   in and lift on hover. */

.glow { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 600px at 15% -10%, rgba(43, 92, 255, .35), transparent 60%),
    radial-gradient(800px 600px at 100% 20%, rgba(155, 77, 255, .25), transparent 60%),
    radial-gradient(700px 500px at 50% 110%, rgba(233, 196, 106, .14), transparent 60%); }

.wrap { width: min(1200px, 100% - 32px); margin: 0 auto; padding-top: 32px; }
.bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.bento + .bento { margin-top: 16px; }
.tile { padding: 24px; border-radius: 28px; }
.js .tile.reveal { transform: translateY(24px) scale(.94); transition-timing-function: var(--spring), var(--spring), var(--ease); }
.js .tile.reveal.is-in { transform: none; }
.tile.glass { transition: transform .5s var(--spring), border-color .3s, opacity .7s var(--ease); }
.tile.glass.is-in:hover, .tile.glass:hover { transform: translateY(-4px); border-color: rgba(255, 255, 255, .2); }

/* top: the intro, then the button box, on the left; the featured card spans both rows on the right */
.top { grid-template-areas: "intro intro feat feat" "nav nav feat feat"; grid-template-rows: 1fr auto; }   /* the intro takes the spare height, the buttons stay small */
.tile--intro { grid-area: intro; display: grid; gap: 18px; align-content: center;
  background: linear-gradient(160deg, rgba(43, 92, 255, .22), rgba(255, 255, 255, .02) 60%); }
.tile--feature { grid-area: feat; padding: 0; }
.intro__id { display: flex; align-items: center; gap: 18px; }
.intro__photo { width: 84px; height: 84px; border-radius: 22px; object-fit: cover; object-position: 50% 28%; flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, .25); }
.intro__name { font-size: clamp(34px, 4vw, 48px); font-weight: 700; letter-spacing: -.04em; line-height: 1.02; }
.intro__role { font-size: 16px; font-weight: 600; margin-top: 4px; }
.intro__loc { font-size: 14px; }

.feature--bento { height: 100%; border-radius: 28px;
  background: linear-gradient(160deg, rgba(233, 196, 106, .14), rgba(255, 255, 255, .02) 60%); }

.tile--stat { display: flex; flex-direction: column; justify-content: space-between; gap: 8px; padding: 20px 22px; }
.stat__value { font-size: 44px; font-weight: 700; letter-spacing: -.04em; line-height: 1;
  background: linear-gradient(135deg, #fff, var(--accent) 60%, var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat__label { color: var(--muted); font-size: 14px; }


/* the button box: four equal buttons, an icon above each name; 4 x 1, or 2 x 2 when narrow */
.tile--nav { grid-area: nav; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 12px; }
.navbtn { display: grid; justify-items: center; align-content: center; gap: 8px; padding: 16px 8px; border-radius: 18px;
  font-size: 14px; font-weight: 600; color: #d9dce4;
  background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .10); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
  transition: transform .35s var(--spring), background .25s, border-color .25s, color .25s; }
.navbtn:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .09); border-color: rgba(255, 255, 255, .2); color: #fff; }
.navbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.navbtn .ico { width: 24px; height: 24px; }
.ico--g { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.navbtn:nth-child(1) .ico { color: var(--accent); }
.navbtn:nth-child(2) .ico { color: #ffd166; }
.navbtn--li .ico { color: #3b9bff; }
.navbtn--gh .ico { color: #fff; }

/* Experience opens with the numbers, Email and CV: six equal tiles, 3 x 2 (2 x 3 on a phone) */
.bento--facts { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; margin-bottom: 16px; }
.tile--act { cursor: pointer; }
.act__ico { height: 44px; display: flex; align-items: center; color: var(--accent); }
.act__ico .ico { width: 38px; height: 38px; }
.tile--act:hover .stat__label { color: var(--ink); }

/* the "Email copied" notice */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 10; padding: 12px 20px; border-radius: 999px;
  font-size: 14px; font-weight: 600; background: rgba(18, 20, 28, .94); border-color: rgba(138, 180, 255, .35);
  transition: opacity .3s var(--ease), transform .4s var(--spring); }
.toast { inset: auto 0 28px 0; margin: 0 auto; width: fit-content; max-width: calc(100vw - 32px); color: var(--ink); text-align: center; }
.toast:not(:popover-open) { display: block; opacity: 0; transform: translateY(16px); pointer-events: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- sheets: Experience and Books open over the page ---------- */
html:has(dialog.sheet[open]) { overflow: hidden; }
.sheet { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 24px; border: 0; background: transparent; color: var(--ink); }
/* no blur behind an open sheet: a backdrop-filter is recomputed on every scroll frame
   (measured: 50ms frames with it, 16.7ms without) */
.sheet::backdrop { background: rgba(4, 5, 8, .8); }
.sheet[open] .sheet__panel { animation: sheet-in .5s var(--spring); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(24px) scale(.97); } }
.sheet__panel:focus { outline: none; }
.sheet__panel { width: min(1160px, 100%); height: 100%; margin: 0 auto; display: grid; grid-template-rows: auto 1fr;
  border-radius: 30px; background: linear-gradient(160deg, rgba(22, 24, 32, .96), rgba(10, 11, 16, .97)); overflow: hidden; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 28px; border-bottom: 1px solid var(--line); }
.sheet__title { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.sheet__sub { font-size: 14px; margin-top: 2px; }
.sheet__close { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  color: var(--ink); background: rgba(255, 255, 255, .07); border: 1px solid var(--line); transition: background .25s, transform .35s var(--spring); }
.sheet__close:focus:not(:focus-visible) { outline: none; }   /* keyboard users still see where they are */
.sheet__close:hover { background: rgba(255, 255, 255, .14); transform: rotate(90deg); }
.sheet__close svg { width: 18px; height: 18px; }
.sheet__body { overflow-y: auto; overscroll-behavior: contain; padding: 24px 28px 32px; }
.sheet .tile.glass { box-shadow: inset 0 1px 0 var(--spec), inset 0 -1px 0 rgba(255, 255, 255, .04); }   /* no 80px drop shadows to repaint while scrolling */

/* ---------- books ---------- */
.bk { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: var(--c);
  background: color-mix(in srgb, var(--c) 16%, rgba(255, 255, 255, .02)); border: 1px solid color-mix(in srgb, var(--c) 38%, transparent); }
.bk__g { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bk__g .f, .ico--g .f { fill: currentColor; stroke: none; }

.sheet [hidden] { display: none !important; }

/* the genre cloud: size by book count, colour by genre */
.books__cloud { min-height: 100%; display: flex; flex-wrap: wrap; align-items: center; align-content: center; justify-content: center;
  gap: calc(6px * var(--k, 1)) calc(22px * var(--k, 1)); padding: 12px 0; max-width: 900px; margin: 0 auto; }
.cloud__w { --s: calc(15px + var(--w) * 1.05px); font: inherit; font-size: calc(min(var(--s), 58px) * var(--k, 1));   /* --k: site.js shrinks it until the cloud fits */ font-weight: 700; letter-spacing: -.02em; line-height: 1.15;
  color: var(--c); background: none; border: 0; padding: 4px 6px; border-radius: 12px; cursor: pointer;
  text-shadow: 0 0 28px color-mix(in srgb, var(--c) 45%, transparent);
  transition: transform .35s var(--spring), background .25s; animation: cloud-in .6s var(--spring) backwards; }
.cloud__w:nth-child(3n) { animation-delay: .06s; } .cloud__w:nth-child(3n+1) { animation-delay: .12s; }
.cloud__w:hover, .cloud__w:focus-visible { transform: scale(1.08); background: color-mix(in srgb, var(--c) 10%, transparent); outline: none; }
.cloud__w sup { font-size: 12px; font-weight: 600; margin-left: 3px; opacity: .65; vertical-align: super; }
@keyframes cloud-in { from { opacity: 0; transform: scale(.6); } }

/* one genre: its books as cards by tag, under a bar pinned while they scroll. The body drops its top
   padding here: a sticky bar pins inside that padding, so it would otherwise cover the first cards. */
.sheet__body:has(.genre:not([hidden])) { padding-top: 0; }
.genre__bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin: 0 -28px 16px; padding: 16px 28px 12px; border-bottom: 1px solid transparent; transition: background .25s, border-color .25s; }
/* see-through at the top; once the list scrolls under it, a full-width solid bar with a hairline */
.sheet__body.is-scrolled .genre__bar { background: #12131a; border-bottom-color: var(--line); }
.genre__back { font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; cursor: pointer; }
.genre__back:hover { color: var(--ink); background: rgba(255, 255, 255, .12); }
.genre__title { font-size: 24px; font-weight: 700; color: var(--c); letter-spacing: -.02em; }
.genre__title .muted { font-size: 14px; font-weight: 400; margin-left: 6px; }
.genre__groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.grp { padding: 16px; border-radius: 18px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); }
.grp__tag { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--c); margin-bottom: 10px; }
.grp ul { display: grid; gap: 8px; }
.bkrow { display: flex; align-items: center; gap: 12px; padding: 4px; border-radius: 12px; }
.bkrow > span { display: grid; min-width: 0; line-height: 1.3; }
.bkrow b { font-size: 14px; font-weight: 600; }
.bkrow small { font-size: 12px; color: var(--muted); }


.tile--about { grid-column: span 4; display: grid; gap: 10px; font-size: 17px; color: #d9dce4; }
.bento--ai { margin-bottom: 16px; }
.ai-row { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tile--ai h3, .small-h { font-size: 18px; font-weight: 600; margin: 4px 0 2px; }

.bento--xp { grid-template-columns: repeat(2, 1fr); }
.xp { display: grid; gap: 18px; align-content: start; }
.xp--wide { grid-column: span 2; }
.xp__head { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }   /* name, then place · span, for every company */
.xp__head h3 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
/* a company's roles sit in one row of equal columns (never 2 + 1), and stack on narrow screens */
.xp--wide .xp__jobs { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 16px; }
@media (max-width: 820px) { .xp--wide .xp__jobs { grid-template-columns: 1fr; } }
.xp__jobs .job { padding: 18px; border-radius: 18px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); }
.chips--lg li { font-size: 14px; padding: 7px 14px; }

@media (max-width: 640px) {
  .sheet { padding: 0; }
  .sheet__panel { border-radius: 0; }
  .sheet__head { padding: 16px 18px; }
  .sheet__title { font-size: 22px; }
  .sheet__body { padding: 18px 16px 28px; }
  .genre__bar { margin: 0 -16px 12px; padding: 14px 16px 10px; }
  .tile--nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .top { grid-template-columns: repeat(2, 1fr); grid-template-areas: "intro intro" "nav nav" "feat feat"; grid-template-rows: auto; }
  .ai-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .bento, .bento--xp, .bento--facts { grid-template-columns: 1fr 1fr; gap: 12px; }
  .bento--facts { margin-bottom: 12px; }
  .tile--about, .xp, .xp--wide, .bento--xp > .tile { grid-column: span 2; }
  .intro__id { align-items: flex-start; }
  .intro__photo { width: 64px; height: 64px; border-radius: 18px; }
  .stat__value { font-size: 36px; }
  .tile { padding: 20px; }
  .tile--feature { padding: 0; }
}

/* short screens (a phone held sideways): a compact header and bar leave room for the cards */
@media (max-height: 520px) {
  .sheet { padding: 8px; }
  .sheet__head { padding: 8px 18px; }
  .sheet__head > div { display: flex; align-items: baseline; gap: 12px; }
  .sheet__title { font-size: 18px; }
  .sheet__sub { margin: 0; }
  .sheet__close { width: 34px; height: 34px; }
  .sheet__body { padding-left: 18px; padding-right: 18px; }
  .genre__bar { margin: 0 -18px 12px; padding: 8px 18px; }
  .genre__back { padding: 5px 12px; }
  .genre__title { font-size: 18px; }
}
}
