/* ─────────────────────────────────────────────
   Rastko Perišić — Folio MMXXVI
   editorial / brutalist hybrid
   ───────────────────────────────────────────── */

:root {
  --bg:        #efece4;
  --bg-deep:   #e6e2d6;
  --ink:       #1a1815;
  --ink-soft:  #3a352e;
  --muted:     #87837a;
  --line:      #d6cfbf;
  --paper:     #f6f3eb;
  --rust:      #c4471d;
  --rust-deep: #a13911;
  --night:     #0f0d0a;

  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans:  "Inter Tight", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "Menlo", monospace;

  --pad: clamp(20px, 4vw, 56px);
  --strip-h: 42px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-feature-settings: "ss01", "ss02";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  cursor: none;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { background: none; border: 0; color: inherit; font: inherit; cursor: none; }
img { display: block; max-width: 100%; height: auto; }
em { font-style: italic; font-family: var(--serif); letter-spacing: 0; }

.mono { font-family: var(--mono); letter-spacing: 0.02em; font-weight: 400; }
.micro { font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; }
.muted { color: var(--muted); }

/* ─── film grain ───────────────────────────── */
.grain {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 9000;
  opacity: 0.045;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/></svg>");
  animation: grain 8s steps(8) infinite;
}
@keyframes grain {
  0%   { transform: translate(0,0); }
  10%  { transform: translate(-2%,-3%); }
  20%  { transform: translate(-4%, 2%); }
  30%  { transform: translate( 2%,-1%); }
  40%  { transform: translate(-1%, 3%); }
  50%  { transform: translate( 3%,-2%); }
  60%  { transform: translate(-3%, 1%); }
  70%  { transform: translate( 1%, 2%); }
  80%  { transform: translate(-1%,-3%); }
  90%  { transform: translate( 2%, 1%); }
  100% { transform: translate(0,0); }
}

/* ─── cursor ───────────────────────────────── */
.cursor { position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none; mix-blend-mode: difference; }
.cursor__dot,
.cursor__ring,
.cursor__label {
  position: absolute; top: 0; left: 0;
  transform: translate(-50%, -50%);
  will-change: transform;
}
.cursor__dot {
  width: 6px; height: 6px;
  background: #fff;
  border-radius: 50%;
}
.cursor__ring {
  width: 36px; height: 36px;
  border: 1px solid #fff;
  border-radius: 50%;
  opacity: 0.6;
  transition: width .3s ease, height .3s ease, opacity .3s ease, border-radius .3s ease;
}
.cursor__label {
  margin-top: 28px; margin-left: 28px;
  transform: translate(0, 0);
  font-family: var(--mono);
  font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .25s ease;
}
.cursor.is-hover .cursor__ring { width: 56px; height: 56px; opacity: 0.95; border-radius: 4px; }
.cursor.is-hover .cursor__label { opacity: 1; }
.cursor.is-click .cursor__ring { width: 20px; height: 20px; }

@media (hover: none) {
  body { cursor: auto; }
  .cursor { display: none; }
  button, a { cursor: pointer; }
}

/* ─── boot screen ──────────────────────────── */
.boot {
  position: fixed; inset: 0; z-index: 8000;
  background: var(--night);
  color: var(--paper);
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  padding: 24px var(--pad);
  transition: opacity .6s ease, visibility .6s;
}
.boot.is-done { opacity: 0; visibility: hidden; }
.boot__row { display: flex; justify-content: space-between; }
.boot__big {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-size: clamp(48px, 11vw, 180px);
  line-height: 0.9;
  font-style: italic;
}
.boot__hello {
  opacity: 0;
  transform: translateY(20px);
  animation: bootIn .8s .2s forwards cubic-bezier(.2,.7,.1,1);
}
@keyframes bootIn { to { opacity: 1; transform: translateY(0); } }
.boot__bar {
  height: 1px; background: rgba(246,243,235,.18);
  position: relative; overflow: hidden;
  margin-top: 8px;
}
.boot__bar span {
  position: absolute; inset: 0 100% 0 0;
  background: var(--paper);
  transition: right .25s linear;
}

/* ─── strip ────────────────────────────────── */
.strip {
  position: sticky; top: 0; z-index: 100;
  height: var(--strip-h);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  align-items: center;
  gap: var(--pad);
  padding: 0 var(--pad);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.strip__cell { display: flex; gap: 12px; align-items: center; min-width: 0; }
.strip__cell--mid { justify-content: center; }
.strip__cell--nav { gap: 22px; justify-content: flex-end; }
.strip__cell--nav a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  position: relative;
}
.strip__cell--nav a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -14px;
  height: 1px; background: var(--ink);
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s ease;
}
.strip__cell--nav a:hover::after { transform: scaleX(1); }

