/* Bart Zimny — portfolio. Deep green, two typefaces, one list. */

:root {
  --bg: #0C1A12;
  --fg: #FFFFFF;
  --mist: #ACBFC2;    /* sans items, secondary text */
  --deep: #1B363A;    /* lines, surfaces */
  --green: #00CC7A;   /* hover, current, actions */
  --grey: #909097;    /* meta */
  --serif: "Newsreader", Georgia, serif;
  --sans: "Karla", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(8px, 1.5vw, 20px);
  --top: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--top); }
body {
  background: var(--bg); color: var(--fg);
  font: 400 16px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--green); color: var(--bg); }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 30; height: var(--top);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 var(--gutter);
  background: var(--bg);
  transition: transform .35s ease;
}
/* Slides away once the ZIMNY + portrait block reaches the top of the window. */
.top.is-hidden { transform: translateY(-100%); }
.top__logo { font: 400 34px/1 var(--serif); font-variant-emoji: text; justify-self: start; }
.top__name { font: 500 17px/1 var(--sans); }
.top__about { justify-self: end; font: 500 17px/1 var(--sans); color: var(--mist); transition: color .2s; }
.top__about:hover, .top__about:focus-visible { color: var(--green); }


/* ---------- 1. work list ---------- */
.work { padding: clamp(40px, 8vh, 96px) var(--gutter) clamp(80px, 16vh, 180px); }
/* Project list: the font size steps up at a few breakpoints and stays fixed in between,
   so a wider window fits more words per line instead of bigger letters. */
.work__list { font-size: 27px; line-height: 1.16; letter-spacing: -.012em; }
@media (min-width: 760px)  { .work__list { font-size: 36px; } }
@media (min-width: 1024px) { .work__list { font-size: 46px; } }
@media (min-width: 1440px) { .work__list { font-size: 58px; } }
@media (min-width: 1920px) { .work__list { font-size: 70px; } }
.item { cursor: pointer; transition: color .2s; }
.item--serif { font-family: var(--serif); font-weight: 500; color: var(--fg); }
.item--sans { font-family: var(--sans); font-weight: 400; color: var(--mist); letter-spacing: -.025em; font-size: .86em; }
.item:hover, .item:focus-visible { color: var(--green); outline: none; }
/* Logo badge that follows the cursor over a project */
.logo-tip {
  position: fixed; left: 0; top: 0; z-index: 40; pointer-events: none;
  height: 48px; padding: 0 18px; border-radius: 999px; background: var(--deep); color: var(--fg);
  display: flex; align-items: center; opacity: 0; scale: .9; transform-origin: 0 0;
  transition: opacity .15s, scale .15s;               /* hiding: quick, no delay */
}
/* Showing: appears right at the cursor after a short pause, with a soft grow. */
.logo-tip.on { opacity: 1; scale: 1; transition: opacity .3s ease-out .12s, scale .35s cubic-bezier(.2, .8, .2, 1) .12s; }
.logo-tip svg { display: block; height: 24px; width: auto; max-width: 170px; fill: currentColor; }
.item:focus-visible { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .12em; }
.sep { color: var(--mist); font-family: var(--sans); font-size: .7em; padding: 0 .3em; vertical-align: .08em; }

/* ---------- 2. hero: ZIMNY + portrait ---------- */
.hero {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter);
  height: 100svh; min-height: 560px; padding: var(--gutter);
}
.hero__name { position: relative; }
#zimny { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
#zimny path { fill: var(--fg); }
.hero__photo { position: relative; overflow: hidden; display: flex; flex-direction: column; }
.hero__photo img { flex: 1; min-height: 0; width: 100%; object-fit: cover; object-position: 50% 30%; filter: grayscale(1); display: block; }

/* ---------- 3. CV ---------- */
.cv {
  display: grid; grid-template-columns: 4fr 8fr; gap: clamp(24px, 4vw, 80px);
  padding: clamp(96px, 18vh, 200px) var(--gutter) clamp(80px, 14vh, 160px);
}
.cv__side { position: sticky; top: calc(var(--top) + 24px); align-self: start; }
.cv__title { font: 500 clamp(40px, 4.4vw, 68px)/.95 var(--serif); letter-spacing: -.02em; text-wrap: balance; }
.cv__name { margin-top: 10px; font: 500 clamp(18px, 1.6vw, 22px)/1.2 var(--sans); color: var(--mist); }
.cv__intro { margin-top: 28px; max-width: 34ch; color: var(--mist); font-size: 17px; }
.cv__links { list-style: none; margin-top: 28px; display: grid; gap: 8px; }
.cv__links a, .cv__links button { color: var(--fg); border-bottom: 1px solid var(--deep); padding-bottom: 2px; transition: color .2s, border-color .2s; }
.cv__links a:hover, .cv__links button:hover { color: var(--green); border-color: var(--green); }

