/* KÍSMI coming-soon page.
   Phone (up to 900px): status line, full-width wordmark that runs into the video, stories, two buttons.
   Computer (from 901px): split screen, the films on the right 58%, the wordmark crossing onto them from the left.
   Only Semplicita Light is used (every heading is set to 300), so it is the only font file. */

@font-face { font-family: "Semplicita"; src: url(../assets/fonts/semplicita-light.woff2) format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }

:root {
  --paper: #ffffff;
  --ink: #2b2b2b;
  --soft: #6f6f6f;
  --hair: #e4e4e4;
  --font: "Semplicita", "Futura", "Jost", "Helvetica Neue", sans-serif;
  --ease: cubic-bezier(.65, 0, .2, 1);
  --pad: 16px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  height: 100%;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; border-radius: 0; cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

/* ---------- buttons: square corners everywhere ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 50px; padding: 0 22px;
  border: 1px solid var(--ink); border-radius: 0;
  background: var(--ink); color: #fff;
  font-size: 15px; letter-spacing: .02em; white-space: nowrap;
  transition: background-color .25s, color .25s;
}
.btn:hover { background: #000; border-color: #000; }
.btn-line { background: transparent; color: var(--ink); }
.btn-line:hover { background: var(--ink); color: #fff; }

/* ---------- page layout: phone ---------- */
.page {
  display: flex; flex-direction: column;
  height: 100vh; height: 100svh;
  /* the top inset keeps the status line and the stroke over the Í out from under the iPhone status bar */
  padding: max(var(--pad), env(safe-area-inset-top)) max(var(--pad), env(safe-area-inset-right))
           max(14px, env(safe-area-inset-bottom)) max(var(--pad), env(safe-area-inset-left));
}

.status { display: flex; justify-content: space-between; align-items: center; font-size: 12px; letter-spacing: .04em; color: var(--soft); }
.status-open { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); }
.status-open::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }

/* the wordmark: Semplicita Light, tracked .06em; on the phone its size is fitted to the width by site.js (--mf).
   Semplicita has different vertical metrics per platform (Windows uses winAscent 1042, Apple uses hhea 845), so on iPhone
   the letters sit ~.07em higher and the stroke over the Í rises ~.13em above a line-height:1 box.
   padding-top keeps the whole glyph inside the box on every platform. */
.mast {
  position: relative; z-index: 3;
  margin-top: calc(var(--mf, 100px) * .04);
  padding-top: .2em;
  font-size: var(--mf, 100px); line-height: 1; font-weight: 300;
  letter-spacing: .06em; text-indent: .06em; /* the indent balances the tracking after the last letter */
  text-align: center; white-space: nowrap;
  pointer-events: none;
}
.mast-ink { font: inherit; color: var(--ink); }
/* the white copy shows only over the video: the bottom --overlap of the box, the same amount .reel is pulled up by */
.mast { --overlap: calc(var(--mf, 100px) * .42); }
.mast-white { position: absolute; inset: 0; padding-top: inherit; color: #fff; clip-path: inset(calc(100% - var(--overlap)) 0 0 0); transition: opacity .4s; }
.on-paper .mast-white { opacity: 0; } /* over the white end screen the whole word is ink */

.tagline, .contacts { display: none; }

/* ---------- stories frame ---------- */
.reel {
  position: relative; z-index: 1;
  flex: 1; min-height: 0;
  margin-top: calc(var(--mf, 100px) * -.42); /* the lower part of the letters sits on the video (= .mast --overlap) */
  overflow: hidden; background: #ececec;
  cursor: pointer; outline-offset: 4px;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.reel-stage, .reel-stage video { position: absolute; inset: 0; width: 100%; height: 100%; }
.reel-stage video { object-fit: cover; opacity: 0; transition: opacity .45s ease; pointer-events: none; }
.reel-stage video.is-on { opacity: 1; }
.reel::after { /* shade under the caption */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 42%; z-index: 1; pointer-events: none;
  background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.48));
}

.reel-caption { position: absolute; left: 6%; right: 6%; bottom: 6%; z-index: 2; color: #fff; pointer-events: none; transition: opacity .3s; }
.reel-caption.is-swapping { opacity: 0; }
.reel-place { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; opacity: .92; }
.reel-title { font-weight: 300; font-size: 26px; line-height: 1.12; margin-top: 8px; max-width: 13ch; }
.reel-count { position: absolute; right: 0; bottom: 0; font-size: 12px; letter-spacing: .04em; font-variant-numeric: tabular-nums; }

.reel-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; z-index: 5; background: rgba(255,255,255,.3); }
.reel-progress i { display: block; height: 100%; background: #fff; transform-origin: 0 50%; transform: scaleX(0); }
.on-paper .reel-progress { background: var(--hair); }
.on-paper .reel-progress i { background: var(--ink); }

/* the enquiry screen after the sixth film (phone only). It is part of the carousel: taps on it still go back and forward. */
.reel-end {
  position: absolute; inset: 0; z-index: 4;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 9% 8%;
  background: var(--paper); box-shadow: inset 0 0 0 1px var(--hair);
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .45s, visibility 0s .45s;
}
/* pointer-events go off at once on leaving, so a quick tap during the fade still moves the story */
.on-paper .reel-end { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .45s; }
.reel-end h2 { font-weight: 300; font-size: 36px; line-height: 1.06; }
.reel-end p { margin-top: 14px; max-width: 30ch; font-size: 14px; line-height: 1.55; color: var(--soft); }
.reel-end-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 26px; }
.reel-end-actions .btn { cursor: pointer; }

