/* Eirinaios Papacharisis — portfolio (four pages: home, work, about, contact)
   Minimal: one idea per page, small quiet UI at the edges, the work as large as possible.
   Motion rules: emilkowalski/skills (strong ease-out, press feedback, hover gating, reduced motion) */

:root {
  --black: #000000;
  --panel: #161514;            /* empty frame / image placeholder */
  --line: #2C2A27;
  --ink: #EFEDEA;
  --muted: #9C978F;
  --tungsten: #E0A33A;         /* the one accent: text selection only */
  --sans: 'Space Grotesk', system-ui, sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-arrive: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-cut: cubic-bezier(0.7, 0, 0.2, 1);

  --px: clamp(20px, 4.4vw, 64px);
  --bar: 88px;
  --t-small: 13px;
  --t-ui: 14px;
  --t-body: 17px;
  --t-lede: clamp(19px, 1.6vw, 23px);
  /* one ink, one muted; on top of images the muted and the lines are translucent versions of the same ink */
  --ink-img: rgba(239,237,234,.74);
  --line-img: rgba(239,237,234,.32);
  /* three display sizes: the name (home only), a page title, a card title */
  --d1: clamp(40px, 7.2vw, 128px);
  --d2: clamp(40px, 5vw, 80px);
  --d3: clamp(26px, 2.6vw, 44px);
  /* titles: Archivo condensed — tall and narrow, between a skate-deck graphic and a film title card.
     Body text stays Space Grotesk. */
  --title-font: 'Archivo', 'Space Grotesk', sans-serif;
  --title-stretch: 62%;
  --title-weight: 800;
  --title-track: 0em;
  --title-scale: 1.24;         /* a condensed face needs more size to carry the same weight */
  --ctl: 44px;                 /* height of every text button */
  --round: 56px;               /* every round icon button */
}

* { box-sizing: border-box; }
html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--black); color: var(--ink); font-family: var(--sans); font-size: var(--t-body); line-height: 1.55; -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a, button { touch-action: manipulation; }
button { user-select: none; -webkit-user-select: none; }
img { display: block; }
p { margin: 0; }
::selection { background: var(--tungsten); color: var(--black); }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* page-to-page: a quiet dissolve (cross-document view transitions, where supported) */
@view-transition { navigation: auto; }

/* ---------- shared header: name + tech-bar left, numbered menu right ---------- */
.bar { height: var(--bar); display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 0 var(--px); font-size: var(--t-ui); position: relative; z-index: 2; }
/* the EP monogram: E and P share the top line and the middle line (which also closes the P) */
.mark { display: inline-flex; padding: 8px 0; color: inherit; }
.mark svg { display: block; width: 30px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; stroke-linejoin: miter; }
.name { display: flex; gap: 12px; align-items: baseline; }
.name span:first-child { font-weight: 500; }
.role { color: var(--muted); }
.bar nav { display: flex; gap: 28px; }
.bar nav a { position: relative; padding: 8px 0; display: inline-flex; gap: 6px; align-items: baseline; }
.bar nav a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px; background: currentColor; }

.page { min-height: 100svh; display: flex; flex-direction: column; }
.page > main { flex: 1; padding: clamp(24px, 5vh, 56px) var(--px) clamp(48px, 9vh, 96px); }
.page-fit { height: 100svh; min-height: 600px; }
.display { margin: 0; font-family: var(--title-font); font-stretch: var(--title-stretch); font-size: calc(var(--d2) * var(--title-scale)); line-height: .92; font-weight: var(--title-weight); letter-spacing: var(--title-track); text-transform: uppercase; text-wrap: balance;  hyphens: none; }
.h2 { margin: 0 0 24px; font-size: var(--t-ui); font-weight: 500; color: var(--muted); }
.ph { position: relative; overflow: hidden; background: var(--panel); }
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.icon-btn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; color: inherit; }

/* ---------- home: the name, big, over the showreel ---------- */
.landing { position: relative; height: 100svh; min-height: 560px; overflow: hidden; color: var(--ink); display: flex; flex-direction: column; }
.landing .bar { position: absolute; top: 0; left: 0; right: 0; }

