/* Nitsan Amir portfolio. Paper, wide heavy type, one red. */
:root {
  --paper: #efede6;
  --grid: #dcd9cf;
  --ink: #111;
  --red: #e3241b;
  --dark: #161514;
  --card-w: max(170px, 18vw);
  --card-gap: max(24px, 2.6vw);
  --step: calc(var(--card-w) + var(--card-gap));
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Archivo, system-ui, sans-serif; color: var(--ink); overflow-x: hidden; }
body.locked { overflow: hidden; }
a { color: var(--ink); }
a:hover { color: var(--red); }
img { max-width: 100%; }
.paper { background-color: var(--paper); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 28px 28px; }
.wide { font-stretch: 125%; font-variation-settings: "wdth" 125; }
.wrap { max-width: 1240px; margin: 0 auto; padding-left: max(4vw, 16px); padding-right: max(4vw, 16px); }
.mk { display: inline-block; font-family: "Permanent Marker", cursive; font-size: 19px; line-height: 1.2; color: var(--red); transform: rotate(-2deg); white-space: nowrap; }
.mk.big { font-size: 22px; }

/* Nav */
.nav { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; justify-content: space-between; padding-top: 22px; padding-bottom: 22px; }
.brand { font-weight: 900; font-size: 18px; text-decoration: none; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px 24px; font-weight: 600; font-size: 16px; }
.nav-links a { text-decoration: none; }

