/* =========================================================================
   Sako Projects
   Black-dominant, grey wordmark, heavy expanded headings, light body text.
   ========================================================================= */

:root {
  --bg: #0b0b0b;
  --ink: #ededeb;        /* headings / primary text */
  --ink-2: #b9b9b5;      /* body text */
  --ink-3: #8a8a85;      /* labels, secondary text */
  --grey: #b4b4b4;       /* brand grey, taken from the logo */
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.26);
  --error: #e0968c;

  --font: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --gutter: clamp(16px, 4.4vw, 64px);
  --maxw: 1680px;
  --bar-h: 64px;
  --section: clamp(96px, 13vw, 200px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* Where the hero photo is anchored when it's cropped (x y). */
  --hero-focus: 50% 40%;
  /* Width of the big SAKO in the hero, as a share of the page width
     (phones here, larger screens in the media query below). */
  --hero-mark-width: 84%;
}

@media (min-width: 768px) {
  :root { --hero-mark-width: 70%; }
}

/* ---------- Base ---------------------------------------------------------- */

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--bar-h);
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--font);
  font-weight: 300;
  font-size: clamp(16px, 0.92rem + 0.25vw, 18px);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul[role="list"] { list-style: none; padding: 0; }
button, input, textarea { font: inherit; color: inherit; }

::selection { background: var(--grey); color: var(--bg); }
:focus-visible { outline: 1px solid var(--grey); outline-offset: 4px; }

html.is-locked { overflow: hidden; }

.skip {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--grey);
  color: var(--bg);
  font-size: 14px;
  transform: translateY(-200%);
  transition: transform 0.2s;
}
.skip:focus { transform: none; }

.wrap {
  width: min(100% - 2 * var(--gutter), var(--maxw));
  margin-inline: auto;
}

.section { padding-block: var(--section); }

.label {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: clamp(28px, 4vw, 56px);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.label::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
}

/* ---------- Top bar ------------------------------------------------------- */

.bar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  height: calc(var(--bar-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) var(--gutter) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid transparent;
  transition: background-color 0.5s var(--ease), border-color 0.5s var(--ease);
}
.bar.is-solid {
  background: rgba(11, 11, 11, 0.86);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}

.bar__logo { display: block; padding-block: 8px; }
.bar__logo img { width: auto; height: 15px; }

.bar__nav { display: flex; align-items: center; gap: clamp(20px, 2.6vw, 36px); }

.bar__ig {
  padding: 8px;
  margin: -8px;
  color: var(--ink);
  opacity: 0.85;
  transition: opacity 0.2s;
}
.bar__ig:hover { opacity: 1; }

.bar__link {
  position: relative;
  padding-block: 10px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink);
}
.bar__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0.26em;
  bottom: 4px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.45s var(--ease);
}
.bar__link:hover::after { transform: scaleX(1); transform-origin: left; }

/* very narrow phones: keep the one-line logo clear of the nav */
@media (max-width: 359px) {
  .bar__logo img { height: 13px; }
  .bar__nav { gap: 16px; }
  .bar__link { letter-spacing: 0.2em; }
}
@media (max-width: 309px) {
  .bar__logo img { height: 11px; }
}
@media (min-width: 768px) {
  .bar__logo img { height: 17px; }
}

/* ---------- 1. Hero ------------------------------------------------------- */

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: #070707;
}

.hero__img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--hero-focus);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg,
    rgba(11, 11, 11, 0.6) 0%,
    rgba(11, 11, 11, 0) 20%,
    rgba(11, 11, 11, 0) 42%,
    rgba(11, 11, 11, 0.55) 70%,
    var(--bg) 100%);
}

.hero__inner {
  width: 100%;
  padding: calc(var(--bar-h) + 48px) var(--gutter) clamp(18px, 3vw, 44px);
}

.hero__sub {
  max-width: 26ch;
  margin-bottom: clamp(20px, 3.4vw, 56px);
  font-size: clamp(1.05rem, 0.8rem + 1vw, 1.6rem);
  line-height: 1.35;
  color: var(--ink);
  text-wrap: balance;
}