.cv__list { list-style: none; border-top: 1px solid var(--deep); }
.cv__row {
  display: grid; grid-template-columns: 120px 1fr; gap: 8px 24px; padding: 22px 0 24px;
  border-bottom: 1px solid var(--deep);
}
.cv__years { color: var(--grey); font-size: 14px; padding-top: .55em; font-variant-numeric: tabular-nums; }
.cv__row.current .cv__years { color: var(--green); }
.cv__row.current .cv__years::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 7px; vertical-align: 1px; }
.cv__role { font: 500 clamp(22px, 2.2vw, 32px)/1.15 var(--serif); }
.cv__co { color: var(--mist); font-size: clamp(17px, 1.4vw, 20px); margin-top: 2px; }
.cv__row.edu { margin-top: 40px; border-top: 1px solid var(--deep); }
.cv__note { grid-column: 2; color: var(--grey); font-size: 15px; max-width: 60ch; }

/* ---------- footer ---------- */
.foot {
  display: flex; justify-content: space-between; padding: 24px var(--gutter) 32px;
  border-top: 1px solid var(--deep); color: var(--grey); font-size: 14px;
}
.foot__links { display: flex; gap: 24px; }
.foot a:hover { color: var(--green); }

/* ---------- dialogs ---------- */
dialog { border: 0; padding: 0; color: var(--fg); background: var(--bg); }
dialog::backdrop { background: rgba(12, 26, 18, .82); backdrop-filter: blur(6px); }

