/* =========================================================
   Tudor Boriceanu — portofoliu
   Light, photocopied paper: heavy slab display type with a
   spray/ink halo, bold mono labels, grain. Black on white.
   ========================================================= */
:root {
  --bg: #efeeea;
  --fg: #111111;
  --muted: #5c5c58;
  --dim: #9a9a94;
  --line: #cdcbc4;
  --card: #dcdad3;
  --gap: 8px;
  --pad: 32px;
  --radius: 14px;
  --font: "Courier Prime", "Courier New", ui-monospace, monospace;
  --display: "Inter", system-ui, sans-serif;
  --mono: "Courier Prime", "Courier New", ui-monospace, monospace;

  /* ---- type scale (one place, used everywhere) ----
     D1 display  : name, project title        Inter 800, lowercase, tight
     D2 heading  : section titles             Inter 800, lowercase, tight
     L  lead     : statement, subtitle, mail  Courier Prime 400, large
     B  body     : paragraphs                 Courier Prime 400, 15px
     S  small    : secondary copy             Courier Prime 400, 13px
     C  caps     : labels, filters, meta      Courier Prime 700, UPPERCASE, open tracking */
  --d1: clamp(52px, 6vw, 104px);
  --d2: 40px;
  --lead: clamp(16px, 1.3vw, 18px);
  --body: 15px;
  --small: 13px;
  --caps: 11.5px;
  --track-text: -.045em;   /* running text: slightly tight, typewriter stays readable */
  --track-caps: .06em;     /* uppercase needs air: positive tracking */
  --track-display: -.055em;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--body);
  line-height: 1.5;
  letter-spacing: var(--track-text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
/* soft vignette only (the photocopier streaks were removed: they read as dark stripes) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(120% 80% at 50% 50%, transparent 60%, rgba(0, 0, 0, .06));
}
/* toner grain over the whole page */
body::after {
  content: ""; position: fixed; inset: -50%; z-index: 100; pointer-events: none;
  opacity: .32; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(5) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
ul { list-style: none; }
::selection { background: var(--fg); color: var(--bg); }

/* bold mono labels, like the stamps on a test print */
.micro, .filters button, .cap, .meta span, .foot, .strip, .btn {
  font-family: var(--mono); font-size: var(--caps); line-height: 1.3; letter-spacing: var(--track-caps); text-transform: uppercase; font-weight: 700;
}
/* heavy slab display type; the SVG filters (#spray / #spray-big, defined in each page)
   round the letters and add a speckled spray halo */
.display { font-family: var(--display); font-weight: 800; letter-spacing: var(--track-display); text-transform: lowercase; }

/* ===== Desktop: two columns that scroll independently ===== */
.split { display: grid; grid-template-columns: minmax(380px, 2fr) 3fr; height: 100vh; height: 100dvh; }
.col { position: relative; height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.col::-webkit-scrollbar { display: none; }
.col-left { padding: 0 var(--pad) var(--pad); border-right: 1px solid var(--line); }
.col-right { padding: 0 12px 12px 12px; }
.progress { display: none; }

/* ===== Header ===== */
.intro { position: relative; }
.strip { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0 0; }
.btn {
  display: inline-flex; align-items: center;
  padding: 9px 16px; border: 1.5px solid var(--fg); border-radius: 999px;
  transition: background .2s, color .2s;
}
.btn:hover { background: var(--fg); color: var(--bg); }

.name {
  margin-top: 56px;
  font-size: var(--d1); line-height: .92;
  filter: url(#spray-big);
}
.name span { display: block; }
.name span + span { margin-left: 0; }
/* the list under the name: one service per line */
.tagline {
  margin-top: 26px;
  font-size: var(--body); line-height: 1.45; letter-spacing: var(--track-text); font-weight: 400;
}
.tagline .m a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; transition: color .2s; }
.tagline .m a:hover { color: var(--fg); }

/* ===== Sections ===== */
.block { padding: 36px 0 44px; }
.head { margin-bottom: 24px; }
.head h2 { font-family: var(--display); font-weight: 800; letter-spacing: var(--track-display); text-transform: lowercase; font-size: var(--d2); line-height: 1; filter: url(#spray); }
.block p.lead { color: var(--muted); font-size: var(--body); max-width: 46ch; }
.block p.lead + p.lead { margin-top: 12px; }
#servicii { scroll-margin-top: 8px; }
/* the "and more" link scrolls smoothly (the left column on desktop, the page on phones) */
html, .col-left { scroll-behavior: smooth; }

.reveal { opacity: .25; transform: translateY(12px); transition: opacity 1s ease, transform 1s ease; }
.reveal.on { opacity: 1; transform: none; }

/* clients: rolling line of names, separated by slashes */
.marquee { overflow: hidden; padding: 24px 0 8px; }
.marquee p { color: var(--muted); font-size: var(--small); margin-bottom: 10px; }
.marquee-track { display: flex; width: max-content; animation: slide 36s linear infinite; }
/* margin (not gap) so the repeated list is exactly half the track and the loop has no jump */
.marquee-track span { font-family: var(--mono); font-weight: 700; font-size: var(--caps); letter-spacing: var(--track-caps); white-space: nowrap; text-transform: uppercase; margin-right: 22px; }
.marquee-track span::after { content: "/"; margin-left: 22px; color: var(--dim); }
.marquee-track img { height: 28px; width: auto; filter: grayscale(1); }
@keyframes slide { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .marquee-track { width: auto; flex-wrap: wrap; row-gap: 6px; }
  .marquee-track span[aria-hidden] { display: none; }
}

/* portrait: B&W, soft contrast, on a light background, with a little grain */
.portrait {
  position: relative; margin: 0 0 26px;
  aspect-ratio: 6 / 7; max-width: 400px;
  overflow: hidden; isolation: isolate; border-radius: var(--radius);
  background: #f0f0ef;
}
.portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.portrait::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2; opacity: .16; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}


/* services */
.services { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 22px; }
.services h3 { font-family: var(--mono); font-size: var(--caps); font-weight: 700; text-transform: uppercase; letter-spacing: var(--track-caps); margin-bottom: 10px; }
.services p { color: var(--muted); font-size: var(--small); line-height: 1.5; }

/* tools & experience */
.index li, .xp article { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.index li span, .xp .when { color: var(--muted); }
.xp p { grid-column: 1 / -1; color: var(--muted); font-size: var(--small); line-height: 1.5; max-width: 52ch; }

/* reviews */
.reviews { display: grid; gap: 22px; }
.review blockquote { font-size: 18px; line-height: 1.35; letter-spacing: var(--track-text); }
.review footer { margin-top: 8px; color: var(--muted); }

/* contact */
.contact .btn { margin-top: 16px; padding: 11px 20px; }
.contact .links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 22px; }
.contact .links a, .contact .rows a { transition: opacity .2s; }
.contact .links a:hover, .contact .rows a:hover { opacity: .55; }
.contact .rows { margin-top: 14px; color: var(--muted); }

.foot { padding-top: 28px; display: flex; justify-content: space-between; align-items: center; color: var(--muted); }
/* "back to top": big enough to see and tap */
.top-btn { width: 38px; height: 38px; border: 2px solid var(--fg); border-radius: 50%; background: transparent; color: var(--fg); cursor: pointer; font: inherit; font-size: 28px; font-weight: 700; line-height: 1; display: grid; place-items: center; transition: background .2s, color .2s; }
.top-btn:hover { background: var(--fg); color: var(--bg); }

/* ===== Filters ===== */
.filters {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 4px 18px; flex-wrap: wrap;
  padding: 16px 2px 14px;
  transition: background .3s ease;
}
.filters button { background: none; border: 0; color: var(--dim); cursor: pointer; padding: 2px 0; transition: color .2s; }
.filters button:hover, .filters button.active { color: var(--fg); }
/* once the gallery scrolls under it, the bar becomes paper (never grey) */
.col.scrolled .filters { background: rgba(239, 238, 234, .92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }

/* ===== Justified gallery: every row is one height, tiles fill the width exactly ===== */
.gallery { display: grid; gap: var(--gap); container-type: inline-size; }
.row {
  display: flex; gap: var(--gap);
  /* height so the tiles' widths add up to the row: (width − gaps) / sum of ratios */
  height: calc((100cqw - (var(--n) - 1) * var(--gap)) / var(--s));
}
.row.fixed { height: var(--h); justify-content: center; }
.row.fixed .card { flex: none; width: calc(var(--r) * var(--h)); }
.card {
  position: relative; display: block; overflow: hidden; margin: 0;
  /* grow in proportion to the aspect ratio (×100: flex-grow sums under 1 would leave a gap) */
  flex: calc(var(--r) * 100) 1 0; min-width: 0; height: 100%;
  background: var(--card); border-radius: var(--radius);
  animation: fadeIn .5s ease both;
}
.card iframe { width: 100%; height: 100%; border: 0; display: block; background: #000; }
.card img, .card video {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.1s cubic-bezier(.2, .7, .2, 1);
}
/* details only on hover */
.card .cap {
  position: absolute; inset: auto 0 0 0; z-index: 4;
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: end;
  padding: 48px 14px 12px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .7));
  opacity: 0; transition: opacity .3s ease;
  pointer-events: none;
}
.card .cap b { color: #fff; }
.card .cap small { display: block; font-size: inherit; color: #d6d6d0; }
.card .cap .tags { color: #d6d6d0; text-align: right; }
@media (hover: hover) {
  .card:hover .cap { opacity: 1; }
  .card:hover img, .card:hover video { transform: scale(1.02); }
}
/* branding thumbnails: no zoom and no dark layer, but a small light label with the project name on hover,
   so it is clear the tile is clickable */
.gallery.simple .card img, .gallery.simple .card video,
.media .card img, .media .card video { transform: none !important; transition: none; }
.gallery.simple .card { cursor: pointer; }
.gallery.simple .card .cap {
  inset: auto auto 10px 10px; display: block; padding: 7px 12px; max-width: calc(100% - 20px);
  background: var(--bg); color: var(--fg); border-radius: 999px; box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
  transform: translateY(6px); transition: opacity .25s ease, transform .25s ease;
}
.gallery.simple .card .cap b { color: var(--fg); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gallery.simple .card .cap small, .gallery.simple .card .cap .tags { display: none; }
@media (hover: hover) { .gallery.simple .card:hover .cap { opacity: 1; transform: none; } }

/* sections of one presentation board, stacked edge to edge so they read as one long image */
.board-stack { display: flex; flex-direction: column; margin-top: 28px; border-radius: var(--radius); overflow: hidden; }
.p-grid:empty + .board-stack { margin-top: 0; }
.board-stack img { display: block; width: 100%; height: auto; margin: 0; border: 0; }
/* overlap by 1px so sub-pixel rounding never leaves a hairline between sections */
.board-stack img + img { margin-top: -1px; }

.empty { color: var(--muted); padding: 40px 0; text-align: center; }
@keyframes fadeIn { from { opacity: 0; } }

/* ===== Project page ===== */
.p-no { margin-top: 52px; color: var(--muted); }
.p-title { margin-top: 14px; font-size: calc(var(--d1) * .64); line-height: .98; filter: url(#spray-big); }
.p-sub { margin-top: 20px; font-size: var(--lead); line-height: 1.35; letter-spacing: var(--track-text); font-weight: 400; max-width: 38ch; }
.meta { display: grid; grid-template-columns: 1fr 1fr; margin-top: 36px; }
.meta div { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--line); }
.meta span { display: block; color: var(--muted); margin-bottom: 3px; }
.p-body { margin-top: 30px; }
.p-body h3 { font-family: var(--mono); font-size: var(--caps); text-transform: uppercase; letter-spacing: var(--track-caps); color: var(--muted); font-weight: 700; margin: 22px 0 6px; }
.p-body p { font-size: var(--body); max-width: 46ch; }
.media { padding-top: 16px; }
.media .card { cursor: default; }
.media .card.zoom { cursor: zoom-in; }
.media .card.flash { animation: flash 1.8s ease; }
@keyframes flash { 0%, 40% { box-shadow: inset 0 0 0 3px var(--fg); } 100% { box-shadow: inset 0 0 0 3px transparent; } }
.next-head { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 16px; margin: 56px 2px 16px; padding-top: 22px; border-top: 2px solid var(--fg); color: var(--fg); text-decoration: none; }
.next-head .micro { grid-column: 1 / -1; color: var(--muted); margin-bottom: 8px; }
.next-title { font-family: var(--display); font-weight: 800; text-transform: lowercase; letter-spacing: var(--track-display); font-size: clamp(30px, 3.4vw, 52px); line-height: 1; filter: url(#spray); overflow-wrap: anywhere; }
.next-title { grid-column: 1; }
.next-client { grid-column: 1; margin-top: 8px; font-family: var(--mono); font-size: var(--small); color: var(--muted); letter-spacing: var(--track-text); }
.next-arrow { grid-column: 2; grid-row: 2 / 4; width: 38px; height: 38px; border: 2px solid var(--fg); border-radius: 50%; display: grid; place-items: center; transition: background .2s, color .2s, transform .25s; }
.next-head:hover .next-arrow { background: var(--fg); color: var(--bg); transform: translateX(6px); }
.next-head + .gallery { margin-top: 0; }

/* ===== Lightbox (stays dark so photos read well) ===== */
.lightbox { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(12, 12, 12, .97);
  opacity: 0; pointer-events: none; transition: opacity .25s ease; color: #ecebe6; }
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img { max-width: calc(100vw - 140px); max-height: calc(100dvh - 90px); width: auto; height: auto; border-radius: 6px; }
.lightbox button { position: absolute; border: 1.5px solid #555; border-radius: 50%; background: transparent; color: #ecebe6;
  width: 42px; height: 42px; font-size: 22px; line-height: 1; cursor: pointer; }
.lightbox button:hover { border-color: #ecebe6; }
.lb-close { top: 18px; 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%); color: #9a9a94; font-family: var(--mono); font-size: var(--caps); letter-spacing: var(--track-caps); }

/* ===== Mobile: one flowing page — intro, the work, then the rest ===== */
@media (max-width: 860px) {
  /* smaller titles on phones: the ink-bleed blur is the same size, so the letters need more room or they merge */
  :root { --pad: 16px; --gap: 5px; --radius: 10px; --d1: 15vw; --d2: 32px; --lead: 16px; --track-display: -.035em; }
  .split { display: flex; flex-direction: column; height: auto; }
  .col { height: auto; overflow: visible; }
  .col-left { display: contents; }
  .col-left .intro { order: 1; padding: 0 var(--pad) 18px; }
  .col-right { order: 2; padding: 0 var(--pad) 24px; }
  .col-left .rest { order: 3; padding: 0 var(--pad) var(--pad); }
  .name { margin-top: 40px; }
  .tagline { margin-top: 24px; }
  .filters { margin: 0 calc(var(--pad) * -1); padding: 14px var(--pad) 12px; flex-wrap: nowrap; overflow-x: auto; background: transparent; scrollbar-width: none; }
  .filters button { flex: none; }
  /* paper strip (never grey) once the page scrolls under the bar */
  body.scrolled .filters { background: rgba(239, 238, 234, .94); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
  /* once the bar is stuck at the top it is solid paper, and a shadow of the same colour hides the images
     that would otherwise show above it, under the phone's status bar */
  body .filters.stuck { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 -100px 0 100px var(--bg); }
  .portrait { max-width: none; }
  .services { grid-template-columns: 1fr; }
  .card .cap { padding: 36px 9px 8px; }
  .card .cap .tags { display: none; }
  .lightbox img { max-width: 100vw; max-height: calc(100dvh - 120px); border-radius: 0; }
  .lb-prev, .lb-next { top: auto; bottom: 12px; transform: none; }
  .lb-count { bottom: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  html, .col-left { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.strip-r { display: flex; align-items: center; gap: 12px; }
.ig { display: inline-block; width: 22px; height: 22px; background: var(--fg); -webkit-mask: url(../assets/instagram.svg) center / contain no-repeat; mask: url(../assets/instagram.svg) center / contain no-repeat; transition: opacity .2s; }
.ig:hover { opacity: .55; }
.contact .links { margin-top: 16px; }

.back { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; }
.back-ico { width: 32px; height: 32px; border: 2px solid var(--fg); border-radius: 50%; display: grid; place-items: center; transition: background .2s, color .2s, transform .25s; }
.back:hover .back-ico { background: var(--fg); color: var(--bg); transform: translateX(-4px); }