.hero__mark { width: min(var(--hero-mark-width), 1240px); }
.hero__mark img { width: 100%; height: auto; }

/* ---------- 2. About ------------------------------------------------------ */

.split { display: grid; }

.about__text {
  max-width: 30ch;
  font-size: clamp(1.45rem, 0.95rem + 2.1vw, 3rem);
  line-height: 1.24;
  letter-spacing: -0.012em;
  color: var(--ink);
  text-wrap: pretty;
}
.about__more { color: var(--ink-3); }

@media (min-width: 900px) {
  .split { grid-template-columns: minmax(180px, 1fr) 3fr; }
  .split .label { margin-bottom: 0; padding-top: 0.9em; align-self: start; }
}

/* ---------- 3. Services --------------------------------------------------- */

.tiles { display: grid; gap: clamp(8px, 1.2vw, 18px); }

.tile {
  position: relative;
  isolation: isolate;
  aspect-ratio: 4 / 5;
  max-height: 86vh;
  overflow: hidden;
  background: #111;
  container-type: inline-size; /* titles scale with the tile, not the window */
}
.tile img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.6s var(--ease);
}
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.72) 100%);
}

.tile__text {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: clamp(20px, 3vw, 44px);
  padding: clamp(18px, 7cqi, 44px);
}
.tile__title {
  font-size: clamp(1.5rem, 3.8vw, 3.9rem);
  font-size: clamp(1.4rem, 8.6cqi, 4rem);
  font-weight: 800;
  font-stretch: 125%;
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--grey);
}
.tile__sub {
  margin-top: 0.75em;
  font-size: clamp(1rem, 0.9rem + 0.35vw, 1.25rem);
  color: var(--ink);
}

@media (min-width: 760px) {
  .tiles { grid-template-columns: 1fr 1fr; }
}
@media (hover: hover) {
  .tile:hover img { transform: scale(1.035); }
}

/* ---------- 4. Gallery ---------------------------------------------------- */

.shots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(4px, 0.8vw, 12px);
}

.shot {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #111;
  cursor: zoom-in;
}
.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.4s var(--ease);
}
.shot:focus-visible { outline-offset: 3px; }

@media (min-width: 900px) {
  .shots { grid-template-columns: repeat(3, 1fr); }
}
@media (hover: hover) {
  .shot:hover img { transform: scale(1.04); }
}

/* ---------- 5. Contact ---------------------------------------------------- */

.contact__title {
  margin-bottom: clamp(40px, 6vw, 88px);
  font-size: clamp(2.6rem, 1rem + 6.6vw, 9rem);
  font-weight: 800;
  font-stretch: 125%;
  line-height: 0.9;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  color: var(--grey);
}

.contact__grid { display: grid; gap: clamp(56px, 7vw, 112px); }

.contact__list { display: grid; gap: 32px; }
.contact__list dt {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.contact__email,
.contact__ig {
  padding-bottom: 3px;
  font-size: clamp(1.2rem, 0.95rem + 1vw, 1.9rem);
  font-weight: 400;
  color: var(--ink);
  overflow-wrap: anywhere;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.5s var(--ease);
}
.contact__email:hover,
.contact__ig:hover { background-size: 100% 1px; }

@media (min-width: 1000px) {
  .contact__grid { grid-template-columns: 5fr 7fr; align-items: start; }
}

/* Form */
.form { display: grid; gap: clamp(24px, 2.6vw, 34px) clamp(20px, 3vw, 40px); }

.field { display: grid; gap: 6px; }
.field label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-3);
  transition: color 0.25s;
}
.field:focus-within label { color: var(--ink); }

