/* Katia Kuethe — offline prototype */
/* Optima is loaded from the site's uploads folder (see functions.php). */
:root {
  --bg: #ffffff;
  --ink: #111111;
  --soft: #333333;
  --muted: #757b76;
  --line: #dedede;
  --tile: #f4f4f4;
  --gap: 10px;
  --edge: 12px;  /* name, menu and gallery start at the far left */
  --side: clamp(260px, 16vw, 340px); /* white margins on the text-animation screens */
  --mh: 74px;  /* phone header height */
  --hh: 128px; /* reserved height for the About header (clock + name + menu) */
  --font: "KK Optima", Optima, "Optima Nova", Candara, "Segoe UI", sans-serif;
  --ui: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* media */
.m { width: 100%; height: 100%; }
.fit-cover { object-fit: cover; }
.fit-contain { object-fit: contain; }

/* ---------- header (Work + About) ---------- */
.site-header { padding: 18px var(--edge) 0; }
.clock { font-family: var(--font); font-variant-numeric: tabular-nums; font-size: 13px; color: var(--soft); margin-bottom: 8px; min-height: 18px; }
.wordmark { display: inline-block; font-size: 32px; line-height: 38px; font-weight: 500; letter-spacing: .01em; }
.menu { display: flex; gap: 24px; margin-top: 6px; font-size: 13px; letter-spacing: .08em; }
.menu a { padding: 3px 0; border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
.menu a:hover { color: var(--muted); }
.menu a[aria-current="page"] { border-bottom-color: currentColor; }

/* ---------- Home: four-site grid ---------- */
.portal-page { height: 100svh; overflow: hidden; }
.portal {
  height: 100svh; padding: 12px;
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 12px;
}
.ptile { position: relative; overflow: hidden; background: var(--tile); display: block; }
.ptile .m { transition: transform .8s cubic-bezier(.2,.7,.2,1); object-position: left top; transform-origin: left top; }
a.ptile:hover .m { transform: scale(1.025); }
.plabel {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 22px 18px;
  display: flex; flex-direction: column; gap: 2px; color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,0));
  opacity: 0; transform: translateY(6px); transition: opacity .35s, transform .35s;
}
.plabel strong { font-weight: 500; font-size: 20px; letter-spacing: .04em; }
.plabel small { font-family: var(--ui); font-size: 13px; opacity: .85; }
a.ptile:hover .plabel, a.ptile:focus-visible .plabel { opacity: 1; transform: none; }
@media (hover: none) { .plabel { opacity: 1; transform: none; } }
.ptile.empty { display: flex; align-items: center; justify-content: center; }
.ptile.empty .plabel { position: static; opacity: 1; transform: none; background: none; color: #9a9a9a; padding: 0; font-size: 14px; letter-spacing: .2em; text-transform: uppercase; }

/* ---------- Work: masonry gallery ---------- */
.gallery { display: flex; gap: var(--gap); align-items: flex-start; padding: 30px var(--edge) 90px; }
.gallery .col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }
.gtile { position: relative; display: block; width: 100%; overflow: hidden; background: var(--tile); cursor: zoom-in; }
.gtile .m { position: absolute; inset: 0; transition: opacity .3s; }
.gtile:hover .m { opacity: .92; }