.reel, .shot, .reel-video { position: absolute; inset: 0; }
.shot, .reel-video { width: 100%; height: 100%; object-fit: cover; }
.shot { opacity: 0; }
.shot.on { opacity: 1; }
/* a steady scrim so the name always reads, whatever the footage does */
.reel::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(rgba(0,0,0,.35), rgba(0,0,0,0) 25%, rgba(0,0,0,.1) 55%, rgba(0,0,0,.66)); }
.hero-name { position: relative; z-index: 1; margin-top: auto; padding: 0 var(--px) clamp(40px, 8vh, 88px); display: grid; gap: clamp(14px, 2.4vh, 22px); }
.hero-line { font-size: var(--t-ui); color: var(--ink-img); }
.hero-title { margin: 0; font-family: var(--title-font); font-stretch: var(--title-stretch); font-size: calc(var(--d1) * var(--title-scale)); line-height: .86; font-weight: var(--title-weight); letter-spacing: var(--title-track); text-transform: uppercase; }
.hero-title span { display: block; }
.hero-foot { position: absolute; z-index: 1; right: var(--px); bottom: calc(clamp(40px, 8vh, 88px) + 74px); display: flex; align-items: center; gap: 12px; }
.hero-go { width: var(--round); height: var(--round); border-radius: 50%; border: 1px solid var(--line-img); display: flex; align-items: center; justify-content: center; }
.hero-pause .i-play { display: none; }
.hero-pause[aria-pressed="false"] .i-play { display: block; }
.hero-pause[aria-pressed="false"] .i-pause { display: none; }
.shot.drift { animation: shot-in 1100ms var(--ease-out) both, drift 9s linear both; }
@keyframes shot-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes drift { from { scale: 1.05; } to { scale: 1; } }

/* ---------- projects: a carousel of poster cards (Siena-inspired, kept quiet) ---------- */
.projects-main { padding-top: 0 !important; padding-bottom: 0 !important; }
.deck { height: calc(100svh - var(--bar)); min-height: 560px; display: flex; flex-direction: column; margin: 0 calc(var(--px) * -1); }
.deck-top, .deck-foot { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 0 var(--px); }
.deck-top { padding-top: 4px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px 24px; font-size: var(--t-ui); }
.filters button, .mode button { padding: 6px 0; color: var(--muted); border-bottom: 1px solid transparent; }
.filters button[aria-pressed="true"], .mode button[aria-pressed="true"] { color: var(--ink); border-bottom-color: currentColor; }
.fc { font-size: 11px; color: var(--muted); margin-left: 2px; }
.mode { display: flex; gap: 20px; font-size: var(--t-ui); }