.field input,
.field textarea {
  width: 100%;
  padding: 12px 0 14px;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  font-size: 18px;
  font-weight: 300;
  color: var(--ink);
  outline: none;
  appearance: none;
  transition: border-color 0.25s;
}
.field textarea { min-height: 132px; resize: vertical; line-height: 1.5; }
.field input:focus,
.field textarea:focus { border-bottom-color: var(--grey); }
.field [aria-invalid="true"] { border-bottom-color: var(--error); }
.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 100px var(--bg) inset;
  caret-color: var(--ink);
}
.field__err { font-size: 13px; color: var(--error); }
.field__err:empty { display: none; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 28px;
  margin-top: 8px;
}
.btn {
  padding: 18px 30px;
  border: 0;
  border-radius: 0;
  background: var(--grey);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  cursor: pointer;
  appearance: none;
  transition: background-color 0.25s;
}
.btn:hover { background: #d4d4d2; }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.form__status { flex: 1 1 260px; font-size: 15px; color: var(--ink-2); }

@media (min-width: 640px) {
  .form { grid-template-columns: 1fr 1fr; }
  .field--full,
  .form__foot { grid-column: 1 / -1; }
}

/* ---------- 6. Licences / footer (with the camo band) --------------------- */

.foot {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(64px, 9vw, 120px) clamp(28px, 4vw, 48px);
  border-top: 1px solid var(--line);
  background: #0d0d0c;
}
.foot::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("../images/camo.svg") 0 0 / 560px 560px repeat;
  opacity: 0.55; /* raise towards 1 for a stronger camo, lower for fainter */
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.2), #000 70%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.2), #000 70%);
}

.foot__inner { display: grid; gap: clamp(40px, 5vw, 64px); }
.foot__logo { width: clamp(150px, 16vw, 220px); height: auto; }

.foot__lic {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px clamp(28px, 4vw, 64px);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.foot__hia img { width: auto; height: 48px; }

.foot__legal {
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}
.foot__legal > span { white-space: nowrap; }

@media (min-width: 900px) {
  .foot__inner { grid-template-columns: auto 1fr; align-items: end; }
  .foot__lic { justify-content: flex-end; }
  .foot__legal { grid-column: 1 / -1; }
}

/* ---------- Lightbox ------------------------------------------------------ */

.lb {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(8, 8, 8, 0.97);
  color: var(--ink);
  opacity: 0;
  overscroll-behavior: contain;
  transition: opacity 0.35s var(--ease);
}
.lb.is-open { opacity: 1; }
.lb::backdrop { background: rgba(0, 0, 0, 0.6); }

.lb__stage {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr); /* lets the photo's max-height resolve */
  place-items: center;
  padding: 72px 12px 96px;
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
}
.lb__img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  -webkit-user-drag: none;
  transition: transform 0.35s var(--ease);
}
.lb__img.is-dragging { transition: none; }

.lb__count {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.26em;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.lb__btn {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  opacity: 0.75;
  cursor: pointer;
  transition: opacity 0.2s;
}
.lb__btn:hover { opacity: 1; }
.lb__close { top: max(8px, env(safe-area-inset-top, 0px)); right: 8px; }
.lb__prev { bottom: 12px; left: 8px; }
.lb__next { bottom: 12px; right: 8px; }

@media (min-width: 768px) {
  .lb__stage { padding: 80px 104px; }
  .lb__prev,
  .lb__next { top: 50%; bottom: auto; transform: translateY(-50%); }
  .lb__prev { left: 24px; }
  .lb__next { right: 24px; }
  .lb__close { top: 16px; right: 24px; }
}

/* ---------- Motion -------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .hero__img { animation: hero-settle 2.8s var(--ease) both; }
  .hero__mark { animation: rise 1.4s var(--ease) 0.15s both; }
  .hero__sub { animation: rise 1.4s var(--ease) 0.45s both; }
  .bar { animation: fade 1.2s var(--ease) 0.6s both; }

  .js .reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
    transition-delay: calc(var(--d, 0) * 110ms);
  }
  .js .reveal.is-in { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .lb, .lb__img, .tile img, .shot img { transition: none; }
}

@keyframes hero-settle {
  from { opacity: 0.35; transform: scale(1.08); }
  to { opacity: 1; transform: none; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
