/* Nilo — Stefan Nilo Blagojevic. Built from the mockups in ../Mockup. */

:root {
  --ink: #000;
  --paper: #fff;
  --slate: #505050;      /* the grey of the logo sheet */
  --quiet: #6f6f6f;      /* secondary text and the grey button */
  --field: #f5f5f5;
  --sans: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif;
  --edge: clamp(20px, 9.4vw, 150px);   /* page side margin, as in the mockups */
  --measure: 1180px;
  --header-h: 84px;    /* the sticky header's fixed height; anchors land below it */
}
@media (max-width: 560px) {
  :root { --header-h: 64px; }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--header-h); }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: 0.045em;
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: 5px; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }

.wrap {
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--edge));
  margin: 0 auto;
  padding: 0 var(--edge);
}


/* ---------- Type ---------- */

.title {
  margin: 0;
  font-weight: 400;
  font-size: clamp(26px, 5.4vw, 60px);
  line-height: 1.12;
  letter-spacing: 0.5em;
  text-transform: uppercase;
}

.label {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.note { margin: 0; font-size: 12px; letter-spacing: 0.3em; }

/* The small dash marks that punctuate every mockup page */
.dashes { display: flex; flex-direction: column; gap: var(--dash-gap, 40px); }
.dashes i, .dash {
  display: block;
  width: 14px;
  height: 3px;
  border: 1px solid currentColor;
  border-radius: 2px;
}

/* ---------- Buttons ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 26px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}
.pill.light { background: var(--paper); color: var(--ink); }
.pill.grey { background: var(--quiet); }

/* ---------- Site header (every page) ----------
   Solid by default: paper with the small wordmark. On home, site.js adds
   .is-over-hero while the video is behind it: transparent, white, with the
   "Books open" label in place of the wordmark. */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--header-h);
  background: var(--paper);
  color: var(--ink);
}
.site-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 100%;
}
.site-header .mark { display: block; padding: 12px 0; }
.site-header .mark img { width: 120px; height: auto; }

/* Label and wordmark share one spot and swap */
.site-header-lead { display: grid; align-items: center; }
.site-header-lead > * { grid-area: 1 / 1; }
.site-header-lead .label { visibility: hidden; opacity: 0; }

.site-header.is-over-hero { background: transparent; color: var(--paper); }
.site-header.is-over-hero .mark { visibility: hidden; opacity: 0; }
.site-header.is-over-hero .label { visibility: visible; opacity: 1; }

/* site.js adds .is-ready after setting the first state, so a page load doesn't fade */
@media (prefers-reduced-motion: no-preference) {
  .site-header.is-ready { transition: background-color 0.35s ease, color 0.35s ease; }
  .site-header.is-ready .mark, .site-header.is-ready .label { transition: opacity 0.35s ease, visibility 0.35s; }
}

/* Home: the video runs up under the header (the margin collapses through main) */
main > .hero:first-child { margin-top: calc(-1 * var(--header-h)); }

.nav { display: flex; gap: 28px; }
.nav a {
  padding: 12px 0;
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  text-decoration: none;
}
.nav a.ask, .nav a[aria-current="page"] { text-decoration: underline; }

/* Tablets and phones: no room for the label beside the full nav.
   Kept below the base .nav rules, or those win over these. */
@media (max-width: 820px) {
  .nav a, .site-header .label { font-size: 11px; letter-spacing: 0.2em; }
  /* "Request." like "Work." and "About."; screen readers still hear the whole name */
  .nav-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .nav .ask::after { content: "."; }
  /* Over the video the label drops just below the bar */
  .site-header-lead .label { position: absolute; top: calc(100% - 8px); left: var(--edge); }
}

/* ---------- Hero (home) ---------- */

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: max(100svh, 640px);
  background: var(--slate);
  color: var(--paper);
  overflow: hidden;
}
.hero video {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(0, 0, 0, 0.34);
}
.hero-mid {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: calc(var(--header-h) + 24px);
  padding-bottom: 24px;
}
.lockup { container-type: inline-size; max-width: 86svh; }  /* keeps the buttons in view on wide, short screens */
.lockup > .dashes { --dash-gap: clamp(28px, 6cqw, 64px); }
.lockup h1 { margin: clamp(48px, 16cqw, 170px) 0 0; }
.lockup h1 img { width: 100%; height: auto; filter: invert(1); }

/* Name set to the exact width of the wordmark */
.lockup .name {
  margin: 3.4cqw 0 0;
  font-size: 2.15cqw;
  line-height: 1;
  letter-spacing: 1.61em;
  margin-right: -1.61em;
  text-transform: uppercase;
  white-space: nowrap;
}
.lockup-low { display: flex; justify-content: space-between; align-items: flex-start; margin-top: 2.2cqw; }
.lockup-low .right { --dash-gap: clamp(28px, 6cqw, 64px); padding-top: 1.2cqw; margin-right: 0.6cqw; }
.facts { display: flex; flex-direction: column; gap: 2.4cqw; }
.facts p {
  margin: 0;
  font-size: max(9px, 1.45cqw);
  line-height: 1.2;
  letter-spacing: 1.05em;
  text-transform: uppercase;
}