/* the track: centre card full size, neighbours smaller and dimmed, driven by --p (0 = centre, 1 = one card away) */
.track { --cw: min(24vw, calc((100svh - var(--bar) - 150px) * .7)); flex: 1; min-height: 0; list-style: none; margin: 0; display: flex; align-items: center; gap: 24px;
  padding: 16px calc(50% - var(--cw) / 2); overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.track::-webkit-scrollbar { display: none; }
.card { flex: 0 0 var(--cw); aspect-ratio: .7; max-height: 100%; scroll-snap-align: center; --p: 1;
  transform: scale(calc(1 - .16 * var(--p))); opacity: calc(1 - .6 * var(--p)); will-change: transform; }
.card[hidden] { display: none !important; }
.card-link { position: relative; display: block; height: 100%; overflow: hidden; }
.card-img { position: absolute; inset: 0; }
.card-img img, .card-img video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-img video { z-index: 1; }
.card-img::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(rgba(0,0,0,0) 45%, rgba(0,0,0,.72)); }
.card-text { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 20px; display: grid; gap: 8px; }
.card-cat { font-size: 11px; color: var(--ink-img); }
.card-title { font-family: var(--title-font); font-stretch: var(--title-stretch); font-size: calc(var(--d3) * var(--title-scale)); font-weight: var(--title-weight); line-height: .9; letter-spacing: var(--title-track); text-transform: uppercase; text-wrap: balance; }
.card-facts { margin: 6px 0 0; display: grid; font-size: 11px; opacity: 0; transition: opacity 400ms ease; }
.card-facts div { display: grid; grid-template-columns: 70px 1fr; gap: 8px; padding: 5px 0; border-top: 1px solid var(--line-img); }
.card-facts dt { color: var(--ink-img); }
.card-facts dd { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.is-active .card-facts { opacity: 1; }
/* footage: the centred card moves (a clip if there is one, otherwise a slow push-in on the still) */
.card.moving .card-img img { animation: push 12s linear infinite alternate; }
@keyframes push { from { scale: 1.1; } to { scale: 1; } }
.deck.poster .card-img video { display: none; }

.deck-foot { padding-top: 8px; padding-bottom: clamp(16px, 3vh, 28px); }
.scrub { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--muted); }
.scrub-line { position: relative; width: clamp(120px, 18vw, 260px); height: 1px; background: repeating-linear-gradient(90deg, var(--line-img) 0 1px, transparent 1px 8px); }
.scrub-line span { position: absolute; left: 0; top: -5px; width: 100%; height: 11px; transition: transform 500ms var(--ease-out); }
.scrub-line span::before { content: ""; position: absolute; left: 0; top: 0; width: 1px; height: 11px; background: var(--ink); }
.deck-nav { display: flex; align-items: center; gap: 4px; }
.explore { margin-left: 16px; height: var(--ctl); padding: 0 16px 0 20px; border: 1px solid var(--line-img); border-radius: calc(var(--ctl) / 2); display: inline-flex; align-items: center; gap: 8px; font-size: var(--t-ui); }

/* project */
.pbar { display: flex; justify-content: space-between; align-items: center; font-size: var(--t-ui); color: var(--muted); }
.back { display: inline-flex; align-items: center; gap: 8px; padding: 8px 0; color: var(--ink); }
.pnav { display: flex; align-items: center; gap: 4px; color: var(--ink); }
.pos { color: var(--muted); margin-right: 8px; }
.ptitle { padding: clamp(32px, 7vh, 64px) 0 clamp(28px, 5vh, 48px); display: flex; flex-direction: column; gap: 16px; }
.ptitle h2 { margin: 0; font-family: var(--title-font); font-stretch: var(--title-stretch); font-size: calc(var(--d2) * var(--title-scale)); line-height: .92; font-weight: var(--title-weight); letter-spacing: var(--title-track); text-transform: uppercase; text-wrap: balance; }
.pmeta { display: flex; flex-direction: column; gap: 2px; font-size: var(--t-lede); line-height: 1.3; }
.psub { color: var(--muted); }
.pframe { position: relative; aspect-ratio: 2.39 / 1; overflow: hidden; background: var(--panel); display: flex; align-items: center; justify-content: center; }
.pframe > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.play { position: relative; z-index: 2; width: var(--round); height: var(--round); border-radius: 50%; background: rgba(0,0,0,.3); border: 1px solid var(--line-img); display: flex; align-items: center; justify-content: center; }
.player { position: absolute; inset: 0; z-index: 3; background: var(--black); }
.player iframe { width: 100%; height: 100%; border: 0; }
.pinfo { padding: clamp(40px, 8vh, 80px) 0; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 7vw, 120px); align-items: start; }
.pnote { font-size: var(--t-lede); line-height: 1.5; max-width: 34ch; }
.credits { margin: 0; font-size: var(--t-ui); }
.credits div { display: grid; grid-template-columns: 190px 1fr; gap: 16px; padding: 13px 0; border-top: 1px solid var(--line); }
.credits div:last-child { border-bottom: 1px solid var(--line); }
.credits dt { color: var(--muted); }
.credits dd { margin: 0; }
.pframes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 24px); }
.pframes .ph { aspect-ratio: 2.39 / 1; }
.pframes .ph:first-child:nth-last-child(odd) { grid-column: span 2; }