/* Hero */
.hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 32px; padding-top: 24px; padding-bottom: 64px; }
.hero-text { flex: 1 1 520px; min-width: 0; }
.hero h1 { margin: 0; font-weight: 900; font-size: clamp(50px, 11vw, 170px); line-height: .86; letter-spacing: -.035em; }
.role { margin: 18px 0 0; font-family: "Permanent Marker", cursive; font-size: clamp(34px, 5.2vw, 72px); line-height: 1; color: var(--red); transform: rotate(-3deg); transform-origin: left center; }
.role-line { display: block; width: min(560px, 90%); height: 18px; margin-top: 6px; transform: rotate(-3deg); transform-origin: left center; }
.role-line path { fill: none; stroke: var(--red); stroke-width: 5; stroke-linecap: round; }
.hero-photo { flex: 0 1 360px; min-width: 260px; margin-left: clamp(16px, 5vw, 80px); padding: 24px 80px 40px 0; position: relative; }
.frame { position: relative; border: 1.5px solid var(--red); padding: 10px; }
.frame img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
.handle { position: absolute; width: 10px; height: 10px; background: #fff; border: 1.5px solid var(--red); }
.handle.tl { top: -6px; left: -6px; } .handle.tr { top: -6px; right: -6px; }
.handle.bl { bottom: -6px; left: -6px; } .handle.br { bottom: -6px; right: -6px; }
.file-tag { position: absolute; bottom: -32px; left: 50%; transform: translateX(-50%); background: var(--red); color: #fff; font-size: 13px; font-weight: 600; padding: 3px 8px; border-radius: 3px; white-space: nowrap; }
.cursor { position: absolute; right: -20px; bottom: 34%; width: 30px; height: 30px; }
.cursor path { fill: var(--ink); stroke: #fff; stroke-width: 1.5; stroke-linejoin: round; }
@keyframes drag { 0%, 12% { transform: translate(0, 0) rotate(0); } 38%, 62% { transform: translate(64px, -18px) rotate(3deg); } 88%, 100% { transform: translate(0, 0) rotate(0); } }
.drag { animation: drag 6s cubic-bezier(.6, 0, .3, 1) infinite; }
@keyframes rise { from { transform: translateY(140px); opacity: 0; } to { transform: none; opacity: 1; } }
.rise { animation: rise 1.4s cubic-bezier(.2, .8, .2, 1) .3s both; }

/* Client band */
.band { background: var(--ink); color: var(--paper); padding: 34px 0; overflow: hidden; clip-path: polygon(0 14px, 4% 4px, 9% 16px, 15% 2px, 22% 13px, 28% 5px, 35% 15px, 41% 3px, 48% 12px, 55% 4px, 61% 16px, 68% 6px, 74% 14px, 81% 2px, 87% 12px, 93% 5px, 100% 13px, 100% calc(100% - 12px), 95% 100%, 89% calc(100% - 14px), 82% calc(100% - 3px), 76% calc(100% - 15px), 69% calc(100% - 4px), 62% calc(100% - 13px), 56% 100%, 49% calc(100% - 12px), 42% calc(100% - 2px), 36% calc(100% - 14px), 29% calc(100% - 5px), 23% calc(100% - 16px), 16% calc(100% - 3px), 10% calc(100% - 13px), 4% calc(100% - 4px), 0 calc(100% - 15px)); }
.mq { display: flex; width: max-content; gap: 40px; font-weight: 900; font-size: clamp(32px, 5vw, 64px); white-space: nowrap; animation: mq 30s linear infinite; }
.mq i { color: var(--red); font-style: normal; }
@keyframes mq { to { transform: translateX(-50%); } }

/* Work rows */
.rows { position: relative; padding: 40px 0 72px; overflow: hidden; }
.row { position: relative; overflow: hidden; padding: 84px 0 24px; margin-top: -40px; }
.shift { transition: transform .7s cubic-bezier(.2, .8, .2, 1); }
.track { display: flex; width: max-content; }
@keyframes trkA { to { transform: translateX(calc(-1 * var(--h))); } }
@keyframes trkB { from { transform: translateX(calc(-1 * var(--h))); } to { transform: none; } }
.row[data-row="coke"] .track { animation: trkA 80s linear infinite; }
.row[data-row="other"] .track { animation: trkB 70s linear infinite; }
.fade { position: absolute; top: 0; bottom: 0; width: 9vw; pointer-events: none; z-index: 5; }
.fade.left { left: 0; background: linear-gradient(90deg, var(--paper), rgba(239, 237, 230, 0)); }
.fade.right { right: 0; background: linear-gradient(270deg, var(--paper), rgba(239, 237, 230, 0)); }

.pol { position: relative; flex: 0 0 auto; width: var(--card-w); margin-left: var(--card-gap); padding: 0; border: 0; background: transparent; cursor: pointer; text-align: left; font: inherit; color: var(--ink); transition: transform .45s cubic-bezier(.2, 1.4, .4, 1); }
.ppr { display: block; position: relative; background: #fff; padding: 11px 11px 13px; box-shadow: 0 8px 18px rgba(0, 0, 0, .15); transition: box-shadow .35s; }
.pol:hover, .pol:focus-visible { transform: translateY(-62px) rotate(0) scale(1.12) !important; z-index: 99; outline: none; }
.pol:hover .ppr, .pol:focus-visible .ppr { box-shadow: 0 34px 44px rgba(0, 0, 0, .32); }
.pol:focus-visible .ppr { outline: 3px solid var(--red); outline-offset: 4px; }
.tape { position: absolute; top: -11px; left: 50%; width: 76px; height: 22px; margin-left: -38px; background: rgba(240, 232, 200, .88); transform: rotate(-3deg); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.pol img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; }
.pol-text { display: block; padding: 10px 2px 0; }
.pol-title { display: block; font-weight: 900; font-size: 15px; line-height: 1.15; }
.pol-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; font-size: 13px; font-weight: 600; color: #4a4a4a; }
.pick { position: absolute; top: -34px; right: -6px; font-family: "Permanent Marker", cursive; font-size: 19px; color: var(--red); opacity: 0; transform: translateY(8px); transition: .3s; white-space: nowrap; }
.pol:hover .pick, .pol:focus-visible .pick { opacity: 1; transform: none; }
@keyframes pop { 0%, 78%, 100% { transform: none; box-shadow: 0 8px 18px rgba(0, 0, 0, .15); } 84% { transform: translateY(-54px) rotate(-4deg); box-shadow: 0 46px 34px -6px rgba(0, 0, 0, .34); } 90% { transform: translateY(-48px) rotate(-3deg); box-shadow: 0 42px 32px -6px rgba(0, 0, 0, .3); } 96% { transform: translateY(-4px); box-shadow: 0 10px 20px rgba(0, 0, 0, .17); } }
.pop { animation: pop 8s cubic-bezier(.3, .7, .3, 1) infinite; }

.arw { position: absolute; top: calc(50% + 20px); z-index: 120; width: 46px; height: 46px; margin-top: -23px; padding: 0; border: 0; background: none; color: var(--red); cursor: pointer; transition: color .2s, transform .2s; }
.arw:hover, .arw:focus-visible { color: var(--ink); transform: scale(1.12); outline: none; }
.arw svg { display: block; width: 100%; height: 100%; }
.arw.prev { left: max(2vw, 10px); }
.arw.next { right: max(2vw, 10px); }

/* Info strip */
#intro { padding-top: 8px; padding-bottom: 96px; }
.intro-grid { display: flex; flex-wrap: wrap; gap: 24px 40px; padding-top: 28px; border-top: 2px solid var(--ink); }
.intro-grid h2 { margin: 0 0 10px; font-weight: 900; font-size: 22px; }
.intro-grid p { margin: 0 0 8px; font-size: 16px; line-height: 1.6; }
.col-hello { flex: 1.6 1 340px; min-width: 0; }
.col-hello p:first-of-type { font-size: 17px; line-height: 1.55; max-width: 36em; }
.col-exp { flex: 1.5 1 420px; min-width: 0; }
.exp { line-height: 1.9 !important; white-space: nowrap; }
.exp .mk { margin-left: 8px; }
.col-edu { flex: 1 1 240px; min-width: 0; }
@media (max-width: 520px) { .exp { white-space: normal; } }

/* Other stuff */
.other { background: var(--dark); color: var(--paper); padding: 88px 0 100px; clip-path: polygon(0 18px, 5% 4px, 11% 15px, 18% 3px, 25% 14px, 31% 5px, 38% 16px, 45% 2px, 52% 13px, 59% 4px, 66% 15px, 73% 3px, 80% 14px, 86% 5px, 93% 16px, 100% 6px, 100% 100%, 0 100%); }
.other-inner { display: flex; flex-wrap: wrap; gap: 40px 64px; align-items: center; }
.other-head { flex: 1 1 300px; }
.other-head h2 { margin: 0 0 12px; font-weight: 900; font-size: clamp(40px, 5.5vw, 72px); line-height: .95; }
.other-head p { margin: 0; }
.other-cards { flex: 2 1 420px; display: flex; flex-wrap: wrap; gap: 40px; justify-content: center; }
.pola { position: relative; display: block; width: 250px; padding: 12px 12px 16px; background: #fff; color: var(--ink); text-decoration: none; box-shadow: 0 10px 22px rgba(0, 0, 0, .35); transition: transform .35s cubic-bezier(.2, 1.4, .4, 1); }
.pola img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; }
.pola .tape { top: -12px; width: 88px; height: 24px; margin-left: -44px; }
.pola-title { display: block; padding-top: 12px; font-weight: 900; font-size: 16px; }
.pola-meta { display: flex; justify-content: space-between; margin-top: 4px; font-size: 13px; font-weight: 600; color: #4a4a4a; }
.tilt-l { transform: rotate(-3deg); } .tilt-r { transform: rotate(2.5deg); }
.pola:hover, .pola:focus-visible { transform: rotate(0) translateY(-10px) scale(1.04); color: var(--ink); }
/* Gentle sway. Uses the separate rotate/translate properties, so it adds to the
   tilt and the hover lift (which use transform) instead of replacing them. */
.pola { animation: sway 4.5s ease-in-out infinite alternate; }
.tilt-r { animation-duration: 5.5s; animation-delay: -2.4s; }
.pola:hover, .pola:focus-visible { animation-play-state: paused; }
@keyframes sway {
  0%   { rotate: -4deg;  translate: -4px 4px; }
  50%  { rotate: 0.5deg;  translate: 6px -16px; }
  100% { rotate: 4.5deg;  translate: -3px 3px; }
}

/* Footer */
.footer { background: var(--red); color: #fff; padding: 88px 0 48px; margin-top: -14px; clip-path: polygon(0 16px, 6% 3px, 12% 14px, 19% 4px, 26% 15px, 33% 2px, 40% 13px, 47% 5px, 54% 16px, 61% 3px, 68% 12px, 75% 4px, 82% 15px, 89% 2px, 95% 12px, 100% 4px, 100% 100%, 0 100%); }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.footer h2 { margin: 0; font-weight: 900; font-size: clamp(40px, 5.5vw, 72px); line-height: .95; }
.footer p { margin: 0; font-size: 18px; line-height: 1.6; font-weight: 600; }
.footer a { color: #fff; }
.footer a:hover { color: var(--ink); }
.footer h2.contact-mk { font-family: "Permanent Marker", cursive; font-weight: 400; font-size: 22px; line-height: 1.2; color: #fff; }
.linkedin { display: inline-flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 800; text-decoration: none; transition: transform .2s; }
.linkedin svg { width: 44px; height: 44px; fill: currentColor; }
.linkedin:hover, .linkedin:focus-visible { transform: rotate(-2deg) scale(1.04); }
.footer-side { display: grid; gap: 18px; justify-items: center; }

/* Overlay pages */
.overlay { position: fixed; inset: 0; z-index: 200; overflow-y: auto; }
.overlay.dark { background: var(--dark); color: var(--paper); }
.overlay-inner { max-width: 1240px; margin: 0 auto; padding: 24px max(4vw, 16px) 96px; }
.ov-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 40px; }
.pill { display: inline-flex; align-items: center; min-height: 48px; padding: 0 20px; border: 2px solid currentColor; border-radius: 999px; background: transparent; font: 800 15px Archivo, sans-serif; cursor: pointer; color: inherit; text-decoration: none; }
.pill:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.dark .pill:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.ov-meta { margin: 0 0 10px; font-weight: 700; font-size: 16px; color: #4a4a4a; }
.dark .ov-meta { color: #c9c4b8; }
.ov-title { margin: 0 0 28px; font-weight: 900; font-size: clamp(40px, 7vw, 104px); line-height: .9; letter-spacing: -.03em; }
.ov-title { --tc: var(--ink); }
.overlay.dark .ov-title { --tc: var(--paper); }
.ov-title:focus { outline: none; }
.wave .word { display: inline-block; white-space: nowrap; }
.wave .ch { display: inline-block; transform-origin: 50% 100%; animation: wave 1.1s cubic-bezier(.2, .9, .3, 1) both; animation-delay: calc(var(--i) * 45ms + 120ms); }
@keyframes wave {
  0%   { opacity: 0; color: var(--red); transform: translateY(.45em) scale(.6, .3); }
  35%  { opacity: 1; color: var(--red); transform: translateY(-.12em) scale(.95, 1.22); }
  60%  { color: var(--red); transform: translateY(.03em) scale(1.06, .94); }
  100% { opacity: 1; color: var(--tc); transform: none; }
}
.ov-intro { display: flex; flex-wrap: wrap; gap: 16px 48px; align-items: start; padding: 24px 0 40px; border-top: 2px solid currentColor; }
.ov-intro .text { flex: 3 1 420px; margin: 0; font-size: 20px; line-height: 1.55; max-width: 40em; }
.ov-intro .role-box { flex: 1 1 200px; margin: 0; font-size: 15px; line-height: 1.6; }
.ov-intro .role-box .mk { margin-top: 4px; }

.gal { display: flex; gap: 20px; align-items: flex-start; }
.gal-col { flex: 1 1 0; min-width: 0; }
.gal-1 { max-width: 1000px; }
.gal figure { position: relative; margin: 0 0 20px; background: #fff; padding: 10px; box-shadow: 0 8px 18px rgba(0, 0, 0, .12); }
.dark .gal figure { box-shadow: none; }
/* Gallery items float gently, each on its own timing, so the page never feels still. */
.gal figure { animation: float 6s ease-in-out infinite alternate; }
.gal figure:nth-child(3n+1) { animation-duration: 6.5s; animation-delay: -1.2s; }
.gal figure:nth-child(3n+2) { animation-duration: 5.4s; animation-delay: -3.1s; }
.gal figure:nth-child(4n)   { animation-duration: 7.2s; animation-delay: -4.6s; animation-direction: alternate-reverse; }
.gal figure:nth-child(5n)   { animation-delay: -2.2s; }
@keyframes float {
  0%   { translate: 0 0;      rotate: -.6deg; }
  50%  { translate: 2px -7px; rotate: .2deg; }
  100% { translate: -1px 2px; rotate: .7deg; }
}
.gal img, .gal video { display: block; width: 100%; height: auto; background: #000; }
.gal img { cursor: zoom-in; background: #eee; }
.gal .play { position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 72px; height: 72px; margin: -36px 0 0 -36px; border: 0; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 5px rgba(255, 255, 255, .85); cursor: pointer; transition: transform .2s; }
.gal .play:hover { transform: scale(1.08); }
.gal .play svg { width: 28px; height: 28px; fill: #fff; margin-left: 4px; }

.poetry-link { position: relative; display: block; }
.poetry-link img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.poetry-link .play { position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 88px; height: 88px; margin: -44px 0 0 -44px; border-radius: 50%; background: var(--red); }
.poetry-link .play svg { width: 34px; height: 34px; fill: #fff; margin-left: 4px; }

/* Image viewer */
.viewer { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 4vh 4vw; background: rgba(17, 17, 17, .94); cursor: zoom-out; }
.viewer[hidden] { display: none; }
.viewer img { max-width: 100%; max-height: 92vh; object-fit: contain; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.viewer-close { position: absolute; top: 16px; right: 20px; width: 52px; height: 52px; border: 0; background: none; color: #fff; font-size: 44px; line-height: 1; cursor: pointer; }
.viewer-close:hover { color: var(--red); }

@media (prefers-reduced-motion: reduce) {
  .mq, .drag, .rise, .track, .pop, .pola, .wave .ch, .gal figure { animation: none !important; }
  .shift, .pol, .pola { transition: none; }
  html { scroll-behavior: auto; }
}
