*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
button, a, [tabindex] { outline: none; }

:root {
  --bg:      #ffffff;
  --text:    #1a1a1a;
  --muted:   #6b7280;
  --subtle:  #9ca3af;
  --border:  #e5e7eb;
  --tag-bg:  #f3f4f6;
  --accent:  #AA0911;
}

html { scroll-behavior: smooth; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Golos Text', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 88px;
}
button { font-family: inherit; font-weight: inherit; letter-spacing: inherit; text-transform: inherit; } /* browsers reset these on buttons (tabs, Prev/Next, Close) */


a { color: inherit; text-decoration: none; }

/* ── GLOBAL MAX WIDTH ── */
.tabs-wrap,
.main {
  width: 100%;
}

/* ── HEADER ── */
/* Hover for pills and links (as on seventeenagency.com): text squeezes away to the left while a copy
   (data-text) unfolds from the right. Markup: <a class="flip" data-text="X"><span>X</span></a> */
.flip { display: inline-grid; }
.flip > span,
.flip::before {
  grid-area: 1 / 1;
  transition: scale 0.45s cubic-bezier(0.32, 0.72, 0, 1);
}
.flip > span { transform-origin: left center; }
.flip::before {
  content: attr(data-text);
  scale: 0 1;
  transform-origin: right center;
  pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
  .flip:is(:hover, :focus-visible) > span,
  :is(.tab, .site-logo):is(:hover, :focus-visible) .flip > span { scale: 0 1; transition-delay: 0.07s; }
  .flip:is(:hover, :focus-visible)::before,
  :is(.tab, .site-logo):is(:hover, :focus-visible) .flip::before { scale: 1 1; transition-delay: 0.07s; }
}

/* ── TABS ── */
.tabs-wrap {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px 32px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  color: inherit;
  text-decoration: none;
}

.header-connect {
  display: flex;
  align-items: center;
  height: 24px; /* = .tab-home-photo, so text centers on the logo row */
}
.header-link--connect {
  font-size: 14px; /* header type size */
  font-weight: 500;
  color: var(--text);
}
.header-link--pill {
  padding: 2px 6px;
  background-color: var(--tag-bg);
}
.menu-email { display: none; } /* mobile only: email lives in the Menu dropdown */
.menu-btn { display: none; font-family: inherit; line-height: inherit; letter-spacing: inherit; border: 0; cursor: pointer; } /* mobile only */
.pill--round { border-radius: 99px; } /* CV, X, Telegram, Channel */
.header-link--pill-dark {
  color: #fff;
  background-color: var(--text);
}

.tabs-menu-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
}

.tabs {
  position: relative;
  display: flex;
  width: 100%;
  justify-content: flex-start;
  align-items: flex-start;
}

.tab-links {
  position: absolute;
  top: calc((24px - 14px * 1.2) / 2); /* text centered on the 24px logo row */
  left: calc(50vw - 28px); /* 4-col grid (8px gaps): column 3 starts at the content centre + 4px; 28 = 32px padding - 4 */
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

/* Static line in the header, on column 2 of the 4-col grid; same type as the tabs */
.header-note {
  position: absolute;
  top: calc((24px - 14px * 1.2) / 2);
  left: calc(25vw - 14px); /* (100vw - 64px padding - 24px gaps) / 4 + 8px */
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--text);
  white-space: nowrap;
}

.tab {
  position: relative;
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  padding: 0 0 2px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Golos Text', system-ui, sans-serif;
  font-size: 16px; /* em base for letter-spacing = body text; visible size comes from .tab-line-1 */
  letter-spacing: 0;
  text-align: left;
}

.tab-lines {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.2;
}

.tab-line-1 {
  font-size: 14px; /* header type size */
  font-weight: 500;
  color: var(--text);
  transition: color 0.15s;
}
.tab.active .tab-line-1 { color: var(--text); }

.tab-line-2 {
  display: none;
}

.tab--home {
  align-items: center;
}

.tab-home-photo {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}
.tab-home-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── MAIN ── */
.main {
  flex: 1;
  padding: 32px 32px 72px; /* bottom room for the fixed .contact-bar */
}