/* ---------- about: one heading, one paragraph, one frame, the people worked with, contact ---------- */
.about { display: flex; flex-direction: column; gap: clamp(56px, 10vh, 120px); }
.about-intro { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 110px); align-items: end; }
.about-head { display: grid; gap: clamp(20px, 3vh, 32px); }
/* the kit: plain list under the title, one item per line */
.kit { list-style: none; margin: 0; padding: 0; display: grid; font-size: var(--t-ui); color: var(--muted); max-width: 320px; }
.kit li { padding: 9px 0; border-top: 1px solid var(--line); }
.kit li:last-child { border-bottom: 1px solid var(--line); }
.lede { font-size: var(--t-lede); line-height: 1.5; max-width: 34ch; color: #CFCBC5; }
.about-still { margin: 0 calc(var(--px) * -1); aspect-ratio: 2.39 / 1; overflow: hidden; background: var(--panel); }
.about-still img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }

/* the people worked with: a slow line that moves by itself, like end credits; it stops under the pointer */
.clients .h2 { margin-bottom: 20px; }
.marquee { overflow: hidden; margin: 0 calc(var(--px) * -1); padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { list-style: none; margin: 0; padding: 0; display: flex; width: max-content; animation: credits 48s linear infinite; }
.marquee-track li { padding: 0 clamp(28px, 3.4vw, 56px); font-size: clamp(22px, 2.4vw, 36px); font-weight: 500; letter-spacing: -0.01em; color: var(--ink); white-space: nowrap; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes credits { to { transform: translateX(-50%); } }

/* footer */
.foot.landing-foot-bar { position: relative; z-index: 1; margin: 0 var(--px); padding: 22px 0 26px; color: var(--ink-img); border-top-color: var(--line-img); }
.landing-foot-bar .foot-ig { color: var(--ink); }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 28px var(--px) 32px; font-size: var(--t-small); color: var(--muted); border-top: 1px solid var(--line); }
.ig-icon { fill: none; stroke: currentColor; stroke-width: 1.6; flex-shrink: 0; }
.row-ig { display: inline-flex; align-items: center; gap: 12px; }
.foot-ig { display: inline-flex; padding: 8px; margin: -8px; color: var(--ink); }

/* ---------- contact (bottom of About) ---------- */
.about .contact { scroll-margin-top: 24px; }
.contact { display: flex; flex-direction: column; justify-content: space-between; gap: 56px; }
.contact-foot { display: flex; flex-direction: column; gap: 32px; }
.rows a { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; padding: 22px 0; border-top: 1px solid var(--line); }
.rows a:last-child { border-bottom: 1px solid var(--line); }
.rows a > span:first-child { font-size: var(--t-ui); color: var(--muted); }
.rows a > span:last-child { font-size: clamp(20px, 1.9vw, 28px); }
.contact-end { display: flex; justify-content: space-between; align-items: center; gap: 24px; font-size: var(--t-ui); color: var(--muted); }
.brief { height: var(--ctl); padding: 0 24px; background: var(--ink); color: var(--black); border-radius: calc(var(--ctl) / 2); font-size: var(--t-ui); font-weight: 500; display: inline-flex; align-items: center; justify-content: center; }

/* ---------- interaction ---------- */
.brief, .play, .icon-btn, .explore, .hero-go { transition: transform 160ms var(--ease-out), opacity 200ms ease; }
.brief:active, .play:active, .icon-btn:active, .explore:active, .hero-go:active { transform: scale(0.97); }
.pframe > img, .pframes img { transition: opacity 200ms ease; }
.swap { opacity: .35; }
@media (hover: hover) and (pointer: fine) {
  .bar a:hover, .rows a:hover, .back:hover, .icon-btn:hover, .foot-ig:hover { opacity: .65; }
  .hero-go:hover { border-color: var(--ink); }
  .brief:hover { opacity: .88; }
  .filters button:hover, .mode button:hover { color: var(--ink); }
  .explore:hover { border-color: var(--ink); }
  .card:not(.is-active) .card-link:hover { opacity: .85; }
}

/* ---------- tablet / phone ---------- */
@media (max-width: 860px) {
  :root { --px: 20px; --bar: auto; }
  .bar { padding-top: 16px; padding-bottom: 12px; align-items: flex-start; }
  .bar nav { flex-direction: column; align-items: flex-end; gap: 0; }
  .bar nav a { padding: 4px 0; }
  .deck { height: calc(100svh - 120px); }
  .track { --cw: min(72vw, calc((100svh - 300px) * .7)); gap: 14px; }
  .deck-top { flex-direction: column; align-items: flex-start; gap: 4px; }
  .scrub-line { width: 90px; }
  .explore { margin-left: 6px; }
  .role { display: none; }
  .display { hyphens: manual; }
  .page-fit { height: auto; min-height: 100svh; }
  .hero-name { padding-bottom: 96px; }
  .hero-foot { bottom: 96px; }
  .landing .bar nav { gap: 0; }
  .pinfo, .about-intro { grid-template-columns: 1fr; }
  .about { gap: 56px; }
  .marquee-track li { font-size: 22px; }
  .credits div { grid-template-columns: 1fr; gap: 2px; padding: 11px 0; }
  .pframes { grid-template-columns: 1fr; }
  .pframes .ph:first-child:nth-last-child(odd) { grid-column: auto; }
  .rows a { flex-direction: column; gap: 4px; padding: 16px 0; }
  .contact-end { flex-direction: column; align-items: stretch; }
}

/* =========================================================
   MOTION LAYER — only when JS adds html.motion (never under reduced motion)
   ========================================================= */
/* home: the frame opens from a thin line, then the name rises out of its line */
html.motion .reel { clip-path: inset(50% 0 50% 0); }
html.motion .landing .bar, html.motion .hero-line, html.motion .hero-foot, html.motion .landing-foot-bar { opacity: 0; }
html.motion .hero-title span { transform: translateY(24px); opacity: 0; }
html.motion.ready .reel { clip-path: inset(0 0 0 0); transition: clip-path 1300ms var(--ease-cut); }
html.motion.ready .hero-title span { transform: none; opacity: 1; transition: transform 1100ms var(--ease-arrive) 700ms, opacity 900ms ease 700ms; }
html.motion.ready .hero-title span + span { transition-delay: 820ms; }
html.motion.ready .hero-line, html.motion.ready .hero-tag { opacity: 1; transition: opacity 900ms ease 1150ms; }
html.motion.ready .landing .bar, html.motion.ready .hero-foot, html.motion.ready .landing-foot-bar { opacity: 1; transition: opacity 900ms ease 1300ms; }

/* inner pages: media is uncovered top-down, text settles */
html.motion [data-reveal="media"] { clip-path: inset(0 0 100% 0); }
html.motion [data-reveal="media"] img { scale: 1.06; }
html.motion [data-reveal="text"] { opacity: 0; transform: translateY(14px); }
html.motion [data-reveal].in { clip-path: inset(0 0 0 0); opacity: 1; transform: none;
  transition: clip-path 1100ms var(--ease-arrive) var(--d, 0ms), opacity 900ms ease var(--d, 0ms), transform 900ms var(--ease-arrive) var(--d, 0ms); }
html.motion [data-reveal="media"].in img { scale: 1; transition: scale 1800ms var(--ease-arrive) var(--d, 0ms), transform 600ms var(--ease-arrive); }
html.motion [data-reveal].instant, html.motion [data-reveal].instant img { transition: none !important; }

/* view transitions: tile still ↔ project frame (a match cut), everything else dissolves */
::view-transition-group(still) { animation-duration: 750ms; animation-timing-function: var(--ease-cut); }
::view-transition-old(still), ::view-transition-new(still) { height: 100%; object-fit: cover; }
::view-transition-old(root) { animation: vt-out 280ms ease both; }
::view-transition-new(root) { animation: vt-in 520ms ease 160ms both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .pframe > img { transition: none; }
  .marquee-track { animation: none; flex-wrap: wrap; width: auto; }
  .marquee-track li[aria-hidden] { display: none; }
  .marquee { mask-image: none; -webkit-mask-image: none; }
  .card.moving .card-img img { animation: none; }
  .brief:active, .play:active, .icon-btn:active { transform: none; }
}