@media (max-width: 900px) {
  .strip { grid-template-columns: 1fr 1fr; height: auto; padding: 10px var(--pad); gap: 8px; }
  .strip__cell:nth-child(3) { display: none; }
  .strip__cell--nav { grid-column: 1 / -1; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
}

/* ─── HERO ─────────────────────────────────── */
.hero {
  min-height: calc(100svh - var(--strip-h));
  padding: clamp(40px, 8vh, 80px) var(--pad) clamp(28px, 6vh, 48px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  position: relative;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.hero__meta {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.hero__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(72px, 21vw, 360px);
  line-height: 0.82;
  letter-spacing: -0.025em;
  margin: clamp(20px, 6vh, 80px) 0;
  align-self: center;
}
.hero__line { display: block; position: relative; }
.hero__line:nth-child(2) { text-align: right; margin-top: -.08em; }
.hero__line sup {
  font-size: 0.18em;
  vertical-align: top;
  letter-spacing: 0;
  margin-left: .15em;
  color: var(--rust);
}
.hero__foot {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: var(--pad);
  align-items: end;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.hero__lede {
  font-family: var(--serif);
  font-size: clamp(20px, 2.2vw, 32px);
  line-height: 1.25;
  max-width: 36ch;
}
.hero__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat__num {
  font-family: var(--serif);
  font-size: clamp(20px, 2.4vw, 28px);
  font-style: italic;
}
.hero__scroll {
  position: absolute; bottom: 22px; right: var(--pad);
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--ink);
  border-radius: 999px;
}
.hero__scroll:hover { background: var(--ink); color: var(--paper); }

@media (max-width: 720px) {
  .hero__foot { grid-template-columns: 1fr; gap: 20px; }
  .hero__stats { grid-template-columns: 1fr 1fr 1fr; }
}

/* ─── MARQUEE ──────────────────────────────── */
.marquee {
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--bg-deep);
  padding: 18px 0;
}
.marquee__track {
  display: inline-flex;
  gap: 32px;
  white-space: nowrap;
  font-family: var(--serif);
  font-size: clamp(28px, 5vw, 64px);
  line-height: 1;
  animation: scroll 28s linear infinite;
  padding-left: 0;
}
.marquee__track span { color: var(--ink); }
.marquee__track span:nth-child(odd) em { color: var(--rust); font-style: italic; }
@keyframes scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ─── SECTION SHELL ────────────────────────── */
.section {
  padding: clamp(60px, 10vh, 120px) var(--pad) clamp(60px, 10vh, 120px);
  border-bottom: 1px solid var(--line);
  position: relative;
}
.section__head {
  display: flex; align-items: center; gap: 18px;
  margin-bottom: clamp(40px, 6vh, 80px);
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--line);
}
.section__head--end { margin-left: auto; }

/* ─── MANIFEST ─────────────────────────────── */
.manifest__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 120px);
}
.manifest__col--lede p {
  font-family: var(--serif);
  font-size: clamp(28px, 3.4vw, 48px);
  line-height: 1.18;
  margin-bottom: 22px;
  max-width: 22ch;
}
.manifest__col--lede p em { color: var(--rust); }
.manifest__col--side {
  padding-left: clamp(20px, 3vw, 40px);
  border-left: 1px solid var(--line);
}
.kv dt { margin-top: 22px; color: var(--muted); }
.kv dt:first-child { margin-top: 0; }
.kv dd {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.2;
  margin-top: 4px;
}
.dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  background: var(--muted);
  vertical-align: middle;
}
.dot--on {
  background: #2d8d4a;
  box-shadow: 0 0 0 0 rgba(45,141,74,.5);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(45,141,74,.55); }
  70%  { box-shadow: 0 0 0 10px rgba(45,141,74,0); }
  100% { box-shadow: 0 0 0 0 rgba(45,141,74,0); }
}