/* ── TAB PANELS ── */
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}

#tab-credits.active,
.index-intro { /* tab intros (Index, Projects, Storage) and About start at the same height */
  margin-top: 88px;
}

/* ── SECTION LABEL ── */
/* To add a new section: use <div class="section-label">Title</div> above a list */
.section-label {
  flex: 0 0 calc(50% - 12px); /* columns 1–2; + 16px gap puts the list on column 3 of the 4-col grid */
  padding-top: 6px;
  font-size: 14px;
  line-height: 21px; /* = 14px × 1.5 row line box, so the label sits on the first row */
  font-weight: 500;
  color: var(--text);
}

/* ── FEATURED PROJECT ── */
.project-grid {
  display: flex;
  gap: 8px;
}

.project-col {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.project-featured {
  display: flex;
  flex-direction: column;
  margin-bottom: 48px;
}

.project-grid .project-featured {
  margin-bottom: 8px;
}

.project-featured-cover {
  width: 100%;
  border: 1px solid #EAEBF1;
  border-radius: 12px;
  padding: 4px;
  box-sizing: border-box;
}

.project-featured-mockup { position: relative; }

a.project-featured { cursor: pointer; }

#tab-playground a.project-featured { cursor: zoom-in; }

.project-featured-mockup {
  border: 1px solid rgba(234, 235, 241, 0.5);
  border-radius: 8px; /* = card 12px - 4px padding, concentric */
  background: #FCFCFD;
  padding: 16px;
  box-sizing: border-box;
  overflow: hidden;
}

.project-featured-mockup--flush {
  background: none;
  padding: 0;
  border: none;
}

/* Case caption: one line on the right half — title · type · year on 3 equal cells, link pinned right */
.case-caption {
  display: grid;
  grid-template-columns: repeat(3, 1fr) auto;
  gap: 8px;
  align-items: baseline;
}
.case-caption-title { font-size: 14px; font-weight: 700; color: var(--text); }
/* Case caption text: 14px black */
.case-caption-meta,
.case-caption-link {
  font-size: 14px;
}
.header-note { font-size: 14px; } /* clock = header type size */
.case-caption-meta { color: var(--text); }
/* year cell with awards: "2026, Awwwards, CSSDA" */ /* second line, under the type: awards with links */
.case-caption-awards a { color: inherit; text-decoration: none; }
.case-caption-link { color: var(--text); text-decoration: none; justify-self: end; } /* plain text link, pinned to the right edge of the page grid */

/* ── INDEX CASES: each case = text (from column 3, like the intro and header tabs) → its work, two per row ── */
.cases {
  display: flex;
  flex-direction: column;
  gap: 120px;
  margin-top: 56px; /* separates the intro from the first case, so its caption doesn't read as part of the intro */
}
.case-screens .project-featured-mockup {
  border: 1px solid #EAEBF1; /* = Storage cards */
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
}
/* Per-card option: the screen sits on a photo (set --bg-photo inline) */
.case-screens .project-featured-mockup--photo {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 8%;
  background: #0b0b0b var(--bg-photo) center / cover no-repeat;
}
.case-screens--three .project-featured-mockup--photo { aspect-ratio: 4 / 3; box-sizing: border-box; } /* = the 4:3 screens beside it */
.case-screens .project-featured-mockup--photo > img { width: auto; max-width: 100%; max-height: 100%; }
.case-screens img, .case-screens video { width: 100%; height: auto; display: block; }
.case-text {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-bottom: 16px;
}
.case-text .case-caption { grid-column: 2; }
.case-screens { /* all of a case's work, two per row */
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* minmax(0) so a 1920px video can't widen its column */
  gap: 8px;
  align-items: start;
}
.case-screens--lead > :first-child { grid-column: 1 / -1; } /* main work full width, the rest two per row */
.case-screens--three { grid-template-columns: repeat(3, minmax(0, 1fr)); } /* a row of three */
.case-screens--four { grid-template-columns: repeat(4, minmax(0, 1fr)); } /* a row of four */
.case-screens + .case-screens { margin-top: 8px; }

/* Smaller image floating inside the card (e.g. inBeetween phones) */
.project-featured-mockup--inset {
  padding: 20px;
}

.project-carousel {
  display: grid;
}

.project-carousel img {
  grid-area: 1 / 1;
  width: 100%;
  height: auto;
  display: block;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.project-carousel--instant img {
  transition: none;
}

.project-carousel img.active {
  opacity: 1;
}

.project-featured-cover img,
.project-featured-cover video {
  width: 100%;
  height: auto;
  display: block;
}

.project-featured-info {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 24px;
}

.project-grid .project-featured-info {
  display: none;
}

.words-item-block {
  display: flex;
  gap: 16px;
  margin-bottom: 48px;
}
.words-item-block.words-item-block--last {
  margin-bottom: 0;
}

.words-item-block-title {
  flex: 0 0 calc(50% - 12px); /* columns 1–2, content from column 3 */
  padding-top: 6px;
  font-size: 14px;
  line-height: 21px; /* = 14px × 1.5 row line box, so the label sits on the first row */
  font-weight: 500;
  color: var(--text);
}

.project-dot {
  color: var(--subtle);
}

/* ── PROJECTS ── */
.project-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.project-period {
  font-size: 15px;
  color: var(--subtle);
  white-space: nowrap;
  flex-shrink: 0;
}

.project-grid .project-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--subtle);
}