.hero-foot {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding-bottom: clamp(28px, 5.4vw, 64px);
}
/* One line that mirrors the top bar: request left, arrow centre, Instagram right */
.hero-foot .pill { justify-self: start; }
.hero-foot .insta { justify-self: end; }
.insta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  text-decoration: none;
}
.insta svg { width: 28px; height: 28px; }
.scroll { display: block; padding: 18px 12px; }
.scroll svg { display: block; width: 22px; height: 11px; }
@media (prefers-reduced-motion: no-preference) {
  .scroll svg { animation: nudge 2.2s ease-in-out infinite; }
  @keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
}

/* ---------- Sections ---------- */

.section { padding-top: clamp(64px, 9vw, 130px); padding-bottom: clamp(64px, 9vw, 130px); }
.section-head { display: flex; flex-direction: column; gap: 22px; margin-bottom: clamp(28px, 4vw, 48px); }

/* Work: two staggered columns, as in the mockup; three on wide screens for the full gallery */
.works { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(14px, 4vw, 48px); align-items: start; }
.works .col { display: flex; flex-direction: column; gap: clamp(14px, 4vw, 48px); }
.works img, .gallery img { width: 100%; height: auto; background: var(--field); }
.gallery { columns: 2; column-gap: clamp(14px, 3vw, 40px); }
.gallery > * { margin-bottom: clamp(14px, 3vw, 40px); break-inside: avoid; }
/* site.js wraps each photo in a button that opens the viewer */
.shot { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; -webkit-tap-highlight-color: transparent; }
@media (min-width: 1000px) {
  .gallery { columns: 3; }
}
.more { display: inline-block; margin-top: clamp(28px, 4vw, 48px); padding: 12px 0; }

/* How booking works */
.steps {
  margin: clamp(40px, 7vw, 84px) 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 44px clamp(20px, 3vw, 44px);
}
.steps .num {
  display: block;
  font-size: clamp(40px, 5vw, 56px);
  line-height: 1;
  letter-spacing: 0.12em;
  font-weight: 400;
}
.steps .dash { margin: 8px 0 22px 4px; }
.steps h3 { margin: 0 0 16px; font-size: 16px; font-weight: 700; letter-spacing: 0.06em; }
.steps p { margin: 0; max-width: 21em; }
.booking .dashes { margin-top: 36px; margin-left: 4px; }
.booking .go { margin-top: clamp(48px, 7vw, 80px); text-align: center; }

/* About */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 42fr) minmax(0, 54fr);
  gap: clamp(20px, 2.6vw, 36px);
  align-items: start;
  margin-top: clamp(36px, 7vw, 84px);
}
.about-grid .photos { display: flex; flex-direction: column; gap: clamp(16px, 3vw, 34px); }
.about-grid .photos img { width: 100%; height: auto; }
.about-grid .text { display: flex; flex-direction: column; gap: 2.4em; padding-top: 2px; }
.about-grid .text p { margin: 0; max-width: 34em; font-size: clamp(15px, 1.5vw, 18px); line-height: 1.25; }
@media (max-width: 640px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-grid .photos { flex-direction: row; align-items: flex-start; }
  .about-grid .photos img { width: calc(50% - 8px); }
}

.facts-list { margin: clamp(40px, 5vw, 64px) 0 0; display: flex; flex-direction: column; gap: 16px; }
.facts-list .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; }
.facts-list .row + .row { position: relative; padding-top: 24px; }
.facts-list .row + .row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 14px;
  height: 3px;
  border: 1px solid currentColor;
  border-radius: 2px;
}
.facts-list dt, .facts-list dd { margin: 0; font-size: 12px; letter-spacing: 0.32em; text-transform: uppercase; }
.about .dashes.tail { margin-top: 44px; }

/* Request */
.request-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.request-head .intro { display: flex; flex-direction: column; gap: 14px; }
.request-head .intro p { margin: 0; }
.request-head .intro .label { margin-bottom: 6px; }
.request .lead-dash { margin: 26px 0 26px 2px; }