/* ---------- Lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 100; background: rgba(255,255,255,.98); display: flex; align-items: center; justify-content: center; }
.lb[hidden] { display: none; }
.lb-stage { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; padding: 64px 90px; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.lb-btn { position: absolute; width: 52px; height: 52px; display: grid; place-items: center; font-size: 28px; line-height: 1; color: var(--ink); }
.lb-btn:hover { color: var(--muted); }
.lb-close { top: 14px; right: 18px; }
.lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 18px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); font-family: var(--ui); font-size: 13px; color: var(--muted); letter-spacing: .05em; }
body.lb-open { overflow: hidden; }

/* ---------- About: full-screen snap sections ---------- */
.about-page { height: 100svh; overflow: hidden; }
.about-page .site-header {
  position: fixed; top: 0; left: 0; z-index: 20;
  background: transparent; pointer-events: none;
}
.about-page .site-header a { pointer-events: auto; }
.snap {
  position: fixed; inset: 0; overflow-y: auto; overflow-x: hidden;
  scroll-snap-type: y mandatory; scrollbar-width: none; overscroll-behavior: contain;
}
.snap::-webkit-scrollbar { display: none; }
.screen {
  height: 100svh; scroll-snap-align: start; scroll-snap-stop: always;
  padding: var(--hh) var(--edge) 28px;
  display: flex; align-items: center; justify-content: center;
}
.stage { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.fit { display: grid; gap: var(--g, 10px); justify-content: center; align-content: center; }
.cell { position: relative; overflow: hidden; background: var(--bg); }
.cell.zoom { cursor: zoom-in; }
.cell.split { display: grid; grid-template-columns: 1fr 1fr; }
.cell.split > * { min-width: 0; height: 100%; }
.cell.center { display: flex; align-items: center; justify-content: center; }
.cell.center .m { width: auto; height: 74%; max-width: 100%; }
.cell.card {
  border: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr 1fr; align-items: stretch;
  padding: clamp(14px, 2vw, 34px);
}
.cell.card h2 { font-weight: 500; font-size: clamp(15px, 1.25vw, 21px); letter-spacing: .06em; text-transform: uppercase; align-self: start; }
.cell.card .m { min-height: 0; }

/* ---------- About layout from the client's deck ---------- */
.about-page .screen { padding: 0; display: block; }                    /* every screen uses the whole screen */
.about-page .text-screen { padding: 0 var(--side); }                 /* white margins left and right */
.agrid { width: 100%; height: 100%; display: grid; gap: 0; }
.agrid .cell { min-width: 0; min-height: 0; }
.agrid .half { position: relative; min-width: 0; min-height: 0; height: 100%; }
.agrid .half .m { position: absolute; inset: 0; }
.agrid .d-only { display: block; }
.agrid .m-only { display: none; }
.agrid button.cell { padding: 0; display: block; width: 100%; height: 100%; }

/* Screen 1: 2 x 2 – text | Berlin video / Umbria video | names + brands */
.g-intro { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.g-intro .a-tl { grid-area: 1 / 1; } .g-intro .a-tr { grid-area: 1 / 2; }
.g-intro .a-bl { grid-area: 2 / 1; } .g-intro .a-br { grid-area: 2 / 2; }
.g-intro .split { display: grid; grid-template-columns: 1fr 1fr; }
.g-intro .pos-low .m { object-position: 50% 85%; }
.g-intro .pos-high .m { object-position: 50% 0%; }
.cell.solo { display: flex; align-items: center; justify-content: center; }
.cell.solo .m { width: 50%; height: auto; aspect-ratio: 16 / 9; }      /* same size as before, centred in its quarter */

/* Screen 2: 4 x 3 brand credits (right column left open, as in the deck) */
.g-clients { grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(3, 1fr); }
.c-dove { grid-area: 1 / 1; } .c-kate { grid-area: 1 / 3; }
.c-af { grid-area: 2 / 1; } .c-target { grid-area: 2 / 2; } .c-bergdorf { grid-area: 2 / 3; }
.c-adv { grid-area: 3 / 1; } .c-roc { grid-area: 3 / 2; } .c-uniqlo { grid-area: 3 / 3; }

/* Text-animation screens: full-height 3 x 3, no empty slots */
.g-text { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); }
.g-text4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }   /* 4 brand credits */
.g-text2 { grid-template-columns: 1fr 1fr; grid-template-rows: 50%; align-content: center; }  /* last 2: same size as one row of the 2 x 2 screens, centred */

/* (older layout, no longer used) */
.g-more { grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(3, 1fr); }
.m-estee { grid-area: 1 / 1; } .m-neiman { grid-area: 1 / 2; } .m-walmart { grid-area: 1 / 3; }
.m-disc { grid-area: 2 / 1; } .m-kk { grid-area: 2 / 2; } .m-mod1 { grid-area: 2 / 3; }
.m-list { grid-area: 3 / 1; } .m-name { grid-area: 3 / 2; } .m-mod4 { grid-area: 3 / 3; }