/* the two buttons under the video; hidden (space kept) while the end screen carries its own */
.actions { display: flex; gap: 10px; margin-top: 12px; transition: opacity .35s; }
.actions .btn:first-child { flex: 1; min-width: 0; }
@media (max-width: 359px) { /* small phones: let the long label wrap instead of pushing Instagram off screen */
  .actions .btn { padding: 0 14px; }
  .actions .btn:first-child { white-space: normal; text-align: center; line-height: 1.2; }
}
.on-paper .actions { opacity: 0; visibility: hidden; }

/* ---------- computer: split screen ----------
   The films fill the right 58% at full height, flush with the edges. The large wordmark starts at the left edge and
   crosses onto the films, white where it lies on the video (the same two layers as on the phone, cut vertically).
   Status line top left, the line and the button under the wordmark, contacts bottom left. */
@media (min-width: 901px) {
  :root { --pad: 48px; --reel-w: 58vw; }

  .page {
    display: grid;
    grid-template-columns: [side] 1fr [reel] var(--reel-w);
    grid-template-rows: auto 1fr auto auto auto 1fr auto;
    height: 100vh; height: 100svh; /* svh: iPad and big phones in landscape keep the bottom row above the toolbar */
    padding: 0;
  }
  .page > * { grid-column: side; }
  .status { grid-row: 1; padding: var(--pad) var(--pad) 0; justify-content: flex-start; font-size: 13px; }
  .status-season { display: none; }

  .mast {
    grid-column: side / -1; grid-row: 3; justify-self: start;
    margin: 0 0 0 calc(var(--pad) - .1em); /* -.1em: the K's stem lines up with the text below */
    font-size: min(18vw, 32vh);
    text-indent: 0; text-align: left;
  }
  /* the white copy starts where the films start: page width minus the films, minus where the wordmark begins */
  .mast-white { clip-path: inset(0 0 0 calc(100vw - var(--reel-w) - var(--pad) + .1em)); }

  .tagline {
    grid-row: 4; display: block; max-width: calc(30ch + var(--pad) * 2);
    margin-top: 24px; padding: 0 var(--pad);
    font-size: 16px; line-height: 1.5; letter-spacing: .02em; color: var(--soft); text-wrap: balance;
  }
  .actions { grid-row: 5; margin-top: 32px; padding: 0 var(--pad); }
  .actions .btn:first-child { flex: 0 0 auto; padding: 0 30px; }
  .actions-ig { display: none; }

  .contacts { grid-row: 7; display: flex; flex-wrap: wrap; gap: 8px 26px; padding: 0 var(--pad) var(--pad); font-size: 14px; letter-spacing: .02em; }
  .contacts a { border-bottom: 1px solid transparent; transition: border-color .25s; }
  .contacts a:hover { border-color: currentColor; }

  .reel { grid-column: reel; grid-row: 1 / -1; flex: none; margin: 0; width: 100%; height: 100%; outline-offset: -3px; } /* flush with the window: draw focus inside */
  .reel-title { font-size: clamp(24px, 2vw, 30px); }
  .reel-end { display: none; }
}

/* computer layout on a short screen (a big phone or a small laptop held sideways): tighter so the contacts stay visible */
@media (min-width: 901px) and (max-height: 560px) {
  :root { --pad: 24px; }
  .mast { font-size: min(18vw, 26vh); }
  .tagline { margin-top: 12px; }
  .actions { margin-top: 16px; }
  .btn { min-height: 44px; }
}

/* ---------- enquiry panel ---------- */
.enquiry {
  position: fixed; inset: auto 0 0 0;
  width: 100%; max-width: none; max-height: 100%;
  margin: 0; padding: 0; border: 0; border-radius: 0;
  background: var(--paper); color: var(--ink);
  transform: translateY(102%); transition: transform .5s var(--ease);
}
.enquiry::backdrop { background: rgba(20,20,20,0); transition: background-color .4s; }
.enquiry.is-open { transform: none; }
.enquiry.is-open::backdrop { background: rgba(20,20,20,.32); }
.enquiry-body { padding: 26px 22px max(22px, env(safe-area-inset-bottom)); }
.enquiry-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--soft); }
.enquiry-close { font-size: 13px; letter-spacing: .03em; text-transform: none; color: var(--ink); border-bottom: 1px solid #cfcfcf; }
.enquiry h2 { font-weight: 300; font-size: 30px; line-height: 1.1; margin-top: 18px; }
.enquiry p { font-size: 14px; line-height: 1.55; color: var(--soft); margin-top: 10px; max-width: 34ch; }
.enquiry-list { list-style: none; margin-top: 22px; border-top: 1px solid var(--hair); }
.enquiry-list a { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 16px 2px; border-bottom: 1px solid var(--hair); font-size: 16px; }
.enquiry-list small { grid-column: 1; font-size: 13px; color: var(--soft); }
.enquiry-list i { grid-row: 1 / 3; grid-column: 2; align-self: center; font-style: normal; color: var(--soft); transition: transform .25s; }
.enquiry-list a:hover i, .enquiry-list a:focus-visible i { transform: translateX(4px); color: var(--ink); }
.enquiry-list a:focus-visible { outline: none; background: #f6f6f6; }

@media (min-width: 901px) {
  .enquiry {
    inset: 0; margin: auto; width: 440px; height: fit-content;
    box-shadow: 0 30px 80px rgba(0,0,0,.14);
    transform: translateY(12px); opacity: 0;
    transition: transform .45s var(--ease), opacity .35s;
  }
  .enquiry.is-open { transform: none; opacity: 1; }
  .enquiry-body { padding: 30px 30px 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}