@media (max-width: 900px) {
  .manifest__grid { grid-template-columns: 1fr; }
  .manifest__col--side { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); padding-top: 30px; }
}

/* ─── WORK ─────────────────────────────────── */
.work__list { list-style: none; }
.entry {
  display: grid;
  grid-template-columns: 80px minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 60px);
  align-items: start;
  padding: clamp(28px, 5vh, 56px) 0;
  border-top: 1px solid var(--line);
  position: relative;
  cursor: none;
  transition: padding .4s cubic-bezier(.2,.7,.1,1);
}
.entry:first-child { border-top: 0; padding-top: 0; }
.entry:hover { padding-left: 14px; }
.entry__num {
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.16em;
  padding-top: 8px;
}
.entry__media {
  overflow: hidden;
  background: var(--bg-deep);
  position: relative;
  aspect-ratio: 16 / 9;
}
.entry__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform .8s cubic-bezier(.2,.7,.1,1);
  filter: saturate(1.05);
}
.entry:hover .entry__media img { transform: scale(1.05); }
.entry__media::after {
  content: "Otvori ↗";
  position: absolute; top: 14px; right: 14px;
  font-family: var(--mono);
  font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--ink); color: var(--paper);
  padding: 6px 10px;
  opacity: 0; transform: translateY(-4px);
  transition: opacity .3s ease, transform .3s ease;
}
.entry:hover .entry__media::after { opacity: 1; transform: translateY(0); }

.entry__meta { display: flex; flex-direction: column; gap: 16px; }
.entry__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 4.8vw, 72px);
  line-height: 1;
  letter-spacing: -0.02em;
}
.entry__title em { color: var(--rust); }
.entry__desc {
  font-family: var(--serif);
  font-size: clamp(16px, 1.4vw, 20px);
  line-height: 1.4;
  max-width: 32ch;
  color: var(--ink-soft);
}
.tags { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 4px; }
.tags li {
  list-style: none;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
}
.entry__year { margin-top: 4px; }

@media (max-width: 900px) {
  .entry { grid-template-columns: 1fr; gap: 16px; }
  .entry__num { padding-top: 0; }
  .entry__title { font-size: clamp(32px, 8vw, 48px); }
}

/* ─── PRACTICE ─────────────────────────────── */
.practice__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.craft {
  background: var(--bg);
  padding: clamp(28px, 4vw, 48px);
  display: flex; flex-direction: column; gap: 16px;
  min-height: 240px;
}
.craft__num { color: var(--muted); }
.craft__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 3.4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.015em;
}
.craft__title em { color: var(--rust); }
.craft p {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.3;
  color: var(--ink-soft);
  max-width: 26ch;
}
.craft ul { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: auto; }
.craft li {
  list-style: none;
  color: var(--muted);
  position: relative;
}
.craft li:not(:last-child)::after {
  content: "/";
  position: absolute; right: -12px;
  color: var(--line);
}

@media (max-width: 720px) {
  .practice__grid { grid-template-columns: 1fr; }
}