/* Screen 4: Talks / Mentions / Recognition / Patents */
.g-recog { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.g-recog .card {
  border-top: 1px solid #8a8a8a; border-left: 1px solid #8a8a8a;
  display: grid; grid-template-columns: 1fr 1fr; padding: clamp(14px, 2.2vw, 40px);
}
.g-recog .card:nth-child(2n) { border-right: 1px solid #8a8a8a; }
.g-recog .card:nth-child(n+3) { border-bottom: 1px solid #8a8a8a; }
.g-recog .card h2 { font-weight: 500; font-size: clamp(14px, 1.1vw, 19px); letter-spacing: .06em; text-transform: uppercase; align-self: start; margin-top: clamp(70px, 13vh, 150px); } /* sits below the header */
.g-recog .card .m { min-height: 0; }

/* Desktop: brand-credit screens get the same grey grid lines as the logo screen */
@media (min-width: 761px) {
  .about-page .text-screen { padding: 0; --tp: clamp(18px, 2.5vw, 48px); }
  .agrid.g-text4, .agrid.g-text2 { gap: 0; }
  .agrid.g-text2 { grid-template-rows: 1fr; align-content: stretch; }
  .agrid.g-text4 > .cell, .agrid.g-text2 > .cell {
    border-top: 1px solid #8a8a8a; border-left: 1px solid #8a8a8a;
    display: flex; align-items: center; justify-content: center; padding: var(--tp);
  }
  .agrid.g-text4 > .cell:nth-child(2n), .agrid.g-text2 > .cell:nth-child(2n) { border-right: 1px solid #8a8a8a; }
  .agrid.g-text4 > .cell:nth-child(n+3), .agrid.g-text2 > .cell { border-bottom: 1px solid #8a8a8a; }
  /* every animation the same size, kept clear of the name and menu at the top left */
  .agrid.g-text4 > .cell:nth-child(-n+2) { padding-top: calc(var(--hh) + 8px); }
  .agrid.g-text4 > .cell:nth-child(n+3) { padding-bottom: calc(var(--hh) + 8px); }
  .agrid.g-text4 > .cell .m, .agrid.g-text2 > .cell .m { width: 100%; height: calc(50svh - var(--hh) - 8px - var(--tp)); }
}

/* section dots */
.dots { position: fixed; right: max(3px, calc(var(--edge) / 2 - 5px)); top: 50%; transform: translateY(-50%); z-index: 21; display: flex; flex-direction: column; gap: 12px; }
.dots button { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--ink); background: transparent; padding: 0; transition: background .2s; }
.dots button[aria-current="true"] { background: var(--ink); }

/* ---------- Tablet / phone ---------- */
@media (max-width: 760px) {
  .wordmark { font-size: 24px; line-height: 30px; }
  .menu { gap: 20px; font-size: 13px; }
  .portal-page { height: auto; overflow: auto; }
  /* phones: the three previews spread evenly down the screen, no empty block at the bottom */
  .portal { min-height: 100svh; height: auto; display: flex; flex-direction: column; justify-content: space-evenly; gap: 12px; }
  .portal .ptile { flex: 0 0 auto; }
  /* phones: three previews at their own shape (no cropping), no "Coming soon" box */
  .ptile { aspect-ratio: var(--ar, 16 / 9); }
  .ptile .m { object-fit: contain; }
  .ptile.empty { display: none; }
  .gallery { padding-top: 22px; }
  .about-page, .about-page body { height: auto; overflow: auto; }
  .about-page .site-header { position: static; height: auto; padding-bottom: 8px; pointer-events: auto; }
  .snap { position: static; overflow: visible; scroll-snap-type: none; }
  .screen { height: auto; min-height: 0; padding: 18px var(--edge); }
  .dots { display: none; }
  /* phones: About as in the deck – each section one full screen, 2 columns */
  .about-page .screen, .about-page .text-screen { height: 100svh; padding: 0; }
  .about-page .site-header { position: absolute; top: 0; left: 0; padding: 14px var(--edge) 0; background: transparent; }
  .g-text { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(3, 1fr); }
  .g-text4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
  .g-text2 { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  .agrid .d-only { display: none; }
  .agrid .m-only { display: block; }
  .g-intro {
    --vr: min(28.125vw, 25svh);
    grid-template-columns: 1fr 1fr;
    grid-template-rows: minmax(0, calc(49% - var(--vr))) var(--vr) var(--vr) minmax(0, 1fr);
  }
  .g-intro .a-tl { grid-area: 1 / 1 / 2 / 3; }
  .g-intro .a-tr { grid-area: 2 / 2; }
  .g-intro .a-bl { grid-area: 3 / 1; }
  .g-intro .a-br { grid-area: 4 / 1 / 5 / 3; }
  .g-clients { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(4, 1fr); }
  .c-dove { grid-area: 1 / 1; } .c-kate { grid-area: 1 / 2; }
  .c-af { grid-area: 2 / 1; } .c-roc { grid-area: 2 / 2; }
  .c-bergdorf { grid-area: 3 / 1; } .c-uniqlo { grid-area: 3 / 2; }
  .c-target { grid-area: 4 / 1; }
  .g-more { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(5, 1fr); }
  .g-more > .cell { grid-area: auto; }
  .g-recog .card { display: grid; grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); padding: 14px 12px; }
  .g-recog .card h2 { display: block; font-size: 12px; margin-top: 4px; }
  .lb-stage { padding: 60px 14px; }
  .lb-prev, .lb-next { top: auto; bottom: 8px; transform: none; }
}

/* ---------- Phones: fixed header on Work + About, one swipe = one About screen ---------- */
@media (max-width: 760px) {
  .site-header, .about-page .site-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 30; height: var(--mh);
    padding: 10px var(--edge) 0; background: #fff; pointer-events: auto;
    display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 12px;
  }
  .clock { grid-column: 1 / 3; font-size: 12px; min-height: 16px; margin-bottom: 2px; }
  .wordmark { font-size: 22px; line-height: 28px; }
  .menu { margin-top: 0; gap: 16px; }
  .work-page main { padding-top: var(--mh); }

  .about-page { height: 100svh; overflow: hidden; }
  .about-page .snap {
    position: fixed; top: var(--mh); left: 0; right: 0; bottom: 0;
    overflow-y: auto; overflow-x: hidden; scroll-snap-type: y mandatory; overscroll-behavior: contain;
  }
  .about-page .screen, .about-page .text-screen {
    height: 100%; padding: 0; scroll-snap-align: start; scroll-snap-stop: always;
  }
  /* brand credits: 1 column of 4 so the words are readable; the empty white strip at the top of each animation is trimmed */
  .g-text4 { grid-template-columns: 1fr; grid-template-rows: repeat(4, minmax(0, 1fr)); }
  .g-text4 .m { object-fit: cover; object-position: 50% 100%; }
  /* Neiman Marcus + Walmart: full width, larger */
  .about-page .text-screen.s-g-text2 { padding: 0; }
  .g-text2 { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; column-gap: 0; align-content: center; }
  /* "Our core categories" a little lower on phones only */
  .g-intro .pos-high .m { object-position: 50% 45%; }
}

/* ---------- WordPress: logged-in admin bar (32px desktop, 46px phones) ---------- */
body.admin-bar.portal-page, body.admin-bar .portal { height: calc(100svh - 32px); }
body.admin-bar.about-page .site-header, body.admin-bar.about-page .snap { top: 32px; }
body.admin-bar.about-page .screen { height: calc(100svh - 32px); }
@media (max-width: 782px) {
  body.admin-bar.portal-page, body.admin-bar .portal { height: calc(100svh - 46px); }
  body.admin-bar.about-page .site-header, body.admin-bar.about-page .snap { top: 46px; }
  body.admin-bar.about-page .screen { height: calc(100svh - 46px); }
}
@media (max-width: 760px) {
  body.admin-bar.portal-page, body.admin-bar .portal { height: auto; min-height: calc(100svh - 46px); }
  body.admin-bar .site-header { top: 46px; }
  body.admin-bar.about-page .snap { top: calc(46px + var(--mh)); }
  body.admin-bar.about-page .screen { height: 100%; }
}

/* ---------- Other addresses (old posts, test pages) ---------- */
.simple { padding: 40px var(--edge) 90px; max-width: 1100px; }
.simple h1 { font-weight: 500; font-size: 28px; letter-spacing: .03em; margin-bottom: 24px; }
.simple-content img, .simple-content video { height: auto; }
@media (max-width: 760px) { .simple { padding-top: calc(var(--mh) + 20px); } }