.form {
  display: flex;
  flex-direction: column;
  gap: 36px;
  max-width: 860px;
  padding: clamp(22px, 5vw, 52px);
  border: 1px solid var(--ink);
}
.form .pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 36px clamp(20px, 4vw, 40px); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 700; letter-spacing: 0.02em; }
.field .hint { font-size: 13px; line-height: 1.5; color: var(--quiet); letter-spacing: 0.02em; }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field textarea {
  min-height: 48px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
}
.field textarea { resize: vertical; }
.field input[type="file"] { min-height: 48px; padding: 18px 16px; border: 1px dashed var(--ink); background: var(--field); max-width: 100%; }
.check { display: flex; align-items: center; gap: 14px; min-height: 44px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--ink); }
.form .pill { min-height: 56px; font-size: 14px; font-weight: 700; letter-spacing: 0.02em; text-transform: none; }
.status { margin: 0; max-width: 34em; line-height: 1.5; }
.status:empty { display: none; }

.form .pill:disabled { opacity: 0.55; cursor: progress; }
.sent { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; max-width: 860px; outline: none; }
.sent p { margin: 0; max-width: 34em; line-height: 1.5; }
/* Bot trap: moved off screen rather than display: none, which some bots skip */
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Work viewer ----------
   site.js builds it on the Work page: a full-screen dialog with every photo
   in one row that snaps one photo at a time, so a phone swipes it natively. */

.viewer {
  --bar: 64px;   /* top row (counter, close) and, on phones, the arrow row below */
  inset: 0;
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
}
.viewer::backdrop { background: var(--ink); }
.viewer:focus { outline: none; }
html:has(.viewer[open]) { overflow: hidden; background: var(--ink); }

.viewer-track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.viewer-track::-webkit-scrollbar { display: none; }
/* site.js turns snapping off while it moves the photos itself (a swipe from the screen edge) */
.viewer-track.is-dragging { scroll-snap-type: none; }
.viewer-slide {
  flex: 0 0 100%;
  margin: 0;
  padding: var(--bar) var(--edge);
  scroll-snap-align: center;
  scroll-snap-stop: always;
}
.viewer-slide img { width: 100%; height: 100%; object-fit: contain; }

.viewer-count { position: absolute; top: 0; left: var(--edge); line-height: var(--bar); }
.viewer button {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.viewer button svg { width: 11px; height: 22px; }
.viewer .viewer-close svg { width: 18px; height: 18px; }
.viewer-close { top: calc((var(--bar) - 48px) / 2); right: calc(var(--edge) - 15px); }
/* Arrows sit in the side margins, beside the photo */
.viewer-prev, .viewer-next { top: calc(50% - 24px); }
.viewer-prev { left: calc(var(--edge) / 2 - 24px); }
.viewer-next { right: calc(var(--edge) / 2 - 24px); }
@media (hover: hover) {
  .viewer button:hover { opacity: 0.6; }
}

/* Phones: the photo takes the full width; the arrows drop to the bottom corners, in thumb
   reach but clear of the 20px edge where site.js catches the iPhone back swipe */
@media (max-width: 560px) {
  .viewer-slide { padding: var(--bar) 0; }
  .viewer-prev, .viewer-next { top: auto; bottom: calc((var(--bar) - 48px) / 2); }
  .viewer-prev { left: 20px; }
  .viewer-next { right: 20px; }
}
/* Phones turned sideways: the photo takes the full height; the controls sit on the black sides */
@media (max-height: 500px) and (min-width: 561px) {
  .viewer-slide { padding-block: 0; }
}

@media (prefers-reduced-motion: no-preference) {
  .viewer[open], .viewer[open]::backdrop { animation: viewer-in 0.25s ease; }
  @keyframes viewer-in { from { opacity: 0; } }
}

/* ---------- Footer ---------- */

.foot { padding-top: clamp(56px, 8vw, 110px); padding-bottom: clamp(64px, 9vw, 130px); color: var(--quiet); }
.foot img { width: clamp(150px, 17vw, 230px); height: auto; margin: 0 0 22px 22px; opacity: 0.62; }
.foot .line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px; }
.foot p { margin: 0; font-size: 12px; letter-spacing: 0.32em; text-transform: uppercase; }

/* ---------- Phone width ---------- */

.pill, .insta { white-space: nowrap; }

@media (max-width: 560px) {
  .site-header-row { gap: 14px; }
  .site-header .mark img { width: 84px; }
  .nav { gap: 16px; }
  .hero-mid { padding-top: calc(var(--header-h) + 40px); }
  /* Request left, Instagram icon right; the arrow drops to its own line */
  .hero-foot { grid-template-columns: 1fr auto; gap: 14px; padding-bottom: 14px; }
  .hero-foot .scroll { grid-row: 2; grid-column: 1 / -1; justify-self: center; padding: 14px 13px; }
  .scroll svg { width: 18px; height: 9px; }
}
@media (max-width: 380px) {
  /* Small phones (360 and 320 wide): wordmark and gaps shrink so the header stays one row */
  .site-header-row, .nav { gap: 12px; }
  .site-header .mark img { width: 68px; }
}

@media (max-width: 760px) {
  .insta { min-width: 44px; justify-content: flex-end; }
  .insta-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