/* ─── CONTACT ──────────────────────────────── */
.contact__body { display: grid; gap: 30px; }
.contact__pre {
  max-width: 40ch;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: 0;
  text-transform: none;
}
.contact__mail {
  font-family: var(--serif);
  font-size: clamp(56px, 11vw, 200px);
  line-height: 0.9;
  letter-spacing: -0.025em;
  display: inline-flex;
  align-items: flex-start;
  gap: .15em;
  color: var(--ink);
  align-self: start;
  position: relative;
  padding-right: .2em;
}
.contact__mail em { color: var(--rust); }
.contact__mail sup {
  font-family: var(--mono);
  font-size: 0.12em;
  margin-top: 0.6em;
  color: var(--rust);
  transition: transform .3s ease;
}
.contact__mail:hover sup { transform: translate(8px, -8px); }
.contact__mail span:first-child { position: relative; }
.contact__mail span:first-child::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 4%;
  height: 4px; background: var(--rust);
  transform: scaleX(0); transform-origin: left;
  transition: transform .5s cubic-bezier(.2,.7,.1,1);
}
.contact__mail:hover span:first-child::after { transform: scaleX(1); }

.contact__links {
  display: flex; flex-wrap: wrap; gap: 20px 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.contact__links a {
  position: relative;
  padding-bottom: 4px;
}
.contact__links a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: var(--ink);
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s ease;
}
.contact__links a:hover::after { transform: scaleX(1); }

/* ─── FOOTER ───────────────────────────────── */
.foot {
  padding: 24px var(--pad) 28px;
  background: var(--night);
  color: var(--paper);
}
.foot__row {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(246,243,235,.15);
  margin-bottom: 22px;
}
.foot__big {
  display: flex; justify-content: space-between; align-items: end; gap: 16px;
  font-family: var(--serif);
  font-size: clamp(48px, 12vw, 200px);
  line-height: 0.85;
  font-style: italic;
}
.foot__big em { color: var(--rust); font-style: italic; }
.foot__top {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 14px;
  border: 1px solid rgba(246,243,235,.4);
  border-radius: 999px;
  align-self: end;
  margin-bottom: 18px;
}
.foot__top:hover { background: var(--paper); color: var(--night); }

/* ─── SHEET (project details) ──────────────── */
.sheet {
  position: fixed; inset: 0;
  z-index: 200;
  background: var(--paper);
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform .6s cubic-bezier(.2,.7,.1,1);
}
.sheet.is-open {
  transform: translateY(0);
}
.sheet__close {
  position: sticky; top: 0; right: 0;
  margin-left: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  font-family: var(--mono);
  font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--ink); color: var(--paper);
  z-index: 4;
  border-bottom-left-radius: 4px;
}
.sheet__close span:last-child { font-size: 18px; line-height: 1; }
.sheet__inner { padding: 24px var(--pad) 60px; }
.sheet__head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 30px;
}
.sheet__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(48px, 9vw, 140px);
  line-height: 0.9;
  letter-spacing: -0.025em;
}
.sheet__title em { color: var(--rust); }
.sheet__desc { max-width: 60ch; text-transform: none; letter-spacing: 0; font-size: 13px; line-height: 1.6; }
.sheet__gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
.sheet__gallery figure {
  background: var(--bg-deep);
  padding: 16px;
}
.sheet__gallery img {
  width: 100%; height: auto;
  display: block;
}
.sheet__gallery figcaption {
  font-family: var(--mono);
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted);
  padding-top: 10px;
}

/* ─── reveal animation ────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .9s cubic-bezier(.2,.7,.1,1), transform .9s cubic-bezier(.2,.7,.1,1);
}
.reveal.is-in { opacity: 1; transform: translateY(0); }

/* ─── selection ────────────────────────────── */
::selection { background: var(--rust); color: var(--paper); }

/* ─── scrollbar ────────────────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--muted); border: 2px solid var(--bg-deep); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink); }

/* ─── reduced motion ──────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