.gate { margin: auto; width: min(520px, calc(100vw - 2 * var(--gutter))); border: 1px solid var(--deep); }
.gate form { padding: clamp(24px, 4vw, 40px); }
.gate__project { color: var(--mist); font-size: 15px; }
.gate__title { font: 500 clamp(28px, 3vw, 38px)/1.08 var(--serif); margin: 10px 0 28px; }
.gate input {
  width: 100%; padding: 10px 0; background: none; border: 0; border-bottom: 1px solid var(--mist);
  color: var(--fg); font: 400 22px var(--sans); outline: none;
}
.gate input:focus { border-color: var(--green); }
.gate__err { min-height: 22px; margin-top: 10px; font-size: 14px; color: #ff8a7a; }
.gate__err.busy { color: var(--grey); }
.gate__actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.btn { height: 42px; padding: 0 20px; background: var(--green); color: var(--bg); font-weight: 500; border-radius: 999px; }
.btn--ghost { background: none; color: var(--mist); }
.btn--ghost:hover { color: var(--fg); }
.gate.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.case { width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; overflow-y: auto; }
.case__bar { position: sticky; top: 0; z-index: 2; height: var(--top); display: flex; align-items: center; padding: 0 var(--gutter); background: var(--bg); }
.case__back { color: var(--green); font: 500 17px/1 var(--sans); padding: 8px 0; transition: opacity .2s; }
.case__back:hover, .case__back:focus-visible { opacity: .75; }
.case__head { padding: clamp(40px, 8vh, 96px) var(--gutter) 48px; max-width: 1400px; }
.case__badge { color: var(--green); font-size: 14px; margin-bottom: 20px; }
.case__title { font: 500 clamp(40px, 6.4vw, 100px)/1.02 var(--serif); letter-spacing: -.015em; }
.case__lede { margin-top: 28px; max-width: 60ch; color: var(--mist); font-size: clamp(18px, 1.6vw, 22px); }
.case__facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--deep); }
.case__facts dt { color: var(--grey); font-size: 14px; margin-bottom: 4px; }
.case__stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--gutter);
  padding: 0 var(--gutter) 24px;
}
.case__stats div { border-top: 1px solid var(--green); padding-top: 14px; }
.case__stats dt { font: 500 clamp(48px, 6vw, 96px)/1 var(--serif); color: var(--green); }
.case__stats dd { margin-top: 10px; color: var(--mist); font-size: 15px; max-width: 24ch; }
.case__sections { max-width: 1100px; padding: 72px var(--gutter) 24px; }
.case__sections section { display: grid; grid-template-columns: 5fr 7fr; gap: 24px; padding: 28px 0; border-top: 1px solid var(--deep); }
.case__sections h2 { font: 500 clamp(22px, 2.2vw, 30px)/1.15 var(--serif); }
.case__sections p { color: var(--mist); font-size: 17px; }
.case__contact { padding: 48px var(--gutter) 96px; font: 500 clamp(24px, 2.6vw, 36px)/1.2 var(--serif); }
.case__contact a { color: var(--green); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .15em; }
/* Long-form case study blocks */
.story { padding: 48px var(--gutter) 24px; display: grid; gap: clamp(48px, 8vh, 96px); }
.story img { display: block; width: 100%; height: auto; }
.story figure { margin: 0; }
.story figcaption { margin-top: 12px; color: var(--grey); font-size: 14px; max-width: 60ch; }
.st-section { display: grid; grid-template-columns: 4fr 8fr; gap: 24px clamp(24px, 4vw, 80px); padding-top: 28px; border-top: 1px solid var(--deep); }
.st-section .num { display: block; color: var(--green); font: 500 14px var(--sans); margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.st-section h2 { font: 500 clamp(28px, 3vw, 44px)/1.08 var(--serif); letter-spacing: -.01em; text-wrap: balance; }
.st-section p { color: var(--mist); font-size: clamp(17px, 1.3vw, 20px); max-width: 62ch; }
.st-section p + p { margin-top: 1em; }
.st-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter) clamp(16px, 2vw, 32px); align-items: start; }
.st-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px clamp(16px, 2vw, 32px); }
.st-list li { border-top: 1px solid var(--green); padding-top: 14px; }
.st-list b { display: block; font: 500 clamp(20px, 1.8vw, 26px)/1.15 var(--serif); margin-bottom: 8px; }
.st-list span { color: var(--mist); font-size: 16px; }
.st-quotes { display: grid; grid-template-columns: 1fr 1fr; gap: 32px clamp(24px, 4vw, 64px); }
.st-quotes blockquote { font: italic 500 clamp(22px, 2.2vw, 32px)/1.25 var(--serif); text-wrap: balance; }
.st-quotes blockquote::before { content: "“"; color: var(--green); }
.st-quotes blockquote::after { content: "”"; color: var(--green); }
.st-timeline { list-style: none; display: grid; grid-template-columns: repeat(7, 1fr); gap: 16px; counter-reset: step; }
.st-timeline li { counter-increment: step; border-top: 1px solid var(--deep); padding-top: 12px; color: var(--mist); font-size: 15px; line-height: 1.3; }
.st-timeline li::before { content: counter(step, decimal-leading-zero); display: block; color: var(--green); font-size: 13px; margin-bottom: 6px; }
@media (max-width: 760px) {
  .st-section, .st-pair, .st-quotes { grid-template-columns: 1fr; }
  .st-timeline { grid-template-columns: 1fr 1fr; }
}
.case__text { max-width: 720px; margin: 0 auto; padding: 72px var(--gutter); font-size: 19px; }
.case__text p + p { margin-top: 1.1em; }
.case__gallery { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); padding: 0 var(--gutter) 96px; }
.slot { aspect-ratio: 4 / 3; background: var(--deep); display: grid; place-items: end start; padding: 14px; color: var(--mist); font-size: 13px; }
.slot:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 9; }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  :root { --top: 56px; }
  .work { padding-top: 36px; padding-bottom: 120px; }
  .hero { grid-template-columns: 1fr; height: auto; min-height: 0; gap: 12px; }
  .hero__name { aspect-ratio: 369 / 375; }
  .hero__photo img { aspect-ratio: 4 / 4.7; flex: none; }
  .cv { grid-template-columns: 1fr; }
  .cv__side { position: static; }
  .cv__row { grid-template-columns: 1fr; gap: 2px; }
  .cv__years { padding-top: 0; margin-bottom: 4px; }
  .cv__note { grid-column: 1; margin-top: 6px; }
  .case__facts { grid-template-columns: 1fr 1fr; }
  .case__gallery { grid-template-columns: 1fr; }
  .case__sections section { grid-template-columns: 1fr; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* ---------- print: the CV only ---------- */
@media print {
  @page { margin: 16mm; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .top, .work, .hero, .foot, dialog, .cv__links li:last-child { display: none !important; }
  .cv { display: block; padding: 0; }
  .cv__side { position: static; margin-bottom: 8mm; }
  .cv__title { font-size: 14pt; color: #555; font-family: var(--sans); }
  .cv__intro, .cv__co, .cv__note, .cv__years, .cv__row.current .cv__years { color: #333; }
  .cv__links a { color: #000; border: 0; }
  .cv__list, .cv__row { border-color: #ccc; }
  .cv__row { padding: 4mm 0; break-inside: avoid; }
  .cv__role { font-size: 13pt; }
}