/* ── ARTICLES / WORDS ── */
/* To add an article: copy an .article-row block, update title, meta and href */
.article-list { display: flex; flex-direction: column; flex: 1; min-width: 0; }

.article-row {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 12px;
  padding: 6px 6px;
  margin: 0 -6px;
  text-decoration: none;
  color: inherit;
  transition: background 0.12s;
}

.article-preview {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  width: 200px;
  height: auto;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(6px) scale(0.97);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 5;
}
.article-row:hover .article-preview {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.article-date {
  order: 1;
  flex: 0 0 60px;
  font-size: 14px;
  color: var(--text);
  text-align: left;
  font-weight: 500;
}

.article-source {
  order: 2;
  flex: 0 0 192px; /* fits "ProKG Public Association" in 14px; keep = .career-company */
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

.article-title {
  order: 3;
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

/* ── CONTACT BAR (fixed bottom-left, replaces the Contacts tab) ── */
.contact-bar {
  position: fixed;
  left: 32px;
  bottom: 16px;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  font-size: 14px; /* = header */
  font-weight: 500;
}
.contact-link { /* same pill as the header email */
  padding: 2px 6px;
  color: #fff;
  background-color: var(--text);
}
.contact-link.pill--round { min-width: 24px; box-sizing: border-box; text-align: center; } /* the one-letter X pill stays a 24px tap target */

/* ── INVERTING HEADER + CONTACT BAR (as naau.studio) ──
   Both bars are drawn white with mix-blend-mode: difference, so they read black on white
   and flip to white over dark work; where they cross other text the letters invert. */
.tabs-wrap,
.contact-bar {
  mix-blend-mode: difference;
  --text: #fff; /* everything inside is white; difference turns it black on the white page */
}
.tabs-wrap .header-link--pill-dark,
.contact-link { color: #000; } /* pill text: black on a white pill → shows as white on black */
.tabs-wrap .tab-home-photo img { filter: invert(1); } /* pre-inverted so the avatar shows normally on white */

/* ── CASE PAGES (READ CASE): full width, same grid as Index ── */
.case-page.active { margin-top: 88px; }
.case-next { margin-top: 96px; padding-bottom: 0; }
/* Case body: section title on column 2, text on column 3; screens span both */
.cs { display: flex; flex-direction: column; gap: 48px; margin-top: 96px; }
.cs-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: baseline; } /* title on column 2, answer on column 3, same line */
.cs-meta { display: flex; flex-direction: column; gap: 4px; } /* Role / Timeline / Scope sit closer than the other rows */
.case-screens[hidden] { display: none; } /* image slots hidden until the screens arrive */
.cs > .case-screens + .case-screens { margin-top: -40px; } /* image rows in a row stay 8px apart, not the 48px between blocks */
.cs-label { font-size: 15px; line-height: 21px; color: var(--text); }
.cs-body { display: flex; flex-direction: column; gap: 12px; font-size: 15px; line-height: 1.4; }
.cs-body p { margin: 0; text-align: justify; } /* like the Index and Storage intros */
.cs-body .cs-title { font-size: 24px; line-height: 1.2; font-weight: 700; text-align: left; } /* the case title */
.cs-list { margin: 0; padding: 0; list-style: none; }
.cs-list li::before { content: '– '; }
/* DRAFT placeholders — remove once the real text and screens are in */
.cs-ask { margin: 0; padding: 8px 10px; border: 1px dashed var(--text); font-size: 14px; line-height: 1.4; }
.cs-ask b { font-weight: 700; margin-right: 4px; }
.cs-img { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 10; padding: 16px; border: 1px dashed var(--text); border-radius: 16px; font-size: 14px; text-align: center; }
.cs-img b { font-weight: 700; margin-right: 4px; }
.cs-img--wide { aspect-ratio: 16 / 7; }


/* ── ABOUT ── */
.about-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 32px;
}

.about-text-group {
  width: 336px;
  max-width: 100%;
  margin-left: calc(50% + 4px); /* column 3 of the 4-col grid */
}

.about-personal {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.4;
}

.about-dark { color: var(--text); }
.index-intro .about-personal { text-align: justify; }
/* Index intro: filter on column 1, sitting on the last line of the description (column 3) */
.index-intro--filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}
.index-intro--filters .about-text-group { grid-column: 3 / -1; margin-left: 0; }
.case-filters { grid-column: 1; display: flex; gap: 4px; }
.case-filter {
  padding: 2px 6px;
  background: none;
  border: 0;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}
.case-filter.active { color: #fff; background-color: var(--text); }
.case[hidden] { display: none; }

.about-text-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.about-section {
  display: flex;
  gap: 16px;
}
.about-section + .about-section {
  margin-top: 48px;
}

.about-columns {
  display: flex;
  flex-direction: column;
}

.about-columns + .words-item-block {
  margin-top: 48px;
}

/* ── CAREER & EDUCATION ── */
/* Same columns as .article-row: period 60px (fits "26–Now") · company 192px · role */
/* To add a row: copy a .career-row block, update period, company, role */
.career-list { display: flex; flex-direction: column; flex: 1; min-width: 0; }

.career-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.career-period {
  flex: 0 0 60px;
  white-space: nowrap;
}

.career-company { flex: 0 0 192px; }

.career-role { flex: 1; }

/* ── PHOTOS ── */
/* To add photos: prepend new .photo-item blocks (round-robin across the 4 .photo-col divs) */
.photo-grid {
  display: flex;
  gap: 8px;
}

.photo-col {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 8px;
}

.photo-item { position: relative; cursor: pointer; }

.photo-item img {
  width: 100%;
  height: auto;
  display: block;
}

.photo-item .photo-caption { display: none; }

/* ── PHOTO LIGHTBOX ── */
.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px;
  box-sizing: border-box;
  cursor: pointer;
}

.photo-lightbox .photo-caption {
  display: flex;
  gap: 8px;
}

.photo-lightbox .photo-caption .project-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.photo-lightbox .photo-caption .project-period {
  font-size: 14px;
  color: var(--subtle);
}

.photo-lightbox[hidden] { display: none; }

/* Storage lightbox: thumbnails of everything in the opened project's group */
.lightbox-group {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 100%;
}
.lightbox-group[hidden],
.photo-lightbox-nav[hidden] { display: none; }
.lightbox-group button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.15s;
}
.lightbox-group button:is(:hover, .active) { opacity: 1; }
.lightbox-group button.active img { outline: 1px solid var(--text); outline-offset: 2px; }
#space-lightbox { cursor: default; }
.lightbox-close { position: fixed; top: 16px; right: 32px; font-family: inherit; line-height: inherit; letter-spacing: inherit; border: 0; cursor: pointer; }
#space-lightbox .lightbox-group img {
  height: 56px;
  width: auto;
  border-radius: 4px;
}

