/* Dolwi Studio — palette and voice taken from the KPI/strategy document:
   coral accent, near-black ink, warm paper, and the edit-suite labelling
   (SEC_, TC, REC) that runs through Jakub's own material. */

:root {
  --ink:     #16181D;
  --paper:   #F6F5F2;
  --white:   #FFFFFF;
  --coral:   #FF5A48;
  --muted:   #5A6068;
  --muted-d: #8B939C;
  --rule:    #E2E0DB;
  --rule-d:  rgba(255, 255, 255, .12);

  --accent: var(--coral);           /* film pages override this per client */

  --gut: clamp(20px, 5vw, 76px);
  --max: 1280px;

  --display: "Familjen Grotesk", ui-sans-serif, system-ui, sans-serif;
  --body: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img, video, iframe { display: block; max-width: 100%; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gut); }

/* ---------- shared type roles ---------- */

.label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted);
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -.03em;
  text-decoration: none;
}

.mark::before {
  content: "";
  width: 15px; height: 15px;
  border-radius: 4px;
  background: var(--coral);
  flex: none;
}

/* =========================================================
   LANDING
   ========================================================= */

.masthead {
  padding-block: clamp(26px, 4vw, 40px) clamp(56px, 11vw, 120px);
  transition: opacity .45s var(--ease), transform .45s var(--ease);
  will-change: opacity, transform;
}

/* the mark and the pitch lift away once the films take over the screen */
body.scrolled .masthead { opacity: 0; transform: translateY(-16px); pointer-events: none; }

.masthead-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: clamp(48px, 9vw, 104px);
}

.pitch {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(38px, 7vw, 82px);
  line-height: 1.0;
  letter-spacing: -.04em;
  margin: 0;
  max-width: 14ch;
}

.pitch em { font-style: normal; color: var(--coral); }

.pitch-sub {
  margin: clamp(20px, 2.6vw, 28px) 0 0;
  max-width: 44ch;
  font-size: clamp(15px, 1.4vw, 18px);
  color: var(--muted);
}

/* ---------- film grid ---------- */

.films { padding-bottom: clamp(48px, 8vw, 96px); }

.films-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: clamp(22px, 3vw, 34px);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(18px, 2.4vw, 30px) clamp(16px, 2vw, 26px);
}

.card { display: block; text-decoration: none; }

.card-media {
  display: block;
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 5px;
  background: #DCDAD5;
  box-shadow: 0 1px 3px rgba(22, 24, 29, .1);
}

.card-media img,
.card-media video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

.card-media video { opacity: 0; transition: opacity .4s var(--ease); }
.card:hover .card-media video,
.card:focus-visible .card-media video { opacity: 1; }

/* the description is the hover state — it slides over the frame */
.card-desc {
  position: absolute; inset: 0;
  display: flex;
  align-items: flex-end;
  padding: clamp(14px, 1.6vw, 20px);
  background: linear-gradient(to top, rgba(12, 14, 17, .93) 30%, rgba(12, 14, 17, .55));
  color: #F2F3F4;
  font-size: 13.5px;
  line-height: 1.45;
  opacity: 0;
  transition: opacity .35s var(--ease);
}

.card:hover .card-desc,
.card:focus-visible .card-desc { opacity: 1; }

.card-desc span {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tag {
  position: absolute;
  top: 12px; left: 12px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .93);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  z-index: 2;
}

.card-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding-top: 13px;
}

.card-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(17px, 1.6vw, 20px);
  letter-spacing: -.022em;
  margin: 0;
}

.card-kind { margin: 3px 0 0; font-size: 13.5px; color: var(--muted); }

.card-views {
  flex: none;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--coral);
  white-space: nowrap;
}

/* ---------- foot ---------- */

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 30px;
  justify-content: space-between;
  border-top: 1px solid var(--rule);
  padding-block: 24px 44px;
}

.foot a { text-decoration-color: rgba(255, 90, 72, .5); text-underline-offset: 3px; }
.foot a:hover { text-decoration-color: var(--coral); }

/* =========================================================
   FILM PAGE — dark screening room, client colour as accent
   ========================================================= */

body.film { background: var(--ink); color: var(--white); }
body.film .label { color: var(--muted-d); }

.filmbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-block: 22px;
  border-bottom: 1px solid var(--rule-d);
}

/* the way back — the thing that was missing before */
.back {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px 9px 13px;
  border: 1px solid var(--rule-d);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
  text-decoration: none;
  transition: border-color .25s var(--ease), color .25s var(--ease);
}

.back:hover { border-color: var(--accent); color: var(--accent); }
.back svg { width: 13px; fill: currentColor; }

.film-head { padding-block: clamp(34px, 6vw, 62px) clamp(20px, 3vw, 32px); }
.film-head .label { color: var(--accent); display: block; }

.film-head h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(30px, 5.2vw, 60px);
  line-height: 1.03;
  letter-spacing: -.035em;
  margin: 14px 0 0;
  max-width: 17ch;
}

.stage {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .09), 0 40px 90px -40px #000;
}

.stage video, .stage iframe { width: 100%; height: 100%; border: 0; }
.stage video { object-fit: contain; background: #000; }

.play {
  position: absolute; inset: 0;
  display: block;
  border: 0; padding: 0;
  background: linear-gradient(to top, rgba(10, 12, 15, .4), rgba(10, 12, 15, 0) 45%);
  cursor: pointer;
}

.play[hidden] { display: none; }

.play-pill {
  position: absolute;
  left: clamp(14px, 2.2vw, 26px);
  bottom: clamp(14px, 2.2vw, 26px);
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 13px 21px 13px 17px;
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .35);
  transition: transform .3s var(--ease);
}

.play:hover .play-pill { transform: translateY(-2px); }
.play-pill svg { width: 11px; fill: currentColor; }

.film-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 16px;
}

.film-meta .dot { color: rgba(255, 255, 255, .25); margin-inline: 9px; }
.film-meta strong { color: var(--accent); font-weight: 500; font-family: var(--mono); font-size: 12px; }

.film-body {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: clamp(24px, 4vw, 64px);
  border-top: 1px solid var(--rule-d);
  margin-top: clamp(38px, 6vw, 64px);
  padding-block: clamp(28px, 4vw, 44px) clamp(56px, 9vw, 104px);
}

.film-body--wide { grid-template-columns: 1fr; }

.film-body p {
  margin: 0;
  font-size: clamp(15px, 1.5vw, 17.5px);
  line-height: 1.6;
  color: #D7DADE;
  max-width: 62ch;
}

.film-body p + p { margin-top: 14px; }

.links { display: flex; flex-direction: column; gap: 11px; align-items: flex-start; }

.links a {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
  text-decoration-color: rgba(255, 255, 255, .3);
  text-underline-offset: 4px;
}

.links a:hover { color: var(--accent); text-decoration-color: var(--accent); }

.film-foot {
  border-top: 1px solid var(--rule-d);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 30px;
  justify-content: space-between;
  padding-block: 22px 40px;
}

/* =========================================================
   responsive + motion
   ========================================================= */

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .film-body { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .filmbar .label { display: none; }
  /* no hover on touch — the description belongs under the frame instead */
  .card-desc { position: static; opacity: 1; background: none; color: var(--muted); padding: 10px 0 0; font-size: 14px; }
  .card-desc span { -webkit-line-clamp: 3; }
}

@media (hover: none) {
  .card-media video { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .card-media video { display: none; }
  body.scrolled .masthead { opacity: 1; transform: none; }
}