.photo-lightbox img {
  max-width: 100%;
  height: 60vh;
  width: auto;
  object-fit: contain;
  display: block;
}
#space-lightbox video { max-width: 100%; height: 60vh; width: auto; display: block; }
#space-lightbox [hidden] { display: none; }

.photo-lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background-color: transparent;
  color: var(--text);
  font-size: 14px; /* = header */
  cursor: pointer;
}
.photo-lightbox-nav--prev { left: 32px; }
.photo-lightbox-nav--next { right: 32px; }

@media (max-width: 640px) {
  .photo-lightbox-nav--prev { left: 12px; }
  .photo-lightbox-nav--next { right: 12px; }
  .lightbox-close { right: 16px; }
}

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  /* Mobile header: logo left, CV / Menu right; tabs and email live in the Menu dropdown */
  .tabs-wrap { padding: 16px 16px 0; align-items: center; }
  .tabs-menu-wrap,
  .tabs { display: contents; }
  .site-logo { padding-bottom: 0; white-space: nowrap; }
  .menu-btn { display: inline-grid; } /* grid keeps the .flip copy stacked on the text */
  .menu-email { display: inline-grid; }
  .header-email { display: none; }
  .tab-links { display: none; }
  .header-note { display: none; }
  .tabs-wrap.menu-open .tab-links {
    position: absolute;
    top: 40px; /* 16px header padding + 24px pill row */
    left: auto;
    right: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
  }
  .tab--home { display: none; } /* Index = logo link */
  .tab-links .tab { padding: 2px 6px; background-color: var(--text); }
  .tab-links .tab .tab-line-1 { color: #000; } /* inverted header: black on white pill → white on black */
  .tab-links .tab-lines { line-height: 1.5; } /* same 21px pill height as CV / email */
  .tab { flex-shrink: 0; }
  .tab-line-2 { display: none; }

  .main { padding: 32px 16px 72px; } /* room for the fixed .contact-bar */
  .case-text, .case-screens, .case-screens--three, .case-screens--four { grid-template-columns: 1fr; }
  .case-text .case-caption { grid-column: 1; }
  .cases { gap: 60px; margin-top: 32px; }
  .case-caption { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 8px; } /* two rows: title, type / year, link; second column from the screen center */
  .case-caption-link { justify-self: start; }
  .contact-bar { left: 16px; }
  #tab-credits.active,
  .index-intro {
    margin-top: 0;
  }
  .index-intro--filters { grid-template-columns: 1fr; gap: 16px; }
  .cs-row { grid-template-columns: 1fr; }
  .cs-label, .cs-body { grid-column: 1; }
  .cs-meta { gap: 12px; }
  .cs-body .cs-title { font-size: 20px; }
  .cs-label { color: var(--muted); } /* gray on mobile, so labels don't merge with the text below */
  .index-intro--filters .about-text-group,
  .case-filters { grid-column: 1; }
  .case-filters { order: 1; } /* below the intro text on mobile */
  .photo-grid { flex-direction: column; }
  .project-featured-info { flex-direction: column; gap: 16px; }
  .project-grid .project-featured-info { flex-direction: row; gap: 8px; }
  .project-grid { flex-direction: column; }
  .about-text-group { margin-left: 0; width: 100%; }
  .about-columns { flex-direction: column; gap: 0; }
  .about-section { flex-direction: column; gap: 8px; }
  .section-label { flex: none; }

  .article-row,
  .career-row { flex-wrap: wrap; row-gap: 2px; text-align: left; }
  /* Mobile rows: date / name / title stacked, all on one left edge */
  .article-date,
  .career-period { order: 1; flex: 0 0 100%; }
  .article-source,
  .career-company { order: 2; flex: 0 0 100%; }
  .article-title,
  .career-role { order: 3; flex: 1 1 auto; min-width: 0; }
}

@media (max-width: 900px) {
  .project-grid { flex-direction: column; gap: 0; }
  .project-col { display: contents; }
  .words-item-block { flex-direction: column; gap: 8px; }
  .words-item-block-title { flex: none; }
  .article-preview { display: none; }
}

